3 * ===================================
4 * HARP | Host ATM Research Platform
5 * ===================================
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.
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.
21 * Copyright 1994-1998 Network Computing Services, Inc.
23 * Copies of this Software may be made, however, the above copyright
24 * notice must be reproduced on all copies.
34 * Protocol control blocks
38 #ifndef _IPATM_IPATM_VAR_H
39 #define _IPATM_IPATM_VAR_H
43 * Structure containing information for each VCC, both SVC and PVC, which
44 * supports IP traffic.
47 Qelem_t iv_elem; /* ip_nif queueing links */
48 u_short iv_flags; /* VCC flags (see below) */
49 u_char iv_state; /* VCC state (see below) */
50 Atm_connection *iv_conn; /* Connection manager token */
51 struct in_addr iv_dst; /* Peer's IP address */
52 struct ip_nif *iv_ipnif; /* IP network interface */
53 struct atm_time iv_time; /* Timer controls */
54 short iv_idle; /* VCC idle timer */
55 u_char iv_parmx; /* Index into provider's vcc params */
56 KBuffer *iv_queue; /* Packet waiting for VCC */
57 struct arpmap *iv_arpent; /* ARP entry for VCC */
58 struct ipvcc *iv_arpnext; /* ARP link field */
59 Atm_connection *iv_arpconn; /* ARP connection manager token */
61 #define iv_forw iv_elem.q_forw
62 #define iv_back iv_elem.q_back
68 #define IVF_PVC 0x0001 /* PVC */
69 #define IVF_SVC 0x0002 /* SVC */
70 #define IVF_LLC 0x0004 /* VCC uses LLC/SNAP encapsulation */
71 #define IVF_MAPOK 0x0008 /* VCC ARP mapping is valid */
72 #define IVF_NOIDLE 0x0010 /* Do not idle-timeout this VCC */
77 #define IPVCC_FREE 0 /* No VCC associated with entry */
78 #define IPVCC_PMAP 1 /* SVC waiting for ARP mapping */
79 #define IPVCC_POPEN 2 /* Pending SVC open completion */
80 #define IPVCC_PACCEPT 3 /* Pending SVC accept completion */
81 #define IPVCC_ACTPENT 4 /* PVC open - waiting for ARP entry */
82 #define IPVCC_ACTIVE 5 /* VCC open - available */
83 #define IPVCC_CLOSED 6 /* VCC has been closed */
88 * Structure containing IP-specific information for each ATM network
89 * interface in the system.
92 struct ip_nif *inf_next; /* Next on interface chain */
93 struct atm_nif *inf_nif; /* ATM network interface */
94 u_short inf_state; /* Interface state (see below) */
95 struct in_ifaddr *inf_addr; /* Interface's IP address */
96 Queue_t inf_vcq; /* VCC connections queue */
97 struct ip_serv *inf_serv; /* Interface service provider */
99 /* For use by IP interface service provider (ie signalling manager) */
100 caddr_t inf_isintf; /* Interface control block */
102 /* IP/ATM provided interface services */
103 void (*inf_arpnotify)/* ARP event notification */
104 (struct ipvcc *, int);
105 int (*inf_ipinput) /* IP packet input */
106 (struct ip_nif *, KBuffer *);
107 int (*inf_createsvc)/* Create an IP SVC */
108 (struct ifnet *, u_short, caddr_t,
113 * Network Interface States
115 #define IPNIF_ADDR 1 /* Waiting for i/f address */
116 #define IPNIF_SIGMGR 2 /* Waiting for sigmgr attach */
117 #define IPNIF_ACTIVE 3 /* Active */
121 * Global IP/ATM Statistics
124 u_long ias_rcvstate; /* Packets received, bad vcc state */
125 u_long ias_rcvnobuf; /* Packets received, no buf avail */
130 * Structure to pass parameters for ipatm_openpvc()
133 struct ip_nif *ipp_ipnif; /* PVC's IP network interface */
134 u_short ipp_vpi; /* VPI value */
135 u_short ipp_vci; /* VCI value */
136 Aal_t ipp_aal; /* AAL type */
137 Encaps_t ipp_encaps; /* VCC encapsulation */
138 struct sockaddr_in ipp_dst; /* Destination's IP address */
139 uint8_t ipp_traffic_type; /* CBR, UBR, ... */
140 struct t_atm_traffic ipp_traffic; /* traffic parameters */
147 #define IPVCC_TIMER(s, t) atm_timeout(&(s)->iv_time, (t), ipatm_timeout)
148 #define IPVCC_CANCEL(s) atm_untimeout(&(s)->iv_time)
153 #define SATOSIN(sa) ((struct sockaddr_in *)(sa))
157 * Global function declarations
160 void ipatm_timeout(struct atm_time *);
161 void ipatm_connected(void *);
162 void ipatm_cleared(void *, struct t_atm_cause *);
163 void ipatm_arpnotify(struct ipvcc *, int);
164 void ipatm_itimeout(struct atm_time *);
167 int ipatm_nifstat(int, struct atm_nif *, intptr_t);
170 void ipatm_cpcs_data(void *, KBuffer *);
171 int ipatm_ipinput(struct ip_nif *, KBuffer *);
176 int ipatm_ifoutput(struct ifnet *, KBuffer *, struct sockaddr *);
179 int ipatm_ioctl(int, caddr_t, caddr_t);
180 caddr_t ipatm_getname(void *);
183 int ipatm_openpvc(struct ipatmpvc *, struct ipvcc **);
184 int ipatm_createsvc(struct ifnet *, u_short, caddr_t,
186 int ipatm_opensvc(struct ipvcc *);
187 int ipatm_retrysvc(struct ipvcc *);
188 void ipatm_activate(struct ipvcc *);
189 int ipatm_incoming(void *, Atm_connection *, Atm_attributes *,
191 int ipatm_closevc(struct ipvcc *, int);
192 int ipatm_chknif(struct in_addr, struct ip_nif *);
193 struct ipvcc *ipatm_iptovc(struct sockaddr_in *, struct atm_nif *);
199 extern int ipatm_vccnt;
200 extern int ipatm_vcidle;
201 extern int ipatm_print;
202 extern u_long last_map_ipdst;
203 extern struct ipvcc *last_map_ipvcc;
204 extern struct ip_nif *ipatm_nif_head;
205 extern uma_zone_t ipatm_vc_zone;
206 extern struct ipatm_stat ipatm_stat;
207 extern struct atm_time ipatm_itimer;
208 extern Atm_endpoint ipatm_endpt;
209 extern Atm_attributes ipatm_aal5llc;
210 extern Atm_attributes ipatm_aal5null;
211 extern Atm_attributes ipatm_aal4null;
214 SYSCTL_DECL(_net_harp_ip);
219 #endif /* _IPATM_IPATM_VAR_H */