Introduce cratom(), remove crcopy().
[dragonfly.git] / sys / netproto / atm / atm_sigmgr.h
1 /*
2  *
3  * ===================================
4  * HARP  |  Host ATM Research Platform
5  * ===================================
6  *
7  *
8  * This Host ATM Research Platform ("HARP") file (the "Software") is
9  * made available by Network Computing Services, Inc. ("NetworkCS")
10  * "AS IS".  NetworkCS does not provide maintenance, improvements or
11  * support of any kind.
12  *
13  * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15  * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16  * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17  * In no event shall NetworkCS be responsible for any damages, including
18  * but not limited to consequential damages, arising from or relating to
19  * any use of the Software or related support.
20  *
21  * Copyright 1994-1998 Network Computing Services, Inc.
22  *
23  * Copies of this Software may be made, however, the above copyright
24  * notice must be reproduced on all copies.
25  *
26  *      @(#) $FreeBSD: src/sys/netatm/atm_sigmgr.h,v 1.2 1999/08/28 00:48:37 peter Exp $
27  *      @(#) $DragonFly: src/sys/netproto/atm/atm_sigmgr.h,v 1.2 2003/06/17 04:28:49 dillon Exp $
28  *
29  */
30
31 /*
32  * Core ATM Services
33  * -----------------
34  *
35  * ATM Signalling Manager definitions 
36  *
37  */
38
39 #ifndef _NETATM_ATM_SIGMGR_H
40 #define _NETATM_ATM_SIGMGR_H
41
42 #ifdef ATM_KERNEL
43 /*
44  * Structure common to all ATM Signalling Managers.  Each Signalling 
45  * Manager must create one of these and use it to register itself 
46  * with the system.
47  */
48 struct  sigmgr {
49         struct sigmgr   *sm_next;       /* Next registered sigmgr */
50         u_char          sm_proto;       /* Signalling protocol (see below) */
51         struct siginst  *sm_prinst;     /* List of protocol instances */
52 /* Exported functions */
53         int             (*sm_attach)    /* Attach interface */
54                                 __P((struct sigmgr *, struct atm_pif *));
55         int             (*sm_detach)    /* Detach interface */
56                                 __P((struct atm_pif *));
57         int             (*sm_setup)     /* Connection setup */
58                                 __P((Atm_connvc *, int *));
59         int             (*sm_accept)    /* Call accepted */
60                                 __P((struct vccb *, int *));
61         int             (*sm_reject)    /* Call rejected */
62                                 __P((struct vccb *, int *));
63         int             (*sm_release)   /* Connection release */
64                                 __P((struct vccb *, int *));
65         int             (*sm_free)      /* Free connection resources */
66                                 __P((struct vccb *));
67         int             (*sm_ioctl)     /* Ioctl handler */
68                                 __P((int, caddr_t, caddr_t));
69 };
70 #endif  /* ATM_KERNEL */
71
72 /* 
73  * ATM Signalling Protocols
74  */
75 #define ATM_SIG_PVC     1               /* PVC-only */
76 #define ATM_SIG_SPANS   2               /* Fore Systems SPANS */
77 #define ATM_SIG_UNI30   3               /* ATM Forum UNI 3.0 */
78 #define ATM_SIG_UNI31   4               /* ATM Forum UNI 3.1 */
79 #define ATM_SIG_UNI40   5               /* ATM Forum UNI 4.0 */
80
81
82 #ifdef ATM_KERNEL
83 /*
84  * Signalling Protocol Instance control block header.  Common header for
85  * every signalling protocol instance control block.
86  */
87 struct  siginst {
88         struct siginst  *si_next;       /* Next sigmgr protocol instance */
89         struct atm_pif  *si_pif;        /* Device interface */
90         Atm_addr        si_addr;        /* Interface ATM address */
91         Atm_addr        si_subaddr;     /* Interface ATM subaddress */
92         Queue_t         si_vccq;        /* VCCB queue */
93         u_short         si_state;       /* Protocol state (sigmgr specific) */
94
95 /* Exported protocol services */
96         struct ip_serv  *si_ipserv;     /* IP/ATM services */
97 };
98
99
100 /*
101  * Sigmgr function return codes
102  */
103 #define CALL_PROCEEDING 1               /* Connection request is in progress */
104 #define CALL_FAILED     2               /* Connection request failed */
105 #define CALL_CONNECTED  3               /* Connection setup successful */
106 #define CALL_CLEARED    4               /* Connection has been terminated */
107
108 #endif  /* ATM_KERNEL */
109
110 #endif  /* _NETATM_ATM_SIGMGR_H */