Coverage Report

Created: 2025-12-27 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-docsis-vendor.c
Line
Count
Source
1
/* packet-vendor.c
2
 * Routines for Vendor Specific Encodings dissection
3
 * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
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
19
 *   ID.
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);
26
 *      break;
27
 * 5.  Please see dissect_cisco for an example of how to do this.
28
 */
29
30
#include "config.h"
31
32
#include <epan/packet.h>
33
#include <epan/expert.h>
34
35
/* Define Vendor ID's here */
36
0
#define VENDOR_CISCO 0x00000C
37
0
#define VENDOR_GENERAL 0xFFFFFF
38
39
void proto_register_docsis_vsif(void);
40
void proto_reg_handoff_docsis_vsif(void);
41
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;
51
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;
62
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;
66
67
static int hf_docsis_vsif_gex_sav_group_name;
68
static int hf_docsis_vsif_gex_sav_static_prefix_rule;
69
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;
73
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;
78
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;
82
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;
91
92
static int hf_docsis_vsif_tlv_unknown;
93
94
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;
104
105
106
static expert_field ei_docsis_vsif_tlvlen_bad;
107
static expert_field ei_docsis_vsif_tlvtype_unknown;
108
109
static const value_string vendorid_vals[] = {
110
  {VENDOR_CISCO, "Cisco Systems, Inc."},
111
  {VENDOR_GENERAL, "General Extension Information"},
112
  {0, NULL},
113
};
114
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"},
119
       {0, NULL},
120
};
121
122
static const value_string authorization_action_vals[] = {
123
       {0, "permit"},
124
       {1, "deny"},
125
       {0, NULL},
126
};
127
128
129
/* Dissector for Cisco Vendor Specific TLVs */
130
131
0
#define NUM_PHONES      0x0a
132
0
#define IOS_CONFIG_FILE 0x80
133
0
#define IP_PREC         0x0b
134
0
#define IP_PREC_VAL     0x01
135
0
#define IP_PREC_BW      0x02
136
137
static void dissect_general_extension_information (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
138
                          int vsif_len);
139
140
141
static void
142
dissect_cisco (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int vsif_len)
143
0
{
144
  /* Start at pos = 5, since tvb includes the Vendor ID field */
145
0
  int pos = 5;
146
0
  uint8_t type, length;
147
0
  proto_tree *ipprec_tree;
148
0
  proto_item *ipprec_item;
149
0
  int templen;
150
151
0
  while (pos < vsif_len)
152
0
    {
153
      /* Extract the type and length Fields from the TLV */
154
0
      type = tvb_get_uint8 (tvb, pos++);
155
0
      length = tvb_get_uint8 (tvb, pos++);
156
0
      switch (type)
157
0
        {
158
0
          case NUM_PHONES:
159
0
            proto_tree_add_item (tree, hf_docsis_vsif_cisco_numphones, tvb,
160
0
                                 pos, length, ENC_BIG_ENDIAN);
161
0
            break;
162
0
          case IP_PREC:
163
0
            ipprec_tree =
164
0
              proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_vsif_ipprec, &ipprec_item, "IP Precedence");
165
            /* Handle Sub-TLVs in IP Precedence */
166
0
            templen = pos + length;
167
0
            while (pos < templen)
168
0
              {
169
0
                type = tvb_get_uint8 (tvb, pos++);
170
0
                length = tvb_get_uint8 (tvb, pos++);
171
0
                switch (type)
172
0
                  {
173
0
                    case IP_PREC_VAL:
174
0
                      if (length == 1)
175
0
                      {
176
0
                        proto_tree_add_item (ipprec_tree,
177
0
                                           hf_docsis_vsif_cisco_ipprec_val, tvb,
178
0
                                           pos, length, ENC_BIG_ENDIAN);
179
0
                      }
180
0
                      else
181
0
                      {
182
0
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
183
0
                      }
184
0
                      break;
185
0
                    case IP_PREC_BW:
186
0
                      if (length != 4)
187
0
                      {
188
0
                        proto_tree_add_item (ipprec_tree,
189
0
                                           hf_docsis_vsif_cisco_ipprec_bw, tvb,
190
0
                                           pos, length, ENC_BIG_ENDIAN);
191
0
                      }
192
0
                      else
193
0
                      {
194
0
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
195
0
                      }
196
0
                      break;
197
0
                    default:
198
0
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvtype_unknown, "Unknown TLV: %u", type);
199
0
                  }
200
0
                pos += length;
201
0
              }
202
0
            break;
203
0
          case IOS_CONFIG_FILE:
204
0
            proto_tree_add_item (tree, hf_docsis_vsif_cisco_config_file, tvb,
205
0
                                 pos, length, ENC_ASCII);
206
0
        }
207
0
      pos += length;
208
0
    }
209
0
}
210
211
/* Dissection */
212
static int
213
dissect_vsif (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
214
0
{
215
0
  proto_item *it;
216
0
  proto_tree *vsif_tree;
217
0
  uint8_t type;
218
0
  uint8_t length;
219
0
  uint32_t value;
220
0
  int vsif_len;
221
222
  /* get the reported length of the VSIF TLV */
223
0
  vsif_len = tvb_reported_length_remaining (tvb, 0);
224
225
0
  it = proto_tree_add_protocol_format (tree, proto_docsis_vsif, tvb, 0, -1,
226
0
                                        "VSIF Encodings");
227
0
  vsif_tree = proto_item_add_subtree (it, ett_docsis_vsif);
228
0
  proto_tree_add_item_ret_uint(vsif_tree, hf_docsis_vsif_vendorid, tvb, 2, 3, ENC_BIG_ENDIAN, &value);
229
230
  /* The first TLV in the VSIF encodings must be type 0x08 (Vendor ID) and
231
   * length 3.
232
   */
233
0
  type = tvb_get_uint8 (tvb, 0);
234
0
  if (type != 0x08)
235
0
     expert_add_info_format(pinfo, it, &ei_docsis_vsif_tlvtype_unknown, "Unknown TLV: %u", type);
236
237
0
  length = tvb_get_uint8 (tvb, 1);
238
0
  if (length != 3)
239
0
     expert_add_info_format(pinfo, it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
240
241
  /* switch on the Vendor ID */
242
0
  switch (value)
243
0
  {
244
0
    case VENDOR_CISCO:
245
0
      proto_item_append_text (it, " (Cisco)");
246
0
      dissect_cisco (tvb, pinfo, vsif_tree, vsif_len);
247
0
      break;
248
0
    case VENDOR_GENERAL:
249
0
      proto_item_append_text (it, " (General Extension Information)");
250
0
      dissect_general_extension_information (tvb, pinfo, vsif_tree, vsif_len);
251
0
      break;
252
0
    default:
253
0
      proto_item_append_text (it, " (Unknown)");
254
0
      proto_tree_add_item (vsif_tree, hf_docsis_vsif_vendor_unknown, tvb,
255
0
                            0, -1, ENC_NA);
256
0
    break;
257
0
  }
258
259
0
  return tvb_captured_length(tvb);
260
0
}
261
262
263
0
#define GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE 1
264
0
#define GEX_ECM_EXTENDED_CMTS_MIC_BITMAP 2
265
0
#define GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE 3
266
267
static void
268
dissect_extended_cmts_mic(tvbuff_t * tvb, proto_tree *tree, int start, uint16_t len)
269
0
{
270
0
  proto_item *ecm_it;
271
0
  proto_tree *ecm_tree;
272
0
  uint8_t type, length;
273
0
  int pos = start;
274
275
0
  ecm_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_ecm, tvb, start, len, ENC_NA);
276
0
  ecm_tree = proto_item_add_subtree(ecm_it, ett_docsis_vsif_gex_ecm);
277
278
0
  while (pos < (start + len))
279
0
    {
280
0
      type = tvb_get_uint8 (tvb, pos++);
281
0
      length = tvb_get_uint8 (tvb, pos++);
282
0
      switch (type)
283
0
        {
284
0
          case GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE:
285
0
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type, tvb, pos, length, ENC_BIG_ENDIAN);
286
0
            break;
287
0
          case GEX_ECM_EXTENDED_CMTS_MIC_BITMAP:
288
0
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap, tvb, pos, length, ENC_NA);
289
0
            break;
290
0
          case GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE:
291
0
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype, tvb, pos, length, ENC_NA);
292
0
            break;
293
0
          default:
294
0
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
295
0
            break;
296
0
        }  /* switch */
297
0
      pos += length;
298
0
    }   /* while */
299
0
}
300
301
0
#define GEX_SAV_STATIC_PREFIX_ADDRESS 1
302
0
#define GEX_SAV_STATIC_PREFIX_LENGTH 2
303
304
static void
305
dissect_sav_static_prefix_rule(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, uint16_t len)
306
0
{
307
0
  proto_item *sav_spr_it;
308
0
  proto_tree *sav_spr_tree;
309
0
  uint8_t type, length;
310
0
  int pos = start;
311
312
0
  sav_spr_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_sav_static_prefix_rule, tvb, start, len, ENC_NA);
313
0
  sav_spr_tree = proto_item_add_subtree(sav_spr_it, ett_docsis_vsif_gex_sav_spr);
314
315
0
  while (pos < (start + len))
316
0
    {
317
0
      type = tvb_get_uint8 (tvb, pos++);
318
0
      length = tvb_get_uint8 (tvb, pos++);
319
0
      switch (type)
320
0
        {
321
0
          case GEX_SAV_STATIC_PREFIX_ADDRESS:
322
0
            if (length == 4) {
323
0
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
324
0
            } else if (length == 6) {
325
0
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_addressv6, tvb, pos, length, ENC_NA);
326
0
            } else {
327
0
              expert_add_info_format(pinfo, sav_spr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
328
0
            }
329
0
            break;
330
0
          case GEX_SAV_STATIC_PREFIX_LENGTH:
331
0
            if (length == 1) {
332
0
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
333
0
            } else {
334
0
              expert_add_info_format(pinfo, sav_spr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
335
0
            }
336
0
            break;
337
0
          default:
338
0
            proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
339
0
            break;
340
0
        }  /* switch */
341
0
        pos += length;
342
0
    }   /* while */
343
0
}
344
345
346
347
0
#define GEX_SAV_GROUP_NAME 1
348
0
#define GEX_SAV_STATIC_PREFIX_RULE 2
349
350
351
static void
352
dissect_sav(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, uint16_t len)
353
0
{
354
0
  proto_item *sav_it;
355
0
  proto_tree *sav_tree;
356
0
  uint8_t type, length;
357
0
  int pos = start;
358
359
0
  sav_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_sav, tvb, start, len, ENC_NA);
360
0
  sav_tree = proto_item_add_subtree(sav_it, ett_docsis_vsif_gex_sav);
361
362
0
  while (pos < (start + len))
363
0
    {
364
0
      type = tvb_get_uint8 (tvb, pos++);
365
0
      length = tvb_get_uint8 (tvb, pos++);
366
0
      switch (type)
367
0
        {
368
0
        case GEX_SAV_GROUP_NAME:
369
0
          proto_tree_add_item (sav_tree, hf_docsis_vsif_gex_sav_group_name, tvb, pos, length, ENC_ASCII);
370
0
          break;
371
0
        case GEX_SAV_STATIC_PREFIX_RULE:
372
0
          dissect_sav_static_prefix_rule(tvb, pinfo, sav_tree, pos, length);
373
0
          break;
374
0
        default:
375
0
          proto_tree_add_item (sav_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
376
0
          break;
377
0
        }  /* switch */
378
0
        pos += length;
379
0
    }   /* while */
380
0
}
381
382
383
0
#define GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK 1
384
0
#define GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK 2
385
0
#define GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK 3
386
0
#define GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK 4
387
388
static void
389
dissect_cable_modem_attribute_masks(tvbuff_t * tvb, packet_info * pinfo, proto_tree *tree, int start, uint16_t len)
390
0
{
391
0
  proto_item *cmam_it;
392
0
  proto_tree *cmam_tree;
393
0
  uint8_t type, length;
394
0
  int pos = start;
395
396
0
  cmam_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_cmam, tvb, start, len, ENC_NA);
397
0
  cmam_tree = proto_item_add_subtree(cmam_it, ett_docsis_vsif_gex_cmam);
398
399
0
  while (pos < (start + len))
400
0
    {
401
0
      type = tvb_get_uint8 (tvb, pos++);
402
0
      length = tvb_get_uint8 (tvb, pos++);
403
0
      switch (type)
404
0
        {
405
0
          case GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK:
406
0
            if (length != 4) {
407
0
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
408
0
            }
409
0
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask, tvb, pos, length, ENC_NA);
410
0
            break;
411
0
          case GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK:
412
0
            if (length != 4) {
413
0
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
414
0
            }
415
0
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask, tvb, pos, length, ENC_NA);
416
0
            break;
417
0
          case GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK:
418
0
            if (length != 4) {
419
0
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
420
0
            }
421
0
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask, tvb, pos, length, ENC_NA);
422
0
            break;
423
0
          case GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK:
424
0
            if (length != 4) {
425
0
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
426
0
            }
427
0
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask, tvb, pos, length, ENC_NA);
428
0
            break;
429
0
          default: proto_tree_add_item (cmam_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
430
0
        }  /* switch */
431
0
        pos += length;
432
0
    }   /* while */
433
0
}
434
435
436
0
#define GEX_IMJA_SSR_RULE_PRIORITY 1
437
0
#define GEX_IMJA_SSR_AUTHORIZATION_ACTION 2
438
0
#define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS 3
439
0
#define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH 4
440
0
#define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS 5
441
0
#define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH 6
442
443
444
static void
445
dissect_ip_multicast_join_authorization_static_session_rule(tvbuff_t * tvb, packet_info * pinfo, proto_tree *tree, int start, uint16_t len)
446
0
{
447
0
  proto_item *imja_ssr_it;
448
0
  proto_tree *imja_ssr_tree;
449
0
  uint8_t type, length;
450
0
  int pos = start;
451
452
0
  imja_ssr_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_imja_ssr, tvb, start, len, ENC_NA);
453
0
  imja_ssr_tree = proto_item_add_subtree(imja_ssr_it, ett_docsis_vsif_gex_imja_ssr);
454
455
0
  while (pos < (start + len))
456
0
    {
457
0
      type = tvb_get_uint8 (tvb, pos++);
458
0
      length = tvb_get_uint8 (tvb, pos++);
459
0
      switch (type)
460
0
        {
461
0
          case GEX_IMJA_SSR_RULE_PRIORITY:
462
0
            if (length != 1) {
463
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
464
0
            }
465
0
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_rule_priority, tvb, pos, length, ENC_BIG_ENDIAN);
466
0
            break;
467
0
          case GEX_IMJA_SSR_AUTHORIZATION_ACTION:
468
0
            if (length != 1) {
469
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
470
0
            }
471
0
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_authorization_action, tvb, pos, length, ENC_BIG_ENDIAN);
472
0
            break;
473
0
          case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS:
474
0
            if (length == 4) {
475
0
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
476
0
            } else if (length == 6) {
477
0
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6, tvb, pos, length, ENC_NA);
478
0
            } else {
479
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
480
0
            }
481
0
            break;
482
0
          case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH:
483
0
            if (length != 1) {
484
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
485
0
            }
486
0
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
487
0
            break;
488
0
          case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS:
489
0
            if (length == 4) {
490
0
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
491
0
            } else if (length == 6) {
492
0
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6, tvb, pos, length, ENC_NA);
493
0
            } else {
494
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
495
0
            }
496
0
            break;
497
0
          case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH:
498
0
            if (length != 1) {
499
0
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
500
0
            }
501
0
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
502
0
            break;
503
0
          default: proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
504
0
        }  /* switch */
505
0
        pos += length;
506
0
    }   /* while */
507
0
}
508
509
0
#define GEX_IMJA_IP_MULTICAST_PROFILE_NAME 1
510
0
#define GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE 2
511
0
#define GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS 3
512
513
514
static void
515
dissect_ip_multicast_join_authorization(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, uint16_t len)
516
0
{
517
0
  proto_item *imja_it;
518
0
  proto_tree *imja_tree;
519
0
  uint8_t type, length;
520
0
  int pos = start;
521
522
0
  imja_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_imja, tvb, start, len, ENC_NA);
523
0
  imja_tree = proto_item_add_subtree(imja_it, ett_docsis_vsif_gex_imja);
524
525
0
  while (pos < (start + len))
526
0
    {
527
0
      type = tvb_get_uint8 (tvb, pos++);
528
0
      length = tvb_get_uint8 (tvb, pos++);
529
0
      switch (type)
530
0
        {
531
0
          case GEX_IMJA_IP_MULTICAST_PROFILE_NAME:
532
0
            if ((length < 1) || (length > 15)) {
533
0
              expert_add_info_format(pinfo, imja_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
534
0
            }
535
0
            proto_tree_add_item (imja_tree, hf_docsis_vsif_gex_imja_ip_multicast_profile_name, tvb, pos, length, ENC_ASCII);
536
0
            break;
537
0
          case GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE:
538
0
            dissect_ip_multicast_join_authorization_static_session_rule(tvb, pinfo, imja_tree, pos, length);
539
0
            break;
540
0
          case GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS:
541
0
            if (length != 2) {
542
0
              expert_add_info_format(pinfo, imja_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
543
0
            }
544
0
            proto_tree_add_item (imja_tree, hf_docsis_vsif_gex_imja_maximum_multicast_sessions, tvb, pos, length, ENC_BIG_ENDIAN);
545
0
            break;
546
0
          default: proto_tree_add_item (imja_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
547
0
        }  /* switch */
548
0
        pos += length;
549
0
    }   /* while */
550
0
}
551
552
553
554
/* Dissector for General Extension TLVs */
555
556
0
#define GEX_CM_LOAD_BALANCING_POLICY_ID 1
557
0
#define GEX_CM_LOAD_BALANCING_PRIORITY 2
558
0
#define GEX_CM_LOAD_BALANCING_GROUP_ID 3
559
0
#define GEX_CM_RANGING_CLASS_ID_EXTENSION 4
560
0
#define GEX_L2VPN_ENCODING 5
561
0
#define GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING 6
562
0
#define GEX_EXTENDED_SAV 7
563
0
#define GEX_CABLE_MODEM_ATTRIBUTE_MASKS 9
564
0
#define GEX_IP_MULTICAST_JOIN_AUTHORIZATION 10
565
0
#define GEX_SERVICE_TYPE_IDENTIFIER 11
566
567
568
569
static void
570
dissect_general_extension_information (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int vsif_len)
571
0
{
572
  /* Start at pos = 5, since tvb includes the Vendor ID field */
573
0
  int pos = 5;
574
0
  uint8_t type, length;
575
576
0
  while (pos < vsif_len)
577
0
    {
578
      /* Extract the type and length Fields from the TLV */
579
0
      type = tvb_get_uint8 (tvb, pos++);
580
0
      length = tvb_get_uint8 (tvb, pos++);
581
0
      switch (type)
582
0
        {
583
0
          case GEX_CM_LOAD_BALANCING_POLICY_ID:
584
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_policy_id, tvb, pos, length, ENC_BIG_ENDIAN);
585
0
            break;
586
0
          case GEX_CM_LOAD_BALANCING_PRIORITY:
587
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_priority, tvb, pos, length, ENC_BIG_ENDIAN);
588
0
            break;
589
0
          case GEX_CM_LOAD_BALANCING_GROUP_ID:
590
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_group_id, tvb, pos, length, ENC_BIG_ENDIAN);
591
0
            break;
592
0
          case GEX_CM_RANGING_CLASS_ID_EXTENSION:
593
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_ranging_class_id_extension, tvb, pos, length, ENC_BIG_ENDIAN);
594
0
            break;
595
0
          case GEX_L2VPN_ENCODING:
596
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_l2vpn_encoding, tvb, pos, length, ENC_NA);
597
0
            break;
598
0
          case GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING:
599
0
            dissect_extended_cmts_mic(tvb, tree, pos, length);
600
0
            break;
601
0
          case GEX_EXTENDED_SAV:
602
0
            dissect_sav(tvb, pinfo, tree, pos, length);
603
0
            break;
604
0
          case GEX_CABLE_MODEM_ATTRIBUTE_MASKS:
605
0
            dissect_cable_modem_attribute_masks(tvb, pinfo, tree, pos, length);
606
0
            break;
607
0
          case GEX_IP_MULTICAST_JOIN_AUTHORIZATION:
608
0
            dissect_ip_multicast_join_authorization(tvb, pinfo, tree, pos, length);
609
0
            break;
610
0
          case GEX_SERVICE_TYPE_IDENTIFIER:
611
0
            proto_tree_add_item (tree, hf_docsis_vsif_gex_service_type_identifier, tvb, pos, length, ENC_ASCII);
612
0
            break;
613
0
          default:
614
0
            proto_tree_add_item (tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
615
0
      }
616
0
      pos += length;
617
0
    }
618
0
}
619
620
621
/* Register the protocol with Wireshark */
622
void
623
proto_register_docsis_vsif (void)
624
14
{
625
14
  static hf_register_info hf[] = {
626
14
    {&hf_docsis_vsif_vendorid,
627
14
     {"Vendor ID", "docsis_vsif.vendorid",
628
14
      FT_UINT24, BASE_HEX, VALS(vendorid_vals), 0x0,
629
14
      "Vendor Identifier", HFILL}
630
14
    },
631
14
    {&hf_docsis_vsif_vendor_unknown,
632
14
     {"VSIF Encodings", "docsis_vsif.unknown",
633
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
634
14
      "Unknown Vendor", HFILL}
635
14
    },
636
14
    {&hf_docsis_vsif_cisco_numphones,
637
14
     {"Number of phone lines", "docsis_vsif.cisco.numphones",
638
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
639
14
      NULL, HFILL}
640
14
    },
641
#if 0
642
    {&hf_docsis_vsif_cisco_ipprec,
643
     {"IP Precedence Encodings", "docsis_vsif.cisco.ipprec",
644
      FT_BYTES, BASE_NONE, NULL, 0x0,
645
      NULL, HFILL}
646
    },
647
#endif
648
14
    {&hf_docsis_vsif_cisco_ipprec_val,
649
14
     {"IP Precedence Value", "docsis_vsif.cisco.ipprec.value",
650
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
651
14
      NULL, HFILL}
652
14
    },
653
14
    {&hf_docsis_vsif_cisco_ipprec_bw,
654
14
     {"IP Precedence Bandwidth", "docsis_vsif.cisco.ipprec.bw",
655
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
656
14
      NULL, HFILL}
657
14
    },
658
14
    {&hf_docsis_vsif_cisco_config_file,
659
14
     {"IOS Config File", "docsis_vsif.cisco.iosfile",
660
14
      FT_STRING, BASE_NONE, NULL, 0x0,
661
14
      NULL, HFILL}
662
14
    },
663
14
    {&hf_docsis_vsif_gex_loadbal_policy_id,
664
14
     {".1 CM Load Balancing Policy ID", "docsis_vsif.gex.loadbal_policyid",
665
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
666
14
      "General Extension Information - CM Load Balancing Policy ID", HFILL}
667
14
    },
668
14
    {&hf_docsis_vsif_gex_loadbal_priority,
669
14
     {".2 CM Load Balancing Priority", "docsis_vsif.gex.loadbal_priority",
670
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
671
14
      "General Extension Information - CM Load Balancing Priority", HFILL}
672
14
    },
673
14
    {&hf_docsis_vsif_gex_loadbal_group_id,
674
14
     {".3 CM Load Balancing Group ID", "docsis_vsif.gex.loadbal_group_id",
675
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
676
14
      "General Extension Information - CM Load Balancing Group ID", HFILL}
677
14
    },
678
14
    {&hf_docsis_vsif_gex_ranging_class_id_extension,
679
14
     {".4 CM Ranging Class ID Extension", "docsis_vsif.gex.ranging_class_id_extension",
680
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
681
14
      "General Extension Information - CM Ranging Class ID Extension", HFILL}
682
14
    },
683
14
    {&hf_docsis_vsif_gex_l2vpn_encoding,
684
14
     {".5 L2VPN Encoding", "docsis_vsif.gex.l2vpn_encoding",
685
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
686
14
      "General Extension Information - L2VPN Encoding", HFILL}
687
14
    },
688
14
    {&hf_docsis_vsif_gex_ecm,
689
14
     {".6 Extended CMTS MIC Configuration Setting", "docsis_vsif.gex.extended_cmts_mic_configuration_setting",
690
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
691
14
      "General Extension Information - Extended CMTS MIC Configuration Setting", HFILL}
692
14
    },
693
14
    {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type,
694
14
     {"..1 Extended CMTS MIC Hmac type", "docsis_vsif.gex.extended_cmts_mic_hmac_type",
695
14
      FT_UINT8, BASE_DEC, VALS(hmac_vals), 0x0,
696
14
      "General Extension Information - Extended CMTS MIC Hmac type", HFILL}
697
14
    },
698
14
    {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap,
699
14
     {"..2 Extended CMTS MIC Bitmap", "docsis_vsif.gex.extended_cmts_mic_bitmap",
700
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
701
14
      "General Extension Information - Extended CMTS MIC Bitmap", HFILL}
702
14
    },
703
14
    {&hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype,
704
14
     {"..3 Explicit Extended CMTS MIC Digest Subtype", "docsis_vsif.gex.extended_cmts_mic_digest_subtype",
705
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
706
14
      "General Extension Information - Explicit Extended CMTS MIC Digest Subtype", HFILL}
707
14
    },
708
14
    {&hf_docsis_vsif_gex_sav,
709
14
     {".7 Source Address Verification (SAV) Authorization Encoding", "docsis_vsif.gex.sav",
710
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
711
14
      "General Extension Information - Source Address Verification (SAV) Authorization Encoding", HFILL}
712
14
    },
713
14
    {&hf_docsis_vsif_gex_sav_group_name,
714
14
     {"..1 SAV Group Name", "docsis_vsif.gex.sav.sav_group_name",
715
14
      FT_STRING, BASE_NONE, NULL, 0x0,
716
14
      "General Extension Information - SAV - SAV Group Name", HFILL}
717
14
    },
718
14
    {&hf_docsis_vsif_gex_sav_static_prefix_rule,
719
14
     {"..2 SAV Static Prefix Rule", "docsis_vsif.gex.sav.static_prefix_rule",
720
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
721
14
      "General Extension Information - SAV -Static Prefix Rule", HFILL}
722
14
    },
723
14
    {&hf_docsis_vsif_gex_sav_static_prefix_addressv4,
724
14
     {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address4",
725
14
      FT_IPv4, BASE_NONE, NULL, 0x0,
726
14
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL}
727
14
    },
728
14
    {&hf_docsis_vsif_gex_sav_static_prefix_addressv6,
729
14
     {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address6",
730
14
      FT_IPv6, BASE_NONE, NULL, 0x0,
731
14
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL}
732
14
    },
733
14
    {&hf_docsis_vsif_gex_sav_static_prefix_length,
734
14
     {"...2 SAV Static Prefix Length", "docsis_vsif.gex.sav.spr.static_prefix_length",
735
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
736
14
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Length", HFILL}
737
14
    },
738
14
    {&hf_docsis_vsif_gex_cmam,
739
14
     {".9 CM Attribute Mask", "docsis_vsif.gex.cmam",
740
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
741
14
      "General Extension Information - CM Attribute Mask", HFILL}
742
14
    },
743
14
    {&hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask,
744
14
     {"..1 CM Required Downstream Attribute", "docsis_vsif.gex.cmam.cm_required_downstream_attribute",
745
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
746
14
      "General Extension Information - CM Attribute Mask - CM Required Downstream Attribute", HFILL}
747
14
    },
748
14
    {&hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask,
749
14
     {"..2 CM Forbidden Downstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_downstream_attribute",
750
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
751
14
      "General Extension Information - CM Attribute Mask - CM Forbidden Downstream Attribute", HFILL}
752
14
    },
753
14
    {&hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask,
754
14
     {"..3 CM Required Upstream Attribute", "docsis_vsif.gex.cmam.cm_required_upstream_attribute",
755
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
756
14
      "General Extension Information - CM Attribute Mask - CM Required Upstream Attribute", HFILL}
757
14
    },
758
14
    {&hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask,
759
14
     {"..4 CM Forbidden Upstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_upstream_attribute",
760
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
761
14
      "General Extension Information - CM Attribute Mask - CM Forbidden Upstream Attribute", HFILL}
762
14
    },
763
14
    {&hf_docsis_vsif_gex_imja,
764
14
     {".10 IP Multicast Join Authorization", "docsis_vsif.gex.imja",
765
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
766
14
      "General Extension Information - IP Multicast Join Authorization", HFILL}
767
14
    },
768
14
    {&hf_docsis_vsif_gex_imja_ip_multicast_profile_name,
769
14
     {"..1 IP Multicast Profile Name", "docsis_vsif.gex.imja.ip_multicast_profile_name",
770
14
      FT_STRING, BASE_NONE, NULL, 0x0,
771
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Name", HFILL}
772
14
    },
773
14
    {&hf_docsis_vsif_gex_imja_ssr,
774
14
     {"..2 IP Multicast Profile Join Authorization Static Session Rule", "docsis_vsif.gex.imja.ip_multicast_join_authorization_static_session_rule",
775
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
776
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule", HFILL}
777
14
    },
778
14
    {&hf_docsis_vsif_gex_imja_ssr_rule_priority,
779
14
     {"...1 Rule Priority", "docsis_vsif.gex.imja.imja_ssr_rule_priority",
780
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
781
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL}
782
14
    },
783
14
    {&hf_docsis_vsif_gex_imja_ssr_authorization_action,
784
14
     {"...2 Authorization Action", "docsis_vsif.gex.imja.imja_ssr_authorization_action",
785
14
      FT_UINT8, BASE_DEC, VALS(authorization_action_vals), 0x0,
786
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL}
787
14
    },
788
14
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4,
789
14
     {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address4",
790
14
      FT_IPv4, BASE_NONE, NULL, 0x0,
791
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL}
792
14
    },
793
14
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6,
794
14
     {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address6",
795
14
      FT_IPv6, BASE_NONE, NULL, 0x0,
796
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL}
797
14
    },
798
14
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_length,
799
14
     {"...4 Source Prefix Length", "docsis_vsif.gex.imja.imja_ssr_source_prefix_length",
800
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
801
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Length", HFILL}
802
14
    },
803
14
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4,
804
14
     {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address4",
805
14
      FT_IPv4, BASE_NONE, NULL, 0x0,
806
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL}
807
14
    },
808
14
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6,
809
14
     {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address6",
810
14
      FT_IPv6, BASE_NONE, NULL, 0x0,
811
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL}
812
14
    },
813
14
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_length,
814
14
     {"...6 Group Prefix Length", "docsis_vsif.gex.imja.imja_ssr_group_prefix_length",
815
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
816
14
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Length", HFILL}
817
14
    },
818
14
    {&hf_docsis_vsif_gex_imja_maximum_multicast_sessions,
819
14
     {"..3 Maximum Multicast Sessions", "docsis_vsif.gex.imja.imja_maximum_multicast_sessions",
820
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
821
14
      "General Extension Information - IP Multicast Join Authorization - Maximum Multicast Sessions", HFILL}
822
14
    },
823
14
    {&hf_docsis_vsif_gex_service_type_identifier,
824
14
     {".11 Service Type Identifier", "docsis_vsif.gex.service_type_identifier",
825
14
      FT_STRING, BASE_NONE, NULL, 0x0,
826
14
      "General Extension Information - Service Type Identifier", HFILL}
827
14
    },
828
14
    {&hf_docsis_vsif_tlv_unknown,
829
14
     {"Unknown VSIF TLV", "docsis_vsif.unknown",
830
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
831
14
      NULL, HFILL}
832
14
    },
833
14
  };
834
835
14
  static int *ett[] = {
836
14
    &ett_docsis_vsif,
837
14
    &ett_docsis_vsif_ipprec,
838
14
    &ett_docsis_vsif_gex_ecm,
839
14
    &ett_docsis_vsif_gex_sav,
840
14
    &ett_docsis_vsif_gex_sav_spr,
841
14
    &ett_docsis_vsif_gex_cmam,
842
14
    &ett_docsis_vsif_gex_imja,
843
14
    &ett_docsis_vsif_gex_imja_ssr
844
14
  };
845
846
14
  expert_module_t* expert_docsis_vsif;
847
848
14
  static ei_register_info ei[] = {
849
14
    {&ei_docsis_vsif_tlvlen_bad, { "docsis_vsif.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
850
14
    {&ei_docsis_vsif_tlvtype_unknown, { "docsis_vsif.tlvtypeunknown", PI_PROTOCOL, PI_WARN, "Unknown TLV type", EXPFILL}},
851
14
  };
852
853
14
  proto_docsis_vsif =
854
14
    proto_register_protocol ("DOCSIS Vendor Specific Encodings",
855
14
                             "DOCSIS VSIF", "docsis_vsif");
856
857
14
  proto_register_field_array (proto_docsis_vsif, hf, array_length (hf));
858
14
  proto_register_subtree_array (ett, array_length (ett));
859
14
  expert_docsis_vsif = expert_register_protocol(proto_docsis_vsif);
860
14
  expert_register_field_array(expert_docsis_vsif, ei, array_length(ei));
861
862
14
  register_dissector ("docsis_vsif", dissect_vsif, proto_docsis_vsif);
863
14
}
864
865
void
866
proto_reg_handoff_docsis_vsif (void)
867
14
{
868
#if 0
869
  dissector_handle_t docsis_vsif_handle;
870
871
  docsis_vsif_handle = find_dissector ("docsis_vsif");
872
  dissector_add_uint ("docsis", 0xFD, docsis_vsif_handle);
873
#endif
874
14
}
875
876
/*
877
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
878
 *
879
 * Local Variables:
880
 * c-basic-offset: 2
881
 * tab-width: 8
882
 * indent-tabs-mode: nil
883
 * End:
884
 *
885
 * ex: set shiftwidth=2 tabstop=8 expandtab:
886
 * :indentSize=2:tabSize=8:noTabs=true:
887
 */