136285Sbrian/*-
236285Sbrian * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
336285Sbrian * All rights reserved.
436285Sbrian *
536285Sbrian * Redistribution and use in source and binary forms, with or without
636285Sbrian * modification, are permitted provided that the following conditions
736285Sbrian * are met:
836285Sbrian * 1. Redistributions of source code must retain the above copyright
936285Sbrian *    notice, this list of conditions and the following disclaimer.
1036285Sbrian * 2. Redistributions in binary form must reproduce the above copyright
1136285Sbrian *    notice, this list of conditions and the following disclaimer in the
1236285Sbrian *    documentation and/or other materials provided with the distribution.
1336285Sbrian *
1436285Sbrian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1536285Sbrian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1636285Sbrian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1736285Sbrian * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1836285Sbrian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1936285Sbrian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2036285Sbrian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2136285Sbrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2236285Sbrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2336285Sbrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2436285Sbrian * SUCH DAMAGE.
2536285Sbrian *
2650479Speter * $FreeBSD: releng/11.0/usr.sbin/ppp/descriptor.h 58028 2000-03-14 01:46:09Z brian $
2736285Sbrian */
2836285Sbrian
2936285Sbrian#define PHYSICAL_DESCRIPTOR (1)
3036285Sbrian#define SERVER_DESCRIPTOR (2)
3136285Sbrian#define PROMPT_DESCRIPTOR (3)
3236285Sbrian#define CHAT_DESCRIPTOR (4)
3336285Sbrian#define DATALINK_DESCRIPTOR (5)
3436285Sbrian#define BUNDLE_DESCRIPTOR (6)
3536285Sbrian#define MPSERVER_DESCRIPTOR (7)
3643693Sbrian#define RADIUS_DESCRIPTOR (8)
3743888Sbrian#define CHAP_DESCRIPTOR (9)
3836285Sbrian
3936285Sbrianstruct bundle;
4036285Sbrian
4158028Sbrianstruct fdescriptor {
4236285Sbrian  int type;
4336285Sbrian
4458028Sbrian  int (*UpdateSet)(struct fdescriptor *, fd_set *, fd_set *, fd_set *, int *);
4558028Sbrian  int (*IsSet)(struct fdescriptor *, const fd_set *);
4658028Sbrian  void (*Read)(struct fdescriptor *, struct bundle *, const fd_set *);
4758028Sbrian  int (*Write)(struct fdescriptor *, struct bundle *, const fd_set *);
4836285Sbrian};
4936285Sbrian
5036285Sbrian#define descriptor_UpdateSet(d, r, w, e, n) ((*(d)->UpdateSet)(d, r, w, e, n))
5136285Sbrian#define descriptor_IsSet(d, s) ((*(d)->IsSet)(d, s))
5236285Sbrian#define descriptor_Read(d, b, f) ((*(d)->Read)(d, b, f))
5336285Sbrian#define descriptor_Write(d, b, f) ((*(d)->Write)(d, b, f))
54