]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/netatm/atm_ioctl.h
This commit was generated by cvs2svn to compensate for changes in r169765,
[FreeBSD/FreeBSD.git] / sys / netatm / atm_ioctl.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$
27  *
28  */
29
30 /*
31  * Core ATM Services
32  * -----------------
33  *
34  * PF_ATM socket ioctl definitions
35  *
36  */
37
38 #ifndef _NETATM_ATM_IOCTL_H
39 #define _NETATM_ATM_IOCTL_H
40
41
42 /*
43  * Structure for PF_ATM configure (AIOCCFG) socket ioctls
44  */
45 struct atmcfgreq {
46         int             acr_opcode;             /* Sub-operation */
47         union {
48                 struct {
49                         /* Configure - attach */
50                         char    acru_att_intf[IFNAMSIZ];/* Interface name */
51                         u_char  acru_att_proto; /* Signalling protocol */
52                 } acru_att;
53                 struct {
54                         /* Configure - detach */
55                         char    acru_det_intf[IFNAMSIZ];/* Interface name */
56                 } acru_det;
57         } acr_u;
58 };
59 #define acr_att_intf    acr_u.acru_att.acru_att_intf
60 #define acr_att_proto   acr_u.acru_att.acru_att_proto
61 #define acr_det_intf    acr_u.acru_det.acru_det_intf
62
63
64 /*
65  * Structure for PF_ATM set (AIOCSET) socket ioctls
66  */
67 struct atmsetreq {
68         int             asr_opcode;             /* Sub-operation */
69         union {
70                 /* ARP server */
71                 struct {
72                         char    asru_arp_intf[IFNAMSIZ];/* Interface name */
73                         Atm_addr        asru_arp_addr;  /* ARP srvr address */
74                         Atm_addr        asru_arp_subaddr;/* ARP srvr subaddr */
75                         caddr_t         asru_arp_pbuf;  /* Prefix buffer addr */
76                         size_t          asru_arp_plen;  /* Prefix buffer len */
77                 } asru_asrvr;
78                 /* MAC address */
79                 struct {
80                         char    asru_mac_intf[IFNAMSIZ];/* Interface name */
81                         struct mac_addr asru_mac_addr;  /* MAC address */
82                 } asru_mac;
83                 /* Network interface */
84                 struct {
85                         char    asru_nif_intf[IFNAMSIZ];/* Interface name */
86                         char    asru_nif_pref[IFNAMSIZ];/* I/f prefix name */
87                         u_int   asru_nif_cnt;           /* Number of i/fs */
88                 } asru_nif;
89                 /* NSAP prefix */
90                 struct {
91                         char    asru_prf_intf[IFNAMSIZ];/* Interface name */
92                         u_char  asru_prf_pref[13];      /* NSAP prefix */
93                 } asru_prf;
94         } asr_u;
95 };
96 #define asr_arp_intf    asr_u.asru_asrvr.asru_arp_intf
97 #define asr_arp_addr    asr_u.asru_asrvr.asru_arp_addr
98 #define asr_arp_pbuf    asr_u.asru_asrvr.asru_arp_pbuf
99 #define asr_arp_plen    asr_u.asru_asrvr.asru_arp_plen
100 #define asr_arp_subaddr asr_u.asru_asrvr.asru_arp_subaddr
101 #define asr_mac_intf    asr_u.asru_mac.asru_mac_intf
102 #define asr_mac_addr    asr_u.asru_mac.asru_mac_addr
103 #define asr_nif_intf    asr_u.asru_nif.asru_nif_intf
104 #define asr_nif_pref    asr_u.asru_nif.asru_nif_pref
105 #define asr_nif_cnt     asr_u.asru_nif.asru_nif_cnt
106 #define asr_prf_intf    asr_u.asru_prf.asru_prf_intf
107 #define asr_prf_pref    asr_u.asru_prf.asru_prf_pref
108
109
110 /*
111  * Structure for PF_ATM add (AIOCADD) socket ioctls
112  */
113 struct atmaddreq {
114         int             aar_opcode;             /* Sub-operation */
115         union {
116                 /* Add PVC */
117                 struct {
118                         char    aaru_pvc_intf[IFNAMSIZ];/* Interface name */
119                         u_short aaru_pvc_vpi;           /* VPI value */
120                         u_short aaru_pvc_vci;           /* VCI value */
121                         struct sockaddr aaru_pvc_dst;   /* Destination addr */
122                         Sap_t   aaru_pvc_sap;           /* Endpoint SAP */
123                         Aal_t   aaru_pvc_aal;           /* AAL */
124                         Encaps_t aaru_pvc_encaps;       /* Encapsulation */
125                         u_char  aaru_pvc_flags;         /* Flags (see below) */
126                         uint8_t aaru_pvc_traffic_type;  /* traffic type */
127                         struct t_atm_traffic aaru_pvc_traffic; /* traffic parameters */
128                 } aaru_add_pvc;
129
130                 /* Add ARP table entry */
131                 struct {
132                         char    aaru_arp_intf[IFNAMSIZ];/* Interface name */
133                         struct sockaddr aaru_arp_dst;   /* IP addr */
134                         Atm_addr        aaru_arp_addr;  /* ATM addr */
135                         u_char  aaru_arp_origin;        /* Entry origin */
136                 } aaru_add_arp;
137         } aar_u;
138 };
139 #define aar_pvc_intf    aar_u.aaru_add_pvc.aaru_pvc_intf
140 #define aar_pvc_vpi     aar_u.aaru_add_pvc.aaru_pvc_vpi
141 #define aar_pvc_vci     aar_u.aaru_add_pvc.aaru_pvc_vci
142 #define aar_pvc_dst     aar_u.aaru_add_pvc.aaru_pvc_dst
143 #define aar_pvc_sap     aar_u.aaru_add_pvc.aaru_pvc_sap
144 #define aar_pvc_aal     aar_u.aaru_add_pvc.aaru_pvc_aal
145 #define aar_pvc_encaps  aar_u.aaru_add_pvc.aaru_pvc_encaps
146 #define aar_pvc_flags   aar_u.aaru_add_pvc.aaru_pvc_flags
147 #define aar_pvc_traffic_type    aar_u.aaru_add_pvc.aaru_pvc_traffic_type
148 #define aar_pvc_traffic aar_u.aaru_add_pvc.aaru_pvc_traffic
149 #define aar_arp_intf    aar_u.aaru_add_arp.aaru_arp_intf
150 #define aar_arp_dst     aar_u.aaru_add_arp.aaru_arp_dst
151 #define aar_arp_addr    aar_u.aaru_add_arp.aaru_arp_addr
152 #define aar_arp_origin  aar_u.aaru_add_arp.aaru_arp_origin
153
154 /* PVC flags */
155 #define PVC_DYN         0x01                    /* Dest addr is dynamic */
156
157
158 /*
159  * Structure for PF_ATM delete (AIOCDEL) socket ioctls
160  */
161 struct atmdelreq {
162         int             adr_opcode;             /* Sub-operation */
163         union {
164                 /* Delete PVC */
165                 struct {
166                         char    adru_pvc_intf[IFNAMSIZ];/* Interface name */
167                         u_short adru_pvc_vpi;           /* VPI value */
168                         u_short adru_pvc_vci;           /* VCI value */
169                 } adru_del_pvc;
170
171                 /* Delete SVC */
172                 struct {
173                         char    adru_svc_intf[IFNAMSIZ];/* Interface name */
174                         u_short adru_svc_vpi;           /* VPI value */
175                         u_short adru_svc_vci;           /* VCI value */
176                 } adru_del_svc;
177
178                 /* Delete ARP table entry */
179                 struct {
180                         char    adru_arp_intf[IFNAMSIZ];/* Interface name */
181                         struct sockaddr adru_arp_dst;   /* IP addr */
182                 } adru_del_arp;
183         } adr_u;
184 };
185 #define adr_pvc_intf    adr_u.adru_del_pvc.adru_pvc_intf
186 #define adr_pvc_vpi     adr_u.adru_del_pvc.adru_pvc_vpi
187 #define adr_pvc_vci     adr_u.adru_del_pvc.adru_pvc_vci
188 #define adr_svc_intf    adr_u.adru_del_svc.adru_svc_intf
189 #define adr_svc_vpi     adr_u.adru_del_svc.adru_svc_vpi
190 #define adr_svc_vci     adr_u.adru_del_svc.adru_svc_vci
191 #define adr_arp_intf    adr_u.adru_del_arp.adru_arp_intf
192 #define adr_arp_dst     adr_u.adru_del_arp.adru_arp_dst
193
194
195 /*
196  * Structure for PF_ATM information (AIOCINFO) socket ioctls
197  */
198 struct atminfreq {
199         int             air_opcode;             /* Sub-operation */
200         caddr_t         air_buf_addr;           /* Buffer for returned info */
201         size_t          air_buf_len;            /* Buffer length */
202         union {
203                 /* Vendor info */
204                 char            airu_vinfo_intf[IFNAMSIZ];/* Interface name */
205                 /* IP VCC */
206                 struct sockaddr airu_ip_addr;           /* Destination host */
207                 /* ARP table */
208                 struct {
209                         struct sockaddr airu_arp_addr;  /* Destination host */
210                         u_char          airu_arp_flags; /* Flags (see below) */
211                 } airu_arp;
212                 /* ARP server */
213                 char            airu_asrv_intf[IFNAMSIZ];/* Interface name */
214                 /* Interface */
215                 char            airu_int_intf[IFNAMSIZ];/* Interface name */
216                 /* VCC */
217                 char            airu_vcc_intf[IFNAMSIZ];/* Interface name */
218                 /* Configuration */
219                 char            airu_cfg_intf[IFNAMSIZ];/* Interface name */
220                 /* Network interface */
221                 char            airu_netif_intf[IFNAMSIZ];/* Interface name */
222                 /* Physical interface statistics */
223                 char            airu_physt_intf[IFNAMSIZ];/* Interface name */
224         } air_u;
225 };
226 #define air_vinfo_intf          air_u.airu_vinfo_intf
227 #define air_ip_addr             air_u.airu_ip_addr
228 #define air_arp_addr            air_u.airu_arp.airu_arp_addr
229 #define air_arp_flags           air_u.airu_arp.airu_arp_flags
230 #define air_asrv_intf           air_u.airu_asrv_intf
231 #define air_int_intf            air_u.airu_int_intf
232 #define air_vcc_intf            air_u.airu_vcc_intf
233 #define air_cfg_intf            air_u.airu_cfg_intf
234 #define air_netif_intf          air_u.airu_netif_intf
235 #define air_physt_intf          air_u.airu_physt_intf
236
237 /* ARP table info flags */
238 #define ARP_RESET_REF   0x01                    /* Reset refresh status */
239
240
241 /*
242  * Structures returned by information requests
243  */
244
245 /*
246  * Vendor-specific interface information
247  */
248 struct air_vinfo_rsp {
249         char            avsp_intf[IFNAMSIZ];    /* Interface name */
250         size_t          avsp_len;               /* Length of returned
251                                                         Vendor Info block */
252                                                 /* Vendor info ... */
253 };
254
255
256 /*
257  * ARP table information
258  */
259 struct air_arp_rsp {
260         struct sockaddr aap_arp_addr;           /* Destination host */
261         char            aap_intf[IFNAMSIZ];     /* Interface name */
262         u_char          aap_flags;              /* Flags (see below) */
263         u_char          aap_origin;             /* Entry origin (see below) */
264         u_char          aap_age;                /* Aging timeout (minutes) */
265         Atm_addr        aap_addr;               /* ATM address */
266         Atm_addr        aap_subaddr;            /* ATM subaddress */
267 };
268
269 /*
270  * ARP entry flags
271  */
272 #define ARPF_VALID      0x01                    /* Entry is valid */
273 #define ARPF_REFRESH    0x02                    /* Entry has been refreshed */
274
275 /*
276  * ARP entry origin
277  */
278 #define ARP_ORIG_PERM   50                      /* Permanent entry */
279
280 /*
281  * IP VCC information
282  */
283 struct air_ip_vcc_rsp {
284         struct sockaddr aip_dst_addr;           /* Destination host */
285         char            aip_intf[IFNAMSIZ];     /* Interface name */
286         u_short         aip_vpi;                /* VPI value */
287         u_short         aip_vci;                /* VCI value */
288         u_char          aip_sig_proto;          /* Signalling protocol */
289         u_char          aip_flags;              /* Flags (IVF_*) */
290         u_char          aip_state;              /* IP VCC state */
291 };
292
293 /*
294  * ARP server information
295  */
296 struct air_asrv_rsp {
297         char            asp_intf[IFNAMSIZ];     /* Interface name */
298         Atm_addr        asp_addr;               /* Server ATM address */
299         Atm_addr        asp_subaddr;            /* Server ATM subaddress */
300         int             asp_state;              /* Server state */
301         int             asp_nprefix;            /* Number of prefix entries */
302 };
303
304 /*
305  * Interface information
306  */
307 struct air_int_rsp {
308         char            anp_intf[IFNAMSIZ];     /* Interface name */
309         Atm_addr        anp_addr;               /* ATM address */
310         Atm_addr        anp_subaddr;            /* ATM subaddress */
311         u_char          anp_sig_proto;          /* Signalling protocol */
312         u_char          anp_sig_state;          /* Signalling protocol state */
313         char            anp_nif_pref[IFNAMSIZ]; /* Netif prefix */
314         u_int           anp_nif_cnt;            /* No. of netifs */
315 };
316
317 /*
318  * Network interface information
319  */
320 struct air_netif_rsp {
321         char            anp_intf[IFNAMSIZ];     /* Interface name */
322         struct sockaddr anp_proto_addr;         /* Protocol address */
323         char            anp_phy_intf[IFNAMSIZ]; /* Interface name */
324 };
325
326 /*
327  * VCC information
328  * Todo: add avp_traffic_type and avp_traffic. Update unisig_if.c,
329  *      spans_if.c and sigpvc_if.c
330  */
331 #define O_CNT           8
332 struct air_vcc_rsp {
333         char            avp_intf[IFNAMSIZ];     /* Interface name */
334         u_short         avp_vpi;                /* VPI value */
335         u_short         avp_vci;                /* VCI value */
336         u_char          avp_type;               /* Type (SVC or PVC) */
337         u_char          avp_aal;                /* AAL */
338         u_char          avp_sig_proto;          /* Signalling protocol */
339         Encaps_t        avp_encaps;             /* Encapsulation */
340         u_char          avp_state;              /* State (sig mgr specific) */
341         char            avp_owners[(T_ATM_APP_NAME_LEN+1)*O_CNT];/* VCC users */
342         Atm_addr        avp_daddr;              /* Address of far end */
343         Atm_addr        avp_dsubaddr;           /* Subaddress of far end */
344         u_long          avp_ipdus;              /* PDUs received from VCC */
345         u_long          avp_opdus;              /* PDUs sent to VCC */
346         u_long          avp_ibytes;             /* Bytes received from VCC */
347         u_long          avp_obytes;             /* Bytes sent to VCC */
348         u_long          avp_ierrors;            /* Errors receiving from VCC */
349         u_long          avp_oerrors;            /* Errors sending to VCC */
350         time_t          avp_tstamp;             /* State transition timestamp */
351 };
352
353 /*
354  * Adapter configuration information
355  */
356 struct air_cfg_rsp {
357         char            acp_intf[IFNAMSIZ];     /* Interface name */
358         Atm_config      acp_cfg;                /* Config info */
359 };
360 #define acp_vendor      acp_cfg.ac_vendor
361 #define acp_vendapi     acp_cfg.ac_vendapi
362 #define acp_device      acp_cfg.ac_device
363 #define acp_media       acp_cfg.ac_media
364 #define acp_serial      acp_cfg.ac_serial
365 #define acp_bustype     acp_cfg.ac_bustype
366 #define acp_busslot     acp_cfg.ac_busslot
367 #define acp_ram         acp_cfg.ac_ram
368 #define acp_ramsize     acp_cfg.ac_ramsize
369 #define acp_macaddr     acp_cfg.ac_macaddr
370 #define acp_hard_vers   acp_cfg.ac_hard_vers
371 #define acp_firm_vers   acp_cfg.ac_firm_vers
372
373 /*
374  * Version information
375  */
376 struct air_version_rsp {
377         int             avp_version;            /* Software version */
378 };
379
380 /*
381  * Physical interface statistics
382  */
383 struct air_phy_stat_rsp {
384         char            app_intf[IFNAMSIZ];     /* Interface name */
385         u_quad_t        app_ipdus;              /* PDUs received from I/F */
386         u_quad_t        app_opdus;              /* PDUs sent to I/F */
387         u_quad_t        app_ibytes;             /* Bytes received from I/F */
388         u_quad_t        app_obytes;             /* Bytes sent to I/F */
389         u_quad_t        app_ierrors;            /* Errors receiving from I/F */
390         u_quad_t        app_oerrors;            /* Errors sending to I/F */
391         u_quad_t        app_cmderrors;          /* I/F command errors */
392 };
393
394
395 /*
396  * PF_ATM sub-operation codes
397  */
398 #define AIOCS_CFG_ATT   1
399 #define AIOCS_CFG_DET   2
400 #define AIOCS_ADD_PVC   32
401 #define AIOCS_ADD_ARP   33
402 #define AIOCS_DEL_PVC   64
403 #define AIOCS_DEL_SVC   65
404 #define AIOCS_DEL_ARP   66
405 #define AIOCS_SET_ASV   96
406 #define AIOCS_SET_NIF   97
407 #define AIOCS_SET_PRF   98
408 #define AIOCS_SET_MAC   99
409 #define AIOCS_INF_VST   160
410 #define AIOCS_INF_IPM   161
411 #define AIOCS_INF_ARP   162
412 #define AIOCS_INF_ASV   163
413 #define AIOCS_INF_INT   164
414 #define AIOCS_INF_VCC   165
415 #define AIOCS_INF_CFG   166
416 #define AIOCS_INF_NIF   167
417 #define AIOCS_INF_PIS   168
418 #define AIOCS_INF_VER   169
419
420
421 /*
422  * PF_ATM ioctls
423  */
424 #define AIOCCFG         _IOW('A', 128, struct atmcfgreq)/* Configure i/f */
425 #define AIOCADD         _IOW('A', 129, struct atmaddreq)/* Add (e.g. PVC) */
426 #define AIOCDEL         _IOW('A', 130, struct atmdelreq)/* Delete */
427 #define AIOCSET         _IOW('A', 132, struct atmsetreq)/* Set (e.g. net i/f) */
428 #define AIOCINFO        _IOWR('A', 133, struct atminfreq)/* Show kernel info */
429
430 #endif  /* _NETATM_ATM_IOCTL_H */