update plugin docs
[l2tpns.git] / constants.c
1 // L2TPNS: constants
2
3 char const *cvs_id_constants = "$Id: constants.c,v 1.6 2005/06/28 14:48:20 bodea Exp $";
4
5 #include <stdio.h>
6 #include "constants.h"
7
8 #define CONSTANT(table, ...) \
9 static char const *table ## s[] = { \
10 __VA_ARGS__ \
11 }; \
12 char const *table(int index) \
13 { \
14 static char n[16]; \
15 if (index >= 0 && index < sizeof(table ## s) / sizeof(table ## s[0]) \
16 && table ## s[index]) \
17 return table ## s[index]; \
18 snprintf(n, sizeof(n), "%d", index); \
19 return n; \
20 }
21
22 CONSTANT(lcp_type,
23 0, // 0
24 "Maximum-Receive-Unit", // 1
25 "Async-Control-Map", // 2
26 "Authentication-Protocol", // 3
27 "Quality-Protocol", // 4
28 "Magic-Number", // 5
29 0, // 6
30 "Protocol-Field-Compression", // 7
31 "Address-and-Control-Field-Compression" // 8
32 )
33
34 CONSTANT(avp_name,
35 "Message Type", // 0
36 "Result Code", // 1
37 "Protocol Version", // 2
38 "Framing Capabilities", // 3
39 "Bearer Capabilities", // 4
40 "Tie Breaker", // 5
41 "Firmware Revision", // 6
42 "Host Name", // 7
43 "Vendor Name", // 8
44 "Assigned Tunnel ID", // 9
45 "Receive Window Size", // 10
46 "Challenge", // 11
47 "Q.931 Cause Code", // 12
48 "Challenge Response", // 13
49 "Assigned Session ID", // 14
50 "Call Serial Number", // 15
51 "Minimum BPS", // 16
52 "Maximum BPS", // 17
53 "Bearer Type", // 18 (2 = Analog, 1 = Digital)
54 "Framing Type", // 19 (2 = Async, 1 = Sync)
55 0, // 20
56 "Called Number", // 21
57 "Calling Number", // 22
58 "Sub Address", // 23
59 "Tx Connect Speed", // 24
60 "Physical Channel ID", // 25
61 "Initial Received LCP CONFREQ", // 26
62 "Last Sent LCP CONFREQ", // 27
63 "Last Received LCP CONFREQ", // 28
64 "Proxy Authen Type", // 29
65 "Proxy Authen Name", // 30
66 "Proxy Authen Challenge", // 31
67 "Proxy Authen ID", // 32
68 "Proxy Authen Response", // 33
69 "Call Errors", // 34
70 "ACCM", // 35
71 "Random Vector", // 36
72 "Private Group ID", // 37
73 "Rx Connect Speed", // 38
74 "Sequencing Required" // 39
75 )
76
77 CONSTANT(stopccn_result_code,
78 0, // 0
79 "General request to clear control connection", // 1
80 "General error--Error Code indicates the problem", // 2
81 "Control channel already exists", // 3
82 "Requester is not authorized to establish a"
83 " control channel", // 4
84 "The protocol version of the requester is not"
85 " supported", // 5
86 "Requester is being shut down", // 6
87 "Finite State Machine error" // 7
88 )
89
90 CONSTANT(cdn_result_code,
91 0, // 0
92 "Call disconnected due to loss of carrier", // 1
93 "Call disconnected for the reason indicated in"
94 " error code", // 2
95 "Call disconnected for administrative reasons", // 3
96 "Call failed due to lack of appropriate facilities"
97 " being available (temporary condition)", // 4
98 "Call failed due to lack of appropriate facilities"
99 " being available (permanent condition)", // 5
100 "Invalid destination", // 6
101 "Call failed due to no carrier detected", // 7
102 "Call failed due to detection of a busy signal", // 8
103 "Call failed due to lack of a dial tone", // 9
104 "Call was not established within time allotted by"
105 " LAC", // 10
106 "Call was connected but no appropriate framing was"
107 " detected" // 11
108 )
109
110 CONSTANT(error_code,
111 "No general error", // 0
112 "No control connection exists yet for this LAC-LNS"
113 " pair", // 1
114 "Length is wrong", // 2
115 "One of the field values was out of range or"
116 " reserved field was non-zero", // 3
117 "Insufficient resources to handle this operation"
118 " now", // 4
119 "The Session ID is invalid in this context", // 5
120 "A generic vendor-specific error occurred in the"
121 " LAC", // 6
122 "Try another LNS", // 7
123 "Session or tunnel was shutdown due to receipt of"
124 " an unknown AVP with the M-bit set" // 8
125 )
126
127 CONSTANT(auth_type,
128 0, // 0
129 "Textual username/password exchange", // 1
130 "PPP CHAP", // 2
131 "PPP PAP", // 3
132 "No Authentication", // 4
133 "Microsoft CHAP Version 1 (MSCHAPv1)" // 5
134 )
135
136 CONSTANT(ppp_lcp_type,
137 0, // 0
138 "ConfigReq", // 1
139 "ConfigAck", // 2
140 "ConfigNak", // 3
141 "ConfigRej", // 4
142 "TerminateReq", // 5
143 "TerminateAck", // 6
144 "CodeRej", // 7
145 "ProtocolRej", // 8
146 "EchoReq", // 9
147 "EchoReply", // 10
148 "DiscardRequest", // 11
149 "IdentRequest" // 12
150 )
151
152 CONSTANT(radius_state,
153 "RADIUSNULL", // 0
154 "RADIUSCHAP", // 1
155 "RADIUSAUTH", // 2
156 "RADIUSIPCP", // 3
157 "RADIUSSTART", // 4
158 "RADIUSSTOP", // 5
159 "RADIUSINTERIM", // 6
160 "RADIUSWAIT" // 7
161 )
162
163 CONSTANT(radius_code,
164 0, // 0
165 "Access-Request", // 1
166 "Access-Accept", // 2
167 "Access-Reject", // 3
168 "Accounting-Request", // 4
169 "Accounting-Response", // 5
170 0, // 6
171 0, // 7
172 0, // 8
173 0, // 9
174 0, // 10
175 "Access-Challenge", // 11
176 "Status-Server", // 12
177 "Status-Client", // 13
178 0, 0, 0, 0, 0, 0, // 14-19
179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20-29
180 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 30-39
181 "Disconnect-Request", // 40
182 "Disconnect-ACK", // 41
183 "Disconnect-NAK", // 42
184 "CoA-Request", // 43
185 "CoA-ACK", // 44
186 "CoA-NAK" // 45
187 )
188
189 CONSTANT(l2tp_message_type,
190 0, // 0
191 "SCCRQ", // 1
192 "SCCRP", // 2
193 "SCCCN", // 3
194 "StopCCN", // 4
195 0, // 5
196 "HELLO", // 6
197 "OCRQ", // 7
198 "OCRP", // 8
199 "OCCN", // 9
200 "ICRQ", // 10
201 "ICRP", // 11
202 "ICCN", // 12
203 0, // 13
204 "CDN", // 14
205 "WEN", // 15
206 "SLI" // 16
207 )