1121934Sharti/*
2121934Sharti * Copyright (c) 1996-2003
3121934Sharti *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4121934Sharti * 	All rights reserved.
5121934Sharti *
6131826Sharti * Author: Hartmut Brandt <harti@freebsd.org>
7131826Sharti *
8121934Sharti * Redistribution and use in source and binary forms, with or without
9121934Sharti * modification, are permitted provided that the following conditions
10121934Sharti * are met:
11121934Sharti * 1. Redistributions of source code must retain the above copyright
12121934Sharti *    notice, this list of conditions and the following disclaimer.
13121934Sharti * 2. Redistributions in binary form must reproduce the above copyright
14121934Sharti *    notice, this list of conditions and the following disclaimer in the
15121934Sharti *    documentation and/or other materials provided with the distribution.
16121934Sharti *
17121934Sharti * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18121934Sharti * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19121934Sharti * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20121934Sharti * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21121934Sharti * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22121934Sharti * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23121934Sharti * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24121934Sharti * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25121934Sharti * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26121934Sharti * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27121934Sharti * SUCH DAMAGE.
28121934Sharti *
29133492Sharti * $Begemot: libunimsg/netnatm/msg/unistruct.h,v 1.7 2004/07/16 18:42:22 brandt Exp $
30121934Sharti *
31121934Sharti * This file defines all structures that are used by
32121934Sharti * API users.
33121934Sharti */
34121934Sharti#ifndef _NETNATM_MSG_UNISTRUCT_H_
35121934Sharti#define _NETNATM_MSG_UNISTRUCT_H_
36121934Sharti
37121934Sharti#include <netnatm/msg/uni_config.h>
38121934Sharti
39121934Sharti/*
40121934Sharti * define IE and MSG header
41121934Sharti */
42121934Sharti#include <netnatm/msg/uni_hdr.h>
43121934Sharti
44121934Sharti/*
45121934Sharti * define all IE's
46121934Sharti */
47121934Sharti/*************************************************************************
48121934Sharti *
49121934Sharti * Free FORM IE
50121934Sharti */
51121934Shartistruct uni_ie_unrec {
52121934Sharti	struct uni_iehdr h;
53121934Sharti	uint8_t id;		/* ID of this IE */
54121934Sharti	u_int len;		/* data length */
55121934Sharti	u_char data[128];	/* arbitrary maximum length */
56121934Sharti};
57121934Sharti
58121934Sharti/*************************************************************************
59121934Sharti *
60121934Sharti * ATM adaptation layer parameters information element
61121934Sharti */
62121934Shartienum {
63121934Sharti	UNI_AAL_SUB_ID		= 0x85,
64121934Sharti	UNI_AAL_CBR_ID		= 0x86,
65121934Sharti	UNI_AAL_MULT_ID		= 0x87,
66121934Sharti	UNI_AAL_SCREC_ID	= 0x88,
67121934Sharti	UNI_AAL_ECM_ID		= 0x89,
68121934Sharti	UNI_AAL_BSIZE_ID	= 0x8a,
69121934Sharti	UNI_AAL_PART_ID		= 0x8b,
70121934Sharti	UNI_AAL_FWDCPCS_ID	= 0x8c,
71121934Sharti	UNI_AAL_BWDCPCS_ID	= 0x81,
72121934Sharti	UNI_AAL_MID_ID		= 0x82,
73121934Sharti	UNI_AAL_SSCS_ID		= 0x84,
74121934Sharti};
75121934Sharti
76121934Shartienum uni_aal {
77121934Sharti	UNI_AAL_0	= 0x00,	/* voice */
78121934Sharti	UNI_AAL_1	= 0x01,
79121934Sharti	UNI_AAL_2	= 0x02,
80121934Sharti	UNI_AAL_4	= 0x03,	/* same as AAL 3 */
81121934Sharti	UNI_AAL_5	= 0x05,
82121934Sharti	UNI_AAL_USER	= 0x10,
83121934Sharti};
84121934Shartienum uni_aal1_subtype {
85121934Sharti	UNI_AAL1_SUB_NULL	= 0x00,
86121934Sharti	UNI_AAL1_SUB_VOICE	= 0x01,
87121934Sharti	UNI_AAL1_SUB_CIRCUIT	= 0x02,
88121934Sharti	UNI_AAL1_SUB_HQAUDIO	= 0x04,
89121934Sharti	UNI_AAL1_SUB_VIDEO	= 0x05,
90121934Sharti};
91121934Shartienum uni_aal1_cbr {
92121934Sharti	UNI_AAL1_CBR_64		= 0x01,
93121934Sharti	UNI_AAL1_CBR_1544	= 0x04,
94121934Sharti	UNI_AAL1_CBR_6312	= 0x05,
95121934Sharti	UNI_AAL1_CBR_32064	= 0x06,
96121934Sharti	UNI_AAL1_CBR_44736	= 0x07,
97121934Sharti	UNI_AAL1_CBR_97728	= 0x08,
98121934Sharti	UNI_AAL1_CBR_2048	= 0x10,
99121934Sharti	UNI_AAL1_CBR_8448	= 0x11,
100121934Sharti	UNI_AAL1_CBR_34368	= 0x12,
101121934Sharti	UNI_AAL1_CBR_139264	= 0x13,
102121934Sharti	UNI_AAL1_CBR_N64	= 0x40,
103121934Sharti	UNI_AAL1_CBR_N8		= 0x41,
104121934Sharti};
105121934Shartienum uni_aal1_screc {
106121934Sharti	UNI_AAL1_SCREC_NULL	= 0x00,	/* synchr. circuit transport */
107121934Sharti	UNI_AAL1_SCREC_SRTS	= 0x01,	/* synchr. residual timestamp */
108121934Sharti	UNI_AAL1_SCREC_ACLK	= 0x02,	/* adaptive clock */
109121934Sharti};
110121934Shartienum uni_aal1_ecm {
111121934Sharti	UNI_AAL1_ECM_NULL	= 0x00,	/* no error correction */
112121934Sharti	UNI_AAL1_ECM_LOSS	= 0x01,	/* for loss sensitive signals */
113121934Sharti	UNI_AAL1_ECM_DELAY	= 0x02,	/* for delay sensitive signals */
114121934Sharti};
115121934Shartienum uni_aal_sscs {
116121934Sharti	UNI_AAL_SSCS_NULL	= 0x00,	/* Null */
117121934Sharti	UNI_AAL_SSCS_SSCOPA	= 0x01,	/* assured SSCOP */
118121934Sharti	UNI_AAL_SSCS_SSCOPU	= 0x02,	/* unassured SSCOP */
119121934Sharti	UNI_AAL_SSCS_FRAME	= 0x04,	/* frame relay */
120121934Sharti};
121121934Sharti
122121934Shartistruct uni_ie_aal {
123121934Sharti	struct uni_iehdr h;
124121934Sharti	enum uni_aal	type;		/* aal type */
125121934Sharti
126121934Sharti	union {
127121934Sharti#define UNI_AAL1_MULT_P	0x01
128121934Sharti#define UNI_AAL1_SCREC_P	0x02
129121934Sharti#define UNI_AAL1_ECM_P		0x04
130121934Sharti#define UNI_AAL1_BSIZE_P	0x08
131121934Sharti#define UNI_AAL1_PART_P	0x10
132121934Sharti	    struct {
133121934Sharti		enum uni_aal1_subtype subtype;	/* AAL1 subtype */
134121934Sharti		enum uni_aal1_cbr cbr_rate;	/* AAL1 CBR rate */
135121934Sharti		u_int		mult;		/* AAL1 CBR mutliplier */
136121934Sharti		enum uni_aal1_screc screc;	/* AAL1 source clock recovery */
137121934Sharti		enum uni_aal1_ecm ecm;		/* AAL1 error correction */
138121934Sharti		u_int	bsize;			/* AAL1 SDT blocksize */
139121934Sharti		u_int	part;			/* AAL1 partial cell fill */
140121934Sharti	    } aal1;
141121934Sharti
142121934Sharti#define UNI_AAL4_CPCS_P	0x01
143121934Sharti#define UNI_AAL4_MID_P		0x02
144121934Sharti#define UNI_AAL4_SSCS_P	0x04
145121934Sharti	    struct {
146121934Sharti		u_int	fwd_cpcs;	/* max fwd cpcs blocksize */
147121934Sharti		u_int	bwd_cpcs;	/* max bkw cpcs blocksize */
148121934Sharti		u_int	mid_low;	/* MID low range */
149121934Sharti		u_int	mid_high;	/* MID high range */
150121934Sharti		enum uni_aal_sscs sscs;	/* sscs type */
151121934Sharti	     } aal4;
152121934Sharti
153121934Sharti#define UNI_AAL5_CPCS_P	0x01
154121934Sharti#define UNI_AAL5_SSCS_P	0x02
155121934Sharti	    struct {
156121934Sharti		u_int	fwd_cpcs;	/* max fwd cpcs blocksize */
157121934Sharti		u_int	bwd_cpcs;	/* max bkw cpcs blocksize */
158121934Sharti		enum uni_aal_sscs sscs;	/* sscs type */
159121934Sharti	     } aal5;
160121934Sharti
161121934Sharti	    struct {
162121934Sharti		u_int	len;		/* number of bytes */
163121934Sharti		u_char	user[4];	/* user data */
164121934Sharti	    } aalu;
165121934Sharti	} u;
166121934Sharti};
167121934Sharti
168121934Sharti/*************************************************************************
169121934Sharti *
170121934Sharti * Called party number information element
171121934Sharti * Called party subaddress information element
172121934Sharti * Calling party number information element
173121934Sharti * Calling party subaddress information element
174121934Sharti * Q.2951/UNI4.0 Connected number information element
175121934Sharti * Q.2951/UNI4.0 Connected subaddress information element
176121934Sharti */
177121934Shartienum uni_addr_type {
178121934Sharti	UNI_ADDR_UNKNOWN	= 0x0,
179121934Sharti	UNI_ADDR_INTERNATIONAL	= 0x1,
180121934Sharti	UNI_ADDR_NATIONAL	= 0x2,	/* not sup */
181121934Sharti	UNI_ADDR_NETWORK	= 0x3,	/* not sup */
182121934Sharti	UNI_ADDR_SUBSCR		= 0x4,	/* not sup */
183121934Sharti	UNI_ADDR_ABBR		= 0x6,	/* not sup */
184121934Sharti};
185121934Shartienum uni_addr_plan {
186121934Sharti	/* UNI_ADDR_UNKNOWN	= 0x0, */	/* not sup */
187121934Sharti	UNI_ADDR_E164		= 0x1,
188121934Sharti	UNI_ADDR_ATME		= 0x2,
189121934Sharti	UNI_ADDR_DATA		= 0x3,	/* not sup */
190121934Sharti	UNI_ADDR_PRIVATE	= 0x9,	/* not sup */
191121934Sharti};
192121934Shartienum uni_subaddr_type {
193121934Sharti	UNI_SUBADDR_NSAP	= 0x0,
194121934Sharti	UNI_SUBADDR_ATME	= 0x1,
195121934Sharti	UNI_SUBADDR_USER	= 0x2,	/* not sup */
196121934Sharti};
197121934Shartienum uni_addr_pres {
198121934Sharti	UNI_ADDR_PRES		= 0x0,
199121934Sharti	UNI_ADDR_RESTRICT	= 0x1,
200121934Sharti	UNI_ADDR_NONUMBER	= 0x2,
201121934Sharti};
202121934Shartienum uni_addr_screen {
203121934Sharti	UNI_ADDR_SCREEN_NOT	= 0x0,
204121934Sharti	UNI_ADDR_SCREEN_PASSED	= 0x1,
205121934Sharti	UNI_ADDR_SCREEN_FAILED	= 0x2,
206121934Sharti	UNI_ADDR_SCREEN_NET	= 0x3,
207121934Sharti};
208121934Sharti
209133492Sharti/* don't use bitfields to get a defined structure layout */
210121934Shartistruct uni_addr {
211133492Sharti	uint8_t			type;
212133492Sharti	uint8_t			plan;
213133492Sharti	uint8_t			len;
214121934Sharti	u_char			addr[UNI_ADDR_MAXLEN];
215121934Sharti};
216121934Shartistruct uni_subaddr {
217121934Sharti	enum uni_subaddr_type	type;
218121934Sharti	u_int			len;
219121934Sharti	u_char			addr[UNI_SUBADDR_MAXLEN];
220121934Sharti};
221121934Sharti
222121934Shartistruct uni_ie_called {
223121934Sharti	struct uni_iehdr	h;
224121934Sharti	struct uni_addr	addr;
225121934Sharti};
226121934Sharti
227121934Shartistruct uni_ie_calledsub {
228121934Sharti	struct uni_iehdr	h;
229121934Sharti	struct uni_subaddr	addr;
230121934Sharti};
231121934Sharti
232121934Shartistruct uni_ie_calling {
233121934Sharti	struct uni_iehdr	h;
234121934Sharti#define UNI_CALLING_SCREEN_P 0x0001
235121934Sharti
236121934Sharti	struct uni_addr		addr;
237121934Sharti	enum uni_addr_pres	pres;
238121934Sharti	enum uni_addr_screen	screen;
239121934Sharti};
240121934Sharti
241121934Shartistruct uni_ie_callingsub {
242121934Sharti	struct uni_iehdr	h;
243121934Sharti	struct uni_subaddr	addr;
244121934Sharti};
245121934Sharti
246121934Shartistruct uni_ie_conned {
247121934Sharti	struct uni_iehdr	h;
248121934Sharti#define UNI_CONNED_SCREEN_P 0x0001
249121934Sharti
250121934Sharti	struct uni_addr		addr;
251121934Sharti	enum uni_addr_pres	pres;
252121934Sharti	enum uni_addr_screen	screen;
253121934Sharti};
254121934Sharti
255121934Shartistruct uni_ie_connedsub {
256121934Sharti	struct uni_iehdr	h;
257121934Sharti	struct uni_subaddr	addr;
258121934Sharti};
259121934Sharti
260121934Sharti/*************************************************************************
261121934Sharti *
262121934Sharti * Broadband bearer capability descriptor
263121934Sharti * On reception of an old bearer descriptor, it is automatically
264121934Sharti * converted to a new, legal one.
265121934Sharti */
266121934Shartienum uni_bearer_class {
267121934Sharti	UNI_BEARER_A		= 0x01,
268121934Sharti	UNI_BEARER_C		= 0x03,
269121934Sharti	UNI_BEARER_X		= 0x10,
270121934Sharti	UNI_BEARER_TVP		= 0x30,
271121934Sharti};
272121934Sharti
273121934Shartienum uni_bearer_atc {
274121934Sharti	UNI_BEARER_ATC_CBR	= 0x05,
275121934Sharti	UNI_BEARER_ATC_CBR1	= 0x07,
276121934Sharti	UNI_BEARER_ATC_VBR	= 0x09,
277121934Sharti	UNI_BEARER_ATC_VBR1	= 0x13,
278121934Sharti	UNI_BEARER_ATC_NVBR	= 0x0a,
279121934Sharti	UNI_BEARER_ATC_NVBR1	= 0x0b,
280121934Sharti	UNI_BEARER_ATC_ABR	= 0x0c,
281121934Sharti
282121934Sharti	UNI_BEARER_ATCX_0	= 0x00,
283121934Sharti	UNI_BEARER_ATCX_1	= 0x01,
284121934Sharti	UNI_BEARER_ATCX_2	= 0x02,
285121934Sharti	UNI_BEARER_ATCX_4	= 0x04,
286121934Sharti	UNI_BEARER_ATCX_6	= 0x06,
287121934Sharti	UNI_BEARER_ATCX_8	= 0x08,
288121934Sharti};
289121934Sharti
290121934Shartienum uni_bearer_clip {
291121934Sharti	UNI_BEARER_NOCLIP	= 0x0,
292121934Sharti	UNI_BEARER_CLIP		= 0x1,
293121934Sharti};
294121934Sharti
295121934Shartienum uni_bearer_cfg {
296121934Sharti	UNI_BEARER_P2P		= 0x0,
297121934Sharti	UNI_BEARER_MP		= 0x1,
298121934Sharti};
299121934Sharti
300121934Shartistruct uni_ie_bearer {
301121934Sharti	struct uni_iehdr	h;
302121934Sharti#define UNI_BEARER_ATC_P	0x02
303121934Sharti
304121934Sharti	enum uni_bearer_class	bclass;		/* bearer class */
305121934Sharti	enum uni_bearer_atc	atc;		/* ATM transfer capability */
306121934Sharti	enum uni_bearer_clip	clip;		/* suspectibility to clipping */
307121934Sharti	enum uni_bearer_cfg	cfg;		/* u-plane configuration */
308121934Sharti};
309121934Sharti
310121934Sharti/*************************************************************************
311121934Sharti *
312121934Sharti * Broadband higher layer information element
313121934Sharti */
314121934Shartienum uni_bhli {
315121934Sharti	UNI_BHLI_ISO	= 0x00,	/* IDO defined */
316121934Sharti	UNI_BHLI_USER	= 0x01,	/* user specific */
317121934Sharti	UNI_BHLI_VENDOR	= 0x03,	/* vendor specific */
318121934Sharti};
319121934Sharti
320121934Shartistruct uni_ie_bhli {
321121934Sharti	struct uni_iehdr	h;
322121934Sharti	enum uni_bhli		type;
323121934Sharti	u_char			info[8];
324121934Sharti	u_int			len;
325121934Sharti};
326121934Sharti
327121934Sharti/*************************************************************************
328121934Sharti *
329121934Sharti * Boradband lower layer information element
330121934Sharti */
331121934Shartienum {
332121934Sharti	UNI_BLLI_L1_ID		= 0x1,
333121934Sharti	UNI_BLLI_L2_ID		= 0x2,
334121934Sharti	UNI_BLLI_L3_ID		= 0x3,
335121934Sharti};
336121934Sharti
337121934Shartienum uni_blli_l2 {
338121934Sharti	UNI_BLLI_L2_BASIC	= 0x01,
339121934Sharti	UNI_BLLI_L2_Q921	= 0x02,
340121934Sharti	UNI_BLLI_L2_X25LL	= 0x06,
341121934Sharti	UNI_BLLI_L2_X25ML	= 0x07,
342121934Sharti	UNI_BLLI_L2_LABP	= 0x08,
343121934Sharti	UNI_BLLI_L2_HDLC_ARM	= 0x09,
344121934Sharti	UNI_BLLI_L2_HDLC_NRM	= 0x0a,
345121934Sharti	UNI_BLLI_L2_HDLC_ABM	= 0x0b,
346121934Sharti	UNI_BLLI_L2_LAN		= 0x0c,
347121934Sharti	UNI_BLLI_L2_X75		= 0x0d,
348121934Sharti	UNI_BLLI_L2_Q922	= 0x0e,
349121934Sharti	UNI_BLLI_L2_USER	= 0x10,
350121934Sharti	UNI_BLLI_L2_ISO7776	= 0x11,
351121934Sharti};
352121934Sharti
353121934Shartienum uni_blli_l2_mode {
354121934Sharti	UNI_BLLI_L2NORM		= 0x1,
355121934Sharti	UNI_BLLI_L2EXT		= 0x2,
356121934Sharti};
357121934Sharti
358121934Shartienum uni_blli_l3 {
359121934Sharti	UNI_BLLI_L3_X25		= 0x06,
360121934Sharti	UNI_BLLI_L3_ISO8208	= 0x07,
361121934Sharti	UNI_BLLI_L3_X223	= 0x08,
362121934Sharti	UNI_BLLI_L3_CLMP	= 0x09,
363121934Sharti	UNI_BLLI_L3_T70		= 0x0a,
364121934Sharti	UNI_BLLI_L3_TR9577	= 0x0b,
365121934Sharti	UNI_BLLI_L3_H310	= 0x0c,
366121934Sharti	UNI_BLLI_L3_H321	= 0x0d,
367121934Sharti	UNI_BLLI_L3_USER	= 0x10,
368121934Sharti};
369121934Sharti
370121934Shartienum uni_blli_l3_mode {
371121934Sharti	UNI_BLLI_L3NSEQ		= 0x1,	/* normal sequence numbering */
372121934Sharti	UNI_BLLI_L3ESEQ		= 0x2,	/* extended sequence numbering */
373121934Sharti};
374121934Sharti
375121934Shartienum uni_blli_l3_psiz {
376121934Sharti	UNI_BLLI_L3_16		= 0x4,	/* 16 byte packets */
377121934Sharti	UNI_BLLI_L3_32		= 0x5,	/* 32 byte packets */
378121934Sharti	UNI_BLLI_L3_64		= 0x6,	/* 64 byte packets */
379121934Sharti	UNI_BLLI_L3_128		= 0x7,	/* 128 byte packets */
380121934Sharti	UNI_BLLI_L3_256		= 0x8,	/* 256 byte packets */
381121934Sharti	UNI_BLLI_L3_512		= 0x9,	/* 512 byte packets */
382121934Sharti	UNI_BLLI_L3_1024	= 0xa,	/* 1024 byte packets */
383121934Sharti	UNI_BLLI_L3_2048	= 0xb,	/* 2048 byte packets */
384121934Sharti	UNI_BLLI_L3_4096	= 0xc,	/* 4096 byte packets */
385121934Sharti};
386121934Sharti
387121934Shartienum uni_blli_l3_ttype {
388121934Sharti	UNI_BLLI_L3_TTYPE_RECV	= 0x1,	/* receive only */
389121934Sharti	UNI_BLLI_L3_TTYPE_SEND	= 0x2,	/* send only */
390121934Sharti	UNI_BLLI_L3_TTYPE_BOTH	= 0x3,	/* both */
391121934Sharti};
392121934Sharti
393121934Shartienum uni_blli_l3_mux {
394121934Sharti	UNI_BLLI_L3_MUX_NOMUX	= 0,	/* no multiplexing */
395121934Sharti	UNI_BLLI_L3_MUX_TS	= 1,	/* transport stream */
396121934Sharti	UNI_BLLI_L3_MUX_TSFEC	= 2,	/* transport stream with FEC */
397121934Sharti	UNI_BLLI_L3_MUX_PS	= 3,	/* program stream */
398121934Sharti	UNI_BLLI_L3_MUX_PSFEC	= 4,	/* program stream with FEC */
399121934Sharti	UNI_BLLI_L3_MUX_H221	= 5,	/* H.221 */
400121934Sharti};
401121934Sharti
402121934Shartienum uni_blli_l3_tcap {
403121934Sharti	UNI_BLLI_L3_TCAP_NOIND	= 0,	/* no indication */
404121934Sharti	UNI_BLLI_L3_TCAP_AAL1	= 1,	/* only AAL1 */
405121934Sharti	UNI_BLLI_L3_TCAP_AAL5	= 2,	/* only AAL5 */
406121934Sharti	UNI_BLLI_L3_TCAP_AAL15	= 3,	/* AAL1 and AAL5 */
407121934Sharti};
408121934Sharti
409121934Sharti/* Value for l3_ipi: */
410121934Shartienum {
411121934Sharti	UNI_BLLI_L3_SNAP	= 0x80,	/* IEEE 802.1 SNAP */
412121934Sharti};
413121934Sharti
414121934Shartistruct uni_ie_blli {
415121934Sharti	struct uni_iehdr	h;
416121934Sharti#define UNI_BLLI_L1_P		0x0001
417121934Sharti#define UNI_BLLI_L2_P		0x0002
418121934Sharti#define UNI_BLLI_L2_Q933_P	0x0004
419121934Sharti#define UNI_BLLI_L2_WSIZ_P	0x0008
420121934Sharti#define UNI_BLLI_L2_USER_P	0x0010
421121934Sharti#define UNI_BLLI_L3_P		0x0020
422121934Sharti#define UNI_BLLI_L3_MODE_P	0x0040
423121934Sharti#define UNI_BLLI_L3_PSIZ_P	0x0080
424121934Sharti#define UNI_BLLI_L3_WSIZ_P	0x0100
425121934Sharti#define UNI_BLLI_L3_USER_P	0x0200
426121934Sharti#define UNI_BLLI_L3_IPI_P	0x0400
427121934Sharti#define UNI_BLLI_L3_SNAP_P	0x0800
428121934Sharti#define UNI_BLLI_L3_TTYPE_P	0x1000
429121934Sharti#define UNI_BLLI_L3_MUX_P	0x2000
430121934Sharti
431121934Sharti	u_int			l1:5;		/* layer 1 info */
432121934Sharti
433121934Sharti	enum uni_blli_l2	l2;		/* layer 2 info */
434121934Sharti	u_int			l2_q933:2;	/* layer 2 Q.933 use */
435121934Sharti	enum uni_blli_l2_mode	l2_mode;	/* layer 2 HDLC mode */
436121934Sharti	u_char			l2_user;	/* layer 2 user info */
437121934Sharti	u_char			l2_wsiz;	/* layer 2 window size */
438121934Sharti
439121934Sharti	enum uni_blli_l3	l3;		/* layer 3 info */
440121934Sharti	enum uni_blli_l3_mode	l3_mode;	/* layer 3 mode */
441121934Sharti	enum uni_blli_l3_psiz	l3_psiz;	/* layer 3 default packet size */
442121934Sharti	u_char			l3_wsiz;	/* layer 3 window size */
443121934Sharti	u_char			l3_user;	/* layer 3 user info */
444121934Sharti	u_char			l3_ipi;		/* IPI byte */
445121934Sharti	u_int			oui;		/* OUI bytes */
446121934Sharti	u_int			pid;		/* PID bytes */
447121934Sharti	enum uni_blli_l3_ttype	l3_ttype;	/* terminal bytes */
448121934Sharti	enum uni_blli_l3_tcap	l3_tcap;	/* terminal capability */
449121934Sharti	enum uni_blli_l3_mux	l3_fmux;	/* forward muxing */
450121934Sharti	enum uni_blli_l3_mux	l3_bmux;	/* forward muxing */
451121934Sharti};
452121934Sharti
453121934Sharti/*************************************************************************
454121934Sharti *
455121934Sharti * Transit network selection IE
456121934Sharti */
457121934Shartistruct uni_ie_tns {
458121934Sharti	struct uni_iehdr h;
459121934Sharti	u_char		net[UNI_TNS_MAXLEN];
460121934Sharti	u_int		len;
461121934Sharti};
462121934Sharti
463121934Sharti/*************************************************************************
464121934Sharti *
465121934Sharti * Call state information element
466121934Sharti */
467121934Shartienum uni_callstate {
468121934Sharti	UNI_CALLSTATE_U0	= 0x00,
469121934Sharti	UNI_CALLSTATE_N0	= 0x00,
470121934Sharti	UNI_CALLSTATE_NN0	= 0x00,
471121934Sharti
472121934Sharti	UNI_CALLSTATE_U1	= 0x01,
473121934Sharti	UNI_CALLSTATE_N1	= 0x01,
474121934Sharti	UNI_CALLSTATE_NN1	= 0x01,
475121934Sharti
476121934Sharti	UNI_CALLSTATE_U3	= 0x03,
477121934Sharti	UNI_CALLSTATE_N3	= 0x03,
478121934Sharti	UNI_CALLSTATE_NN3	= 0x03,
479121934Sharti
480121934Sharti	UNI_CALLSTATE_U4	= 0x04,
481121934Sharti	UNI_CALLSTATE_N4	= 0x04,
482121934Sharti	UNI_CALLSTATE_NN4	= 0x04,
483121934Sharti
484121934Sharti	UNI_CALLSTATE_U6	= 0x06,
485121934Sharti	UNI_CALLSTATE_N6	= 0x06,
486121934Sharti	UNI_CALLSTATE_NN6	= 0x06,
487121934Sharti
488121934Sharti	UNI_CALLSTATE_U7	= 0x07,
489121934Sharti	UNI_CALLSTATE_N7	= 0x07,
490121934Sharti	UNI_CALLSTATE_NN7	= 0x07,
491121934Sharti
492121934Sharti	UNI_CALLSTATE_U8	= 0x08,
493121934Sharti	UNI_CALLSTATE_N8	= 0x08,
494121934Sharti
495121934Sharti	UNI_CALLSTATE_U9	= 0x09,
496121934Sharti	UNI_CALLSTATE_N9	= 0x09,
497121934Sharti	UNI_CALLSTATE_NN9	= 0x09,
498121934Sharti
499121934Sharti	UNI_CALLSTATE_U10	= 0x0a,
500121934Sharti	UNI_CALLSTATE_N10	= 0x0a,
501121934Sharti	UNI_CALLSTATE_NN10	= 0x0a,
502121934Sharti
503121934Sharti	UNI_CALLSTATE_U11	= 0x0b,
504121934Sharti	UNI_CALLSTATE_N11	= 0x0b,
505121934Sharti	UNI_CALLSTATE_NN11	= 0x0b,
506121934Sharti
507121934Sharti	UNI_CALLSTATE_U12	= 0x0c,
508121934Sharti	UNI_CALLSTATE_N12	= 0x0c,
509121934Sharti	UNI_CALLSTATE_NN12	= 0x0c,
510121934Sharti
511121934Sharti	UNI_CALLSTATE_REST0	= 0x00,
512121934Sharti	UNI_CALLSTATE_REST1	= 0x3d,
513121934Sharti	UNI_CALLSTATE_REST2	= 0x3e,
514121934Sharti
515121934Sharti	UNI_CALLSTATE_U13	= 0x0d,
516121934Sharti	UNI_CALLSTATE_N13	= 0x0d,
517121934Sharti
518121934Sharti	UNI_CALLSTATE_U14	= 0x0e,
519121934Sharti	UNI_CALLSTATE_N14	= 0x0e,
520121934Sharti};
521121934Sharti
522121934Shartistruct uni_ie_callstate {
523121934Sharti	struct uni_iehdr	h;
524121934Sharti	enum uni_callstate	state;
525121934Sharti};
526121934Sharti
527121934Sharti/*************************************************************************
528121934Sharti *
529121934Sharti * Cause information element
530121934Sharti */
531121934Shartienum uni_cause_loc {
532121934Sharti	UNI_CAUSE_LOC_USER	= 0x0,
533121934Sharti	UNI_CAUSE_LOC_PRIVLOC	= 0x1,
534121934Sharti	UNI_CAUSE_LOC_PUBLOC	= 0x2,
535121934Sharti	UNI_CAUSE_LOC_TRANSIT	= 0x3,
536121934Sharti	UNI_CAUSE_LOC_PUBREM	= 0x4,
537121934Sharti	UNI_CAUSE_LOC_PRIVREM	= 0x5,
538121934Sharti	UNI_CAUSE_LOC_INTERNAT	= 0x6,
539121934Sharti	UNI_CAUSE_LOC_BEYOND	= 0x7,
540121934Sharti};
541121934Sharti
542121934Sharti#define UNI_DECLARE_CAUSE_VALUES \
543121934ShartiD(UNALL_NUM,	0x01 /*  1*/, COND,	Q.850,	"Unallocated (unassigned) number") \
544121934ShartiD(NOROUTE_NET,	0x02 /*  2*/, TNS,	Q.850,	"No route to specified transit network") \
545121934ShartiD(NOROUTE,	0x03 /*  3*/, COND,	Q.850,	"No route to destination") \
546121934ShartiD(SPTONE,	0x04 /*  4*/, NONE,	Q.850,	"Send special information tone") \
547121934ShartiD(BADTRUNK,	0x05 /*  5*/, NONE,	Q.850,	"Misdialled trunk prefix") \
548121934ShartiD(BADCHAN,	0x06 /*  6*/, NONE,	Q.850,	"Channel unacceptable") \
549121934ShartiD(CALLAWARDED,	0x07 /*  7*/, NONE,	Q.850,	"Call awarded and being delivered in an established channel") \
550121934ShartiD(PREEMPT,	0x08 /*  8*/, NONE,	Q.850,	"Preemption") \
551121934ShartiD(PREEMPT_RES,	0x09 /*  9*/, NONE,	Q.850,	"Preemption - circuit reserved for reuse") \
552121934ShartiD(CLEARING,	0x10 /* 16*/, COND,	Q.850,	"Normal call clearing") \
553121934ShartiD(BUSY,		0x11 /* 17*/, CCBS,	Q.850,	"User busy") \
554121934ShartiD(NO_RESPONSE,	0x12 /* 18*/, NONE,	Q.850,	"No user responding") \
555121934ShartiD(NO_RESP_ALERT,0x13 /* 19*/, NONE,	Q.850,	"No answer from user (user alerted)") \
556121934ShartiD(ABSENT,	0x14 /* 20*/, NONE,	Q.850,	"Subscriber absent") \
557121934ShartiD(REJECTED,	0x15 /* 21*/, REJ,	Q.850,	"Call rejected") \
558121934ShartiD(NUMCHG,	0x16 /* 22*/, NUMBER,	Q.850,	"Number changed") \
559121934ShartiD(REDIR,	0x17 /* 23*/, NONE,	Q.850,	"Redirection to new destination") \
560121934ShartiN(CLIR_REJECTED,0x17 /* 23*/, NONE,	UNI4.0,	"User rejects call with calling line identification restriction (CLIR)") \
561121934ShartiD(EXCHG_ERR,	0x19 /* 25*/, NONE,	Q.850,	"Exchange routing error") \
562121934ShartiD(NOSEL_CLEAR,	0x1a /* 26*/, NONE,	Q.850,	"Non-selected user clearing") \
563121934ShartiD(DST_OOO,	0x1b /* 27*/, NONE,	Q.850,	"Destination out of order") \
564121934ShartiD(INV_ADDR,	0x1c /* 28*/, NONE,	Q.850,	"Invalid number format (address incomplete)") \
565121934ShartiD(FAC_REJ,	0x1d /* 29*/, FAC,	Q.850,	"Facility rejected") \
566121934ShartiD(STATUS,	0x1e /* 30*/, NONE,	Q.850,	"Response to STATUS ENQUIRY") \
567121934ShartiD(UNSPEC,	0x1f /* 31*/, NONE,	Q.850,	"Normal, unspecified") \
568121934ShartiD(TMY_PARTY,	0x20 /* 32*/, NONE,	Q.2971,	"Too many pending add party requests") \
569121934ShartiD(NOCHAN,	0x22 /* 34*/, CCBS,	Q.850,	"No circuit/channel available") \
570121934ShartiN(SOFT_NAVL,	0x22 /* 34*/, NONE,	PNNI1.0,"Requested called party soft PVPC or PVCC not available")\
571121934ShartiD(VPCI_NAVL,	0x23 /* 35*/, NONE,	Q.2610,	"Requested VPCI/VCI not available") \
572121934ShartiD(VPCI_FAIL,	0x24 /* 36*/, NONE,	Q.2610,	"VPCI/VPI assignment failure") \
573121934ShartiD(CRATE_NAVL,	0x25 /* 37*/, CRATE,	Q.2610,	"User cell rate not available") \
574121934ShartiD(NET_OOO,	0x26 /* 38*/, NONE,	Q.850,	"Network out of order") \
575121934ShartiD(FRAME_OOS,	0x27 /* 39*/, NONE,	Q.850,	"Permanent frame mode connection out of service") \
576121934ShartiD(FRAME_OP,	0x28 /* 40*/, NONE,	Q.850,	"Permanent frame mode connection operational") \
577121934ShartiD(TEMP,		0x29 /* 41*/, NONE,	Q.850,	"Temporary failure") \
578121934ShartiD(CONG,		0x2a /* 42*/, NONE,	Q.850,	"Switching equipment congestion") \
579121934ShartiD(ACC_DISC,	0x2b /* 43*/, IE,	Q.850,	"Access information discarded") \
580121934ShartiD(REQNOCHAN,	0x2c /* 44*/, NONE,	Q.850,	"Requested circuit/channel not available") \
581121934ShartiD(NOVPCI,	0x2d /* 45*/, NONE,	Q.2610,	"No VPCI/VCI available") \
582121934ShartiD(PREC_BLOCK,	0x2e /* 46*/, NONE,	Q.850,	"Precedence call blocked") \
583121934ShartiD(RESRC_NAVL,	0x2f /* 47*/, NONE,	Q.850,	"Resource unavailable, unspecified") \
584121934ShartiD(QOS_NAVL,	0x31 /* 49*/, COND,	Q.850,	"Quality of service not available") \
585121934ShartiD(FAC_NOTSUB,	0x32 /* 50*/, FAC,	Q.850,	"Requested facility not subscribed") \
586121934ShartiD(OUT_CUG,	0x35 /* 53*/, NONE,	Q.850,	"Outgoing calls barred within CUG") \
587121934ShartiN(PGL_CHG,	0x35 /* 53*/, NONE,	PNNI1.0,"Call cleared due to change in PGL") \
588121934ShartiD(IN_CUG,	0x37 /* 55*/, NONE,	Q.850,	"Incoming call barred within CUG") \
589121934ShartiD(BEARER_NAUTH,	0x39 /* 57*/, ATTR,	Q.850,	"Bearer capability not authorized") \
590121934ShartiD(BEARER_NAVL,	0x3a /* 58*/, ATTR,	Q.850,	"Bearer capability not presently available") \
591121934ShartiD(INCONS,	0x3e /* 62*/, NONE,	Q.850,	"Inconsistency in designated outgoing access information and subscriber class") \
592121934ShartiD(OPT_NAVL,	0x3f /* 63*/, NONE,	Q.850,	"Service or option not available, unspecified") \
593121934ShartiD(BEARER_NIMPL,	0x41 /* 65*/, ATTR,	Q.850,	"Bearer capability not implemented") \
594121934ShartiD(CHANNEL_NIMPL,0x42 /* 66*/, CHANNEL,	Q.850,	"Channel type not implemented") \
595121934ShartiD(FAC_NIMPL,	0x45 /* 69*/, FAC,	Q.850,	"Requested facility not implemented") \
596121934ShartiD(RESTR_DIG,	0x46 /* 70*/, NONE,	Q.850,	"Only restricted digital information bearer capability is available") \
597121934ShartiD(TRAFFIC_UNSUP,0x49 /* 73*/, NONE,	Q.2971,	"Unsupported combination of traffic parameters") \
598121934ShartiN(AAL_UNSUP,	0x4c /* 78*/, NONE,	UNI3.1,	"AAL parameters cannot be supported") \
599121934ShartiD(CREF_INV,	0x51 /* 81*/, NONE,	Q.850,	"Invalid call reference value") \
600121934ShartiD(CHANNEL_NEX,	0x52 /* 82*/, CHANID,	Q.850,	"Identified channel does not exist") \
601121934ShartiD(SUSPENDED,	0x53 /* 83*/, NONE,	Q.850,	"A suspended call exists, but this call identity does not") \
602121934ShartiD(CID_INUSE,	0x54 /* 84*/, NONE,	Q.850,	"Call identity in use") \
603121934ShartiD(NOTSUSP,	0x55 /* 85*/, NONE,	Q.850,	"No call suspended") \
604121934ShartiD(CLEARED,	0x56 /* 86*/, CAUSE,	Q.850,	"Call having requested call identity has been cleared") \
605121934ShartiD(NOT_MEMBER,	0x57 /* 87*/, NONE,	Q.850,	"User not member of CUG") \
606121934ShartiD(INCOMP,	0x58 /* 88*/, PARAM,	Q.850,	"Incompatible destination") \
607121934ShartiD(ENDP_INV,	0x59 /* 89*/, IE,	UNI3.1,	"Invalid endpoint reference") \
608121934ShartiD(NEX_CUG,	0x5a /* 90*/, NONE,	Q.850,	"Non-existend CUG") \
609121934ShartiD(TRANSIT_INV,	0x5b /* 91*/, NONE,	Q.850,	"Invalid transit network selection") \
610121934ShartiD(AALNOTSUPP,	0x5d /* 93*/, NONE,	Q.2610,	"AAL parameters cannot be supported") \
611121934ShartiD(INVMSG,	0x5f /* 95*/, NONE,	Q.850,	"Invalid message, unspecified") \
612121934ShartiD(MANDAT,	0x60 /* 96*/, IE,	Q.850,	"Mandatory information element is missing") \
613121934ShartiD(MTYPE_NIMPL,	0x61 /* 97*/, MTYPE,	Q.850,	"Message type non-existent or not implemented") \
614121934ShartiD(MSG_NOTCOMP,	0x62 /* 98*/, MTYPE,	Q.850,	"Message not compatible with call state or message type non-existent or not implemented") \
615121934ShartiD(IE_NIMPL,	0x63 /* 99*/, IE,	Q.850,	"Information element/parameter non-existent or not implemented") \
616121934ShartiD(IE_INV,	0x64 /*100*/, IE,	Q.850,	"Invalid information element contents") \
617121934ShartiD(MSG_INCOMP,	0x65 /*101*/, MTYPE,	Q.850,	"Message not compatible with call state") \
618121934ShartiD(RECOVER,	0x66 /*102*/, TIMER,	Q.850,	"Recovery on timer expiry") \
619121934ShartiD(PARAM_NEX,	0x67 /*103*/, PARAM,	Q.850,	"Parameter non-existent or not implemented, passed on") \
620121934ShartiN(BAD_LENGTH,	0x68 /*104*/, NONE,	UNI3.1,	"Incorrect message length") \
621121934ShartiD(PARAM_UNREC,	0x6e /*110*/, PARAM,	Q.850,	"Message with unrecognized parameter, discarded") \
622121934ShartiD(PROTO,	0x6f /*111*/, NONE,	Q.850,	"Protocol error, unspecified") \
623121934ShartiD(INTERWORKING,	0x7f /*127*/, NONE,	Q.850,	"Interworking, unspecified")
624121934Sharti
625121934Sharti#define D(NAME,VAL,DIAG,STD,STR) UNI_CAUSE_##NAME = VAL,
626121934Sharti#define N(NAME,VAL,DIAG,STD,STR) UNI_CAUSE_##NAME = VAL,
627121934Sharti
628121934Shartienum uni_cause {
629121934ShartiUNI_DECLARE_CAUSE_VALUES
630121934Sharti};
631121934Sharti
632121934Sharti#undef D
633121934Sharti#undef N
634121934Sharti
635121934Shartienum uni_cause_class {
636121934Sharti	UNI_CAUSE_CLASS_NORM	= 0x0,
637121934Sharti	UNI_CAUSE_CLASS_NORM1	= 0x1,
638121934Sharti	UNI_CAUSE_CLASS_RES	= 0x2,
639121934Sharti	UNI_CAUSE_CLASS_NAVL	= 0x3,
640121934Sharti	UNI_CAUSE_CLASS_NIMPL	= 0x4,
641121934Sharti	UNI_CAUSE_CLASS_INV	= 0x5,
642121934Sharti	UNI_CAUSE_CLASS_PROTO	= 0x6,
643121934Sharti	UNI_CAUSE_CLASS_INTER	= 0x7,
644121934Sharti};
645121934Shartienum uni_cause_pu {
646121934Sharti	UNI_CAUSE_PU_PROVIDER	= 0,
647121934Sharti	UNI_CAUSE_PU_USER	= 1,
648121934Sharti};
649121934Shartienum uni_cause_na {
650121934Sharti	UNI_CAUSE_NA_NORMAL	= 0,
651121934Sharti	UNI_CAUSE_NA_ABNORMAL	= 1,
652121934Sharti};
653121934Shartienum uni_cause_cond {
654121934Sharti	UNI_CAUSE_COND_UNKNOWN	= 0,
655121934Sharti	UNI_CAUSE_COND_PERM	= 1,
656121934Sharti	UNI_CAUSE_COND_TRANS	= 2,
657121934Sharti};
658121934Shartienum uni_cause_reason {
659121934Sharti	UNI_CAUSE_REASON_USER	= 0x00,
660121934Sharti	UNI_CAUSE_REASON_IEMISS	= 0x01,
661121934Sharti	UNI_CAUSE_REASON_IESUFF	= 0x02,
662121934Sharti};
663121934Sharti
664121934Shartienum uni_diag {
665121934Sharti	UNI_DIAG_NONE,		/* no diagnostics */
666121934Sharti
667121934Sharti	UNI_DIAG_COND,		/* Condition */
668121934Sharti	UNI_DIAG_TNS,		/* Transit Network Selector */
669121934Sharti	UNI_DIAG_REJ,		/* Call Rejected */
670121934Sharti	UNI_DIAG_NUMBER,	/* New Destination */
671121934Sharti	UNI_DIAG_CRATE,		/* Traffic descriptor subfield */
672121934Sharti	UNI_DIAG_ATTR,		/* Attribute idendity */
673121934Sharti	UNI_DIAG_PARAM,		/* Parameter, same as one IE */
674121934Sharti	UNI_DIAG_TIMER,		/* timer in ASCII */
675121934Sharti	UNI_DIAG_MTYPE,		/* Message type */
676121934Sharti	UNI_DIAG_IE,		/* Information element */
677121934Sharti	UNI_DIAG_CHANID,	/* VPCI/VCI */
678121934Sharti
679121934Sharti	UNI_DIAG_CAUSE = UNI_DIAG_NONE,		/* Not specified */
680121934Sharti	UNI_DIAG_CHANNEL = UNI_DIAG_NONE,	/* For N-ISDN */
681121934Sharti	UNI_DIAG_CCBS = UNI_DIAG_NONE,		/* Not used in Q.931 */
682121934Sharti	UNI_DIAG_FAC = UNI_DIAG_NONE,		/* Not specified */
683121934Sharti};
684121934Sharti
685121934Shartienum {
686121934Sharti	UNI_CAUSE_TRAFFIC_N	= 34-6,
687121934Sharti	UNI_CAUSE_IE_N		= 34-6,
688121934Sharti	UNI_CAUSE_ATTR_N	= (34-6)/3,
689121934Sharti};
690121934Sharti
691121934Shartistruct uni_ie_cause {
692121934Sharti	struct uni_iehdr	h;
693121934Sharti#define UNI_CAUSE_COND_P	0x0001
694121934Sharti#define UNI_CAUSE_REJ_P		0x0002
695121934Sharti#define UNI_CAUSE_REJ_USER_P	0x0004
696121934Sharti#define UNI_CAUSE_REJ_IE_P	0x0008
697121934Sharti#define UNI_CAUSE_IE_P		0x0010
698121934Sharti#define UNI_CAUSE_TRAFFIC_P	0x0020
699121934Sharti#define UNI_CAUSE_VPCI_P	0x0040
700121934Sharti#define UNI_CAUSE_MTYPE_P	0x0080
701121934Sharti#define UNI_CAUSE_TIMER_P	0x0100
702121934Sharti#define UNI_CAUSE_TNS_P		0x0200
703121934Sharti#define UNI_CAUSE_NUMBER_P	0x0400
704121934Sharti#define UNI_CAUSE_ATTR_P	0x0800
705121934Sharti#define UNI_CAUSE_PARAM_P	0x1000
706121934Sharti
707121934Sharti	enum uni_cause_loc	loc;
708121934Sharti	enum uni_cause		cause;
709121934Sharti
710121934Sharti	union {
711121934Sharti	    struct {
712121934Sharti		enum uni_cause_pu	pu;
713121934Sharti		enum uni_cause_na	na;
714121934Sharti		enum uni_cause_cond	cond;
715121934Sharti	    } cond;
716121934Sharti	    struct {
717121934Sharti		enum uni_cause_reason	reason;
718121934Sharti		enum uni_cause_cond	cond;
719121934Sharti		u_int			user;
720121934Sharti		uint8_t			ie;
721121934Sharti	    } rej;
722121934Sharti	    struct {
723121934Sharti		uint8_t			ie[UNI_CAUSE_IE_N];
724121934Sharti		u_int			len;
725121934Sharti	    } ie;
726121934Sharti	    struct {
727121934Sharti		uint8_t			traffic[UNI_CAUSE_TRAFFIC_N];
728121934Sharti		u_int			len;
729121934Sharti	    } traffic;
730121934Sharti	    struct {
731121934Sharti		uint16_t		vpci;
732121934Sharti		uint16_t		vci;
733121934Sharti	    } vpci;
734121934Sharti	    uint8_t			mtype;
735121934Sharti	    u_char			timer[3];
736121934Sharti	    struct uni_ie_tns		tns;
737121934Sharti	    struct uni_ie_called	number;		/* TNS does not fit */
738121934Sharti	    uint8_t			param;
739121934Sharti	    struct {
740121934Sharti		u_int			nattr;
741121934Sharti	        u_char			attr[UNI_CAUSE_ATTR_N][3];
742121934Sharti	    }				attr;
743121934Sharti	} u;
744121934Sharti};
745121934Shartienum uni_diag uni_diag(enum uni_cause, enum uni_coding);
746121934Sharti
747121934Sharti/* return a string for the cause (NULL if the coding/cause are illegal) */
748121934Sharticonst char *uni_ie_cause2str(enum uni_coding, u_int);
749121934Sharti
750121934Sharti/*************************************************************************
751121934Sharti *
752121934Sharti * Connection identifier information element
753121934Sharti */
754121934Shartienum uni_connid_type {
755121934Sharti	UNI_CONNID_VCI		= 0,
756121934Sharti	UNI_CONNID_ANYVCI	= 1,
757121934Sharti	UNI_CONNID_NOVCI	= 4,
758121934Sharti};
759121934Shartienum uni_connid_assoc {
760121934Sharti	UNI_CONNID_ASSOC	= 0,
761121934Sharti	UNI_CONNID_NONASSOC	= 1,
762121934Sharti};
763121934Shartistruct uni_ie_connid {
764121934Sharti	struct uni_iehdr	h;
765121934Sharti	enum uni_connid_assoc	assoc;
766121934Sharti	enum uni_connid_type	type;
767121934Sharti	u_int			vpci : 16;
768121934Sharti	u_int			vci : 16;
769121934Sharti};
770121934Sharti
771121934Sharti/*************************************************************************
772121934Sharti *
773121934Sharti * End point reference IE
774121934Sharti */
775121934Shartistruct uni_ie_epref {
776121934Sharti	struct uni_iehdr	h;
777121934Sharti	u_int			flag : 1;
778121934Sharti	u_int			epref : 15;
779121934Sharti};
780121934Sharti
781121934Sharti/*************************************************************************
782121934Sharti *
783121934Sharti * End point state IE
784121934Sharti */
785121934Shartienum uni_epstate {
786121934Sharti	UNI_EPSTATE_NULL	= 0x00,
787121934Sharti	UNI_EPSTATE_ADD_INIT	= 0x01,
788121934Sharti	UNI_EPSTATE_ALERT_DLVD	= 0x04,
789121934Sharti	UNI_EPSTATE_ADD_RCVD	= 0x06,
790121934Sharti	UNI_EPSTATE_ALERT_RCVD	= 0x07,
791121934Sharti	UNI_EPSTATE_ACTIVE	= 0x0a,
792121934Sharti	UNI_EPSTATE_DROP_INIT	= 0x0b,
793121934Sharti	UNI_EPSTATE_DROP_RCVD	= 0x0c,
794121934Sharti};
795121934Sharti
796121934Shartistruct uni_ie_epstate {
797121934Sharti	struct uni_iehdr h;
798121934Sharti	enum uni_epstate state;
799121934Sharti};
800121934Sharti
801121934Sharti/*************************************************************************
802121934Sharti *
803121934Sharti * Q.2932 Facility IE
804121934Sharti */
805121934Shartienum {
806121934Sharti	UNI_FACILITY_ROSE	= 0x11,
807121934Sharti
808121934Sharti	UNI_FACILITY_MAXAPDU	= 128,
809121934Sharti};
810121934Sharti
811121934Shartistruct uni_ie_facility {
812121934Sharti	struct uni_iehdr h;
813121934Sharti
814121934Sharti	u_char		proto;
815121934Sharti	u_char		apdu[UNI_FACILITY_MAXAPDU];
816121934Sharti	u_int		len;
817121934Sharti};
818121934Sharti
819121934Sharti/*************************************************************************
820121934Sharti *
821121934Sharti * Notification indicator
822121934Sharti */
823121934Shartienum {
824121934Sharti	UNI_NOTIFY_MAXLEN	= 128,	/* maximum info length */
825121934Sharti};
826121934Shartistruct uni_ie_notify {
827121934Sharti	struct uni_iehdr h;
828121934Sharti	u_int		len;
829121934Sharti	u_char		notify[UNI_NOTIFY_MAXLEN];
830121934Sharti};
831121934Sharti
832121934Sharti/*************************************************************************
833121934Sharti *
834121934Sharti * QoS information element
835121934Sharti */
836121934Shartienum uni_qos {
837121934Sharti	UNI_QOS_CLASS0	= 0x00,
838121934Sharti	UNI_QOS_CLASS1	= 0x01,
839121934Sharti	UNI_QOS_CLASS2	= 0x02,
840121934Sharti	UNI_QOS_CLASS3	= 0x03,
841121934Sharti	UNI_QOS_CLASS4	= 0x04,
842121934Sharti};
843121934Sharti
844121934Shartistruct uni_ie_qos {
845121934Sharti	struct uni_iehdr h;
846121934Sharti	enum uni_qos	fwd;
847121934Sharti	enum uni_qos	bwd;
848121934Sharti};
849121934Sharti
850121934Sharti/*************************************************************************
851121934Sharti *
852121934Sharti * Broadband repeat indicator information element
853121934Sharti */
854121934Shartienum uni_repeat_type {
855121934Sharti	UNI_REPEAT_PRIDESC	= 0x02,
856121934Sharti	UNI_REPEAT_STACK	= 0x0a,		/* PNNI */
857121934Sharti};
858121934Sharti
859121934Shartistruct uni_ie_repeat {
860121934Sharti	struct uni_iehdr h;
861121934Sharti	enum uni_repeat_type type;
862121934Sharti};
863121934Sharti
864121934Sharti/*************************************************************************
865121934Sharti *
866121934Sharti * Restart indicator information element
867121934Sharti */
868121934Shartienum uni_restart_type {
869121934Sharti	UNI_RESTART_CHANNEL	= 0x0,
870121934Sharti	UNI_RESTART_PATH	= 0x1,
871121934Sharti	UNI_RESTART_ALL		= 0x2,
872121934Sharti};
873121934Sharti
874121934Shartistruct uni_ie_restart {
875121934Sharti	struct uni_iehdr h;
876121934Sharti	enum uni_restart_type rclass;
877121934Sharti};
878121934Sharti
879121934Sharti/*************************************************************************
880121934Sharti *
881121934Sharti * Broadband sending complete indicator information element
882121934Sharti */
883121934Shartistruct uni_ie_scompl {
884121934Sharti	struct uni_iehdr h;
885121934Sharti};
886121934Sharti
887121934Sharti/*************************************************************************
888121934Sharti *
889121934Sharti * ATM traffic descriptor information element
890121934Sharti */
891121934Shartienum {
892121934Sharti	UNI_TRAFFIC_FMDCR_ID	= 0x00,
893121934Sharti	UNI_TRAFFIC_BMDCR_ID	= 0x02,
894121934Sharti	UNI_TRAFFIC_FPCR0_ID	= 0x82,
895121934Sharti	UNI_TRAFFIC_BPCR0_ID	= 0x83,
896121934Sharti	UNI_TRAFFIC_FPCR1_ID	= 0x84,
897121934Sharti	UNI_TRAFFIC_BPCR1_ID	= 0x85,
898121934Sharti	UNI_TRAFFIC_FSCR0_ID	= 0x88,
899121934Sharti	UNI_TRAFFIC_BSCR0_ID	= 0x89,
900121934Sharti	UNI_TRAFFIC_FSCR1_ID	= 0x90,
901121934Sharti	UNI_TRAFFIC_BSCR1_ID	= 0x91,
902121934Sharti	UNI_TRAFFIC_FABR1_ID	= 0x92,
903121934Sharti	UNI_TRAFFIC_BABR1_ID	= 0x93,
904121934Sharti	UNI_TRAFFIC_FMBS0_ID	= 0xa0,
905121934Sharti	UNI_TRAFFIC_BMBS0_ID	= 0xa1,
906121934Sharti	UNI_TRAFFIC_FMBS1_ID	= 0xb0,
907121934Sharti	UNI_TRAFFIC_BMBS1_ID	= 0xb1,
908121934Sharti	UNI_TRAFFIC_BEST_ID	= 0xbe,
909121934Sharti	UNI_TRAFFIC_MOPT_ID	= 0xbf,
910121934Sharti
911121934Sharti	UNI_TRAFFIC_FTAG	= 0x01,
912121934Sharti	UNI_TRAFFIC_BTAG	= 0x02,
913121934Sharti	UNI_TRAFFIC_FDISC	= 0x80,
914121934Sharti	UNI_TRAFFIC_BDISC	= 0x40,
915121934Sharti
916121934Sharti	UNI_MINTRAFFIC_FPCR0_ID	= 0x82,
917121934Sharti	UNI_MINTRAFFIC_BPCR0_ID	= 0x83,
918121934Sharti	UNI_MINTRAFFIC_FPCR1_ID	= 0x84,
919121934Sharti	UNI_MINTRAFFIC_BPCR1_ID	= 0x85,
920121934Sharti	UNI_MINTRAFFIC_FABR1_ID	= 0x92,
921121934Sharti	UNI_MINTRAFFIC_BABR1_ID	= 0x93,
922121934Sharti
923121934Sharti	UNI_MDCR_ORIGIN_USER	= 0x00,
924121934Sharti	UNI_MDCR_ORIGIN_NET	= 0x01,
925121934Sharti};
926121934Sharti
927121934Sharti#define UNI_TRAFFIC_FPCR0_P	0x0001
928121934Sharti#define UNI_TRAFFIC_BPCR0_P	0x0002
929121934Sharti#define UNI_TRAFFIC_FPCR1_P	0x0004
930121934Sharti#define UNI_TRAFFIC_BPCR1_P	0x0008
931121934Sharti#define UNI_TRAFFIC_FSCR0_P	0x0010
932121934Sharti#define UNI_TRAFFIC_BSCR0_P	0x0020
933121934Sharti#define UNI_TRAFFIC_FSCR1_P	0x0040
934121934Sharti#define UNI_TRAFFIC_BSCR1_P	0x0080
935121934Sharti#define UNI_TRAFFIC_FMBS0_P	0x0100
936121934Sharti#define UNI_TRAFFIC_BMBS0_P	0x0200
937121934Sharti#define UNI_TRAFFIC_FMBS1_P	0x0400
938121934Sharti#define UNI_TRAFFIC_BMBS1_P	0x0800
939121934Sharti#define UNI_TRAFFIC_BEST_P	0x1000
940121934Sharti#define UNI_TRAFFIC_MOPT_P	0x2000
941121934Sharti#define UNI_TRAFFIC_FABR1_P	0x4000
942121934Sharti#define UNI_TRAFFIC_BABR1_P	0x8000
943121934Shartistruct uni_xtraffic {
944121934Sharti	u_int	fpcr0, bpcr0;
945121934Sharti	u_int	fpcr1, bpcr1;
946121934Sharti	u_int	fscr0, bscr0;
947121934Sharti	u_int	fscr1, bscr1;
948121934Sharti	u_int	fmbs0, bmbs0;
949121934Sharti	u_int	fmbs1, bmbs1;
950121934Sharti	u_int	fabr1, babr1;
951121934Sharti	u_int	ftag, btag;
952121934Sharti	u_int	fdisc, bdisc;
953121934Sharti};
954121934Sharti
955121934Shartistruct uni_ie_traffic {
956121934Sharti	struct uni_iehdr h;
957121934Sharti	struct uni_xtraffic t;
958121934Sharti};
959121934Shartistruct uni_ie_atraffic {
960121934Sharti	struct uni_iehdr h;
961121934Sharti	struct uni_xtraffic t;
962121934Sharti};
963121934Sharti
964121934Sharti/*
965121934Sharti * Q.2961 minimum traffic descriptor
966121934Sharti */
967121934Shartistruct uni_ie_mintraffic {
968121934Sharti	struct uni_iehdr h;
969121934Sharti#define UNI_MINTRAFFIC_FPCR0_P	0x0001
970121934Sharti#define UNI_MINTRAFFIC_BPCR0_P	0x0002
971121934Sharti#define UNI_MINTRAFFIC_FPCR1_P	0x0004
972121934Sharti#define UNI_MINTRAFFIC_BPCR1_P	0x0008
973121934Sharti#define UNI_MINTRAFFIC_FABR1_P	0x0010
974121934Sharti#define UNI_MINTRAFFIC_BABR1_P	0x0020
975121934Sharti
976121934Sharti	u_int	fpcr0, bpcr0;
977121934Sharti	u_int	fpcr1, bpcr1;
978121934Sharti	u_int	fabr1, babr1;
979121934Sharti};
980121934Sharti
981121934Sharti/*
982121934Sharti * UNI4.0+ (af-cs-0147.000) Minimum Desired Cell Rate
983121934Sharti */
984121934Shartistruct uni_ie_mdcr {
985121934Sharti	struct uni_iehdr h;
986121934Sharti	u_int	origin;
987121934Sharti	u_int	fmdcr, bmdcr;
988121934Sharti};
989121934Sharti
990121934Sharti/*************************************************************************
991121934Sharti *
992121934Sharti * User-user information information element
993121934Sharti */
994121934Shartistruct uni_ie_uu {
995121934Sharti	struct uni_iehdr h;
996121934Sharti	u_int		len;
997121934Sharti	u_char		uu[UNI_UU_MAXLEN];
998121934Sharti};
999121934Sharti
1000121934Sharti/*************************************************************************
1001121934Sharti *
1002121934Sharti * Generic identifier transport
1003121934Sharti */
1004121934Shartienum uni_git_std {
1005121934Sharti	UNI_GIT_STD_DSMCC	= 0x01,	/* DSM-CC */
1006121934Sharti	UNI_GIT_STD_H245	= 0x02,	/* H.245 */
1007121934Sharti};
1008121934Shartienum uni_git_type {
1009121934Sharti	UNI_GIT_TYPE_SESS	= 0x01,	/* session id */
1010121934Sharti	UNI_GIT_TYPE_RES	= 0x02,	/* resource id */
1011121934Sharti};
1012121934Sharti
1013121934Shartienum {
1014121934Sharti	UNI_GIT_MAXSESS		= 20,	/* max session value length */
1015121934Sharti	UNI_GIT_MAXRES		= 4,	/* max resource value length */
1016121934Sharti
1017121934Sharti	UNI_GIT_MAXVAL		= 20,	/* the maximum of the above */
1018121934Sharti	UNI_GIT_MAXSUB		= 2,	/* maximum number of og. 6 */
1019121934Sharti};
1020121934Sharti
1021121934Shartistruct uni_ie_git {
1022121934Sharti	struct uni_iehdr	h;
1023121934Sharti
1024121934Sharti	enum uni_git_std	std;	/* identifier related standard/application */
1025121934Sharti	u_int			numsub;
1026121934Sharti	struct {
1027121934Sharti		enum uni_git_type type;
1028121934Sharti		u_int		len;
1029121934Sharti		u_char		val[UNI_GIT_MAXVAL];
1030121934Sharti	}			sub[UNI_GIT_MAXSUB];
1031121934Sharti};
1032121934Sharti
1033121934Sharti/*************************************************************************
1034121934Sharti *
1035121934Sharti * End-to-end transit delay
1036121934Sharti */
1037121934Shartienum {
1038121934Sharti	UNI_EETD_CTD_ID		= 0x01,	/* cumulative transit delay */
1039121934Sharti	UNI_EETD_MTD_ID		= 0x03,	/* maximum transit delay */
1040121934Sharti	UNI_EETD_NET_ID		= 0x0a,	/* network generated */
1041121934Sharti	UNI_EETD_PMTD_ID	= 0x0b,	/* PNNI acceptable forward maximum ctd */
1042121934Sharti	UNI_EETD_PCTD_ID	= 0x11,	/* PNNI cumulative forward maximum ctd */
1043121934Sharti
1044121934Sharti	UNI_EETD_ANYMAX		= 0xffff,
1045121934Sharti	UNI_EETD_MAXVAL		= 0xffff,	/* maximum value */
1046121934Sharti};
1047121934Sharti
1048121934Shartistruct uni_ie_eetd {
1049121934Sharti	struct uni_iehdr	h;
1050121934Sharti#define UNI_EETD_CUM_P		0x0001
1051121934Sharti#define UNI_EETD_MAX_P		0x0002
1052121934Sharti#define UNI_EETD_NET_P		0x0004	/* UNI4.0 9.1.2.1 */
1053121934Sharti#define UNI_EETD_PMTD_P		0x0008	/* PNNI1.0 6.4.5.24 */
1054121934Sharti#define UNI_EETD_PCTD_P		0x0010	/* PNNI1.0 6.4.5.24 */
1055121934Sharti
1056121934Sharti	u_int	cumulative;
1057121934Sharti	u_int	maximum;
1058121934Sharti	u_int	pmtd;
1059121934Sharti	u_int	pctd;
1060121934Sharti};
1061121934Sharti
1062121934Sharti/*************************************************************************
1063121934Sharti *
1064121934Sharti * Leaf-initiated-join call identifier
1065121934Sharti */
1066121934Shartienum uni_lij_idtype {
1067121934Sharti	UNI_LIJ_IDTYPE_ROOT	= 0x0,	/* root created */
1068121934Sharti};
1069121934Sharti
1070121934Shartistruct uni_ie_lij_callid {
1071121934Sharti	struct uni_iehdr	h;
1072121934Sharti
1073121934Sharti	enum uni_lij_idtype	type;
1074121934Sharti	u_int			callid;
1075121934Sharti};
1076121934Sharti
1077121934Sharti/*
1078121934Sharti * LIJ parameters
1079121934Sharti */
1080121934Shartienum uni_lij_screen {
1081121934Sharti	UNI_LIJ_SCREEN_NETJOIN	= 0x0,	/* without root notification */
1082121934Sharti};
1083121934Sharti
1084121934Shartistruct uni_ie_lij_param {
1085121934Sharti	struct uni_iehdr	h;
1086121934Sharti
1087121934Sharti	enum uni_lij_screen	screen;
1088121934Sharti};
1089121934Sharti
1090121934Sharti/*
1091121934Sharti * LIJ sequence number
1092121934Sharti */
1093121934Shartistruct uni_ie_lij_seqno {
1094121934Sharti	struct uni_iehdr	h;
1095121934Sharti
1096121934Sharti	u_int			seqno;
1097121934Sharti};
1098121934Sharti
1099121934Sharti/*************************************************************************
1100121934Sharti *
1101121934Sharti * Locking/Non-locking shift not supported
1102121934Sharti */
1103121934Shartistruct uni_ie_lshift {
1104121934Sharti	struct uni_iehdr h;
1105121934Sharti	u_int		set:3;
1106121934Sharti};
1107121934Sharti
1108121934Shartistruct uni_ie_nlshift {
1109121934Sharti	struct uni_iehdr h;
1110121934Sharti	u_int		set:3;
1111121934Sharti};
1112121934Sharti
1113121934Sharti/*************************************************************************
1114121934Sharti *
1115121934Sharti * Externded QoS information element
1116121934Sharti */
1117121934Shartienum {
1118121934Sharti	UNI_EXQOS_FACC_ID	= 0x94,
1119121934Sharti	UNI_EXQOS_BACC_ID	= 0x95,
1120121934Sharti	UNI_EXQOS_FCUM_ID	= 0x96,
1121121934Sharti	UNI_EXQOS_BCUM_ID	= 0x97,
1122121934Sharti	UNI_EXQOS_FCLR_ID	= 0xa2,
1123121934Sharti	UNI_EXQOS_BCLR_ID	= 0xa3,
1124121934Sharti};
1125121934Sharti
1126121934Shartienum uni_exqos_origin {
1127121934Sharti	UNI_EXQOS_USER	= 0,
1128121934Sharti	UNI_EXQOS_NET	= 1,
1129121934Sharti};
1130121934Sharti
1131121934Shartienum {
1132121934Sharti	UNI_EXQOS_ANY_CDV	= 0xffffff,
1133121934Sharti	UNI_EXQOS_ANY_CLR	= 0xff,
1134121934Sharti};
1135121934Sharti
1136121934Shartistruct uni_ie_exqos {
1137121934Sharti	struct uni_iehdr	h;
1138121934Sharti#define UNI_EXQOS_FACC_P	0x0001
1139121934Sharti#define UNI_EXQOS_BACC_P	0x0002
1140121934Sharti#define UNI_EXQOS_FCUM_P	0x0004
1141121934Sharti#define UNI_EXQOS_BCUM_P	0x0008
1142121934Sharti#define UNI_EXQOS_FCLR_P	0x0010
1143121934Sharti#define UNI_EXQOS_BCLR_P	0x0020
1144121934Sharti
1145121934Sharti	enum uni_exqos_origin	origin;
1146121934Sharti	u_int			facc;
1147121934Sharti	u_int			bacc;
1148121934Sharti	u_int			fcum;
1149121934Sharti	u_int			bcum;
1150121934Sharti	u_int			fclr;
1151121934Sharti	u_int			bclr;
1152121934Sharti};
1153121934Sharti
1154121934Sharti/*************************************************************************
1155121934Sharti *
1156121934Sharti * Additional ABR parameters
1157121934Sharti * ABR setup parameters
1158121934Sharti */
1159121934Shartienum {
1160121934Sharti	UNI_ABRADD_FADD_ID	= 0xc2,
1161121934Sharti	UNI_ABRADD_BADD_ID	= 0xc3,
1162121934Sharti	UNI_ABRSETUP_FICR_ID	= 0xc2,
1163121934Sharti	UNI_ABRSETUP_BICR_ID	= 0xc3,
1164121934Sharti	UNI_ABRSETUP_FTBE_ID	= 0xc4,
1165121934Sharti	UNI_ABRSETUP_BTBE_ID	= 0xc5,
1166121934Sharti	UNI_ABRSETUP_RMFRT_ID	= 0xc6,
1167121934Sharti	UNI_ABRSETUP_FRIF_ID	= 0xc8,
1168121934Sharti	UNI_ABRSETUP_BRIF_ID	= 0xc9,
1169121934Sharti	UNI_ABRSETUP_FRDF_ID	= 0xca,
1170121934Sharti	UNI_ABRSETUP_BRDF_ID	= 0xcb,
1171121934Sharti};
1172121934Sharti
1173121934Shartistruct uni_abr_rec {
1174121934Sharti	u_int			present;
1175121934Sharti#define UNI_ABR_REC_NRM_P	0x80000000
1176121934Sharti#define UNI_ABR_REC_TRM_P	0x40000000
1177121934Sharti#define UNI_ABR_REC_CDF_P	0x20000000
1178121934Sharti#define UNI_ABR_REC_ADTF_P	0x10000000
1179121934Sharti	u_int		nrm:3;
1180121934Sharti	u_int		trm:3;
1181121934Sharti	u_int		cdf:3;
1182121934Sharti	u_int		adtf:10;
1183121934Sharti};
1184121934Sharti
1185121934Shartistruct uni_ie_abradd {
1186121934Sharti	struct uni_iehdr	h;
1187121934Sharti	struct uni_abr_rec	fwd, bwd;
1188121934Sharti};
1189121934Sharti
1190121934Shartistruct uni_ie_abrsetup {
1191121934Sharti	struct uni_iehdr	h;
1192121934Sharti#define UNI_ABRSETUP_FICR_P	0x0001
1193121934Sharti#define UNI_ABRSETUP_BICR_P	0x0002
1194121934Sharti#define UNI_ABRSETUP_FTBE_P	0x0004
1195121934Sharti#define UNI_ABRSETUP_BTBE_P	0x0008
1196121934Sharti#define UNI_ABRSETUP_FRIF_P	0x0010
1197121934Sharti#define UNI_ABRSETUP_BRIF_P	0x0020
1198121934Sharti#define UNI_ABRSETUP_FRDF_P	0x0040
1199121934Sharti#define UNI_ABRSETUP_BRDF_P	0x0080
1200121934Sharti#define UNI_ABRSETUP_RMFRT_P	0x0100
1201121934Sharti
1202121934Sharti	u_int		ficr, bicr;
1203121934Sharti	u_int		ftbe, btbe;
1204121934Sharti	u_int		rmfrt;
1205121934Sharti	u_int		frif, brif;
1206121934Sharti	u_int		frdf, brdf;
1207121934Sharti};
1208121934Sharti
1209121934Sharti/*************************************************************************
1210121934Sharti *
1211121934Sharti * Connection scope information element
1212121934Sharti */
1213121934Shartienum uni_cscope {
1214121934Sharti	UNI_CSCOPE_ORG	= 0x01,
1215121934Sharti};
1216121934Sharti
1217121934Shartienum {
1218121934Sharti	UNI_CSCOPE_ORG_LOC	= 0x01,
1219121934Sharti	UNI_CSCOPE_ORG_LOC_P1	= 0x02,
1220121934Sharti	UNI_CSCOPE_ORG_LOC_P2	= 0x03,
1221121934Sharti	UNI_CSCOPE_ORG_SITE_M1	= 0x04,
1222121934Sharti	UNI_CSCOPE_ORG_SITE	= 0x05,
1223121934Sharti	UNI_CSCOPE_ORG_SITE_P1	= 0x06,
1224121934Sharti	UNI_CSCOPE_ORG_ORG_M1	= 0x07,
1225121934Sharti	UNI_CSCOPE_ORG_ORG	= 0x08,
1226121934Sharti	UNI_CSCOPE_ORG_ORG_P1	= 0x09,
1227121934Sharti	UNI_CSCOPE_ORG_COMM_M1	= 0x0a,
1228121934Sharti	UNI_CSCOPE_ORG_COMM	= 0x0b,
1229121934Sharti	UNI_CSCOPE_ORG_COMM_P1	= 0x0c,
1230121934Sharti	UNI_CSCOPE_ORG_REG	= 0x0d,
1231121934Sharti	UNI_CSCOPE_ORG_INTER	= 0x0e,
1232121934Sharti	UNI_CSCOPE_ORG_GLOBAL	= 0x0f,
1233121934Sharti};
1234121934Sharti
1235121934Shartistruct uni_ie_cscope {
1236121934Sharti	struct uni_iehdr	h;
1237121934Sharti	enum uni_cscope		type;
1238121934Sharti	u_int			scope:8;
1239121934Sharti};
1240121934Sharti
1241121934Sharti/*************************************************************************
1242121934Sharti *
1243121934Sharti * Connection scope information element
1244121934Sharti */
1245121934Shartienum uni_report {
1246121934Sharti	UNI_REPORT_MODCONF	= 0x01,
1247121934Sharti	UNI_REPORT_CLOCK	= 0x02,
1248121934Sharti	UNI_REPORT_EEAVAIL	= 0x04,
1249121934Sharti	UNI_REPORT_EEREQ	= 0x05,
1250121934Sharti	UNI_REPORT_EECOMPL	= 0x06,
1251121934Sharti};
1252121934Sharti
1253121934Shartistruct uni_ie_report {
1254121934Sharti	struct uni_iehdr h;
1255121934Sharti	enum uni_report	report;
1256121934Sharti};
1257121934Sharti
1258121934Sharti/*************************************************************************
1259121934Sharti *
1260121934Sharti * PNNI Designated transit list information element
1261121934Sharti */
1262121934Shartienum {
1263121934Sharti	UNI_DTL_LOGNP	= 0x01,
1264121934Sharti	UNI_DTL_LOGNP_SIZE = 27,
1265121934Sharti};
1266121934Sharti
1267121934Shartistruct uni_ie_dtl {
1268121934Sharti	struct uni_iehdr	h;
1269121934Sharti	u_int			ptr:16;
1270121934Sharti	u_int			num;
1271121934Sharti	struct {
1272121934Sharti	  u_char		node_level;
1273121934Sharti	  u_char		node_id[21];
1274121934Sharti	  u_int			port_id;
1275121934Sharti	}			dtl[UNI_DTL_MAXNUM];
1276121934Sharti};
1277121934Sharti
1278121934Sharti/*************************************************************************
1279121934Sharti *
1280121934Sharti * PNNI Crankback information element
1281121934Sharti */
1282121934Shartienum uni_crankback {
1283121934Sharti	UNI_CRANKBACK_IF	= 0x02,
1284121934Sharti	UNI_CRANKBACK_NODE	= 0x03,
1285121934Sharti	UNI_CRANKBACK_LINK	= 0x04,
1286121934Sharti};
1287121934Sharti
1288121934Shartienum {
1289121934Sharti	UNI_CAUSE_NXNODE_UNREACH = 128,
1290121934Sharti	UNI_CAUSE_DTL_NOT_MY_ID	= 160,
1291121934Sharti};
1292121934Sharti
1293121934Shartistruct uni_ie_crankback {
1294121934Sharti	struct uni_iehdr	h;
1295121934Sharti#define UNI_CRANKBACK_TOP_P	0x0001
1296121934Sharti#define UNI_CRANKBACK_TOPX_P	0x0002
1297121934Sharti#define UNI_CRANKBACK_QOS_P	0x0004
1298121934Sharti	u_int			level:8;
1299121934Sharti	enum uni_crankback	type;
1300121934Sharti	union {
1301121934Sharti	  struct {
1302121934Sharti	    u_char		level;
1303121934Sharti	    u_char		id[21];
1304121934Sharti	  }			node;
1305121934Sharti	  struct {
1306121934Sharti	    u_char		plevel;
1307121934Sharti	    u_char		pid[21];
1308121934Sharti	    u_int		port;
1309121934Sharti	    u_char		slevel;
1310121934Sharti	    u_char		sid[21];
1311121934Sharti	  }			link;
1312121934Sharti	}			id;
1313121934Sharti	u_int			cause:8;
1314121934Sharti	union {
1315121934Sharti	  struct {
1316121934Sharti	    u_int		dir:8;
1317121934Sharti	    u_int		port;
1318121934Sharti	    u_int		avcr;
1319121934Sharti	    u_int		crm;
1320121934Sharti	    u_int		vf;
1321121934Sharti	  }			top;
1322121934Sharti	  struct {
1323121934Sharti	    u_int		ctd:1;
1324121934Sharti	    u_int		cdv:1;
1325121934Sharti	    u_int		clr:1;
1326121934Sharti	    u_int		other:1;
1327121934Sharti	  }			qos;
1328121934Sharti	}			diag;
1329121934Sharti};
1330121934Sharti
1331121934Sharti/*************************************************************************
1332121934Sharti *
1333121934Sharti * PNNI Call_ing/called party soft PVPC/PVCC information element
1334121934Sharti */
1335121934Shartienum uni_soft_sel {
1336121934Sharti	UNI_SOFT_SEL_ANY	= 0x00,
1337121934Sharti	UNI_SOFT_SEL_REQ	= 0x02,
1338121934Sharti	UNI_SOFT_SEL_ASS	= 0x04,
1339121934Sharti};
1340121934Sharti
1341121934Shartistruct uni_ie_calling_soft {
1342121934Sharti	struct uni_iehdr h;
1343121934Sharti#define UNI_CALLING_SOFT_VCI_P	0x0001
1344121934Sharti	u_int		vpi:12;
1345121934Sharti	u_int		vci:16;
1346121934Sharti};
1347121934Shartistruct uni_ie_called_soft {
1348121934Sharti	struct uni_iehdr h;
1349121934Sharti#define UNI_CALLED_SOFT_VPI_P	0x0001
1350121934Sharti#define UNI_CALLED_SOFT_VCI_P	0x0002
1351121934Sharti	enum uni_soft_sel sel;
1352121934Sharti	u_int		vpi:12;
1353121934Sharti	u_int		vci:16;
1354121934Sharti};
1355121934Sharti
1356121934Sharti/*************************************************************************/
1357121934Sharti
1358121934Sharti#include <netnatm/msg/uni_ie.h>
1359121934Sharti#include <netnatm/msg/uni_msg.h>
1360121934Sharti
1361121934Shartistruct uni_all {
1362121934Sharti	enum uni_msgtype	mtype;
1363121934Sharti	union uni_msgall	u;
1364121934Sharti};
1365121934Sharti
1366121934Shartistruct uni_ie {
1367121934Sharti	enum uni_ietype		ietype;
1368121934Sharti	union uni_ieall		u;
1369121934Sharti};
1370121934Sharti
1371121934Sharti#endif
1372