Network threading stage 1/3: netisrs are already software interrupts,
[dragonfly.git] / sys / netproto / atm / atm_var.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_var.h,v 1.2 1999/08/28 00:48:39 peter Exp $
27  *      @(#) $DragonFly: src/sys/netproto/atm/atm_var.h,v 1.6 2003/09/16 05:03:13 hsu Exp $
28  *
29  */
30
31 /*
32  * Core ATM Services
33  * -----------------
34  *
35  * ATM system variables
36  *
37  */
38
39 #ifndef _NETATM_ATM_VAR_H
40 #define _NETATM_ATM_VAR_H
41
42
43 #ifdef ATM_KERNEL
44 /*
45  * Global variable declarations
46  */
47         /* atm_aal5.c */
48 #if (defined(__FreeBSD__) && (BSD >= 199506))
49 extern struct pr_usrreqs        atm_aal5_usrreqs;
50 #endif
51
52         /* atm_proto.c */
53 extern struct domain    atmdomain;
54
55         /* atm_subr.c */
56 extern struct atm_pif   *atm_interface_head;
57 extern struct atm_ncm   *atm_netconv_head;
58 extern Atm_endpoint     *atm_endpoints[];
59 extern struct sp_info   *atm_pool_head;
60 extern struct stackq_entry      *atm_stackq_head;
61 extern struct stackq_entry      *atm_stackq_tail;
62 extern struct ifqueue   atm_intrq;
63 #ifdef sgi
64 extern  int             atm_intr_index;
65 #endif
66 extern struct atm_sock_stat     atm_sock_stat;
67 extern int              atm_init;
68 extern int              atm_version;
69 extern int              atm_debug;
70 extern struct timeval   atm_debugtime;
71 extern int              atm_dev_print;
72 extern int              atm_print_data;
73 extern struct sp_info   atm_attributes_pool;
74
75         /* atm_usrreq.c */
76 #if (defined(__FreeBSD__) && (BSD >= 199506))
77 extern struct pr_usrreqs        atm_dgram_usrreqs;
78 #endif
79
80
81 /*
82  * Global function declarations
83  */
84         /* atm_aal5.c */
85 int             atm_aal5_ctloutput (struct socket *, struct sockopt *);
86 void            atm_aal5_init (void);
87
88         /* atm_cm.c */
89 int             atm_cm_connect (Atm_endpoint *, void *, Atm_attributes *,
90                         Atm_connection **);
91 int             atm_cm_listen (Atm_endpoint *, void *, Atm_attributes *,
92                         Atm_connection **);
93 int             atm_cm_addllc (Atm_endpoint *, void *, struct attr_llc *,
94                         Atm_connection *, Atm_connection **);
95 int             atm_cm_addparty (Atm_connection *, int,
96                         struct t_atm_sap *);
97 int             atm_cm_dropparty (Atm_connection *, int,
98                         struct t_atm_cause *);
99 int             atm_cm_release (Atm_connection *, struct t_atm_cause *);
100 int             atm_cm_abort (Atm_connvc *, struct t_atm_cause *);
101 int             atm_cm_incoming (struct vccb *, Atm_attributes *);
102 void            atm_cm_connected (Atm_connvc *);
103 void            atm_cm_cleared (Atm_connvc *);
104 Atm_connection *atm_cm_match (Atm_attributes *, Atm_connection *);
105 int             atm_cm_cpcs_ctl (int, Atm_connection *, void *);
106 int             atm_cm_cpcs_data (Atm_connection *, KBuffer *);
107 int             atm_cm_saal_ctl (int, Atm_connection *, void *);
108 int             atm_cm_saal_data (Atm_connection *, KBuffer *);
109 int             atm_cm_sscop_ctl (int, Atm_connection *, void *, void *);
110 int             atm_cm_sscop_data (Atm_connection *, KBuffer *);
111 int             atm_endpoint_register (Atm_endpoint *);
112 int             atm_endpoint_deregister (Atm_endpoint *);
113
114         /* atm_device.c */
115 int             atm_dev_inst (struct stack_defn **, Atm_connvc *);
116 void            atm_dev_lower (int, void *, int, int);
117 void *          atm_dev_alloc (u_int, u_int, u_int);
118 void            atm_dev_free (volatile void *);
119 #if defined(sun4m)
120 void *          atm_dma_map (caddr_t, int, int);
121 void            atm_dma_free (caddr_t, int);
122 #endif
123 KBuffer *       atm_dev_compress (KBuffer *);
124 Cmn_vcc *       atm_dev_vcc_find (Cmn_unit *, u_int, u_int, u_int);
125 void            atm_dev_pdu_print (Cmn_unit *, Cmn_vcc *, KBuffer *,
126                         char *);
127
128         /* atm_if.c */
129 int             atm_physif_register (Cmn_unit *, char *,
130                         struct stack_defn *);
131 int             atm_physif_deregister (Cmn_unit *);
132 void            atm_physif_freenifs (struct atm_pif *);
133 int             atm_netconv_register (struct atm_ncm *);
134 int             atm_netconv_deregister (struct atm_ncm *);
135 int             atm_nif_attach (struct atm_nif *);
136 void            atm_nif_detach (struct atm_nif *);
137 int             atm_nif_setaddr (struct atm_nif *, struct ifaddr *);
138 #if (defined(BSD) && (BSD >= 199103))
139 int             atm_ifoutput (struct ifnet *, KBuffer *,
140                         struct sockaddr *, struct rtentry *);
141 #else
142 int             atm_ifoutput (struct ifnet *, KBuffer *,
143                         struct sockaddr *);
144 #endif
145 struct atm_pif *
146                 atm_pifname (char *);
147 struct atm_nif *
148                 atm_nifname (char *);
149
150         /* atm_proto.c */
151 #if (defined(__FreeBSD__) && (BSD >= 199506))
152 int             atm_proto_notsupp1 (struct socket *);
153 int             atm_proto_notsupp2 (struct socket *, struct sockaddr *,
154                         struct thread *);
155 int             atm_proto_notsupp3 (struct socket *, struct sockaddr **);
156 int             atm_proto_notsupp4 (struct socket *, int, KBuffer *, 
157                         struct sockaddr *, KBuffer *, struct thread *);
158 #endif
159
160         /* atm_signal.c */
161 int             atm_sigmgr_register (struct sigmgr *);
162 int             atm_sigmgr_deregister (struct sigmgr *);
163 int             atm_sigmgr_attach (struct atm_pif *, u_char);
164 int             atm_sigmgr_detach (struct atm_pif *);
165 int             atm_stack_register (struct stack_defn *);
166 int             atm_stack_deregister (struct stack_defn *);
167 int             atm_create_stack (Atm_connvc *, struct stack_list *,
168                         void (*)(int, void *, int, int) );
169
170         /* atm_socket.c */
171 int             atm_sock_attach (struct socket *, u_long, u_long);
172 int             atm_sock_detach (struct socket *);
173 int             atm_sock_bind (struct socket *, struct sockaddr *);
174 int             atm_sock_listen (struct socket *, Atm_endpoint *);
175 int             atm_sock_connect (struct socket *, struct sockaddr *,
176                         Atm_endpoint *);
177 int             atm_sock_disconnect (struct socket *);
178 int             atm_sock_sockaddr (struct socket *, struct sockaddr **);
179 int             atm_sock_peeraddr (struct socket *, struct sockaddr **);
180 int             atm_sock_setopt (struct socket *, struct sockopt *,
181                         Atm_pcb *);
182 int             atm_sock_getopt (struct socket *, struct sockopt *,
183                         Atm_pcb *);
184 void            atm_sock_connected (void *);
185 void            atm_sock_cleared (void *, struct t_atm_cause *);
186
187         /* atm_subr.c */
188 void            atm_initialize (void);
189 void *          atm_allocate (struct sp_info *);
190 void            atm_free (void *);
191 void            atm_release_pool (struct sp_info *);
192 void            atm_timeout (struct atm_time *, int, 
193                         void (*) (struct atm_time *) );
194 int             atm_untimeout (struct atm_time *);
195 int             atm_stack_enq (int, void (*) (int, void *, int, int), 
196                         void *, Atm_connvc *, int, int);
197 void            atm_stack_drain (void);
198 void            atm_pdu_print (KBuffer *, char *);
199
200         /* atm_usrreq.c */
201 #if (!(defined(__FreeBSD__) && (BSD >= 199506)))
202 int             atm_dgram_usrreq (struct socket *, int, KBuffer *,
203                         KBuffer *, KBuffer *);
204 #endif
205
206 #endif  /* ATM_KERNEL */
207
208 #endif  /* _NETATM_ATM_VAR_H */