summaryrefslogtreecommitdiffstats
path: root/sys/netatm/uni/unisig_decode.h
blob: 1e9a986df6009e07578cd12b11a910821ee0274e (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
/*
 *
 * ===================================
 * 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$
 *
 */

/*
 * ATM Forum UNI 3.0/3.1 Signalling Manager
 * ----------------------------------------
 *
 * Message formats
 *
 */

#ifndef _UNI_SIG_DECODE_H
#define _UNI_SIG_DECODE_H


/*
 * Values specifying which IEs are required in messages
 */
#define	IE_NA	0
#define	IE_MAND	1
#define	IE_OPT	2

/*
 * Structure for information element decoding information
 */
struct ie_ent {
	u_char		ident;		/* IE identifier */
	int		min_len;	/* Min. length */
	int		max_len;	/* Max. length */
	int		p_idx;		/* IE pointer index in msg */
	int		(*decode)	/* Decoding function */
				(struct usfmt *, struct ie_generic *);
};

/*
 * Macro to give the offset of a field in a generic IE structure
 */
#define	IE_OFFSET(f) \
	((int)&((struct ie_generic *) 0)->f)

/*
 * Macro to give the size of a field in a generic IE structure
 */
#define IE_FSIZE(f) \
	(sizeof(((struct ie_generic *) 0)->f))

#define IE_OFF_SIZE(f)   IE_OFFSET(f),IE_FSIZE(f)


/*
 * Structure to define a field-driven decoding table (for AAL
 * parameters and ATM user cell rate IEs)
 */
struct ie_decode_tbl {
	u_char	ident;
	int	len;
	int	f_offs;
	int	f_size;
};

#endif /* _UNI_SIG_DECODE_H */
OpenPOWER on IntegriCloud