Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / netproto / atm / ipatm / ipatm_serv.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/ipatm/ipatm_serv.h,v 1.2 1999/08/28 00:48:45 peter Exp $
27  *
28  */
29
30 /*
31  * IP Over ATM Support
32  * -------------------
33  *
34  * IP/ATM service interface definitions
35  *
36  */
37
38 #ifndef _IPATM_IPATM_SERV_H
39 #define _IPATM_IPATM_SERV_H
40
41
42 /*
43  * Structures specifying VCC parameters and pointers to all of the IP 
44  * services offered by an external IP interface service provider.
45  */
46 struct ip_vccparm {
47         Aal_t           ivc_aal;                /* AAL type */
48         Encaps_t        ivc_encaps;             /* VCC encapsulation */
49 };
50
51 #define IPATM_VCCPARMS  4                       /* Number of parameter lists */
52
53 struct ip_serv {
54 /* Interfaces to IP/ATM interface services */
55         int             (*is_ifact)             /* Interface activation */
56                                 __P((struct ip_nif *));
57         int             (*is_ifdact)            /* Interface deactivation */
58                                 __P((struct ip_nif *));
59         int             (*is_ioctl)             /* Interface ioctl */
60                                 __P((int, caddr_t, caddr_t));
61
62 /* Interfaces to IP/ATM ARP services */
63         int             (*is_arp_pvcopen)       /* IP creating dynamic PVC */
64                                 __P((struct ipvcc *));
65         int             (*is_arp_svcout)        /* IP creating outgoing SVC */
66                                 __P((struct ipvcc *, struct in_addr *));
67         int             (*is_arp_svcin)         /* IP creating incoming SVC */
68                                 __P((struct ipvcc *, Atm_addr *, Atm_addr *));
69         int             (*is_arp_svcact)        /* IP SVC is active */
70                                 __P((struct ipvcc *));
71         void            (*is_arp_close)         /* IP closing VCC */
72                                 __P((struct ipvcc *));
73
74 /* Interfaces to IP/ATM broadcast services */
75         int             (*is_bcast_output)      /* IP broadcast packet output */
76                                 __P((struct ip_nif *, KBuffer *));
77
78 /* Interfaces to IP/ATM multicast services */
79
80 /* Ordered list of parameters to try for IP/ATM VCC connections */
81         struct ip_vccparm is_vccparm[IPATM_VCCPARMS];   /* List of vcc params */
82 };
83
84
85 /*
86  * ARP Interface
87  * ----------------
88  */
89
90 /*
91  * Common header for IP/ATM ARP mappings.  For each IP VCC created, the
92  * appropriate IP/ATM ARP server must assign one of these structures to 
93  * indicate the address mapping.  This is the only IP-visible ARP structure.
94  * The servers may embed this structure at the beginning of their 
95  * module-specific mappings.
96  */
97 struct arpmap {
98         struct in_addr  am_dstip;       /* Destination IP address */
99         Atm_addr        am_dstatm;      /* Destination ATM address */
100         Atm_addr        am_dstatmsub;   /* Destination ATM subaddress */
101 };
102
103
104 /*
105  * is_arp_[ps]open() return codes and ipatm_arpnotify() event types
106  */
107 #define MAP_PROCEEDING  1               /* Lookup is proceeding (open only) */
108 #define MAP_VALID       2               /* Mapping is valid */
109 #define MAP_INVALID     3               /* Mapping is invalid */
110 #define MAP_CHANGED     4               /* Mapping has changed */
111 #define MAP_FAILED      5               /* Mapping request has failed */
112
113
114 #endif  /* _IPATM_IPATM_SERV_H */