Browse Source

Added support for TLV64, fixed decode function to support TLV64

John Barbieri 10 years ago
parent
commit
0a5fb4b42c
3 changed files with 11 additions and 6 deletions
  1. 1 1
      src/docsis_common.h
  2. 5 5
      src/docsis_decode.c
  3. 5 0
      src/docsis_symtable.h

+ 1 - 1
src/docsis_common.h

@@ -31,7 +31,7 @@
 
 
 #ifndef NUM_IDENTIFIERS
-#define NUM_IDENTIFIERS 347
+#define NUM_IDENTIFIERS 351
 #endif /*  NUM_IDENTIFIERS, needed in docsis_symtable.h  */
 
 #define MAXINT 2000000000

+ 5 - 5
src/docsis_decode.c

@@ -441,18 +441,18 @@ void decode_main_aggregate (unsigned char *tlvbuf, size_t buflen)
   __docsis_indent(INDENT_NOOP, TRUE);
 
   current_symbol = find_symbol_by_code_and_pid (cp[0],0);
-  if (cp[0] == 64) {
-	tlv_llen = 2;
+ /* if (cp[0] == 64) {
+	tlv_llen = 1;
 	tlv_vlen = (size_t) ntohs(*((unsigned short *)(cp+1)));
-  } else  {
+  } else  { */
 	tlv_llen = 1;
 	tlv_vlen = (size_t) cp[1];
-  }
+/*  } */
   if (current_symbol == NULL) {
 		decode_unknown(cp, NULL, (size_t) cp[1] );
   	} else {
       		current_symbol->decode_func (cp+1+tlv_llen, current_symbol, tlv_vlen );
-  	}
+  	} 
 #ifdef DEBUG
 	if (cp[0] == 64 )   /* TLV 64 has length encoded as a short */
 	   printf("/* TLV 64, size %hu */ \n", ntohs(*((unsigned short *)(cp+1))) );

+ 5 - 0
src/docsis_symtable.h

@@ -414,6 +414,11 @@ symbol_type symtable[NUM_IDENTIFIERS] =  {
 
 /*{ 156, "SnmpMibObject",                    64, 0,    (encode_nothing),     (decode_snmp_object),    1,        2048       },*/
 
+{ 500, "CMTSStaticMulticastSessionEncodings",  64,     0,    (encode_nothing),          (decode_aggregate),      0,           0	            },
+{ 501, "CMTSStaticMulticastSessionGroup",      1,      500,  (encode_ip),               (decode_ip),             4,           16            },
+{ 502, "CMTSStaticMulticastSessionSource",     2,      500,  (encode_ip),               (decode_ip),             4,           16            },
+{ 503, "CMTSStaticMulticastSessionCMIM",       3,      500,  (encode_hexstr),           (decode_hexstr),         0,           0             },
+
 /* eRouter TLVs */
 { 175,    "eRouter",                           202,    0,      (encode_nothing),        (decode_aggregate),      0,           0             }, /* TLV 202 eRouter-I12 */
 { 176,    "InitializationMode",                1,      175,    (encode_uchar),          (decode_uchar),          0,           3             }, /* TLV 202.1 eRouter-I12 Annex B.4.2 */