2 * Routines for Vendor Specific Encodings dissection
3 * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
13 /* Notes to Adding dissectors for Vendor specific TLVs:
14 * 1. Create a dissect_<vendorname> function with the following prototype:
15 * dissect_foovendor(tvbuff_t *tvb, proto_tree *tree, int vsif_len)
16 * 2. vsif_len will be the *entire* length of the vsif TLV (including the
17 * Vendor ID TLV, which is 5 bytes long).
18 * 3. Create a new 'case' statement in dissect_vsif, for your specific Vendor
20 * 4. In that 'case' statement you will make the following calls:
21 * (assume for this example that your vendor ID is 0x000054)
22 * #define VENDOR_FOOVENDOR 0x00054
23 * case VENDOR_FOOVENDOR:
24 * proto_item_append_text (it, " (foo vendor)");
25 * dissect_foovendor (tvb, vsif_tree, vsif_len);
27 * 5. Please see dissect_cisco for an example of how to do this.
32 #include <epan/packet.h>
33 #include <epan/expert.h>
35 /* Define Vendor ID's here */
36 #define VENDOR_CISCO 0x00000C
37 #define VENDOR_GENERAL 0xFFFFFF
39 void proto_register_docsis_vsif(void);
40 void proto_reg_handoff_docsis_vsif(void);
42 /* Initialize the protocol and registered fields */
43 static int proto_docsis_vsif
;
44 static int hf_docsis_vsif_vendorid
;
45 static int hf_docsis_vsif_vendor_unknown
;
46 static int hf_docsis_vsif_cisco_numphones
;
47 /* static int hf_docsis_vsif_cisco_ipprec; */
48 static int hf_docsis_vsif_cisco_ipprec_val
;
49 static int hf_docsis_vsif_cisco_ipprec_bw
;
50 static int hf_docsis_vsif_cisco_config_file
;
52 static int hf_docsis_vsif_gex_loadbal_policy_id
;
53 static int hf_docsis_vsif_gex_loadbal_priority
;
54 static int hf_docsis_vsif_gex_loadbal_group_id
;
55 static int hf_docsis_vsif_gex_ranging_class_id_extension
;
56 static int hf_docsis_vsif_gex_l2vpn_encoding
;
57 static int hf_docsis_vsif_gex_ecm
;
58 static int hf_docsis_vsif_gex_sav
;
59 static int hf_docsis_vsif_gex_cmam
;
60 static int hf_docsis_vsif_gex_imja
;
61 static int hf_docsis_vsif_gex_service_type_identifier
;
63 static int hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type
;
64 static int hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap
;
65 static int hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype
;
67 static int hf_docsis_vsif_gex_sav_group_name
;
68 static int hf_docsis_vsif_gex_sav_static_prefix_rule
;
70 static int hf_docsis_vsif_gex_sav_static_prefix_addressv4
;
71 static int hf_docsis_vsif_gex_sav_static_prefix_addressv6
;
72 static int hf_docsis_vsif_gex_sav_static_prefix_length
;
74 static int hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask
;
75 static int hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask
;
76 static int hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask
;
77 static int hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask
;
79 static int hf_docsis_vsif_gex_imja_ip_multicast_profile_name
;
80 static int hf_docsis_vsif_gex_imja_ssr
;
81 static int hf_docsis_vsif_gex_imja_maximum_multicast_sessions
;
83 static int hf_docsis_vsif_gex_imja_ssr_rule_priority
;
84 static int hf_docsis_vsif_gex_imja_ssr_authorization_action
;
85 static int hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4
;
86 static int hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6
;
87 static int hf_docsis_vsif_gex_imja_ssr_source_prefix_length
;
88 static int hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4
;
89 static int hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6
;
90 static int hf_docsis_vsif_gex_imja_ssr_group_prefix_length
;
92 static int hf_docsis_vsif_tlv_unknown
;
95 /* Initialize the subtree pointers */
96 static int ett_docsis_vsif
;
97 static int ett_docsis_vsif_ipprec
;
98 static int ett_docsis_vsif_gex_ecm
;
99 static int ett_docsis_vsif_gex_sav
;
100 static int ett_docsis_vsif_gex_sav_spr
;
101 static int ett_docsis_vsif_gex_cmam
;
102 static int ett_docsis_vsif_gex_imja
;
103 static int ett_docsis_vsif_gex_imja_ssr
;
106 static expert_field ei_docsis_vsif_tlvlen_bad
;
107 static expert_field ei_docsis_vsif_tlvtype_unknown
;
109 static const value_string vendorid_vals
[] = {
110 {VENDOR_CISCO
, "Cisco Systems, Inc."},
111 {VENDOR_GENERAL
, "General Extension Information"},
115 static const value_string hmac_vals
[] = {
116 {1, "MD5 HMAC [RFC 2104]"},
117 {2, "MMH16-sigma-n HMAC [DOCSIS SECv3.0]"},
118 {43, "Vendor Specific"},
122 static const value_string authorization_action_vals
[] = {
129 /* Dissector for Cisco Vendor Specific TLVs */
131 #define NUM_PHONES 0x0a
132 #define IOS_CONFIG_FILE 0x80
134 #define IP_PREC_VAL 0x01
135 #define IP_PREC_BW 0x02
137 static void dissect_general_extension_information (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
,
142 dissect_cisco (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, int vsif_len
)
144 /* Start at pos = 5, since tvb includes the Vendor ID field */
146 uint8_t type
, length
;
147 proto_tree
*ipprec_tree
;
148 proto_item
*ipprec_item
;
151 while (pos
< vsif_len
)
153 /* Extract the type and length Fields from the TLV */
154 type
= tvb_get_uint8 (tvb
, pos
++);
155 length
= tvb_get_uint8 (tvb
, pos
++);
159 proto_tree_add_item (tree
, hf_docsis_vsif_cisco_numphones
, tvb
,
160 pos
, length
, ENC_BIG_ENDIAN
);
164 proto_tree_add_subtree(tree
, tvb
, pos
, length
, ett_docsis_vsif_ipprec
, &ipprec_item
, "IP Precedence");
165 /* Handle Sub-TLVs in IP Precedence */
166 templen
= pos
+ length
;
167 while (pos
< templen
)
169 type
= tvb_get_uint8 (tvb
, pos
++);
170 length
= tvb_get_uint8 (tvb
, pos
++);
176 proto_tree_add_item (ipprec_tree
,
177 hf_docsis_vsif_cisco_ipprec_val
, tvb
,
178 pos
, length
, ENC_BIG_ENDIAN
);
182 expert_add_info_format(pinfo
, ipprec_item
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
188 proto_tree_add_item (ipprec_tree
,
189 hf_docsis_vsif_cisco_ipprec_bw
, tvb
,
190 pos
, length
, ENC_BIG_ENDIAN
);
194 expert_add_info_format(pinfo
, ipprec_item
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
198 expert_add_info_format(pinfo
, ipprec_item
, &ei_docsis_vsif_tlvtype_unknown
, "Unknown TLV: %u", type
);
203 case IOS_CONFIG_FILE
:
204 proto_tree_add_item (tree
, hf_docsis_vsif_cisco_config_file
, tvb
,
205 pos
, length
, ENC_ASCII
);
213 dissect_vsif (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, void* data _U_
)
216 proto_tree
*vsif_tree
;
222 /* get the reported length of the VSIF TLV */
223 vsif_len
= tvb_reported_length_remaining (tvb
, 0);
225 it
= proto_tree_add_protocol_format (tree
, proto_docsis_vsif
, tvb
, 0, -1,
227 vsif_tree
= proto_item_add_subtree (it
, ett_docsis_vsif
);
228 proto_tree_add_item_ret_uint(vsif_tree
, hf_docsis_vsif_vendorid
, tvb
, 2, 3, ENC_BIG_ENDIAN
, &value
);
230 /* The first TLV in the VSIF encodings must be type 0x08 (Vendor ID) and
233 type
= tvb_get_uint8 (tvb
, 0);
235 expert_add_info_format(pinfo
, it
, &ei_docsis_vsif_tlvtype_unknown
, "Unknown TLV: %u", type
);
237 length
= tvb_get_uint8 (tvb
, 1);
239 expert_add_info_format(pinfo
, it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
241 /* switch on the Vendor ID */
245 proto_item_append_text (it
, " (Cisco)");
246 dissect_cisco (tvb
, pinfo
, vsif_tree
, vsif_len
);
249 proto_item_append_text (it
, " (General Extension Information)");
250 dissect_general_extension_information (tvb
, pinfo
, vsif_tree
, vsif_len
);
253 proto_item_append_text (it
, " (Unknown)");
254 proto_tree_add_item (vsif_tree
, hf_docsis_vsif_vendor_unknown
, tvb
,
259 return tvb_captured_length(tvb
);
263 #define GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE 1
264 #define GEX_ECM_EXTENDED_CMTS_MIC_BITMAP 2
265 #define GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE 3
268 dissect_extended_cmts_mic(tvbuff_t
* tvb
, proto_tree
*tree
, int start
, uint16_t len
)
271 proto_tree
*ecm_tree
;
272 uint8_t type
, length
;
275 ecm_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_ecm
, tvb
, start
, len
, ENC_NA
);
276 ecm_tree
= proto_item_add_subtree(ecm_it
, ett_docsis_vsif_gex_ecm
);
278 while (pos
< (start
+ len
))
280 type
= tvb_get_uint8 (tvb
, pos
++);
281 length
= tvb_get_uint8 (tvb
, pos
++);
284 case GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE
:
285 proto_tree_add_item (ecm_tree
, hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
287 case GEX_ECM_EXTENDED_CMTS_MIC_BITMAP
:
288 proto_tree_add_item (ecm_tree
, hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap
, tvb
, pos
, length
, ENC_NA
);
290 case GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE
:
291 proto_tree_add_item (ecm_tree
, hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype
, tvb
, pos
, length
, ENC_NA
);
294 proto_tree_add_item (ecm_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
301 #define GEX_SAV_STATIC_PREFIX_ADDRESS 1
302 #define GEX_SAV_STATIC_PREFIX_LENGTH 2
305 dissect_sav_static_prefix_rule(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
*tree
, int start
, uint16_t len
)
307 proto_item
*sav_spr_it
;
308 proto_tree
*sav_spr_tree
;
309 uint8_t type
, length
;
312 sav_spr_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_sav_static_prefix_rule
, tvb
, start
, len
, ENC_NA
);
313 sav_spr_tree
= proto_item_add_subtree(sav_spr_it
, ett_docsis_vsif_gex_sav_spr
);
315 while (pos
< (start
+ len
))
317 type
= tvb_get_uint8 (tvb
, pos
++);
318 length
= tvb_get_uint8 (tvb
, pos
++);
321 case GEX_SAV_STATIC_PREFIX_ADDRESS
:
323 proto_tree_add_item (sav_spr_tree
, hf_docsis_vsif_gex_sav_static_prefix_addressv4
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
324 } else if (length
== 6) {
325 proto_tree_add_item (sav_spr_tree
, hf_docsis_vsif_gex_sav_static_prefix_addressv6
, tvb
, pos
, length
, ENC_NA
);
327 expert_add_info_format(pinfo
, sav_spr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
330 case GEX_SAV_STATIC_PREFIX_LENGTH
:
332 proto_tree_add_item (sav_spr_tree
, hf_docsis_vsif_gex_sav_static_prefix_length
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
334 expert_add_info_format(pinfo
, sav_spr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
338 proto_tree_add_item (sav_spr_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
347 #define GEX_SAV_GROUP_NAME 1
348 #define GEX_SAV_STATIC_PREFIX_RULE 2
352 dissect_sav(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
*tree
, int start
, uint16_t len
)
355 proto_tree
*sav_tree
;
356 uint8_t type
, length
;
359 sav_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_sav
, tvb
, start
, len
, ENC_NA
);
360 sav_tree
= proto_item_add_subtree(sav_it
, ett_docsis_vsif_gex_sav
);
362 while (pos
< (start
+ len
))
364 type
= tvb_get_uint8 (tvb
, pos
++);
365 length
= tvb_get_uint8 (tvb
, pos
++);
368 case GEX_SAV_GROUP_NAME
:
369 proto_tree_add_item (sav_tree
, hf_docsis_vsif_gex_sav_group_name
, tvb
, pos
, length
, ENC_ASCII
);
371 case GEX_SAV_STATIC_PREFIX_RULE
:
372 dissect_sav_static_prefix_rule(tvb
, pinfo
, sav_tree
, pos
, length
);
375 proto_tree_add_item (sav_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
383 #define GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK 1
384 #define GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK 2
385 #define GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK 3
386 #define GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK 4
389 dissect_cable_modem_attribute_masks(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
*tree
, int start
, uint16_t len
)
392 proto_tree
*cmam_tree
;
393 uint8_t type
, length
;
396 cmam_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_cmam
, tvb
, start
, len
, ENC_NA
);
397 cmam_tree
= proto_item_add_subtree(cmam_it
, ett_docsis_vsif_gex_cmam
);
399 while (pos
< (start
+ len
))
401 type
= tvb_get_uint8 (tvb
, pos
++);
402 length
= tvb_get_uint8 (tvb
, pos
++);
405 case GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK
:
407 expert_add_info_format(pinfo
, cmam_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
409 proto_tree_add_item (cmam_tree
, hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask
, tvb
, pos
, length
, ENC_NA
);
411 case GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK
:
413 expert_add_info_format(pinfo
, cmam_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
415 proto_tree_add_item (cmam_tree
, hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask
, tvb
, pos
, length
, ENC_NA
);
417 case GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK
:
419 expert_add_info_format(pinfo
, cmam_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
421 proto_tree_add_item (cmam_tree
, hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask
, tvb
, pos
, length
, ENC_NA
);
423 case GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK
:
425 expert_add_info_format(pinfo
, cmam_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
427 proto_tree_add_item (cmam_tree
, hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask
, tvb
, pos
, length
, ENC_NA
);
429 default: proto_tree_add_item (cmam_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
436 #define GEX_IMJA_SSR_RULE_PRIORITY 1
437 #define GEX_IMJA_SSR_AUTHORIZATION_ACTION 2
438 #define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS 3
439 #define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH 4
440 #define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS 5
441 #define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH 6
445 dissect_ip_multicast_join_authorization_static_session_rule(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
*tree
, int start
, uint16_t len
)
447 proto_item
*imja_ssr_it
;
448 proto_tree
*imja_ssr_tree
;
449 uint8_t type
, length
;
452 imja_ssr_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_imja_ssr
, tvb
, start
, len
, ENC_NA
);
453 imja_ssr_tree
= proto_item_add_subtree(imja_ssr_it
, ett_docsis_vsif_gex_imja_ssr
);
455 while (pos
< (start
+ len
))
457 type
= tvb_get_uint8 (tvb
, pos
++);
458 length
= tvb_get_uint8 (tvb
, pos
++);
461 case GEX_IMJA_SSR_RULE_PRIORITY
:
463 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
465 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_rule_priority
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
467 case GEX_IMJA_SSR_AUTHORIZATION_ACTION
:
469 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
471 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_authorization_action
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
473 case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS
:
475 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
476 } else if (length
== 6) {
477 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6
, tvb
, pos
, length
, ENC_NA
);
479 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
482 case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH
:
484 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
486 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_source_prefix_length
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
488 case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS
:
490 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
491 } else if (length
== 6) {
492 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6
, tvb
, pos
, length
, ENC_NA
);
494 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
497 case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH
:
499 expert_add_info_format(pinfo
, imja_ssr_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
501 proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_gex_imja_ssr_group_prefix_length
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
503 default: proto_tree_add_item (imja_ssr_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
509 #define GEX_IMJA_IP_MULTICAST_PROFILE_NAME 1
510 #define GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE 2
511 #define GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS 3
515 dissect_ip_multicast_join_authorization(tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
*tree
, int start
, uint16_t len
)
518 proto_tree
*imja_tree
;
519 uint8_t type
, length
;
522 imja_it
= proto_tree_add_item (tree
, hf_docsis_vsif_gex_imja
, tvb
, start
, len
, ENC_NA
);
523 imja_tree
= proto_item_add_subtree(imja_it
, ett_docsis_vsif_gex_imja
);
525 while (pos
< (start
+ len
))
527 type
= tvb_get_uint8 (tvb
, pos
++);
528 length
= tvb_get_uint8 (tvb
, pos
++);
531 case GEX_IMJA_IP_MULTICAST_PROFILE_NAME
:
532 if ((length
< 1) || (length
> 15)) {
533 expert_add_info_format(pinfo
, imja_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
535 proto_tree_add_item (imja_tree
, hf_docsis_vsif_gex_imja_ip_multicast_profile_name
, tvb
, pos
, length
, ENC_ASCII
);
537 case GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE
:
538 dissect_ip_multicast_join_authorization_static_session_rule(tvb
, pinfo
, imja_tree
, pos
, length
);
540 case GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS
:
542 expert_add_info_format(pinfo
, imja_it
, &ei_docsis_vsif_tlvlen_bad
, "Wrong TLV length: %u", length
);
544 proto_tree_add_item (imja_tree
, hf_docsis_vsif_gex_imja_maximum_multicast_sessions
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
546 default: proto_tree_add_item (imja_tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
554 /* Dissector for General Extension TLVs */
556 #define GEX_CM_LOAD_BALANCING_POLICY_ID 1
557 #define GEX_CM_LOAD_BALANCING_PRIORITY 2
558 #define GEX_CM_LOAD_BALANCING_GROUP_ID 3
559 #define GEX_CM_RANGING_CLASS_ID_EXTENSION 4
560 #define GEX_L2VPN_ENCODING 5
561 #define GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING 6
562 #define GEX_EXTENDED_SAV 7
563 #define GEX_CABLE_MODEM_ATTRIBUTE_MASKS 9
564 #define GEX_IP_MULTICAST_JOIN_AUTHORIZATION 10
565 #define GEX_SERVICE_TYPE_IDENTIFIER 11
570 dissect_general_extension_information (tvbuff_t
* tvb
, packet_info
* pinfo
, proto_tree
* tree
, int vsif_len
)
572 /* Start at pos = 5, since tvb includes the Vendor ID field */
574 uint8_t type
, length
;
576 while (pos
< vsif_len
)
578 /* Extract the type and length Fields from the TLV */
579 type
= tvb_get_uint8 (tvb
, pos
++);
580 length
= tvb_get_uint8 (tvb
, pos
++);
583 case GEX_CM_LOAD_BALANCING_POLICY_ID
:
584 proto_tree_add_item (tree
, hf_docsis_vsif_gex_loadbal_policy_id
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
586 case GEX_CM_LOAD_BALANCING_PRIORITY
:
587 proto_tree_add_item (tree
, hf_docsis_vsif_gex_loadbal_priority
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
589 case GEX_CM_LOAD_BALANCING_GROUP_ID
:
590 proto_tree_add_item (tree
, hf_docsis_vsif_gex_loadbal_group_id
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
592 case GEX_CM_RANGING_CLASS_ID_EXTENSION
:
593 proto_tree_add_item (tree
, hf_docsis_vsif_gex_ranging_class_id_extension
, tvb
, pos
, length
, ENC_BIG_ENDIAN
);
595 case GEX_L2VPN_ENCODING
:
596 proto_tree_add_item (tree
, hf_docsis_vsif_gex_l2vpn_encoding
, tvb
, pos
, length
, ENC_NA
);
598 case GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING
:
599 dissect_extended_cmts_mic(tvb
, tree
, pos
, length
);
601 case GEX_EXTENDED_SAV
:
602 dissect_sav(tvb
, pinfo
, tree
, pos
, length
);
604 case GEX_CABLE_MODEM_ATTRIBUTE_MASKS
:
605 dissect_cable_modem_attribute_masks(tvb
, pinfo
, tree
, pos
, length
);
607 case GEX_IP_MULTICAST_JOIN_AUTHORIZATION
:
608 dissect_ip_multicast_join_authorization(tvb
, pinfo
, tree
, pos
, length
);
610 case GEX_SERVICE_TYPE_IDENTIFIER
:
611 proto_tree_add_item (tree
, hf_docsis_vsif_gex_service_type_identifier
, tvb
, pos
, length
, ENC_ASCII
);
614 proto_tree_add_item (tree
, hf_docsis_vsif_tlv_unknown
, tvb
, pos
, length
, ENC_NA
);
621 /* Register the protocol with Wireshark */
623 proto_register_docsis_vsif (void)
625 static hf_register_info hf
[] = {
626 {&hf_docsis_vsif_vendorid
,
627 {"Vendor ID", "docsis_vsif.vendorid",
628 FT_UINT24
, BASE_HEX
, VALS(vendorid_vals
), 0x0,
629 "Vendor Identifier", HFILL
}
631 {&hf_docsis_vsif_vendor_unknown
,
632 {"VSIF Encodings", "docsis_vsif.unknown",
633 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
634 "Unknown Vendor", HFILL
}
636 {&hf_docsis_vsif_cisco_numphones
,
637 {"Number of phone lines", "docsis_vsif.cisco.numphones",
638 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
642 {&hf_docsis_vsif_cisco_ipprec
,
643 {"IP Precedence Encodings", "docsis_vsif.cisco.ipprec",
644 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
648 {&hf_docsis_vsif_cisco_ipprec_val
,
649 {"IP Precedence Value", "docsis_vsif.cisco.ipprec.value",
650 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
653 {&hf_docsis_vsif_cisco_ipprec_bw
,
654 {"IP Precedence Bandwidth", "docsis_vsif.cisco.ipprec.bw",
655 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
658 {&hf_docsis_vsif_cisco_config_file
,
659 {"IOS Config File", "docsis_vsif.cisco.iosfile",
660 FT_STRING
, BASE_NONE
, NULL
, 0x0,
663 {&hf_docsis_vsif_gex_loadbal_policy_id
,
664 {".1 CM Load Balancing Policy ID", "docsis_vsif.gex.loadbal_policyid",
665 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
666 "General Extension Information - CM Load Balancing Policy ID", HFILL
}
668 {&hf_docsis_vsif_gex_loadbal_priority
,
669 {".2 CM Load Balancing Priority", "docsis_vsif.gex.loadbal_priority",
670 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
671 "General Extension Information - CM Load Balancing Priority", HFILL
}
673 {&hf_docsis_vsif_gex_loadbal_group_id
,
674 {".3 CM Load Balancing Group ID", "docsis_vsif.gex.loadbal_group_id",
675 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
676 "General Extension Information - CM Load Balancing Group ID", HFILL
}
678 {&hf_docsis_vsif_gex_ranging_class_id_extension
,
679 {".4 CM Ranging Class ID Extension", "docsis_vsif.gex.ranging_class_id_extension",
680 FT_UINT32
, BASE_DEC
, NULL
, 0x0,
681 "General Extension Information - CM Ranging Class ID Extension", HFILL
}
683 {&hf_docsis_vsif_gex_l2vpn_encoding
,
684 {".5 L2VPN Encoding", "docsis_vsif.gex.l2vpn_encoding",
685 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
686 "General Extension Information - L2VPN Encoding", HFILL
}
688 {&hf_docsis_vsif_gex_ecm
,
689 {".6 Extended CMTS MIC Configuration Setting", "docsis_vsif.gex.extended_cmts_mic_configuration_setting",
690 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
691 "General Extension Information - Extended CMTS MIC Configuration Setting", HFILL
}
693 {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type
,
694 {"..1 Extended CMTS MIC Hmac type", "docsis_vsif.gex.extended_cmts_mic_hmac_type",
695 FT_UINT8
, BASE_DEC
, VALS(hmac_vals
), 0x0,
696 "General Extension Information - Extended CMTS MIC Hmac type", HFILL
}
698 {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap
,
699 {"..2 Extended CMTS MIC Bitmap", "docsis_vsif.gex.extended_cmts_mic_bitmap",
700 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
701 "General Extension Information - Extended CMTS MIC Bitmap", HFILL
}
703 {&hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype
,
704 {"..3 Explicit Extended CMTS MIC Digest Subtype", "docsis_vsif.gex.extended_cmts_mic_digest_subtype",
705 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
706 "General Extension Information - Explicit Extended CMTS MIC Digest Subtype", HFILL
}
708 {&hf_docsis_vsif_gex_sav
,
709 {".7 Source Address Verification (SAV) Authorization Encoding", "docsis_vsif.gex.sav",
710 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
711 "General Extension Information - Source Address Verification (SAV) Authorization Encoding", HFILL
}
713 {&hf_docsis_vsif_gex_sav_group_name
,
714 {"..1 SAV Group Name", "docsis_vsif.gex.sav.sav_group_name",
715 FT_STRING
, BASE_NONE
, NULL
, 0x0,
716 "General Extension Information - SAV - SAV Group Name", HFILL
}
718 {&hf_docsis_vsif_gex_sav_static_prefix_rule
,
719 {"..2 SAV Static Prefix Rule", "docsis_vsif.gex.sav.static_prefix_rule",
720 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
721 "General Extension Information - SAV -Static Prefix Rule", HFILL
}
723 {&hf_docsis_vsif_gex_sav_static_prefix_addressv4
,
724 {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address4",
725 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
726 "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL
}
728 {&hf_docsis_vsif_gex_sav_static_prefix_addressv6
,
729 {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address6",
730 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
731 "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL
}
733 {&hf_docsis_vsif_gex_sav_static_prefix_length
,
734 {"...2 SAV Static Prefix Length", "docsis_vsif.gex.sav.spr.static_prefix_length",
735 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
736 "General Extension Information - SAV -Static Prefix Rule - Static Prefix Length", HFILL
}
738 {&hf_docsis_vsif_gex_cmam
,
739 {".9 CM Attribute Mask", "docsis_vsif.gex.cmam",
740 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
741 "General Extension Information - CM Attribute Mask", HFILL
}
743 {&hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask
,
744 {"..1 CM Required Downstream Attribute", "docsis_vsif.gex.cmam.cm_required_downstream_attribute",
745 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
746 "General Extension Information - CM Attribute Mask - CM Required Downstream Attribute", HFILL
}
748 {&hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask
,
749 {"..2 CM Forbidden Downstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_downstream_attribute",
750 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
751 "General Extension Information - CM Attribute Mask - CM Forbidden Downstream Attribute", HFILL
}
753 {&hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask
,
754 {"..3 CM Required Upstream Attribute", "docsis_vsif.gex.cmam.cm_required_upstream_attribute",
755 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
756 "General Extension Information - CM Attribute Mask - CM Required Upstream Attribute", HFILL
}
758 {&hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask
,
759 {"..4 CM Forbidden Upstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_upstream_attribute",
760 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
761 "General Extension Information - CM Attribute Mask - CM Forbidden Upstream Attribute", HFILL
}
763 {&hf_docsis_vsif_gex_imja
,
764 {".10 IP Multicast Join Authorization", "docsis_vsif.gex.imja",
765 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
766 "General Extension Information - IP Multicast Join Authorization", HFILL
}
768 {&hf_docsis_vsif_gex_imja_ip_multicast_profile_name
,
769 {"..1 IP Multicast Profile Name", "docsis_vsif.gex.imja.ip_multicast_profile_name",
770 FT_STRING
, BASE_NONE
, NULL
, 0x0,
771 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Name", HFILL
}
773 {&hf_docsis_vsif_gex_imja_ssr
,
774 {"..2 IP Multicast Profile Join Authorization Static Session Rule", "docsis_vsif.gex.imja.ip_multicast_join_authorization_static_session_rule",
775 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
776 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule", HFILL
}
778 {&hf_docsis_vsif_gex_imja_ssr_rule_priority
,
779 {"...1 Rule Priority", "docsis_vsif.gex.imja.imja_ssr_rule_priority",
780 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
781 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL
}
783 {&hf_docsis_vsif_gex_imja_ssr_authorization_action
,
784 {"...2 Authorization Action", "docsis_vsif.gex.imja.imja_ssr_authorization_action",
785 FT_UINT8
, BASE_DEC
, VALS(authorization_action_vals
), 0x0,
786 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL
}
788 {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4
,
789 {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address4",
790 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
791 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL
}
793 {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6
,
794 {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address6",
795 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
796 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL
}
798 {&hf_docsis_vsif_gex_imja_ssr_source_prefix_length
,
799 {"...4 Source Prefix Length", "docsis_vsif.gex.imja.imja_ssr_source_prefix_length",
800 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
801 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Length", HFILL
}
803 {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4
,
804 {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address4",
805 FT_IPv4
, BASE_NONE
, NULL
, 0x0,
806 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL
}
808 {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6
,
809 {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address6",
810 FT_IPv6
, BASE_NONE
, NULL
, 0x0,
811 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL
}
813 {&hf_docsis_vsif_gex_imja_ssr_group_prefix_length
,
814 {"...6 Group Prefix Length", "docsis_vsif.gex.imja.imja_ssr_group_prefix_length",
815 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
816 "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Length", HFILL
}
818 {&hf_docsis_vsif_gex_imja_maximum_multicast_sessions
,
819 {"..3 Maximum Multicast Sessions", "docsis_vsif.gex.imja.imja_maximum_multicast_sessions",
820 FT_UINT16
, BASE_DEC
, NULL
, 0x0,
821 "General Extension Information - IP Multicast Join Authorization - Maximum Multicast Sessions", HFILL
}
823 {&hf_docsis_vsif_gex_service_type_identifier
,
824 {".11 Service Type Identifier", "docsis_vsif.gex.service_type_identifier",
825 FT_STRING
, BASE_NONE
, NULL
, 0x0,
826 "General Extension Information - Service Type Identifier", HFILL
}
828 {&hf_docsis_vsif_tlv_unknown
,
829 {"Unknown VSIF TLV", "docsis_vsif.unknown",
830 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
835 static int *ett
[] = {
837 &ett_docsis_vsif_ipprec
,
838 &ett_docsis_vsif_gex_ecm
,
839 &ett_docsis_vsif_gex_sav
,
840 &ett_docsis_vsif_gex_sav_spr
,
841 &ett_docsis_vsif_gex_cmam
,
842 &ett_docsis_vsif_gex_imja
,
843 &ett_docsis_vsif_gex_imja_ssr
846 expert_module_t
* expert_docsis_vsif
;
848 static ei_register_info ei
[] = {
849 {&ei_docsis_vsif_tlvlen_bad
, { "docsis_vsif.tlvlenbad", PI_MALFORMED
, PI_ERROR
, "Bad TLV length", EXPFILL
}},
850 {&ei_docsis_vsif_tlvtype_unknown
, { "docsis_vsif.tlvtypeunknown", PI_PROTOCOL
, PI_WARN
, "Unknown TLV type", EXPFILL
}},
854 proto_register_protocol ("DOCSIS Vendor Specific Encodings",
855 "DOCSIS VSIF", "docsis_vsif");
857 proto_register_field_array (proto_docsis_vsif
, hf
, array_length (hf
));
858 proto_register_subtree_array (ett
, array_length (ett
));
859 expert_docsis_vsif
= expert_register_protocol(proto_docsis_vsif
);
860 expert_register_field_array(expert_docsis_vsif
, ei
, array_length(ei
));
862 register_dissector ("docsis_vsif", dissect_vsif
, proto_docsis_vsif
);
866 proto_reg_handoff_docsis_vsif (void)
869 dissector_handle_t docsis_vsif_handle
;
871 docsis_vsif_handle
= find_dissector ("docsis_vsif");
872 dissector_add_uint ("docsis", 0xFD, docsis_vsif_handle
);
877 * Editor modelines - https://www.wireshark.org/tools/modelines.html
882 * indent-tabs-mode: nil
885 * ex: set shiftwidth=2 tabstop=8 expandtab:
886 * :indentSize=2:tabSize=8:noTabs=true: