]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/atm/atm/atm.h
This commit was generated by cvs2svn to compensate for changes in r151600,
[FreeBSD/FreeBSD.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$
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         const char *name;               /* Command name */
54         int     minp;                   /* Minimum number of parameters */
55         int     maxp;                   /* Maximum number of parameters */
56         void    (*func)(int, char **,
57                     const struct cmd *);/* Processing function */
58         const char *help;               /* User help string */
59 };
60
61
62 /*
63  * Supported signalling protocols
64  */
65 struct proto {
66         const 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         const 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         const char      *p_name;        /* Signalling manager name */
85         const struct state *p_state;    /* Protocol state table */
86         const 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         const char *o_name;             /* Owner name */
96         u_int   o_sap;                  /* Owner's SAP */
97         void    (*o_pvcadd)(int, char **, const struct cmd *,
98                     struct atmaddreq *, struct air_int_rsp *);
99                                         /* PVC ADD processing function */
100 };
101
102
103 /*
104  * Supported AALs
105  */
106 struct aal {
107         const char *a_name;             /* AAL name */
108         u_char  a_id;                   /* AAL code */ 
109 };
110
111
112 /*
113  * Supported encapsulations
114  */
115 struct encaps {
116         const char *e_name;             /* Encapsulation name */
117         u_char  e_id;                   /* Encapsulation code */ 
118 };
119
120 /*
121  * Supported traffic type
122  */
123 struct traffics {
124         const char *t_name;             /* Traffic name: CBR, VBR, UBR, ... */
125         uint8_t t_type;                 /* HARP code T_ATM_XXX */
126         int     t_argc;                 /* Number of args */
127         const char *help;               /* User help string */
128 };
129
130 /*
131  * External variables
132  */
133 extern char     *prog;                  /* Program invocation */
134 extern char     prefix[];               /* Current command prefix */
135
136 /*
137  * Global function declarations
138  */
139
140         /* atm_eni.c */
141 void            show_eni_stats(char *, int, char **);
142
143         /* atm_fore200.c */
144 void            show_fore200_stats(char *, int, char **);
145
146         /* atm_inet.c */
147 void            ip_pvcadd(int, char **, const struct cmd *, struct atmaddreq *,
148                         struct air_int_rsp *);
149
150         /* atm_print.c */
151 void            print_arp_info(struct air_arp_rsp *);
152 void            print_asrv_info(struct air_asrv_rsp *);
153 void            print_cfg_info(struct air_cfg_rsp *);
154 void            print_intf_info(struct air_int_rsp *);
155 void            print_ip_vcc_info(struct air_ip_vcc_rsp *);
156 void            print_netif_info(struct air_netif_rsp *);
157 void            print_intf_stats(struct air_phy_stat_rsp *);
158 void            print_vcc_stats(struct air_vcc_rsp *);
159 void            print_vcc_info(struct air_vcc_rsp *);
160 void            print_version_info(struct air_version_rsp *);
161
162         /* atm_set.c */
163 void            set_arpserver(int, char **, const struct cmd *);
164 void            set_macaddr(int, char **, const struct cmd *);
165 void            set_netif(int, char **, const struct cmd *);
166 void            set_prefix(int, char **, const struct cmd *);
167
168         /* atm_show.c */
169 void            show_arp(int, char **, const struct cmd *);
170 void            show_arpserv(int, char **, const struct cmd *);
171 void            show_config(int, char **, const struct cmd *);
172 void            show_intf(int, char **, const struct cmd *);
173 void            show_ip_vcc(int, char **, const struct cmd *);
174 void            show_netif(int, char **, const struct cmd *);
175 void            show_vcc(int, char **, const struct cmd *);
176 void            show_version(int, char **, const struct cmd *);
177 void            show_intf_stats(int, char **, const struct cmd *);
178 void            show_vcc_stats(int, char **, const struct cmd *);
179
180         /* atm_subr.c */
181 const char *    get_vendor(int);
182 const char *    get_adapter(int);
183 const char *    get_media_type(int);
184 const char *    get_bus_type(int);
185 const char *    get_bus_slot_info(int, u_long);
186 const char *    get_adapter_name(const char *);
187 int             get_hex_addr(char *, u_char *, int);
188 const char *    format_mac_addr(const Mac_addr *);
189 int             parse_ip_prefix(const char *, struct in_addr *);
190 size_t          compress_prefix_list(struct in_addr *, size_t);
191 void            check_netif_name(const char *);
192 void            sock_error(int);
193
194 extern const struct aal         aals[];
195 extern const struct encaps      encaps[];