]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sys/i4b/layer3/i4b_q931.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sys / i4b / layer3 / i4b_q931.h
1 /*-
2  * Copyright (c) 1997, 2002 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  */
25
26 /*---------------------------------------------------------------------------
27  *
28  *      i4b_q931.h - Q931 handling header file
29  *      --------------------------------------
30  *
31  * $FreeBSD$
32  *
33  *      last edit-date: [Tue Mar 26 15:04:33 2002]
34  *
35  *---------------------------------------------------------------------------*/
36
37 #ifndef _I4B_Q931_H_
38 #define _I4B_Q931_H_
39
40 /* extension bit */
41
42 #define EXT_LAST                0x80    /* last octett */
43
44 /* reserve space in mbuf */
45
46 #define I_FRAME_HDRLEN          4       /* to be added by layer 2 */
47
48 /* SHIFT */
49
50 #define CODESET_MASK            0x07
51 #define UNSHIFTED               0
52 #define SHIFTED                 1
53 #define CRLENGTH_MASK           0x0f
54
55 /* CONNECT */
56
57 #define MSG_CONNECT_LEN         4       /* length of a connect message */
58
59 /* DISCONNECT */
60
61 #define MSG_DISCONNECT_LEN      8       /* length of a disconnect message */
62
63 /* RELEASE COMPLETE */
64
65 #define MSG_RELEASE_COMPLETE_LEN 8      /* length of release complete msg */
66
67 /* for outgoing causes */
68
69 #define CAUSE_LEN               2
70 #define CAUSE_STD_LOC_OUT       0x80    /* std = CCITT, loc = user */
71
72 /* SETUP */
73
74 #define MSG_SETUP_LEN           12      /* without called party,        */
75                                         /*      calling party and       */
76                                         /*      keypad facility !       */
77
78 #define IEI_BEARERCAP_LEN       2       /* 2 octetts length */
79
80 #define IT_CAP_SPEECH           0x80    /* BC: information xfer capability */
81 #define IT_CAP_UNR_DIG_INFO     0x88    /* BC: information xfer capability */
82
83 #define IT_RATE_64K             0x90    /* BC: information xfer rate    */
84 #define IT_UL1_G711A            0xa3    /* layer1 proto G.711 A-law     */
85
86 #define IEI_CHANNELID_LEN       0x01    /* length of channel id         */
87 #define CHANNELID_B1            0x81    /* channel = B1 (outgoing)      */
88 #define CHANNELID_B2            0x82    /* channel = B2 (outgoing)      */
89 #define CHANNELID_ANY           0x83    /* channel = any channel (outgoing) */
90
91 #define IE_CHAN_ID_NO           0x00    /* no channel (incoming)        */
92 #define IE_CHAN_ID_B1           0x01    /* B1 channel (incoming)        */
93 #define IE_CHAN_ID_B2           0x02    /* B2 channel (incoming)        */
94 #define IE_CHAN_ID_ANY          0x03    /* ANY channel (incoming)       */
95
96 #define NUMBER_TYPEPLAN         0x81    /* type of number/numbering plan */
97
98 #define IEI_CALLINGPN_LEN       1       /* without number string !      */
99 #define IEI_CALLEDPN_LEN        1       /* without number string !      */
100
101 #define IEI_CALLINGPS_LEN       1
102 #define IEI_CALLEDPS_LEN        1
103
104 #define SUBADDR_TYPE_NSAP       0x80    /* subaddr: type=NSAP           */
105
106 /* CONNECT_ACK */
107
108 #define MSG_CONNECT_ACK_LEN     4       /* length of a connect ack message */
109
110 /* STATUS */
111
112 #define MSG_STATUS_LEN          11
113 #define CALLSTATE_LEN           1
114
115 /* RELEASE */
116
117 #define MSG_RELEASE_LEN         8       /* length of release msg */
118
119 /* ALERT */
120
121 #define MSG_ALERT_LEN           4       /* length of an alert message */
122
123 #endif /* _I4B_Q931_H_ */
124
125 /* EOF */