Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sbin / atm / atm / atm.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/sbin/atm/atm/atm.h,v 1.4 1999/08/28 00:12:17 peter Exp $
27  *
28  */
29
30 /*
31  * User configuration and display program
32  * --------------------------------------
33  *
34  * Control blocks
35  *
36  */
37
38 #define MAX_NIFS        256             /* Max network interfaces */
39 #define MIN_VCI         32              /* Smallest non-reserved VCI */
40
41 #ifndef TRUE
42 #define TRUE    1
43 #endif
44 #ifndef FALSE
45 #define FALSE   0
46 #endif
47
48  
49 /*
50  * User commands
51  */
52 struct cmd {
53         char    *name;                  /* Command name */
54         int     minp;                   /* Minimum number of parameters */
55         int     maxp;                   /* Maximum number of parameters */
56         void    (*func)                 /* Processing function */
57                         __P((int, char **, struct cmd *));
58         char    *help;                  /* User help string */
59 };
60
61
62 /*
63  * Supported signalling protocols
64  */
65 struct proto {
66         char    *p_name;                /* Protocol name */
67         u_char  p_id;                   /* Protocol id */ 
68 };
69
70
71 /*
72  * Table of state names
73  */
74 struct state {
75         char    *s_name;                /* State name */
76         u_char  s_id;                   /* State id */ 
77 };
78
79
80 /*
81  * Supported signalling protocol states
82  */
83 struct proto_state {
84         char            *p_name;        /* Signalling manager name */
85         struct state    *p_state;       /* Protocol state table */
86         struct state    *v_state;       /* Protocol VCC state table */
87         u_char          p_id;           /* Protocol ID */ 
88 };
89
90
91 /*
92  * Supported VCC owners
93  */
94 struct owner {
95         char    *o_name;                /* Owner name */
96         u_int   o_sap;                  /* Owner's SAP */
97         void    (*o_pvcadd)             /* PVC ADD processing function */
98                         __P((int, char **, struct cmd *, struct atmaddreq *,
99                              struct air_int_rsp *));
100 };
101
102
103 /*
104  * Supported AALs
105  */
106 struct aal {
107         char    *a_name;                /* AAL name */
108         u_char  a_id;                   /* AAL code */ 
109 };
110
111
112 /*
113  * Supported encapsulations
114  */
115 struct encaps {
116         char    *e_name;                /* Encapsulation name */
117         u_char  e_id;                   /* Encapsulation code */ 
118 };
119
120
121 /*
122  * External variables
123  */
124 extern char     *prog;                  /* Program invocation */
125 extern char     prefix[];               /* Current command prefix */
126
127 /*
128  * Global function declarations
129  */
130         /* atm.c */
131 int             do_cmd __P((struct cmd *, int, char **));
132 void            usage __P((struct cmd *, char *));
133 void            attach __P((int, char **, struct cmd *));
134 void            detach __P((int, char **, struct cmd *));
135 void            pvc_add __P((int, char **, struct cmd *));
136 void            arp_add __P((int, char **, struct cmd *));
137 void            pvc_dlt __P((int, char **, struct cmd *));
138 void            svc_dlt __P((int, char **, struct cmd *));
139 void            vcc_dlt __P((int, char **, struct cmd *, struct atmdelreq *));
140 void            arp_dlt __P((int, char **, struct cmd *));
141 void            help __P((int, char **, struct cmd *));
142
143         /* atm_eni.c */
144 void            show_eni_stats __P((char *, int, char **));
145 void            print_eni_oc3 __P((struct air_vinfo_rsp *));
146 void            print_eni_atm __P((struct air_vinfo_rsp *));
147 void            print_eni_aal0 __P((struct air_vinfo_rsp *));
148 void            print_eni_aal5 __P((struct air_vinfo_rsp *));
149 void            print_eni_driver __P((struct air_vinfo_rsp *));
150
151         /* atm_fore200.c */
152 void            show_fore200_stats __P((char *, int, char **));
153 void            print_fore200_taxi __P((struct air_vinfo_rsp *));
154 void            print_fore200_oc3 __P((struct air_vinfo_rsp *));
155 void            print_fore200_dev __P((struct air_vinfo_rsp *));
156 void            print_fore200_atm __P((struct air_vinfo_rsp *));
157 void            print_fore200_aal0 __P((struct air_vinfo_rsp *));
158 void            print_fore200_aal4 __P((struct air_vinfo_rsp *));
159 void            print_fore200_aal5 __P((struct air_vinfo_rsp *));
160 void            print_fore200_driver __P((struct air_vinfo_rsp *));
161
162         /* atm_inet.c */
163 void            ip_pvcadd __P((int, char **, struct cmd *, struct atmaddreq *,
164                         struct air_int_rsp *));
165
166         /* atm_print.c */
167 void            print_arp_info __P((struct air_arp_rsp *));
168 void            print_asrv_info __P((struct air_asrv_rsp *));
169 void            print_cfg_info __P((struct air_cfg_rsp *));
170 void            print_intf_info __P((struct air_int_rsp *));
171 void            print_ip_vcc_info __P((struct air_ip_vcc_rsp *));
172 void            print_netif_info __P((struct air_netif_rsp *));
173 void            print_intf_stats __P((struct air_phy_stat_rsp *));
174 void            print_vcc_stats __P((struct air_vcc_rsp *));
175 void            print_vcc_info __P((struct air_vcc_rsp *));
176 void            print_version_info __P((struct air_version_rsp *));
177
178         /* atm_set.c */
179 void            set_arpserver __P((int, char **, struct cmd *));
180 void            set_macaddr __P((int, char **, struct cmd *));
181 void            set_netif __P((int, char **, struct cmd *));
182 void            set_prefix __P((int, char **, struct cmd *));
183
184         /* atm_show.c */
185 void            show_arp __P((int, char **, struct cmd *));
186 void            show_arpserv __P((int, char **, struct cmd *));
187 void            show_config __P((int, char **, struct cmd *));
188 void            show_intf __P((int, char **, struct cmd *));
189 void            show_ip_vcc __P((int, char **, struct cmd *));
190 void            show_netif __P((int, char **, struct cmd *));
191 void            show_intf_stats __P((int, char **, struct cmd *));
192 void            show_vcc_stats __P((int, char **, struct cmd *));
193 void            show_vcc __P((int, char **, struct cmd *));
194 void            show_version __P((int, char **, struct cmd *));
195
196         /* atm_subr.c */
197 char *          get_vendor __P((int));
198 char *          get_adapter __P((int));
199 char *          get_media_type __P((int));
200 char *          get_bus_type __P((int));
201 char *          get_bus_slot_info __P((int, u_long));
202 char *          get_adapter_name __P((char *));
203 int             do_info_ioctl __P((struct atminfreq *, int));
204 int             get_vcc_info __P((char *, struct air_vcc_rsp **));
205 int             verify_nif_name __P((char *));
206 struct sockaddr_in *
207                 get_ip_addr __P((char *));
208 int             get_hex_addr __P((char *, u_char *, int));
209 char *          format_mac_addr __P((Mac_addr *));
210 int             parse_ip_prefix __P((char *, struct in_addr *));
211 int             compress_prefix_list __P((struct in_addr *, int));
212 void            check_netif_name __P((char *));
213 void            sock_error __P((int));