summaryrefslogtreecommitdiffstats
path: root/usr.sbin/atm/scspd/scsp_if.h
blob: 844ee2c8213562189635fe32d3a7d10e5e71d9b0 (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
/*
 *
 * ===================================
 * 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$
 *
 */

/*
 * Server Cache Synchronization Protocol (SCSP) Support
 * ----------------------------------------------------
 *
 * Interface to server clients of SCSP
 *
 */

#ifndef _SCSP_SCSP_IF_H
#define _SCSP_SCSP_IF_H


/*
 * SCSP configuration message
 */
struct scsp_cfg_msg {
	char	atmarp_netif[IFNAMSIZ];
};
typedef	struct scsp_cfg_msg	Scsp_cfg_msg;


/*
 * SCSP cache summary
 */
struct scsp_sum_msg {
	u_short		ss_hops;	/* Hop count */
	u_char		ss_null;	/* Null flag */
	long		ss_seq;		/* CSA seq. no. */
	Scsp_ckey	ss_key;		/* Cache key */
	Scsp_id		ss_oid;		/* Originator ID */
};
typedef	struct scsp_sum_msg	Scsp_sum_msg;


/*
 * SCSP constants for ATMARP
 */
#define	SCSP_ATMARP_PROTO	1
#define	SCSP_ATMARP_SIDL	4
#define	SCSP_ATMARP_RIDL	4
#define	SCSP_ATMARP_CKL		4
#define	SCSP_ATMARP_OIDL	4


/*
 * SCSP ATMARP message
 */
struct scsp_atmarp_msg {
	u_char		sa_state;	/* Cache entry state (below) */
	struct in_addr	sa_cpa;		/* Cached protocol address */
	Atm_addr	sa_cha;		/* Cached ATM address */
	Atm_addr	sa_csa;		/* Cached ATM subaddress */
	Scsp_ckey	sa_key;		/* Cache key for entry */
	Scsp_id		sa_oid;		/* Originator ID */
	long		sa_seq;		/* Sequence no. */
};
typedef	struct scsp_atmarp_msg	Scsp_atmarp_msg;

#define	SCSP_ASTATE_NEW	0	/* ATMARP new server registration */
#define	SCSP_ASTATE_UPD	1	/* ATMARP server refreshed */
#define	SCSP_ASTATE_DEL	2	/* ATMARP server data deleted */


/*
 * SCSP constants for NHRP
 */
#define	SCSP_NHRP_PROTO		2
#define	SCSP_NHRP_SIDL		4
#define	SCSP_NHRP_RIDL		4
#define	SCSP_NHRP_CKL		4
#define	SCSP_NHRP_OIDL		4


/*
 * SCSP NHRP message
 */
struct scsp_nhrp_msg {
	u_short	sn_af;		/* Address family */
	u_short	sn_proto;	/* NHRP protocol type */
	u_char	sn_snap[5];	/* SNAP */
	u_char	sn_ver;		/* NHRP version number */
	u_short	sn_flags;	/* Flags */
	u_long	sn_rid;		/* Request ID */
	u_char	sn_state;	/* State */
	u_char	sn_prel;	/* Prefix length */
	u_short	sn_mtu;		/* Maximum transmission unit */
	u_short sn_hold;	/* Holding time */
	Atm_addr	sn_addr;	/* Server network address */
	Atm_addr	sn_saddr;	/* Server network subaddress */
	struct in_addr	sn_paddr;	/* Server protocol address */
	Scsp_ckey sn_key;	/* Cache key for entry */
	Scsp_id	sn_oid;		/* Originator ID */
};
typedef	struct scsp_nhrp_msg	Scsp_nhrp_msg;

#define	SCSP_NSTATE_NEW	0	/* New NHRP server */
#define	SCSP_NSTATE_UPD	1	/* NHRP server re-registered */
#define	SCSP_NSTATE_DEL	2	/* NHRP server data purged */
#define	SCSP_NSTATE_NSD	3	/* NHRP no such data in server */


/*
 * SCSP/server message header
 */
struct scsp_if_msg_hdr {
	u_char	sh_type;	/* Message type */
	u_char	sh_rc;		/* Response code */
	u_short	sh_proto;	/* SCSP protocol ID */
	int	sh_len;		/* Length of message */
	u_long	sh_tok;		/* Token from SCSP daemon */
};
typedef	struct scsp_if_msg_hdr	Scsp_if_msg_hdr;


/*
 * SCSP-server message
 */
struct scsp_if_msg {
	Scsp_if_msg_hdr	si_hdr;	/* Header fields */
	union {
		Scsp_cfg_msg	siu_cfg;	/* Config data */
		Scsp_sum_msg	siu_sum;	/* Cache summary */
		Scsp_atmarp_msg	siu_atmarp;	/* ATMARP update */
		Scsp_nhrp_msg	siu_nhrp;	/* NHRP update */
	} si_u;
};
typedef	struct scsp_if_msg	Scsp_if_msg;

#define	si_type		si_hdr.sh_type
#define	si_rc		si_hdr.sh_rc
#define	si_proto	si_hdr.sh_proto
#define	si_len		si_hdr.sh_len
#define	si_tok		si_hdr.sh_tok

#define	si_cfg		si_u.siu_cfg
#define	si_sum		si_u.siu_sum
#define	si_atmarp	si_u.siu_atmarp
#define	si_nhrp		si_u.siu_nhrp


/*
 * Message types
 */
#define	SCSP_NOP_REQ		1
#define	SCSP_CFG_REQ		2
#define	SCSP_CFG_RSP		3
#define	SCSP_CACHE_IND		4
#define	SCSP_CACHE_RSP		5
#define	SCSP_SOLICIT_IND	6
#define	SCSP_SOLICIT_RSP	7
#define	SCSP_UPDATE_IND		8
#define	SCSP_UPDATE_REQ		9
#define	SCSP_UPDATE_RSP		10


/*
 * Response codes
 */
#define	SCSP_RSP_OK		0
#define	SCSP_RSP_ERR		1
#define	SCSP_RSP_REJ		2
#define	SCSP_RSP_NOT_FOUND	3


#endif	/* _SCSP_SCSP_IF_H */
OpenPOWER on IntegriCloud