Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-v150fw.c
blobe1109f6201432dcf77bdd76e76a3e296cea8121e
1 /* packet-v150fw.c
3 * v150fw = v.150.1 SSE messages, contained in RTP packets
5 * Written by Jamison Adcock <jamison.adcock@cobham.com>
6 * for Sparta Inc., dba Cobham Analytic Solutions
7 * This code is largely based on the RTP parsing code
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include "config.h"
19 #include <epan/packet.h>
20 #include <epan/tfs.h>
21 #include <wsutil/array.h>
23 void proto_register_v150fw(void);
25 /* Initialize the protocol & registered fields
26 * Look familiar? This is in the same format as an NTE (named telephone event) from RFC 2833:
28 static int proto_v150fw;
30 static int hf_v150fw_event_id; /* 6 bits */
31 static int hf_v150fw_force_response_bit;
32 static int hf_v150fw_extension_bit;
34 static int hf_v150fw_reason_id_code; /* value & string */
36 static int hf_v150fw_reason_id_code_info; /* 16 bits */
38 static int hf_v150fw_ric_info_mod_avail; /* ric = 1,2 */
39 static int hf_v150fw_cm_jm_mod_avail_pcm_mode;
40 static int hf_v150fw_cm_jm_mod_avail_v34_duplex;
41 static int hf_v150fw_cm_jm_mod_avail_v34_half_duplex;
42 static int hf_v150fw_cm_jm_mod_avail_v32_v32bis;
43 static int hf_v150fw_cm_jm_mod_avail_v22_v22bis;
44 static int hf_v150fw_cm_jm_mod_avail_v17;
45 static int hf_v150fw_cm_jm_mod_avail_v29_half_duplex;
46 static int hf_v150fw_cm_jm_mod_avail_v27ter;
47 static int hf_v150fw_cm_jm_mod_avail_v26ter;
48 static int hf_v150fw_cm_jm_mod_avail_v26bis;
49 static int hf_v150fw_cm_jm_mod_avail_v23_duplex;
50 static int hf_v150fw_cm_jm_mod_avail_v23_half_duplex;
51 static int hf_v150fw_cm_jm_mod_avail_v21;
52 static int hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog;
53 static int hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital;
54 static int hf_v150fw_cm_jm_mod_avail_v91;
56 static int hf_v150fw_ric_info_timeout; /* ric= 18 */
57 static int hf_v150fw_ric_info_timeout_vendor;
59 static int hf_v150fw_ric_info_cleardown; /* ric = 20 */
60 static int hf_v150fw_ric_info_cleardown_reserved;
61 static int hf_v150fw_ric_info_cleardown_vendor_tag; /* extension fields */
62 static int hf_v150fw_ric_info_cleardown_vendor_info;
64 static int hf_v150fw_reserved; /* 5 bits */
65 static int hf_v150fw_extension_len; /* 11 bits */
66 static int hf_v150fw_remainder;
68 /* initialize the subtree pointers */
69 static int ett_v150fw;
70 static int ett_available_modulations;
72 /* for some "range_string"s, there's only one value in the range */
73 #define V150FW_VALUE_RANGE(a) a,a
76 /* V.150.1 State Signalling Events (SSE): */
77 #define V150FW_EVENT_RESERVED1 0
78 #define V150FW_EVENT_INITIAL_AUDIO 1
79 #define V150FW_EVENT_VOICEBAND_DATA 2
80 #define V150FW_EVENT_MODEM_RELAY 3
81 #define V150FW_EVENT_FAX_RELAY 4
82 #define V150FW_EVENT_TEXT_RELAY 5
83 #define V150FW_EVENT_TEXT_PROBE 6 /* new in ITU-T Rec. V.150.1 (2003)/Amd.2 (05/2006) */
84 /* 7 - 31 reserved for future use */
85 #define V150FW_EVENT_RESERVED2_START 7
86 #define V150FW_EVENT_RESERVED2_END 31
87 /* 32 - 63 vendor-defined */
88 #define V150FW_EVENT_VENDOR_START 32
89 #define V150FW_EVENT_VENDOR_END 63
92 /* V.150.1 SSE reason ID codes: */
93 #define V150FW_RIC_NULL 0
94 #define V150FW_RIC_CM 1
95 #define V150FW_RIC_JM 2
96 #define V150FW_RIC_AA 3
97 #define V150FW_RIC_AC 4
98 #define V150FW_RIC_USB1 5
99 #define V150FW_RIC_SB1 6
100 #define V150FW_RIC_S1 7
101 #define V150FW_RIC_V21_CH2 8
102 #define V150FW_RIC_V21_CH1 9
103 #define V150FW_RIC_V23_HIGH_CHANNEL 10
104 #define V150FW_RIC_V23_LOW_CHANNEL 11
105 #define V150FW_RIC_TONE_2225_HZ 12
106 #define V150FW_RIC_V21_CH2_HDLC_FLAGS 13
107 #define V150FW_RIC_INDETERMINATE_SIGNAL 14
108 #define V150FW_RIC_SILENCE 15
109 #define V150FW_RIC_CNG 16
110 #define V150FW_RIC_VOICE 17
111 #define V150FW_RIC_TIMEOUT 18
112 #define V150FW_RIC_P_STATE_TRANS 19
113 #define V150FW_RIC_CLEARDOWN 20
114 #define V150FW_RIC_ANS_CED_2100_HZ 21
115 #define V150FW_RIC_ANSAM 22
116 #define V150FW_RIC_SLASH_ANS 23
117 #define V150FW_RIC_SLASH_ANSAM 24
118 #define V150FW_RIC_QC1A 25
119 #define V150FW_RIC_QC1D 26
120 #define V150FW_RIC_QC2A 27
121 #define V150FW_RIC_QC2D 28
122 #define V150FW_RIC_CRE 29
123 #define V150FW_RIC_CRD 30
124 /* new from ITU-T V.150.1 Amendment 1: */
125 #define V150FW_RIC_TIA_825A_45 31
126 #define V150FW_RIC_TIA_825A_50 32
127 #define V150FW_RIC_EDT 33
128 #define V150FW_RIC_BELL_103_MODEM 34
129 #define V150FW_RIC_V21_TEXT_PHONE_T50 35
130 #define V150FW_RIC_V23_TEXT_MINITEL 36
131 #define V150FW_RIC_V18_TEXT_PHONE_T140 37
132 #define V150FW_RIC_DTMF_BASED_TEXT_RELAY 38
133 #define V150FW_RIC_CTM 39
134 /* 40 - 127 reserved */
135 #define V150FW_RIC_RESERVED_START 40
136 #define V150FW_RIC_RESERVED_END 127
137 /* 128 - 255 for vendor use */
138 #define V150FW_RIC_VENDOR_START 128
139 #define V150FW_RIC_VENDOR_END 255
142 /* Timeout (V150FW_RIC_TIMEOUT) reason info: */
143 #define V150FW_RIC_INFO_TIMEOUT_NULL 0
144 #define V150FW_RIC_INFO_TIMEOUT_CALL_DISCRIMINATION_TIMEOUT 1
145 #define V150FW_RIC_INFO_TIMEOUT_IP_TLP_TIMEOUT 2
146 #define V150FW_RIC_INFO_TIMEOUT_SSE_EXPLICIT_ACK_TIMEOUT 3
149 /* Cleardown (V150FW_RIC_CLEARDOWN) reason info: */
150 #define V150FW_RIC_INFO_CLEARDOWN_UNKNOWN 0
151 #define V150FW_RIC_INFO_CLEARDOWN_PHYSICAL_LAYER_RELEASE 1
152 #define V150FW_RIC_INFO_CLEARDOWN_LINK_LAYER_DISCONNECT 2
153 #define V150FW_RIC_INFO_CLEARDOWN_DATA_COMPRESSION_DISCONNECT 3
154 #define V150FW_RIC_INFO_CLEARDOWN_ABORT 4
155 #define V150FW_RIC_INFO_CLEARDOWN_ON_HOOK 5
156 #define V150FW_RIC_INFO_CLEARDOWN_NETWORK_LAYER_TERMINATION 6
157 #define V150FW_RIC_INFO_CLEARDOWN_ADMINISTRATIVE 7
159 /* value strings & range strings */
160 static const range_string v150fw_event_id_name[] = {
161 { V150FW_VALUE_RANGE(V150FW_EVENT_RESERVED1), "Event ID reserved" },
162 { V150FW_VALUE_RANGE(V150FW_EVENT_INITIAL_AUDIO), "Initial audio" },
163 { V150FW_VALUE_RANGE(V150FW_EVENT_VOICEBAND_DATA), "Voice band data" },
164 { V150FW_VALUE_RANGE(V150FW_EVENT_MODEM_RELAY), "Modem relay" },
165 { V150FW_VALUE_RANGE(V150FW_EVENT_FAX_RELAY), "Fax relay" },
166 { V150FW_VALUE_RANGE(V150FW_EVENT_TEXT_RELAY), "Text relay" },
167 { V150FW_VALUE_RANGE(V150FW_EVENT_TEXT_PROBE), "Text probe" },
168 { V150FW_EVENT_RESERVED2_START, V150FW_EVENT_RESERVED2_END, "Reserved for ITU_T" },
169 { V150FW_EVENT_VENDOR_START, V150FW_EVENT_VENDOR_END, "Vendor-defined event" },
170 { 0, 0, NULL }
173 static const range_string v150fw_ric_name[] = {
174 { V150FW_VALUE_RANGE(V150FW_RIC_NULL), "None" },
175 { V150FW_VALUE_RANGE(V150FW_RIC_CM), "CM" },
176 { V150FW_VALUE_RANGE(V150FW_RIC_JM), "JM" },
177 { V150FW_VALUE_RANGE(V150FW_RIC_AA), "AA" },
178 { V150FW_VALUE_RANGE(V150FW_RIC_AC), "AC" },
179 { V150FW_VALUE_RANGE(V150FW_RIC_USB1), "USB1" },
180 { V150FW_VALUE_RANGE(V150FW_RIC_SB1), "SB1" },
181 { V150FW_VALUE_RANGE(V150FW_RIC_S1), "S1" },
182 { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH2), "V.21 Ch2" },
183 { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH1), "V.21 Ch1" },
184 { V150FW_VALUE_RANGE(V150FW_RIC_V23_HIGH_CHANNEL), "V.23 High Channel" },
185 { V150FW_VALUE_RANGE(V150FW_RIC_V23_LOW_CHANNEL), "V.23 Low Channel" },
186 { V150FW_VALUE_RANGE(V150FW_RIC_TONE_2225_HZ), "Tone (2225 Hz)" },
187 { V150FW_VALUE_RANGE(V150FW_RIC_V21_CH2_HDLC_FLAGS), "V.21 Ch2 HDLC Flags" },
188 { V150FW_VALUE_RANGE(V150FW_RIC_INDETERMINATE_SIGNAL), "Indeterminate signal" },
189 { V150FW_VALUE_RANGE(V150FW_RIC_SILENCE), "Silence" },
190 { V150FW_VALUE_RANGE(V150FW_RIC_CNG), "CNG" },
191 { V150FW_VALUE_RANGE(V150FW_RIC_VOICE), "Voice" },
192 { V150FW_VALUE_RANGE(V150FW_RIC_TIMEOUT), "Timeout" },
193 { V150FW_VALUE_RANGE(V150FW_RIC_P_STATE_TRANS), "p' State Transition" },
194 { V150FW_VALUE_RANGE(V150FW_RIC_CLEARDOWN), "Cleardown" },
195 { V150FW_VALUE_RANGE(V150FW_RIC_ANS_CED_2100_HZ), "ANS/CED (2100Hz)" },
196 { V150FW_VALUE_RANGE(V150FW_RIC_ANSAM), "ANSam" },
197 { V150FW_VALUE_RANGE(V150FW_RIC_SLASH_ANS), "/ANS" },
198 { V150FW_VALUE_RANGE(V150FW_RIC_SLASH_ANSAM), "/ANSam" },
199 { V150FW_VALUE_RANGE(V150FW_RIC_QC1A), "QC1a" },
200 { V150FW_VALUE_RANGE(V150FW_RIC_QC1D), "QC1d" },
201 { V150FW_VALUE_RANGE(V150FW_RIC_QC2A), "QC2a" },
202 { V150FW_VALUE_RANGE(V150FW_RIC_QC2D), "QC2d" },
203 { V150FW_VALUE_RANGE(V150FW_RIC_CRE), "Cre" },
204 { V150FW_VALUE_RANGE(V150FW_RIC_CRD), "CRd" },
205 { V150FW_VALUE_RANGE(V150FW_RIC_TIA_825A_45), "TIA-825A (45.45 bit/s)" },
206 { V150FW_VALUE_RANGE(V150FW_RIC_TIA_825A_50), "TIA-825A (50 bit/s)" },
207 { V150FW_VALUE_RANGE(V150FW_RIC_EDT), "EDT (European Deaf Telephone)" },
208 { V150FW_VALUE_RANGE(V150FW_RIC_BELL_103_MODEM), "Bell 103 Modem" },
209 { V150FW_VALUE_RANGE(V150FW_RIC_V21_TEXT_PHONE_T50), "V.21 text telephone, T-50 encoding" },
210 { V150FW_VALUE_RANGE(V150FW_RIC_V23_TEXT_MINITEL), "V.23 text (Minitel)" },
211 { V150FW_VALUE_RANGE(V150FW_RIC_V18_TEXT_PHONE_T140), "V.18 text telephone, T-140 encoding" },
212 { V150FW_VALUE_RANGE(V150FW_RIC_DTMF_BASED_TEXT_RELAY), "DTMF based Text Relay (Annex B/V.18)" },
213 { V150FW_VALUE_RANGE(V150FW_RIC_CTM), "CTM" },
214 { V150FW_RIC_RESERVED_START, V150FW_RIC_RESERVED_END, "Reserved for use by ITU-T" },
215 { V150FW_RIC_VENDOR_START, V150FW_RIC_VENDOR_END, "For use by vendor" },
216 { 0, 0, NULL }
219 static const value_string v150fw_ric_info_timeout_type[] = {
220 { V150FW_RIC_INFO_TIMEOUT_NULL, "Null" },
221 { V150FW_RIC_INFO_TIMEOUT_CALL_DISCRIMINATION_TIMEOUT, "Call discrimination timeout" },
222 { V150FW_RIC_INFO_TIMEOUT_IP_TLP_TIMEOUT, "IP TLP timeout" },
223 { V150FW_RIC_INFO_TIMEOUT_SSE_EXPLICIT_ACK_TIMEOUT, "Explicit acknowledgement timeout" },
224 { 0, NULL }
227 static const value_string v150fw_ric_info_cleardown_type[] = {
228 { V150FW_RIC_INFO_CLEARDOWN_UNKNOWN, "Unknown/unspecified" },
229 { V150FW_RIC_INFO_CLEARDOWN_PHYSICAL_LAYER_RELEASE, "Physical layer release" },
230 { V150FW_RIC_INFO_CLEARDOWN_LINK_LAYER_DISCONNECT, "Link layer disconnect" },
231 { V150FW_RIC_INFO_CLEARDOWN_DATA_COMPRESSION_DISCONNECT, "Data compression disconnect" },
232 { V150FW_RIC_INFO_CLEARDOWN_ABORT, "Abort" },
233 { V150FW_RIC_INFO_CLEARDOWN_ON_HOOK, "On hook" },
234 { V150FW_RIC_INFO_CLEARDOWN_NETWORK_LAYER_TERMINATION, "Network layer termination" },
235 { V150FW_RIC_INFO_CLEARDOWN_ADMINISTRATIVE, "Administrative" },
236 { 0, NULL }
240 #if 0 /* XXX: The following doesn't actually dissect anything. Is dissect_v150fw() supposed to be called ? */
241 static bool
242 dissect_v150fw_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_)
244 uint8_t octet1;
245 uint8_t extb, ric;
246 uint16_t ric_info;
247 int payload_length = tvb_captured_length(tvb);
248 unsigned int offset = 0;
250 /* see appendix C (State Signalling Events) in ITU-T Rec. V.150.1 for details */
252 /* Get the fields */
253 octet1 = tvb_get_uint8(tvb, offset);
254 extb = octet1 & 0x01;
255 ric = tvb_get_uint8(tvb, offset + 1) & 0xFF;
257 ric_info = tvb_get_ntohs(tvb, offset + 2);
259 /* minimum lengths */
260 if(!extb && payload_length <= 4) /* extb is not set, so minimum length is 4 bytes */
261 return false;
262 if(extb && payload_length <= 6) /* ext bit is set, but no extension found? */
263 return false;
265 if(ric == 0 || (ric >= 6 && ric <= 31)) /* values reserved for future use */
266 return false;
268 switch(ric)
270 case 0:
271 if(ric_info != 0) /* ric_info must be NULL if ric is NULL */
272 return false;
273 case V150FW_RIC_CM:
274 case V150FW_RIC_JM:
275 if(!extb && payload_length > 4) /* payload too long */
276 return false;
277 break;
278 case V150FW_RIC_TIMEOUT:
279 case V150FW_RIC_CLEARDOWN:
280 break;
281 default:
282 if(ric < 31 && ric_info != 0) /* ric_info is zero unless ric is CM, JM, TIMEOUT ro CLEARDOWN */
283 return false;
284 if(ric >= 31 && ric <= 127) /* 31 - 127 are reserved for future use */
285 return false;
286 /* 128 - 255 are vendor-specific */
287 break;
290 return true;
292 #endif
294 static int
295 dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
297 /* Set up structures needed to add the protocol subtree and manage it */
298 proto_item *ti;
299 proto_tree *v150fw_tree, *field_tree;
300 uint8_t extb, ric;
301 int payload_length;
302 unsigned int offset = 0;
304 if(tree)
306 /* create the trees */
307 ti = proto_tree_add_item(tree, proto_v150fw, tvb, 0, -1, ENC_NA);
308 v150fw_tree = proto_item_add_subtree(ti, ett_v150fw);
310 payload_length = tvb_reported_length(tvb);
312 /* Get fields needed for further dissection */
313 extb = tvb_get_uint8(tvb, offset) & 0x01; /* extension bit */
314 ric = tvb_get_uint8(tvb, offset + 1);
316 proto_tree_add_item(v150fw_tree, hf_v150fw_event_id, tvb, offset, 1, ENC_BIG_ENDIAN);
317 proto_tree_add_item(v150fw_tree, hf_v150fw_force_response_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
318 proto_tree_add_item(v150fw_tree, hf_v150fw_extension_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
319 offset++;
321 proto_tree_add_item(v150fw_tree, hf_v150fw_reason_id_code, tvb, offset, 1, ENC_BIG_ENDIAN);
322 offset++;
324 /* reason identifier code information */
325 switch(ric)
327 case V150FW_RIC_CM:
328 case V150FW_RIC_JM:
329 ti = proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_mod_avail, tvb, offset, 2, ENC_BIG_ENDIAN);
330 field_tree = proto_item_add_subtree(ti, ett_available_modulations);
331 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_pcm_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
332 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v34_duplex, tvb, offset, 2, ENC_BIG_ENDIAN);
333 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v34_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN);
334 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v32_v32bis, tvb, offset, 2, ENC_BIG_ENDIAN);
335 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v22_v22bis, tvb, offset, 2, ENC_BIG_ENDIAN);
336 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v17, tvb, offset, 2, ENC_BIG_ENDIAN);
337 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v29_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN);
338 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v27ter, tvb, offset, 2, ENC_BIG_ENDIAN);
339 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v26ter, tvb, offset, 2, ENC_BIG_ENDIAN);
340 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v26bis, tvb, offset, 2, ENC_BIG_ENDIAN);
341 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v23_duplex, tvb, offset, 2, ENC_BIG_ENDIAN);
342 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v23_half_duplex, tvb, offset, 2, ENC_BIG_ENDIAN);
343 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v21, tvb, offset, 2, ENC_BIG_ENDIAN);
344 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog, tvb, offset, 2, ENC_BIG_ENDIAN);
345 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital, tvb, offset, 2, ENC_BIG_ENDIAN);
346 proto_tree_add_item(field_tree, hf_v150fw_cm_jm_mod_avail_v91, tvb, offset, 2, ENC_BIG_ENDIAN);
347 break;
348 case V150FW_RIC_TIMEOUT:
349 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_timeout, tvb, offset, 1, ENC_BIG_ENDIAN);
350 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_timeout_vendor, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
351 break;
352 case V150FW_RIC_CLEARDOWN:
353 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown, tvb, offset, 1, ENC_BIG_ENDIAN);
354 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_reserved, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
355 break;
356 default:
357 proto_tree_add_item(v150fw_tree, hf_v150fw_reason_id_code_info, tvb, offset, 2, ENC_BIG_ENDIAN);
358 break;
359 } /* switch(ric) */
360 offset += 2;
362 if(extb && payload_length >= 6) /* display optional extension fields */
364 proto_tree_add_item(v150fw_tree, hf_v150fw_reserved, tvb, offset, 2, ENC_BIG_ENDIAN);
365 /* TODO ext field len doesn't match actual len (ext_len != (payload_length - 6)),
366 * that isn't illegal, but is perhaps worth noting */
367 proto_tree_add_item(v150fw_tree, hf_v150fw_extension_len, tvb, offset, 2, ENC_BIG_ENDIAN);
368 offset += 2;
370 /* display optional extension fields */
371 switch(ric) {
372 case V150FW_RIC_CLEARDOWN: /* show vendor tag & vendor-specific info */
373 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_vendor_tag, tvb, offset, 1, ENC_BIG_ENDIAN);
374 proto_tree_add_item(v150fw_tree, hf_v150fw_ric_info_cleardown_vendor_info, tvb, offset+1, 1, ENC_BIG_ENDIAN);
375 break;
376 default:
377 /* just dump the bytes for now */
378 proto_tree_add_item(v150fw_tree, hf_v150fw_remainder, tvb, offset, (payload_length - 6), ENC_NA);
379 break;
384 return tvb_captured_length(tvb);
387 void
388 proto_register_v150fw(void)
390 /* set up header fields */
391 static hf_register_info hf[] =
394 &hf_v150fw_event_id,
396 "Event ID",
397 "v150fw.event",
398 FT_UINT8,
399 BASE_DEC | BASE_RANGE_STRING,
400 RVALS(v150fw_event_id_name),
401 0xFC,
402 NULL, HFILL
406 &hf_v150fw_force_response_bit,
408 "Force response",
409 "v150fw.frb",
410 FT_BOOLEAN,
412 TFS(&tfs_yes_no),
413 0x02,
414 NULL, HFILL
418 &hf_v150fw_extension_bit,
420 "Payload extension",
421 "v150fw.extb",
422 FT_BOOLEAN,
424 TFS(&tfs_present_absent),
425 0x01,
426 NULL, HFILL
430 &hf_v150fw_reason_id_code, /* ric value + string */
432 "Reason ID",
433 "v150fw.ric",
434 FT_UINT8,
435 BASE_DEC | BASE_RANGE_STRING,
436 RVALS(v150fw_ric_name),
437 0x0,
438 NULL, HFILL
442 &hf_v150fw_reason_id_code_info,
444 "Info",
445 "v150fw.ricinfo",
446 FT_UINT16,
447 BASE_HEX,
448 NULL,
449 0x0,
450 NULL, HFILL
454 &hf_v150fw_ric_info_timeout,
456 "Timeout type",
457 "v150fw.ricinfo.timeout",
458 FT_UINT16,
459 BASE_HEX,
460 VALS(v150fw_ric_info_timeout_type),
461 0xFF00,
462 NULL, HFILL
466 &hf_v150fw_ric_info_timeout_vendor,
468 "Vendor-specific timeout info",
469 "v150fw.ricinfo.timeout_vendor",
470 FT_UINT16,
471 BASE_HEX,
472 NULL,
473 0x00FF,
474 NULL, HFILL
478 &hf_v150fw_ric_info_cleardown,
480 "Cleardown type",
481 "v150fw.ricinfo.cleardown",
482 FT_UINT16,
483 BASE_HEX,
484 VALS(v150fw_ric_info_cleardown_type),
485 0xFF00,
486 NULL, HFILL
490 &hf_v150fw_ric_info_cleardown_reserved,
492 "Reserved for use by the ITU-T",
493 "v150fw.ricinfo.cleardown_reserved",
494 FT_UINT16,
495 BASE_HEX,
496 NULL,
497 0x00FF,
498 NULL, HFILL
502 &hf_v150fw_ric_info_cleardown_vendor_tag,
504 "Vendor tag",
505 "v150fw.cleardown_vendor_tag",
506 FT_UINT8,
507 BASE_HEX,
508 NULL,
509 0x0,
510 NULL, HFILL
514 &hf_v150fw_ric_info_cleardown_vendor_info,
516 "Vendor-specific info",
517 "v150fw.cleardown_vendor_info",
518 FT_UINT8,
519 BASE_HEX,
520 NULL,
521 0x0,
522 NULL, HFILL
526 &hf_v150fw_ric_info_mod_avail,
528 "Modulation availability",
529 "v150fw.rinfo.mod_avail",
530 FT_UINT16,
531 BASE_HEX,
532 NULL,
533 0x0,
534 NULL, HFILL
538 &hf_v150fw_cm_jm_mod_avail_pcm_mode,
540 "PCM mode",
541 "v150fw.rinfo.mod_avail.pcm_mode",
542 FT_BOOLEAN,
544 TFS(&tfs_available_not_available),
545 0x8000,
546 NULL, HFILL
550 &hf_v150fw_cm_jm_mod_avail_v34_duplex,
552 "V.34 duplex",
553 "v150fw.rinfo.mod_avail.v34_duplex",
554 FT_BOOLEAN,
556 TFS(&tfs_available_not_available),
557 0x4000,
558 NULL, HFILL
562 &hf_v150fw_cm_jm_mod_avail_v34_half_duplex,
564 "V.34 half-duplex",
565 "v150fw.rinfo.mod_avail.v34_half_duplex",
566 FT_BOOLEAN,
568 TFS(&tfs_available_not_available),
569 0x2000,
570 NULL, HFILL
574 &hf_v150fw_cm_jm_mod_avail_v32_v32bis,
576 "V.32/V.32bis",
577 "v150fw.rinfo.mod_avail.v32_v32bis",
578 FT_BOOLEAN,
580 TFS(&tfs_available_not_available),
581 0x1000,
582 NULL, HFILL
586 &hf_v150fw_cm_jm_mod_avail_v22_v22bis,
588 "V.22/V.22bis",
589 "v150fw.rinfo.mod_avail.v22_v22bis",
590 FT_BOOLEAN,
592 TFS(&tfs_available_not_available),
593 0x0800,
594 NULL, HFILL
598 &hf_v150fw_cm_jm_mod_avail_v17,
600 "V.17",
601 "v150fw.rinfo.mod_avail.v17",
602 FT_BOOLEAN,
604 TFS(&tfs_available_not_available),
605 0x0400,
606 NULL, HFILL
610 &hf_v150fw_cm_jm_mod_avail_v29_half_duplex,
612 "V.29 half-duplex",
613 "v150fw.rinfo.mod_avail.v29_half_duplex",
614 FT_BOOLEAN,
616 TFS(&tfs_available_not_available),
617 0x0200,
618 NULL, HFILL
622 &hf_v150fw_cm_jm_mod_avail_v27ter,
624 "V.27ter",
625 "v150fw.rinfo.mod_avail.v27ter",
626 FT_BOOLEAN,
628 TFS(&tfs_available_not_available),
629 0x0100,
630 NULL, HFILL
634 &hf_v150fw_cm_jm_mod_avail_v26ter,
636 "V.26ter",
637 "v150fw.rinfo.mod_avail.v26ter",
638 FT_BOOLEAN,
640 TFS(&tfs_available_not_available),
641 0x0080,
642 NULL, HFILL
646 &hf_v150fw_cm_jm_mod_avail_v26bis,
648 "V.26bis",
649 "v150fw.rinfo.mod_avail.v26bis",
650 FT_BOOLEAN,
652 TFS(&tfs_available_not_available),
653 0x0040,
654 NULL, HFILL
658 &hf_v150fw_cm_jm_mod_avail_v23_duplex,
660 "V.23 duplex",
661 "v150fw.rinfo.mod_avail.v23_duplex",
662 FT_BOOLEAN,
664 TFS(&tfs_available_not_available),
665 0x0020,
666 NULL, HFILL
670 &hf_v150fw_cm_jm_mod_avail_v23_half_duplex,
672 "V.23 half-duplex",
673 "v150fw.rinfo.mod_avail.half_duplex",
674 FT_BOOLEAN,
676 TFS(&tfs_available_not_available),
677 0x0010,
678 NULL, HFILL
682 &hf_v150fw_cm_jm_mod_avail_v21,
684 "V.21",
685 "v150fw.rinfo.mod_avail.v21",
686 FT_BOOLEAN,
688 TFS(&tfs_available_not_available),
689 0x0008,
690 NULL, HFILL
694 &hf_v150fw_cm_jm_mod_avail_v90_or_v92_analog,
696 "V.90 or V.92 analog",
697 "v150fw.rinfo.mod_avail.v90_or_v92_analog",
698 FT_BOOLEAN,
700 TFS(&tfs_available_not_available),
701 0x0004,
702 NULL, HFILL
706 &hf_v150fw_cm_jm_mod_avail_v90_or_v92_digital,
708 "V.90 or V.92 digital",
709 "v150fw.rinfo.mod_avail.v90_or_v92_digital",
710 FT_BOOLEAN,
712 TFS(&tfs_available_not_available),
713 0x0002,
714 NULL, HFILL
718 &hf_v150fw_cm_jm_mod_avail_v91,
720 "V.91",
721 "v150fw.rinfo.mod_avail.v91",
722 FT_BOOLEAN,
724 TFS(&tfs_available_not_available),
725 0x0001,
726 NULL, HFILL
730 &hf_v150fw_reserved,
732 "Reserved",
733 "v150fw.reserved",
734 FT_UINT16,
735 BASE_HEX,
736 NULL,
737 0xF800,
738 NULL, HFILL
742 &hf_v150fw_extension_len,
744 "Extension field length",
745 "v150fw.eflen",
746 FT_UINT16,
747 BASE_DEC,
748 NULL,
749 0x07FF,
750 NULL, HFILL
753 /* dump remaining bytes: */
755 &hf_v150fw_remainder,
757 "Remaining bytes",
758 "v150fw.remainder",
759 FT_BYTES,
760 BASE_NONE,
761 NULL,
762 0x0,
763 NULL, HFILL
766 }; /* hf_register_info hf[] */
768 /* setup protocol subtree array */
769 static int *ett[] = {
770 &ett_v150fw,
771 &ett_available_modulations
774 /* register protocol name & description */
775 proto_v150fw = proto_register_protocol("V.150.1 State Signaling Event", "V.150.1 SSE", "v150fw");
777 /* required function calls to register the header fields and subtrees used */
778 proto_register_field_array(proto_v150fw, hf, array_length(hf));
779 proto_register_subtree_array(ett, array_length(ett));
781 /* register the dissector */
782 register_dissector("v150fw", dissect_v150fw, proto_v150fw);
786 * Editor modelines - https://www.wireshark.org/tools/modelines.html
788 * Local variables:
789 * c-basic-offset: 4
790 * tab-width: 8
791 * indent-tabs-mode: nil
792 * End:
794 * vi: set shiftwidth=4 tabstop=8 expandtab:
795 * :indentSize=4:tabSize=8:noTabs=true: