138097Speter/*- 264567Sgshapiro * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 338097Speter * All rights reserved. 464567Sgshapiro * 580029Sobrien * Redistribution and use in source and binary forms, with or without 664567Sgshapiro * modification, are permitted provided that the following conditions 738097Speter * are met: 890798Sgshapiro * 1. Redistributions of source code must retain the above copyright 974816Sru * notice, this list of conditions and the following disclaimer. 1038097Speter * 2. Redistributions in binary form must reproduce the above copyright 1190798Sgshapiro * notice, this list of conditions and the following disclaimer in the 1280029Sobrien * documentation and/or other materials provided with the distribution. 1380029Sobrien * 14201390Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15201390Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16147225Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17147225Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1890798Sgshapiro * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19147225Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20147225Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2138097Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22147225Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23147225Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2438097Speter * SUCH DAMAGE. 2590798Sgshapiro * 2690798Sgshapiro * $FreeBSD$ 2764567Sgshapiro */ 2890798Sgshapiro 2990798Sgshapiro#define PHYSICAL_DESCRIPTOR (1) 3090798Sgshapiro#define SERVER_DESCRIPTOR (2) 3165970Sgshapiro#define PROMPT_DESCRIPTOR (3) 3265970Sgshapiro#define CHAT_DESCRIPTOR (4) 3366961Sgshapiro#define DATALINK_DESCRIPTOR (5) 3466961Sgshapiro#define BUNDLE_DESCRIPTOR (6) 3565970Sgshapiro#define MPSERVER_DESCRIPTOR (7) 3665970Sgshapiro#define RADIUS_DESCRIPTOR (8) 3790798Sgshapiro#define CHAP_DESCRIPTOR (9) 3890798Sgshapiro 3990798Sgshapirostruct bundle; 4038097Speter 41struct fdescriptor { 42 int type; 43 44 int (*UpdateSet)(struct fdescriptor *, fd_set *, fd_set *, fd_set *, int *); 45 int (*IsSet)(struct fdescriptor *, const fd_set *); 46 void (*Read)(struct fdescriptor *, struct bundle *, const fd_set *); 47 int (*Write)(struct fdescriptor *, struct bundle *, const fd_set *); 48}; 49 50#define descriptor_UpdateSet(d, r, w, e, n) ((*(d)->UpdateSet)(d, r, w, e, n)) 51#define descriptor_IsSet(d, s) ((*(d)->IsSet)(d, s)) 52#define descriptor_Read(d, b, f) ((*(d)->Read)(d, b, f)) 53#define descriptor_Write(d, b, f) ((*(d)->Write)(d, b, f)) 54