4537b694272a6d975630bc4f80a902d7fab0f0be
[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  *      @(#) $DragonFly: src/sbin/atm/atm/atm.h,v 1.5 2006/10/16 00:15:35 pavalos Exp $
28  *
29  */
30
31 /*
32  * User configuration and display program
33  * --------------------------------------
34  *
35  * Control blocks
36  *
37  */
38
39 #define MAX_NIFS        256             /* Max network interfaces */
40 #define MIN_VCI         32              /* Smallest non-reserved VCI */
41
42 #ifndef TRUE
43 #define TRUE    1
44 #endif
45 #ifndef FALSE
46 #define FALSE   0
47 #endif
48
49  
50 /*
51  * User commands
52  */
53 struct cmd {
54         const char      *name;          /* Command name */
55         int     minp;                   /* Minimum number of parameters */
56         int     maxp;                   /* Maximum number of parameters */
57         void    (*func)                 /* Processing function */
58                 (int, char **, const struct cmd *);
59         const char      *help;          /* User help string */
60 };
61
62
63 /*
64  * Supported signalling protocols
65  */
66 struct proto {
67         const char      *p_name;        /* Protocol name */
68         u_char  p_id;                   /* Protocol id */ 
69 };
70
71
72 /*
73  * Table of state names
74  */
75 struct state {
76         const char      *s_name;        /* State name */
77         u_char  s_id;                   /* State id */ 
78 };
79
80
81 /*
82  * Supported signalling protocol states
83  */
84 struct proto_state {
85         const char      *p_name;        /* Signalling manager name */
86         const struct state *p_state;    /* Protocol state table */
87         const struct state *v_state;    /* Protocol VCC state table */
88         u_char          p_id;           /* Protocol ID */ 
89 };
90
91
92 /*
93  * Supported VCC owners
94  */
95 struct owner {
96         const char      *o_name;        /* Owner name */
97         u_int   o_sap;                  /* Owner's SAP */
98         void    (*o_pvcadd)             /* PVC ADD processing function */
99                         (int, char **, const struct cmd *, struct atmaddreq *,
100                              struct air_int_rsp *);
101 };
102
103
104 /*
105  * Supported AALs
106  */
107 struct aal {
108         const char      *a_name;        /* AAL name */
109         u_char  a_id;                   /* AAL code */ 
110 };
111
112
113 /*
114  * Supported encapsulations
115  */
116 struct encaps {
117         const char      *e_name;        /* Encapsulation name */
118         u_char  e_id;                   /* Encapsulation code */ 
119 };
120
121
122 /*
123  * External variables
124  */
125 extern char     *prog;                  /* Program invocation */
126 extern char     prefix[];               /* Current command prefix */
127
128 /*
129  * Global function declarations
130  */
131
132         /* atm_eni.c */
133 void            show_eni_stats(char *, int, char **);
134
135         /* atm_fore200.c */
136 void            show_fore200_stats(char *, int, char **);
137
138         /* atm_inet.c */
139 void            ip_pvcadd (int, char **, const struct cmd *, struct atmaddreq *,
140                         struct air_int_rsp *);
141
142         /* atm_print.c */
143 void            print_arp_info(struct air_arp_rsp *);
144 void            print_asrv_info(struct air_asrv_rsp *);
145 void            print_cfg_info(struct air_cfg_rsp *);
146 void            print_intf_info(struct air_int_rsp *);
147 void            print_ip_vcc_info(struct air_ip_vcc_rsp *);
148 void            print_netif_info(struct air_netif_rsp *);
149 void            print_intf_stats(struct air_phy_stat_rsp *);
150 void            print_vcc_stats(struct air_vcc_rsp *);
151 void            print_vcc_info(struct air_vcc_rsp *);
152 void            print_version_info(struct air_version_rsp *);
153
154         /* atm_set.c */
155 void            set_arpserver(int, char **, const struct cmd *);
156 void            set_macaddr(int, char **, const struct cmd *);
157 void            set_netif(int, char **, const struct cmd *);
158 void            set_prefix(int, char **, const struct cmd *);
159
160         /* atm_show.c */
161 void            show_arp(int, char **, const struct cmd *);
162 void            show_arpserv(int, char **, const struct cmd *);
163 void            show_config(int, char **, const struct cmd *);
164 void            show_intf(int, char **, const struct cmd *);
165 void            show_ip_vcc(int, char **, const struct cmd *);
166 void            show_netif(int, char **, const struct cmd *);
167 void            show_intf_stats(int, char **, const struct cmd *);
168 void            show_vcc_stats(int, char **, const struct cmd *);
169 void            show_vcc(int, char **, const struct cmd *);
170 void            show_version(int, char **, const struct cmd *);
171
172         /* atm_subr.c */
173 const char *    get_vendor(int);
174 const char *    get_adapter(int);
175 const char *    get_media_type(int);
176 const char *    get_bus_type(int);
177 const char *    get_adapter_name(char *);
178 const char *    format_mac_addr(Mac_addr *);
179 int             parse_ip_prefix(char *, struct in_addr *);
180 int             compress_prefix_list(struct in_addr *, int);
181 void            check_netif_name(char *);
182 void            sock_error(int);