summaryrefslogtreecommitdiffstats
path: root/sbin/atm/atm/atm.h
blob: 7ecae34a4b3fe92764c07cac2407eed4a8cc1ae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
 *
 * ===================================
 * HARP  |  Host ATM Research Platform
 * ===================================
 *
 *
 * This Host ATM Research Platform ("HARP") file (the "Software") is
 * made available by Network Computing Services, Inc. ("NetworkCS")
 * "AS IS".  NetworkCS does not provide maintenance, improvements or
 * support of any kind.
 *
 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
 * In no event shall NetworkCS be responsible for any damages, including
 * but not limited to consequential damages, arising from or relating to
 * any use of the Software or related support.
 *
 * Copyright 1994-1998 Network Computing Services, Inc.
 *
 * Copies of this Software may be made, however, the above copyright
 * notice must be reproduced on all copies.
 *
 *	@(#) $FreeBSD$
 *
 */

/*
 * User configuration and display program
 * --------------------------------------
 *
 * Control blocks
 *
 */

#define	MAX_NIFS	256		/* Max network interfaces */
#define	MIN_VCI		32		/* Smallest non-reserved VCI */

#ifndef TRUE
#define	TRUE	1
#endif
#ifndef FALSE
#define	FALSE	0
#endif

 
/*
 * User commands
 */
struct cmd {
	const char *name;		/* Command name */
	int	minp;			/* Minimum number of parameters */
	int	maxp;			/* Maximum number of parameters */
	void	(*func)(int, char **,
		    const struct cmd *);/* Processing function */
	const char *help;		/* User help string */
};


/*
 * Supported signalling protocols
 */
struct proto {
	const char *p_name;		/* Protocol name */
	u_char	p_id;			/* Protocol id */ 
};


/*
 * Table of state names
 */
struct state {
	const char *s_name;		/* State name */
	u_char	s_id;			/* State id */ 
};


/*
 * Supported signalling protocol states
 */
struct proto_state {
	const char 	*p_name;	/* Signalling manager name */
	const struct state *p_state;	/* Protocol state table */
	const struct state *v_state;	/* Protocol VCC state table */
	u_char		p_id;		/* Protocol ID */ 
};


/*
 * Supported VCC owners
 */
struct owner {
	const char *o_name;		/* Owner name */
	u_int	o_sap;			/* Owner's SAP */
	void	(*o_pvcadd)(int, char **, const struct cmd *,
		    struct atmaddreq *, struct air_int_rsp *);
					/* PVC ADD processing function */
};


/*
 * Supported AALs
 */
struct aal {
	const char *a_name;		/* AAL name */
	u_char	a_id;			/* AAL code */ 
};


/*
 * Supported encapsulations
 */
struct encaps {
	const char *e_name;		/* Encapsulation name */
	u_char	e_id;			/* Encapsulation code */ 
};

/*
 * Supported traffic type
 */
struct traffics {
	const char *t_name;		/* Traffic name: CBR, VBR, UBR, ... */
	uint8_t	t_type;			/* HARP code T_ATM_XXX */
	int	t_argc;			/* Number of args */
	const char *help;		/* User help string */
};

/*
 * External variables
 */
extern char	*prog;			/* Program invocation */
extern char	prefix[];		/* Current command prefix */

/*
 * Global function declarations
 */

	/* atm_eni.c */
void		show_eni_stats(char *, int, char **);

	/* atm_fore200.c */
void		show_fore200_stats(char *, int, char **);

	/* atm_inet.c */
void		ip_pvcadd(int, char **, const struct cmd *, struct atmaddreq *,
			struct air_int_rsp *);

	/* atm_print.c */
void		print_arp_info(struct air_arp_rsp *);
void		print_asrv_info(struct air_asrv_rsp *);
void		print_cfg_info(struct air_cfg_rsp *);
void		print_intf_info(struct air_int_rsp *);
void		print_ip_vcc_info(struct air_ip_vcc_rsp *);
void		print_netif_info(struct air_netif_rsp *);
void		print_intf_stats(struct air_phy_stat_rsp *);
void		print_vcc_stats(struct air_vcc_rsp *);
void		print_vcc_info(struct air_vcc_rsp *);
void		print_version_info(struct air_version_rsp *);

	/* atm_set.c */
void		set_arpserver(int, char **, const struct cmd *);
void		set_macaddr(int, char **, const struct cmd *);
void		set_netif(int, char **, const struct cmd *);
void		set_prefix(int, char **, const struct cmd *);

	/* atm_show.c */
void		show_arp(int, char **, const struct cmd *);
void		show_arpserv(int, char **, const struct cmd *);
void		show_config(int, char **, const struct cmd *);
void		show_intf(int, char **, const struct cmd *);
void		show_ip_vcc(int, char **, const struct cmd *);
void		show_netif(int, char **, const struct cmd *);
void		show_vcc(int, char **, const struct cmd *);
void		show_version(int, char **, const struct cmd *);
void		show_intf_stats(int, char **, const struct cmd *);
void		show_vcc_stats(int, char **, const struct cmd *);

	/* atm_subr.c */
const char *	get_vendor(int);
const char *	get_adapter(int);
const char *	get_media_type(int);
const char *	get_bus_type(int);
const char *	get_bus_slot_info(int, u_long);
const char *	get_adapter_name(const char *);
int		get_hex_addr(char *, u_char *, int);
const char *	format_mac_addr(const Mac_addr *);
int		parse_ip_prefix(const char *, struct in_addr *);
size_t		compress_prefix_list(struct in_addr *, size_t);
void		check_netif_name(const char *);
void		sock_error(int);

extern const struct proto	protos[];
extern const struct aal		aals[];
extern const struct encaps	encaps[];
OpenPOWER on IntegriCloud