kernel: Sync ACPICA with Intel's version 20140424.
[dragonfly.git] / usr.sbin / atm / scspd / scsp_if.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/usr.sbin/atm/scspd/scsp_if.h,v 1.2 1999/08/28 01:15:33 peter Exp $
27  *      @(#) $DragonFly: src/usr.sbin/atm/scspd/scsp_if.h,v 1.2 2003/06/17 04:29:52 dillon Exp $
28  *
29  */
30
31 /*
32  * Server Cache Synchronization Protocol (SCSP) Support
33  * ----------------------------------------------------
34  *
35  * Interface to server clients of SCSP
36  *
37  */
38
39 #ifndef _SCSP_SCSP_IF_H
40 #define _SCSP_SCSP_IF_H
41
42
43 /*
44  * SCSP configuration message
45  */
46 struct scsp_cfg_msg {
47         char    atmarp_netif[IFNAMSIZ];
48 };
49 typedef struct scsp_cfg_msg     Scsp_cfg_msg;
50
51
52 /*
53  * SCSP cache summary
54  */
55 struct scsp_sum_msg {
56         u_short         ss_hops;        /* Hop count */
57         u_char          ss_null;        /* Null flag */
58         long            ss_seq;         /* CSA seq. no. */
59         Scsp_ckey       ss_key;         /* Cache key */
60         Scsp_id         ss_oid;         /* Originator ID */
61 };
62 typedef struct scsp_sum_msg     Scsp_sum_msg;
63
64
65 /*
66  * SCSP constants for ATMARP
67  */
68 #define SCSP_ATMARP_PROTO       1
69 #define SCSP_ATMARP_SIDL        4
70 #define SCSP_ATMARP_RIDL        4
71 #define SCSP_ATMARP_CKL         4
72 #define SCSP_ATMARP_OIDL        4
73
74
75 /*
76  * SCSP ATMARP message
77  */
78 struct scsp_atmarp_msg {
79         u_char          sa_state;       /* Cache entry state (below) */
80         struct in_addr  sa_cpa;         /* Cached protocol address */
81         Atm_addr        sa_cha;         /* Cached ATM address */
82         Atm_addr        sa_csa;         /* Cached ATM subaddress */
83         Scsp_ckey       sa_key;         /* Cache key for entry */
84         Scsp_id         sa_oid;         /* Originator ID */
85         long            sa_seq;         /* Sequence no. */
86 };
87 typedef struct scsp_atmarp_msg  Scsp_atmarp_msg;
88
89 #define SCSP_ASTATE_NEW 0       /* ATMARP new server registration */
90 #define SCSP_ASTATE_UPD 1       /* ATMARP server refreshed */
91 #define SCSP_ASTATE_DEL 2       /* ATMARP server data deleted */
92
93
94 /*
95  * SCSP constants for NHRP
96  */
97 #define SCSP_NHRP_PROTO         2
98 #define SCSP_NHRP_SIDL          4
99 #define SCSP_NHRP_RIDL          4
100 #define SCSP_NHRP_CKL           4
101 #define SCSP_NHRP_OIDL          4
102
103
104 /*
105  * SCSP NHRP message
106  */
107 struct scsp_nhrp_msg {
108         u_short sn_af;          /* Address family */
109         u_short sn_proto;       /* NHRP protocol type */
110         u_char  sn_snap[5];     /* SNAP */
111         u_char  sn_ver;         /* NHRP version number */
112         u_short sn_flags;       /* Flags */
113         u_long  sn_rid;         /* Request ID */
114         u_char  sn_state;       /* State */
115         u_char  sn_prel;        /* Prefix length */
116         u_short sn_mtu;         /* Maximum transmission unit */
117         u_short sn_hold;        /* Holding time */
118         Atm_addr        sn_addr;        /* Server network address */
119         Atm_addr        sn_saddr;       /* Server network subaddress */
120         struct in_addr  sn_paddr;       /* Server protocol address */
121         Scsp_ckey sn_key;       /* Cache key for entry */
122         Scsp_id sn_oid;         /* Originator ID */
123 };
124 typedef struct scsp_nhrp_msg    Scsp_nhrp_msg;
125
126 #define SCSP_NSTATE_NEW 0       /* New NHRP server */
127 #define SCSP_NSTATE_UPD 1       /* NHRP server re-registered */
128 #define SCSP_NSTATE_DEL 2       /* NHRP server data purged */
129 #define SCSP_NSTATE_NSD 3       /* NHRP no such data in server */
130
131
132 /*
133  * SCSP/server message header
134  */
135 struct scsp_if_msg_hdr {
136         u_char  sh_type;        /* Message type */
137         u_char  sh_rc;          /* Response code */
138         u_short sh_proto;       /* SCSP protocol ID */
139         int     sh_len;         /* Length of message */
140         u_long  sh_tok;         /* Token from SCSP daemon */
141 };
142 typedef struct scsp_if_msg_hdr  Scsp_if_msg_hdr;
143
144
145 /*
146  * SCSP-server message
147  */
148 struct scsp_if_msg {
149         Scsp_if_msg_hdr si_hdr; /* Header fields */
150         union {
151                 Scsp_cfg_msg    siu_cfg;        /* Config data */
152                 Scsp_sum_msg    siu_sum;        /* Cache summary */
153                 Scsp_atmarp_msg siu_atmarp;     /* ATMARP update */
154                 Scsp_nhrp_msg   siu_nhrp;       /* NHRP update */
155         } si_u;
156 };
157 typedef struct scsp_if_msg      Scsp_if_msg;
158
159 #define si_type         si_hdr.sh_type
160 #define si_rc           si_hdr.sh_rc
161 #define si_proto        si_hdr.sh_proto
162 #define si_len          si_hdr.sh_len
163 #define si_tok          si_hdr.sh_tok
164
165 #define si_cfg          si_u.siu_cfg
166 #define si_sum          si_u.siu_sum
167 #define si_atmarp       si_u.siu_atmarp
168 #define si_nhrp         si_u.siu_nhrp
169
170
171 /*
172  * Message types
173  */
174 #define SCSP_NOP_REQ            1
175 #define SCSP_CFG_REQ            2
176 #define SCSP_CFG_RSP            3
177 #define SCSP_CACHE_IND          4
178 #define SCSP_CACHE_RSP          5
179 #define SCSP_SOLICIT_IND        6
180 #define SCSP_SOLICIT_RSP        7
181 #define SCSP_UPDATE_IND         8
182 #define SCSP_UPDATE_REQ         9
183 #define SCSP_UPDATE_RSP         10
184
185
186 /*
187  * Response codes
188  */
189 #define SCSP_RSP_OK             0
190 #define SCSP_RSP_ERR            1
191 #define SCSP_RSP_REJ            2
192 #define SCSP_RSP_NOT_FOUND      3
193
194
195 #endif  /* _SCSP_SCSP_IF_H */