aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/docsis/packet-vendor.c
blob: 4a870138fd7babf5988e8d4432b4661ac472ae69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
/* packet-vendor.c
 * Routines for Vendor Specific Encodings dissection
 * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


/* Notes to Adding dissectors for Vendor specific TLV's:
 * 1. Create a dissect_<vendorname> function with the following prototype:
 *   dissect_foovendor(tvbuff_t *tvb, proto_tree *tree, gint vsif_len)
 * 2. vsif_len will be the *entire* length of the vsif TLV (including the
 *   Vendor Id TLV, which is 5 bytes long).
 * 3. Create a new 'case' statement in dissect_vsif, for your specific Vendor
 *   id.
 * 4. In that 'case' statement you will make the following calls:
 *   (assume for this example that your vendor id is 0x000054)
 *   #define VENDOR_FOOVENDOR 0x00054
 *   case VENDOR_FOOVENDOR:
 *      proto_item_append_text (it, " (foo vendor)");
 *      dissect_foovendor (tvb, vsif_tree, vsif_len);
 *      break;
 * 5.  Please see dissect_cisco for an example of how to do this.
 */

#include "config.h"

#include <epan/packet.h>
#include <epan/expert.h>

/* Define Vendor ID's here */
#define VENDOR_CISCO 0x00000C
#define VENDOR_GENERAL 0xFFFFFF

void proto_register_docsis_vsif(void);
void proto_reg_handoff_docsis_vsif(void);

/* Initialize the protocol and registered fields */
static int proto_docsis_vsif = -1;
static int hf_docsis_vsif_vendorid = -1;
static int hf_docsis_vsif_vendor_unknown = -1;
static int hf_docsis_vsif_cisco_numphones = -1;
/* static int hf_docsis_vsif_cisco_ipprec = -1; */
static int hf_docsis_vsif_cisco_ipprec_val = -1;
static int hf_docsis_vsif_cisco_ipprec_bw = -1;
static int hf_docsis_vsif_cisco_config_file = -1;

static int hf_docsis_vsif_gex_loadbal_policy_id = -1;
static int hf_docsis_vsif_gex_loadbal_priority = -1;
static int hf_docsis_vsif_gex_loadbal_group_id = -1;
static int hf_docsis_vsif_gex_ranging_class_id_extension = -1;
static int hf_docsis_vsif_gex_l2vpn_encoding = -1;
static int hf_docsis_vsif_gex_ecm = -1;
static int hf_docsis_vsif_gex_sav = -1;
static int hf_docsis_vsif_gex_cmam = -1;
static int hf_docsis_vsif_gex_imja = -1;
static int hf_docsis_vsif_gex_service_type_identifier = -1;

static int hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type = -1;
static int hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap = -1;
static int hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype = -1;

static int hf_docsis_vsif_gex_sav_group_name = -1;
static int hf_docsis_vsif_gex_sav_static_prefix_rule = -1;

static int hf_docsis_vsif_gex_sav_static_prefix_addressv4 = -1;
static int hf_docsis_vsif_gex_sav_static_prefix_addressv6 = -1;
static int hf_docsis_vsif_gex_sav_static_prefix_length = -1;

static int hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask = -1;
static int hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask = -1;
static int hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask = -1;
static int hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask = -1;

static int hf_docsis_vsif_gex_imja_ip_multicast_profile_name = -1;
static int hf_docsis_vsif_gex_imja_ssr = -1;
static int hf_docsis_vsif_gex_imja_maximum_multicast_sessions = -1;

static int hf_docsis_vsif_gex_imja_ssr_rule_priority = -1;
static int hf_docsis_vsif_gex_imja_ssr_authorization_action = -1;
static int hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4 = -1;
static int hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6 = -1;
static int hf_docsis_vsif_gex_imja_ssr_source_prefix_length = -1;
static int hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4 = -1;
static int hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6 = -1;
static int hf_docsis_vsif_gex_imja_ssr_group_prefix_length = -1;

static int hf_docsis_vsif_tlv_unknown = -1;


/* Initialize the subtree pointers */
static gint ett_docsis_vsif = -1;
static gint ett_docsis_vsif_ipprec = -1;
static gint ett_docsis_vsif_gex_ecm = -1;
static gint ett_docsis_vsif_gex_sav = -1;
static gint ett_docsis_vsif_gex_sav_spr = -1;
static gint ett_docsis_vsif_gex_cmam = -1;
static gint ett_docsis_vsif_gex_imja = -1;
static gint ett_docsis_vsif_gex_imja_ssr = -1;


static expert_field ei_docsis_vsif_tlvlen_bad = EI_INIT;
static expert_field ei_docsis_vsif_tlvtype_unknown = EI_INIT;

static const value_string vendorid_vals[] = {
  {VENDOR_CISCO, "Cisco Systems, Inc."},
  {VENDOR_GENERAL, "General Extension Information"},
  {0, NULL},
};

static const value_string hmac_vals[] = {
       {1, "MD5 HMAC [RFC 2104]"},
       {2, "MMH16-sigma-n HMAC [DOCSIS SECv3.0]"},
       {43, "Vendor Specific"},
       {0, NULL},
};

static const value_string authorization_action_vals[] = {
       {0, "permit"},
       {1, "deny"},
       {0, NULL},
};


/* Dissector for Cisco Vendor Specific TLV's */

#define NUM_PHONES      0x0a
#define IOS_CONFIG_FILE 0x80
#define IP_PREC         0x0b
#define IP_PREC_VAL     0x01
#define IP_PREC_BW      0x02

static void dissect_general_extension_information (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
                          gint vsif_len);


static void
dissect_cisco (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint vsif_len)
{
  /* Start at pos = 5, since tvb includes the Vendor ID field */
  int pos = 5;
  guint8 type, length;
  proto_tree *ipprec_tree;
  proto_item *ipprec_item;
  int templen;

  while (pos < vsif_len)
    {
      /* Extract the type and length Fields from the TLV */
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case NUM_PHONES:
            proto_tree_add_item (tree, hf_docsis_vsif_cisco_numphones, tvb,
                                 pos, length, ENC_BIG_ENDIAN);
            break;
          case IP_PREC:
            ipprec_tree =
              proto_tree_add_subtree(tree, tvb, pos, length, ett_docsis_vsif_ipprec, &ipprec_item, "IP Precedence");
            /* Handle Sub-TLVs in IP Precedence */
            templen = pos + length;
            while (pos < templen)
              {
                type = tvb_get_guint8 (tvb, pos++);
                length = tvb_get_guint8 (tvb, pos++);
                switch (type)
                  {
                    case IP_PREC_VAL:
                      if (length == 1)
                      {
                        proto_tree_add_item (ipprec_tree,
                                           hf_docsis_vsif_cisco_ipprec_val, tvb,
                                           pos, length, ENC_BIG_ENDIAN);
                      }
                      else
                      {
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
                      }
                      break;
                    case IP_PREC_BW:
                      if (length != 4)
                      {
                        proto_tree_add_item (ipprec_tree,
                                           hf_docsis_vsif_cisco_ipprec_bw, tvb,
                                           pos, length, ENC_BIG_ENDIAN);
                      }
                      else
                      {
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
                      }
                      break;
                    default:
                        expert_add_info_format(pinfo, ipprec_item, &ei_docsis_vsif_tlvtype_unknown, "Unknown TLV: %u", type);
                  }
                pos += length;
              }
            break;
          case IOS_CONFIG_FILE:
            proto_tree_add_item (tree, hf_docsis_vsif_cisco_config_file, tvb,
                                 pos, length, ENC_ASCII|ENC_NA);
        }
      pos += length;
    }
}

/* Dissection */
static int
dissect_vsif (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
  proto_item *it;
  proto_tree *vsif_tree;
  guint8 type;
  guint8 length;
  guint32 value;
  gint vsif_len;

  /* get the reported length of the VSIF TLV */
  vsif_len = tvb_reported_length_remaining (tvb, 0);

  it = proto_tree_add_protocol_format (tree, proto_docsis_vsif, tvb, 0, -1,
                                        "VSIF Encodings");
  vsif_tree = proto_item_add_subtree (it, ett_docsis_vsif);
  proto_tree_add_item_ret_uint(vsif_tree, hf_docsis_vsif_vendorid, tvb, 2, 3, ENC_BIG_ENDIAN, &value);

  /* The first TLV in the VSIF encodings must be type 0x08 (Vendor ID) and
   * length 3.
   */
  type = tvb_get_guint8 (tvb, 0);
  if (type != 0x08)
     expert_add_info_format(pinfo, it, &ei_docsis_vsif_tlvtype_unknown, "Unknown TLV: %u", type);

  length = tvb_get_guint8 (tvb, 1);
  if (length != 3)
     expert_add_info_format(pinfo, it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);

  /* switch on the Vendor ID */
  switch (value)
  {
    case VENDOR_CISCO:
      proto_item_append_text (it, " (Cisco)");
      dissect_cisco (tvb, pinfo, vsif_tree, vsif_len);
      break;
    case VENDOR_GENERAL:
      proto_item_append_text (it, " (General Extension Information)");
      dissect_general_extension_information (tvb, pinfo, vsif_tree, vsif_len);
      break;
    default:
      proto_item_append_text (it, " (Unknown)");
      proto_tree_add_item (vsif_tree, hf_docsis_vsif_vendor_unknown, tvb,
                            0, -1, ENC_NA);
    break;
  }

  return tvb_captured_length(tvb);
}


#define GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE 1
#define GEX_ECM_EXTENDED_CMTS_MIC_BITMAP 2
#define GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE 3

static void
dissect_extended_cmts_mic(tvbuff_t * tvb, proto_tree *tree, int start, guint16 len)
{
  proto_item *ecm_it;
  proto_tree *ecm_tree;
  guint8 type, length;
  int pos = start;

  ecm_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_ecm, tvb, start, len, ENC_NA);
  ecm_tree = proto_item_add_subtree(ecm_it, ett_docsis_vsif_gex_ecm);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_ECM_EXTENDED_CMTS_MIC_HMAC_TYPE:
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_ECM_EXTENDED_CMTS_MIC_BITMAP:
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap, tvb, pos, length, ENC_NA);
            break;
          case GEX_ECM_EXPLICIT_EXTENDED_CMTS_MIC_DIGEST_SUBTYPE:
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype, tvb, pos, length, ENC_NA);
            break;
          default:
            proto_tree_add_item (ecm_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
            break;
        }  /* switch */
      pos += length;
    }   /* while */
}

#define GEX_SAV_STATIC_PREFIX_ADDRESS 1
#define GEX_SAV_STATIC_PREFIX_LENGTH 2

static void
dissect_sav_static_prefix_rule(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, guint16 len)
{
  proto_item *sav_spr_it;
  proto_tree *sav_spr_tree;
  guint8 type, length;
  int pos = start;

  sav_spr_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_sav_static_prefix_rule, tvb, start, len, ENC_NA);
  sav_spr_tree = proto_item_add_subtree(sav_spr_it, ett_docsis_vsif_gex_sav_spr);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_SAV_STATIC_PREFIX_ADDRESS:
            if (length == 4) {
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
            } else if (length == 6) {
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_addressv6, tvb, pos, length, ENC_NA);
            } else {
              expert_add_info_format(pinfo, sav_spr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            break;
          case GEX_SAV_STATIC_PREFIX_LENGTH:
            if (length == 1) {
              proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_gex_sav_static_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
            } else {
              expert_add_info_format(pinfo, sav_spr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            break;
          default:
            proto_tree_add_item (sav_spr_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
            break;
        }  /* switch */
        pos += length;
    }   /* while */
}



#define GEX_SAV_GROUP_NAME 1
#define GEX_SAV_STATIC_PREFIX_RULE 2


static void
dissect_sav(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, guint16 len)
{
  proto_item *sav_it;
  proto_tree *sav_tree;
  guint8 type, length;
  int pos = start;

  sav_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_sav, tvb, start, len, ENC_NA);
  sav_tree = proto_item_add_subtree(sav_it, ett_docsis_vsif_gex_sav);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
        case GEX_SAV_GROUP_NAME:
          proto_tree_add_item (sav_tree, hf_docsis_vsif_gex_sav_group_name, tvb, pos, length, ENC_ASCII|ENC_NA);
          break;
        case GEX_SAV_STATIC_PREFIX_RULE:
          dissect_sav_static_prefix_rule(tvb, pinfo, sav_tree, pos, length);
          break;
        default:
          proto_tree_add_item (sav_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
          break;
        }  /* switch */
        pos += length;
    }   /* while */
}


#define GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK 1
#define GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK 2
#define GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK 3
#define GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK 4

static void
dissect_cable_modem_attribute_masks(tvbuff_t * tvb, packet_info * pinfo, proto_tree *tree, int start, guint16 len)
{
  proto_item *cmam_it;
  proto_tree *cmam_tree;
  guint8 type, length;
  int pos = start;

  cmam_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_cmam, tvb, start, len, ENC_NA);
  cmam_tree = proto_item_add_subtree(cmam_it, ett_docsis_vsif_gex_cmam);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_CM_REQUIRED_DOWNSTREAM_ATTRIBUTE_MASK:
            if (length != 4) {
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask, tvb, pos, length, ENC_NA);
            break;
          case GEX_CM_FORBIDDEN_DOWNSTREAM_ATTRIBUTE_MASK:
            if (length != 4) {
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask, tvb, pos, length, ENC_NA);
            break;
          case GEX_CM_REQUIRED_UPSTREAM_ATTRIBUTE_MASK:
            if (length != 4) {
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask, tvb, pos, length, ENC_NA);
            break;
          case GEX_CM_FORBIDDEN_UPSTREAM_ATTRIBUTE_MASK:
            if (length != 4) {
              expert_add_info_format(pinfo, cmam_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (cmam_tree, hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask, tvb, pos, length, ENC_NA);
            break;
          default: proto_tree_add_item (cmam_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
        }  /* switch */
        pos += length;
    }   /* while */
}


#define GEX_IMJA_SSR_RULE_PRIORITY 1
#define GEX_IMJA_SSR_AUTHORIZATION_ACTION 2
#define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS 3
#define GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH 4
#define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS 5
#define GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH 6


static void
dissect_ip_multicast_join_authorization_static_session_rule(tvbuff_t * tvb, packet_info * pinfo, proto_tree *tree, int start, guint16 len)
{
  proto_item *imja_ssr_it;
  proto_tree *imja_ssr_tree;
  guint8 type, length;
  int pos = start;

  imja_ssr_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_imja_ssr, tvb, start, len, ENC_NA);
  imja_ssr_tree = proto_item_add_subtree(imja_ssr_it, ett_docsis_vsif_gex_imja_ssr);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_IMJA_SSR_RULE_PRIORITY:
            if (length != 1) {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_rule_priority, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_IMJA_SSR_AUTHORIZATION_ACTION:
            if (length != 1) {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_authorization_action, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_ADDRESS:
            if (length == 4) {
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
            } else if (length == 6) {
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6, tvb, pos, length, ENC_NA);
            } else {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            break;
          case GEX_IMJA_SSR_AUTHORIZATION_SOURCE_PREFIX_LENGTH:
            if (length != 1) {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_source_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_ADDRESS:
            if (length == 4) {
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4, tvb, pos, length, ENC_BIG_ENDIAN);
            } else if (length == 6) {
              proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6, tvb, pos, length, ENC_NA);
            } else {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            break;
          case GEX_IMJA_SSR_AUTHORIZATION_GROUP_PREFIX_LENGTH:
            if (length != 1) {
              expert_add_info_format(pinfo, imja_ssr_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_gex_imja_ssr_group_prefix_length, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          default: proto_tree_add_item (imja_ssr_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
        }  /* switch */
        pos += length;
    }   /* while */
}

#define GEX_IMJA_IP_MULTICAST_PROFILE_NAME 1
#define GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE 2
#define GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS 3


static void
dissect_ip_multicast_join_authorization(tvbuff_t * tvb, packet_info * pinfo,  proto_tree *tree, int start, guint16 len)
{
  proto_item *imja_it;
  proto_tree *imja_tree;
  guint8 type, length;
  int pos = start;

  imja_it = proto_tree_add_item (tree, hf_docsis_vsif_gex_imja, tvb, start, len, ENC_NA);
  imja_tree = proto_item_add_subtree(imja_it, ett_docsis_vsif_gex_imja);

  while (pos < (start + len))
    {
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_IMJA_IP_MULTICAST_PROFILE_NAME:
            if ((length < 1) || (length > 15)) {
              expert_add_info_format(pinfo, imja_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_tree, hf_docsis_vsif_gex_imja_ip_multicast_profile_name, tvb, pos, length, ENC_ASCII|ENC_NA);
            break;
          case GEX_IMJA_IP_MULTICAST_PROFILE_JOIN_AUTHORIZATION_STATIC_SESSION_RULE:
            dissect_ip_multicast_join_authorization_static_session_rule(tvb, pinfo, imja_tree, pos, length);
            break;
          case GEX_IMJA_MAXIMUM_MULTICAST_SESSIONS:
            if (length != 2) {
              expert_add_info_format(pinfo, imja_it, &ei_docsis_vsif_tlvlen_bad, "Wrong TLV length: %u", length);
            }
            proto_tree_add_item (imja_tree, hf_docsis_vsif_gex_imja_maximum_multicast_sessions, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          default: proto_tree_add_item (imja_tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
        }  /* switch */
        pos += length;
    }   /* while */
}



/* Dissector for General Extension TLV's */

#define GEX_CM_LOAD_BALANCING_POLICY_ID 1
#define GEX_CM_LOAD_BALANCING_PRIORITY 2
#define GEX_CM_LOAD_BALANCING_GROUP_ID 3
#define GEX_CM_RANGING_CLASS_ID_EXTENSION 4
#define GEX_L2VPN_ENCODING 5
#define GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING 6
#define GEX_EXTENDED_SAV 7
#define GEX_CABLE_MODEM_ATTRIBUTE_MASKS 9
#define GEX_IP_MULTICAST_JOIN_AUTHORIZATION 10
#define GEX_SERVICE_TYPE_IDENTIFIER 11



static void
dissect_general_extension_information (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint vsif_len)
{
  /* Start at pos = 5, since tvb includes the Vendor ID field */
  int pos = 5;
  guint8 type, length;

  while (pos < vsif_len)
    {
      /* Extract the type and length Fields from the TLV */
      type = tvb_get_guint8 (tvb, pos++);
      length = tvb_get_guint8 (tvb, pos++);
      switch (type)
        {
          case GEX_CM_LOAD_BALANCING_POLICY_ID:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_policy_id, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_CM_LOAD_BALANCING_PRIORITY:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_priority, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_CM_LOAD_BALANCING_GROUP_ID:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_loadbal_group_id, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_CM_RANGING_CLASS_ID_EXTENSION:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_ranging_class_id_extension, tvb, pos, length, ENC_BIG_ENDIAN);
            break;
          case GEX_L2VPN_ENCODING:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_l2vpn_encoding, tvb, pos, length, ENC_NA);
            break;
          case GEX_EXTENDED_CMTS_MIC_CONFIGURATION_SETTING:
            dissect_extended_cmts_mic(tvb, tree, pos, length);
            break;
          case GEX_EXTENDED_SAV:
            dissect_sav(tvb, pinfo, tree, pos, length);
            break;
          case GEX_CABLE_MODEM_ATTRIBUTE_MASKS:
            dissect_cable_modem_attribute_masks(tvb, pinfo, tree, pos, length);
            break;
          case GEX_IP_MULTICAST_JOIN_AUTHORIZATION:
            dissect_ip_multicast_join_authorization(tvb, pinfo, tree, pos, length);
            break;
          case GEX_SERVICE_TYPE_IDENTIFIER:
            proto_tree_add_item (tree, hf_docsis_vsif_gex_service_type_identifier, tvb, pos, length, ENC_ASCII|ENC_NA);
            break;
          default:
            proto_tree_add_item (tree, hf_docsis_vsif_tlv_unknown, tvb, pos, length, ENC_NA);
      }
      pos += length;
    }
}


/* Register the protocol with Wireshark */
void
proto_register_docsis_vsif (void)
{
  static hf_register_info hf[] = {
    {&hf_docsis_vsif_vendorid,
     {"Vendor Id", "docsis_vsif.vendorid",
      FT_UINT24, BASE_HEX, VALS(vendorid_vals), 0x0,
      "Vendor Identifier", HFILL}
    },
    {&hf_docsis_vsif_vendor_unknown,
     {"VSIF Encodings", "docsis_vsif.unknown",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "Unknown Vendor", HFILL}
    },
    {&hf_docsis_vsif_cisco_numphones,
     {"Number of phone lines", "docsis_vsif.cisco.numphones",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      NULL, HFILL}
    },
#if 0
    {&hf_docsis_vsif_cisco_ipprec,
     {"IP Precedence Encodings", "docsis_vsif.cisco.ipprec",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      NULL, HFILL}
    },
#endif
    {&hf_docsis_vsif_cisco_ipprec_val,
     {"IP Precedence Value", "docsis_vsif.cisco.ipprec.value",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      NULL, HFILL}
    },
    {&hf_docsis_vsif_cisco_ipprec_bw,
     {"IP Precedence Bandwidth", "docsis_vsif.cisco.ipprec.bw",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      NULL, HFILL}
    },
    {&hf_docsis_vsif_cisco_config_file,
     {"IOS Config File", "docsis_vsif.cisco.iosfile",
      FT_STRING, BASE_NONE, NULL, 0x0,
      NULL, HFILL}
    },
    {&hf_docsis_vsif_gex_loadbal_policy_id,
     {".1 CM Load Balancing Policy ID", "docsis_vsif.gex.loadbal_policyid",
      FT_UINT32, BASE_DEC, NULL, 0x0,
      "General Extension Information - CM Load Balancing Policy ID", HFILL}
    },
    {&hf_docsis_vsif_gex_loadbal_priority,
     {".2 CM Load Balancing Priority", "docsis_vsif.gex.loadbal_priority",
      FT_UINT32, BASE_DEC, NULL, 0x0,
      "General Extension Information - CM Load Balancing Priority", HFILL}
    },
    {&hf_docsis_vsif_gex_loadbal_group_id,
     {".3 CM Load Balancing Group ID", "docsis_vsif.gex.loadbal_group_id",
      FT_UINT32, BASE_DEC, NULL, 0x0,
      "General Extension Information - CM Load Balancing Group ID", HFILL}
    },
    {&hf_docsis_vsif_gex_ranging_class_id_extension,
     {".4 CM Ranging Class ID Extension", "docsis_vsif.gex.ranging_class_id_extension",
      FT_UINT32, BASE_DEC, NULL, 0x0,
      "General Extension Information - CM Ranging Class ID Extension", HFILL}
    },
    {&hf_docsis_vsif_gex_l2vpn_encoding,
     {".5 L2VPN Encoding", "docsis_vsif.gex.l2vpn_encoding",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - L2VPN Encoding", HFILL}
    },
    {&hf_docsis_vsif_gex_ecm,
     {".6 Extended CMTS MIC Configuration Setting", "docsis_vsif.gex.extended_cmts_mic_configuration_setting",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - Extended CMTS MIC Configuration Setting", HFILL}
    },
    {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_hmac_type,
     {"..1 Extended CMTS MIC Hmac type", "docsis_vsif.gex.extended_cmts_mic_hmac_type",
      FT_UINT8, BASE_DEC, VALS(hmac_vals), 0x0,
      "General Extension Information - Extended CMTS MIC Hmac type", HFILL}
    },
    {&hf_docsis_vsif_gex_ecm_extended_cmts_mic_bitmap,
     {"..2 Extended CMTS MIC Bitmap", "docsis_vsif.gex.extended_cmts_mic_bitmap",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - Extended CMTS MIC Bitmap", HFILL}
    },
    {&hf_docsis_vsif_gex_ecm_explicit_extended_cmts_mic_digest_subtype,
     {"..3 Explicit Extended CMTS MIC Digest Subtype", "docsis_vsif.gex.extended_cmts_mic_digest_subtype",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - Explicit Extended CMTS MIC Digest Subtype", HFILL}
    },
    {&hf_docsis_vsif_gex_sav,
     {".7 Source Address Verification (SAV) Authorization Encoding", "docsis_vsif.gex.sav",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - Source Address Verification (SAV) Authorization Encoding", HFILL}
    },
    {&hf_docsis_vsif_gex_sav_group_name,
     {"..1 SAV Group Name", "docsis_vsif.gex.sav.sav_group_name",
      FT_STRING, BASE_NONE, NULL, 0x0,
      "General Extension Information - SAV - SAV Group Name", HFILL}
    },
    {&hf_docsis_vsif_gex_sav_static_prefix_rule,
     {"..2 SAV Static Prefix Rule", "docsis_vsif.gex.sav.static_prefix_rule",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - SAV -Static Prefix Rule", HFILL}
    },
    {&hf_docsis_vsif_gex_sav_static_prefix_addressv4,
     {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address",
      FT_IPv4, BASE_NONE, NULL, 0x0,
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_sav_static_prefix_addressv6,
     {"...1 SAV Static Prefix Address", "docsis_vsif.gex.sav.spr.static_prefix_address",
      FT_IPv6, BASE_NONE, NULL, 0x0,
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_sav_static_prefix_length,
     {"...2 SAV Static Prefix Length", "docsis_vsif.gex.sav.spr.static_prefix_length",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      "General Extension Information - SAV -Static Prefix Rule - Static Prefix Length", HFILL}
    },
    {&hf_docsis_vsif_gex_cmam,
     {".9 CM Attribute Mask", "docsis_vsif.gex.cmam",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - CM Attribute Mask", HFILL}
    },
    {&hf_docsis_vsif_gex_cmam_cm_required_downstream_attribute_mask,
     {"..1 CM Required Downstream Attribute", "docsis_vsif.gex.cmam.cm_required_downstream_attribute",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - CM Attribute Mask - CM Required Downstream Attribute", HFILL}
    },
    {&hf_docsis_vsif_gex_cmam_cm_forbidden_downstream_attribute_mask,
     {"..2 CM Forbidden Downstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_downstream_attribute",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - CM Attribute Mask - CM Forbidden Downstream Attribute", HFILL}
    },
    {&hf_docsis_vsif_gex_cmam_cm_required_upstream_attribute_mask,
     {"..3 CM Required Upstream Attribute", "docsis_vsif.gex.cmam.cm_required_upstream_attribute",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - CM Attribute Mask - CM Required Upstream Attribute", HFILL}
    },
    {&hf_docsis_vsif_gex_cmam_cm_forbidden_upstream_attribute_mask,
     {"..4 CM Forbidden Upstream Attribute", "docsis_vsif.gex.cmam.cm_forbidden_upstream_attribute",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - CM Attribute Mask - CM Forbidden Upstream Attribute", HFILL}
    },
    {&hf_docsis_vsif_gex_imja,
     {".10 IP Multicast Join Authorization", "docsis_vsif.gex.imja",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ip_multicast_profile_name,
     {"..1 IP Multicast Profile Name", "docsis_vsif.gex.imja.ip_multicast_profile_name",
      FT_STRING, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Name", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr,
     {"..2 IP Multicast Profile Join Authorization Static Session Rule", "docsis_vsif.gex.imja.ip_multicast_join_authorization_static_session_rule",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_rule_priority,
     {"...1 Rule Priority", "docsis_vsif.gex.imja.imja_ssr_rule_priority",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_authorization_action,
     {"...2 Authorization Action", "docsis_vsif.gex.imja.imja_ssr_authorization_action",
      FT_UINT8, BASE_DEC, VALS(authorization_action_vals), 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Rule Priority", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv4,
     {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address",
      FT_IPv4, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_addressv6,
     {"...3 Source Prefix Address", "docsis_vsif.gex.imja.imja_ssr_source_prefix_address",
      FT_IPv6, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_source_prefix_length,
     {"...4 Source Prefix Length", "docsis_vsif.gex.imja.imja_ssr_source_prefix_length",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Source Prefix Length", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv4,
     {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address",
      FT_IPv4, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_addressv6,
     {"...5 Group Prefix Address", "docsis_vsif.gex.imja.imja_ssr_group_prefix_address",
      FT_IPv6, BASE_NONE, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Address", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_ssr_group_prefix_length,
     {"...6 Group Prefix Length", "docsis_vsif.gex.imja.imja_ssr_group_prefix_length",
      FT_UINT8, BASE_DEC, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - IP Multicast Profile Join Authorization Static Session Rule - Group Prefix Length", HFILL}
    },
    {&hf_docsis_vsif_gex_imja_maximum_multicast_sessions,
     {"..3 Maximum Multicast Sessions", "docsis_vsif.gex.imja.imja_maximum_multicast_sessions",
      FT_UINT16, BASE_DEC, NULL, 0x0,
      "General Extension Information - IP Multicast Join Authorization - Maximum Multicast Sessions", HFILL}
    },
    {&hf_docsis_vsif_gex_service_type_identifier,
     {".11 Service Type Identifier", "docsis_vsif.gex.service_type_identifier",
      FT_STRING, BASE_NONE, NULL, 0x0,
      "General Extension Information - Service Type Identifier", HFILL}
    },
    {&hf_docsis_vsif_tlv_unknown,
     {"Unknown VSIF TLV", "docsis_vsif.unknown",
      FT_BYTES, BASE_NONE, NULL, 0x0,
      NULL, HFILL}
    },
  };

  static gint *ett[] = {
    &ett_docsis_vsif,
    &ett_docsis_vsif_ipprec,
    &ett_docsis_vsif_gex_ecm,
    &ett_docsis_vsif_gex_sav,
    &ett_docsis_vsif_gex_sav_spr,
    &ett_docsis_vsif_gex_cmam,
    &ett_docsis_vsif_gex_imja,
    &ett_docsis_vsif_gex_imja_ssr
  };

  expert_module_t* expert_docsis_vsif;

  static ei_register_info ei[] = {
    {&ei_docsis_vsif_tlvlen_bad, { "docsis_vsif.tlvlenbad", PI_MALFORMED, PI_ERROR, "Bad TLV length", EXPFILL}},
    {&ei_docsis_vsif_tlvtype_unknown, { "docsis_vsif.tlvtypeunknown", PI_PROTOCOL, PI_WARN, "Unknown TLV type", EXPFILL}},
  };

  proto_docsis_vsif =
    proto_register_protocol ("DOCSIS Vendor Specific Encodings",
                             "DOCSIS VSIF", "docsis_vsif");

  proto_register_field_array (proto_docsis_vsif, hf, array_length (hf));
  proto_register_subtree_array (ett, array_length (ett));
  expert_docsis_vsif = expert_register_protocol(proto_docsis_vsif);
  expert_register_field_array(expert_docsis_vsif, ei, array_length(ei));

  register_dissector ("docsis_vsif", dissect_vsif, proto_docsis_vsif);
}

void
proto_reg_handoff_docsis_vsif (void)
{
#if 0
  dissector_handle_t docsis_vsif_handle;

  docsis_vsif_handle = find_dissector ("docsis_vsif");
  dissector_add_uint ("docsis", 0xFD, docsis_vsif_handle);
#endif
}

/*
 * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
 *
 * Local Variables:
 * c-basic-offset: 2
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * ex: set shiftwidth=2 tabstop=8 expandtab:
 * :indentSize=2:tabSize=8:noTabs=true:
 */