2 * Routines for the disassembly of the 3com NetworkJack management protocol
6 * Copyright 2005 Joerg Mayer (see AUTHORS file)
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 - Find out lots more values :-)
30 - Support for other 3com devices that use the same protocol
31 - Do any devices use TCP or different ports?
32 - Sanity checks for tlv_length depending on tlv_type
33 - Search and fix XXX comments in the code
34 - Proper descriptions in hf_ fields
37 No specs available. All knowledge gained by looking at traffic dumps
38 Packets to Managementstation: PORT_NJACK_PC (5264)
39 Packets to Switch: PORT_NJACK_SWITCH (5265)
41 Type 0x00? (localquery): M -> BC, Magic, type, 'LOCALQUERY'?
42 Type 0x01 (query): M -> S, Magic, type, 'QUERY'
43 Type 0x02 (query resp): S -> M, Magic, type, tlv-list (end: ffxx)
44 Type 0x04 ??? (after query resp): M -> S, Magic, type, 0x43AAD406
45 Type 0x07 (set): M -> S, Magic, type, length (16 bit be)
46 Type 0x08 (set resp): S -> M, Magic, type, net length (8 bit), result status
47 Type 0x0b (get): M -> S, Magic, type, 00 00 63 ff
48 Type 0x0c (get resp): S -> M, Magic, type, T(8 bit) L(8 bit) V(L bytes)
49 Type 0x0d (dhcpinfo): S -> M, Magic, type, tlv, t=00 = last (no length)
50 Type 0x10 (clear counters): M -> S, Magic, type, 0400
51 Type 0x10 (clear counters resp): M -> S, Magic, type, 00
59 #include <epan/packet.h>
60 #include <epan/emem.h>
62 /* protocol handles */
63 static int proto_njack = -1;
66 static int ett_njack = -1;
67 static int ett_njack_tlv_header = -1;
70 static int hf_njack_magic = -1;
71 static int hf_njack_type = -1;
72 /* type set/get response */
73 static int hf_njack_tlv_length = -1;
74 static int hf_njack_tlv_data = -1;
75 static int hf_njack_tlv_version = -1;
76 static int hf_njack_tlv_type = -1;
77 static int hf_njack_tlv_typeip = -1;
78 static int hf_njack_tlv_devicemac = -1;
79 static int hf_njack_tlv_snmpwrite = -1;
80 static int hf_njack_tlv_dhcpcontrol = -1;
81 static int hf_njack_tlv_typestring = -1;
83 static int hf_njack_tlv_countermode = -1;
84 static int hf_njack_tlv_scheduling = -1;
85 static int hf_njack_tlv_addtagscheme = -1;
86 static int hf_njack_tlv_portingressmode = -1;
87 static int hf_njack_tlv_maxframesize = -1;
88 static int hf_njack_tlv_powerforwarding = -1;
90 static int hf_njack_set_length = -1;
91 static int hf_njack_set_salt = -1;
92 static int hf_njack_set_authdata = -1;
93 /* type 08: set result */
94 static int hf_njack_setresult = -1;
96 /* type 0c: get response */
97 static int hf_njack_getresp_unknown1 = -1;
99 #define PROTO_SHORT_NAME "NJACK"
100 #define PROTO_LONG_NAME "3com Network Jack"
102 #define PORT_NJACK_PC 5264
103 #define PORT_NJACK_SWITCH 5265
106 NJACK_TYPE_QUERY = 0x01,
107 NJACK_TYPE_QUERYRESP = 0x02,
108 /* type 0x04 exists - see specs sections */
109 NJACK_TYPE_SET = 0x07,
110 NJACK_TYPE_SETRESULT = 0x08,
112 NJACK_TYPE_GET = 0x0b,
113 NJACK_TYPE_GETRESP = 0x0c,
115 NJACK_TYPE_DHCPINFO = 0x0d,
117 NJACK_TYPE_CLEARCOUNTER = 0x10,
118 NJACK_TYPE_COUNTERRESP = 0x11
121 static const value_string njack_type_vals[] = {
122 { NJACK_TYPE_SET, "Set"},
123 { NJACK_TYPE_SETRESULT, "Set result"},
124 { NJACK_TYPE_QUERY, "Query (discovery)"},
125 { NJACK_TYPE_QUERYRESP, "Query response"},
126 { NJACK_TYPE_GET, "Get"},
127 { NJACK_TYPE_GETRESP, "Get response"},
128 { NJACK_TYPE_DHCPINFO, "DHCP info\?\?"},
129 { NJACK_TYPE_CLEARCOUNTER, "Clear counters\?\?"},
130 { NJACK_TYPE_COUNTERRESP, "Clear counters response\?\?"},
136 NJACK_CMD_STARTOFPARAMS = 0x00,
137 NJACK_CMD_MACADDRESS = 0x01,
138 NJACK_CMD_IPADDRESS = 0x02,
139 NJACK_CMD_NETWORK = 0x03,
140 NJACK_CMD_MASK = 0x04,
141 NJACK_CMD_MAXFRAMESIZE = 0x05,
142 NJACK_CMD_COUNTERMODE = 0x06,
143 NJACK_CMD_QUEUEING = 0x0a,
144 NJACK_CMD_ADDTAGSCHEME = 0x0b,
145 NJACK_CMD_REMOVETAG = 0x0c,
146 NJACK_CMD_GROUP = 0x0d,
147 NJACK_CMD_LOCATION = 0x0e,
148 NJACK_CMD_VERSION = 0x0f,
149 NJACK_CMD_PORT1 = 0x13,
150 NJACK_CMD_PORT2 = 0x14,
151 NJACK_CMD_PORT3 = 0x15,
152 NJACK_CMD_PORT4 = 0x16,
153 NJACK_CMD_PASSWORD = 0x19,
154 NJACK_CMD_ENABLESNMPWRITE = 0x1a,
155 NJACK_CMD_ROCOMMUNITY = 0x1b,
156 NJACK_CMD_RWCOMMUNITY = 0x1c,
157 NJACK_CMD_POWERFORWARDING = 0x1e,
158 NJACK_CMD_DHCPCONTROL = 0x1f,
159 NJACK_CMD_IPGATEWAY = 0x20,
160 NJACK_CMD_SNMPTRAP = 0x23,
161 NJACK_CMD_COLDSTARTTRAP = 0x26,
162 NJACK_CMD_LINKDOWNTRAP = 0x27,
163 NJACK_CMD_LINKUPTRAP = 0x28,
164 NJACK_CMD_AUTHFAILTRAP = 0x29,
165 NJACK_CMD_PRODUCTNAME = 0x2a,
166 NJACK_CMD_SERIALNO = 0x2b,
167 NJACK_CMD_GETALLPARMAMS = 0x63,
168 NJACK_CMD_ENDOFPACKET = 0xff
171 static const value_string njack_cmd_vals[] = {
172 { NJACK_CMD_STARTOFPARAMS, "Start of Parameters" },
173 { NJACK_CMD_MACADDRESS, "MAC address" },
174 { NJACK_CMD_IPADDRESS, "IP address" },
175 { NJACK_CMD_NETWORK, "IP network" },
176 { NJACK_CMD_MASK, "IP netmask" },
177 { NJACK_CMD_MAXFRAMESIZE, "Max frame size" },
178 { NJACK_CMD_COUNTERMODE, "Countermode" },
179 { NJACK_CMD_QUEUEING, "Priority scheduling policy" },
180 { NJACK_CMD_ADDTAGSCHEME, "Add tag scheme" },
181 { NJACK_CMD_REMOVETAG, "Remove tag" },
182 { NJACK_CMD_GROUP, "Device group" },
183 { NJACK_CMD_LOCATION, "Location" },
184 { NJACK_CMD_VERSION, "Firmware version" },
185 { NJACK_CMD_PORT1, "Port 1" },
186 { NJACK_CMD_PORT2, "Port 2" },
187 { NJACK_CMD_PORT3, "Port 3" },
188 { NJACK_CMD_PORT4, "Port 4" },
189 { NJACK_CMD_PASSWORD, "Device password" },
190 { NJACK_CMD_ENABLESNMPWRITE, "SNMP write enable" },
191 { NJACK_CMD_ROCOMMUNITY, "RO community" },
192 { NJACK_CMD_RWCOMMUNITY, "RW community" },
193 { NJACK_CMD_POWERFORWARDING, "Port power forwarding" },
194 { NJACK_CMD_DHCPCONTROL, "DHCP control" },
195 { NJACK_CMD_IPGATEWAY, "IP gateway" },
196 { NJACK_CMD_SNMPTRAP, "SNMP trap" },
197 { NJACK_CMD_COLDSTARTTRAP, "Coldstart trap" },
198 { NJACK_CMD_LINKDOWNTRAP, "Linkdown trap" },
199 { NJACK_CMD_LINKUPTRAP, "Linkup trap" },
200 { NJACK_CMD_AUTHFAILTRAP, "Auth fail trap" },
201 { NJACK_CMD_PRODUCTNAME, "Product name" },
202 { NJACK_CMD_SERIALNO, "Serial no" },
203 { NJACK_CMD_GETALLPARMAMS, "Get all parameters" },
204 { NJACK_CMD_ENDOFPACKET, "End of packet" },
210 NJACK_SETRESULT_SUCCESS = 0x01,
211 NJACK_SETRESULT_FAILAUTH = 0xFD
214 static const value_string njack_setresult_vals[] = {
215 { NJACK_SETRESULT_SUCCESS, "Success" },
216 { NJACK_SETRESULT_FAILAUTH, "Failauth" },
221 /* General settings TAB */
222 static const value_string njack_dhcpcontrol[] = {
228 /* End General settings TAB */
230 /* Port settings TAB */
231 static const true_false_string tfs_port_state = {
236 static const true_false_string tfs_port_autoneg = {
241 static const true_false_string tfs_port_speed = {
246 static const true_false_string tfs_port_duplex = {
251 /* End Port settings TAB */
253 /* Hardware Settings TAB */
254 static const value_string njack_scheduling[] = {
255 { 0, "Weighted fair" },
256 { 1, "Strict priority" },
261 static const value_string njack_addtagscheme[] = {
262 { 0, "Frames transmitted unmodified" },
263 { 1, "Add tag to untagged frame" },
268 static const value_string njack_portingressmode[] = {
269 { 0, "Receive unmodified" },
270 { 1, "Remove tag if present" },
275 static const value_string njack_maxframesize[] = {
276 { 0, "1522 tagged, 1518 untagged" },
282 static const value_string njack_countermode[] = {
283 { 0, "Count Rx, Tx Good frames" },
284 { 1, "RX errors, TX collisions" },
289 static const value_string njack_powerforwarding[] = {
292 /* XXX find out correct value */
297 /* End Hardware Settings TAB */
300 static const value_string njack_snmpwrite[] = {
307 static const value_string njack_snmptrap[] = {
314 static const value_string njack_coldstarttrap[] = {
321 static const value_string njack_linkdowntrap[] = {
328 static const value_string njack_linkuptrap[] = {
335 static const value_string njack_authfailtrap[] = {
344 dissect_portsettings(tvbuff_t *tvb, proto_tree *port_tree, guint32 offset)
346 /* XXX This is still work in progress, the information here
347 * may be wrong and is obviously incomplete
348 * Structure: 8 bytes, total 64 bits.
350 * Bytes 0-1: select feature
351 * 2-7: feature values
352 * Feature Indicator Valuebit(s)
353 * ------------------------------------------------------------
354 * Port Vlan 0x8000 0x0000 0078 0000 (bits: port 4 ... 1)
355 * Prio (hw queue) 0x4000 0x0000 0006 0000
356 * MC rate limit 0x1000 0x0000 6000 0000 (0:3, 1:6, 2:12, 3:100%)
357 * Speed/Duplex 0x0c00 XXX don't know which bit is speed / duplex
358 * 0x0000 0800 0000 (duplex 0 half, 1 full)
359 * 0x0000 1000 0000 (speed 0 10M, 1 100M)
360 * Port Ena 0x0100 0x0000 0300 0000 (1 dis, 3 ena)
361 * Auto neg 0x0008 0x0000 0000 0800 (0 man, 1 auto)
362 * Vlan number 0x0004 0xff0f 0000 0000 (le)
363 * XXX evaluate the following stuff:
364 * Flowcontrol 0x0001 0x0000 0000 0200 ???
365 * Flowcontrol 0x0001 0x0100 83f1 0a00 <- recorded
366 * Auto Mdi 0x0002 0x0000 0000 0300 (1 man, 2 auto)
367 * Manual MDI 0x0002 0x0100 8371 0900 <- recorded
368 * Manual MDI-X 0x0002 0x0100 8371 0800 <- recorded
371 proto_tree_add_item(port_tree, hf_njack_tlv_data,
372 tvb, offset, 8, FALSE);
377 dissect_tlvs(tvbuff_t *tvb, proto_tree *njack_tree, guint32 offset)
381 proto_item *tlv_item;
382 proto_item *tlv_tree;
385 tlv_type = tvb_get_guint8(tvb, offset);
386 /* Special cases that don't have a length field */
387 if (tlv_type == NJACK_CMD_ENDOFPACKET) {
388 proto_tree_add_item(njack_tree, hf_njack_tlv_type,
389 tvb, offset, 1, FALSE);
393 if (tlv_type == NJACK_CMD_GETALLPARMAMS) {
394 proto_tree_add_item(njack_tree, hf_njack_tlv_type,
395 tvb, offset, 1, FALSE);
399 tlv_length = tvb_get_guint8(tvb, offset + 1);
400 tlv_item = proto_tree_add_text(njack_tree, tvb,
401 offset, tlv_length + 2,
402 "T %02x, L %02x: %s",
405 val_to_str(tlv_type, njack_cmd_vals, "Unknown"));
406 tlv_tree = proto_item_add_subtree(tlv_item,
407 ett_njack_tlv_header);
408 proto_tree_add_item(tlv_tree, hf_njack_tlv_type,
409 tvb, offset, 1, FALSE);
411 proto_tree_add_item(tlv_tree, hf_njack_tlv_length,
412 tvb, offset, 1, FALSE);
415 case NJACK_CMD_STARTOFPARAMS:
417 case NJACK_CMD_COUNTERMODE:
418 proto_tree_add_item(tlv_tree, hf_njack_tlv_countermode,
419 tvb, offset, 1, FALSE);
422 case NJACK_CMD_QUEUEING:
423 proto_tree_add_item(tlv_tree, hf_njack_tlv_scheduling,
424 tvb, offset, 1, FALSE);
427 case NJACK_CMD_ADDTAGSCHEME:
428 proto_tree_add_item(tlv_tree, hf_njack_tlv_addtagscheme,
429 tvb, offset, 1, FALSE);
432 case NJACK_CMD_REMOVETAG:
433 proto_tree_add_item(tlv_tree, hf_njack_tlv_portingressmode,
434 tvb, offset, 1, FALSE);
437 case NJACK_CMD_MAXFRAMESIZE:
438 proto_tree_add_item(tlv_tree, hf_njack_tlv_maxframesize,
439 tvb, offset, 1, FALSE);
442 case NJACK_CMD_ENABLESNMPWRITE:
443 proto_tree_add_item(tlv_tree, hf_njack_tlv_snmpwrite,
444 tvb, offset, 1, FALSE);
447 case NJACK_CMD_POWERFORWARDING:
448 proto_tree_add_item(tlv_tree, hf_njack_tlv_powerforwarding,
449 tvb, offset, 1, FALSE);
452 case NJACK_CMD_DHCPCONTROL:
453 proto_tree_add_item(tlv_tree, hf_njack_tlv_dhcpcontrol,
454 tvb, offset, 1, FALSE);
457 case NJACK_CMD_MACADDRESS:
458 proto_tree_add_item(tlv_tree, hf_njack_tlv_devicemac,
459 tvb, offset, 6, FALSE);
462 case NJACK_CMD_VERSION:
463 /* XXX Don't misuse ip address printing here */
464 proto_tree_add_item(tlv_tree, hf_njack_tlv_version,
465 tvb, offset, 4, TRUE);
468 case NJACK_CMD_IPADDRESS:
469 case NJACK_CMD_NETWORK:
471 case NJACK_CMD_IPGATEWAY:
472 proto_tree_add_item(tlv_tree, hf_njack_tlv_typeip,
473 tvb, offset, 4, FALSE);
476 case NJACK_CMD_GROUP:
477 case NJACK_CMD_LOCATION:
478 case NJACK_CMD_PASSWORD:
479 case NJACK_CMD_ROCOMMUNITY:
480 case NJACK_CMD_RWCOMMUNITY:
482 case NJACK_CMD_PRODUCTNAME:
483 case NJACK_CMD_SERIALNO:
484 proto_tree_add_item(tlv_tree, hf_njack_tlv_typestring,
485 tvb, offset, tlv_length, FALSE);
486 offset += tlv_length;
488 case NJACK_CMD_PORT1:
489 case NJACK_CMD_PORT2:
490 case NJACK_CMD_PORT3:
491 case NJACK_CMD_PORT4:
492 if (tlv_length == 8) {
493 dissect_portsettings(tvb, tlv_tree, offset);
495 offset += tlv_length;
498 if (tlv_length > 0) {
499 proto_tree_add_item(tlv_tree, hf_njack_tlv_data,
500 tvb, offset, tlv_length, FALSE);
501 offset += tlv_length;
510 #include <epan/crypt-md5.h>
513 verify_password(tvbuff_t *tvb, const char *password)
515 /* 1. pad non-terminated password-string to a length of 32 bytes
516 * (padding: 0x01, 0x02, 0x03...)
517 * 2. Calculate MD5 of padded password and write it to offset 12 of packet
518 * 3. Calculate MD5 of resulting packet and write it to offset 12 of packet
521 gboolean is_valid = TRUE;
522 const guint8 *packetdata;
530 workbuffer=ep_alloc(32);
533 length = tvb_get_ntohs(tvb, 6);
534 packetdata = tvb_get_ptr(tvb, 0, length);
535 for (i = 0; i<32 && *password; i++, password++) {
536 workbuffer[i] = *password;
538 for (byte = 1; i<32; i++, byte++) {
539 workbuffer[i] = byte;
542 md5_append(&md_ctx, workbuffer, 32);
543 md5_finish(&md_ctx, digest);
545 md5_append(&md_ctx, packetdata, 12);
546 md5_append(&md_ctx, digest, 16);
547 md5_append(&md_ctx, packetdata + 28, length - 28);
548 md5_finish(&md_ctx, digest);
549 fprintf(stderr, "Calclulated digest: "); /* debugging */
550 for (i = 0; i < 16; i++) {
551 fprintf(stderr, "%02X", digest[i]); /* debugging */
552 if (digest[i] != *(packetdata + 12 + i)) {
557 fprintf(stderr, " (%d)\n", is_valid); /* debugging */
564 dissect_njack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
567 proto_tree *njack_tree = NULL;
573 packet_type = tvb_get_guint8(tvb, 5);
574 if (check_col(pinfo->cinfo, COL_PROTOCOL))
575 col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_SHORT_NAME);
576 if (check_col(pinfo->cinfo, COL_INFO))
577 col_add_fstr(pinfo->cinfo, COL_INFO, val_to_str(packet_type,
578 njack_type_vals, "Type 0x%02x"));
581 ti = proto_tree_add_item(tree, proto_njack, tvb, offset, -1,
583 njack_tree = proto_item_add_subtree(ti, ett_njack);
585 proto_tree_add_item(njack_tree, hf_njack_magic, tvb, offset, 5,
589 proto_tree_add_item(njack_tree, hf_njack_type, tvb, offset, 1,
592 switch (packet_type) {
594 /* Type 0x07: S -> M, Magic, type, length (16 bit be) */
595 proto_tree_add_item(njack_tree, hf_njack_set_length, tvb, offset,
598 proto_tree_add_item(njack_tree, hf_njack_set_salt, tvb, offset,
601 proto_tree_add_item(njack_tree, hf_njack_set_authdata, tvb, offset,
604 offset = dissect_tlvs(tvb, njack_tree, offset);
606 case NJACK_TYPE_SETRESULT:
607 /* Type 0x08: M -> S, Magic, type, setresult (8 bit) */
608 setresult = tvb_get_guint8(tvb, offset);
609 proto_tree_add_item(njack_tree, hf_njack_setresult, tvb, offset,
612 if (check_col(pinfo->cinfo, COL_INFO))
613 col_append_fstr(pinfo->cinfo, COL_INFO, ": %s",
614 val_to_str(setresult, njack_setresult_vals, "[0x%02x]"));
617 /* Type 0x0b: S -> M, Magic, type, 00 00 63 ff */
618 offset = dissect_tlvs(tvb, njack_tree, offset);
620 case NJACK_TYPE_QUERYRESP:
621 /* Type 0x02: M -> S, Magic, type, T(8 bit) L(8 bit) V(L bytes) */
622 case NJACK_TYPE_GETRESP:
623 /* Type 0x0c: M -> S, Magic, type, T(8 bit) L(8 bit) V(L bytes) */
624 offset = dissect_tlvs(tvb, njack_tree, offset);
625 proto_tree_add_item(njack_tree, hf_njack_getresp_unknown1, tvb, offset,
629 case NJACK_TYPE_DHCPINFO: /* not completely understood */
632 remaining = tvb_reported_length_remaining(tvb, offset);
634 proto_tree_add_item(njack_tree, hf_njack_tlv_data,
635 tvb, offset, remaining, FALSE);
645 test_njack(tvbuff_t *tvb)
647 /* We need at least 'NJ200' + 1 Byte packet type */
648 if ( !tvb_bytes_exist(tvb, 0, 6) ||
649 g_strncasecmp((const char *)tvb_get_ptr(tvb, 0, 5), "NJ200", 5) ) {
656 dissect_njack_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
658 if ( !test_njack(tvb) ) {
661 dissect_njack(tvb, pinfo, tree);
666 dissect_njack_static(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
668 if ( !test_njack(tvb) ) {
671 return dissect_njack(tvb, pinfo, tree);
674 void proto_register_njack(void);
677 proto_register_njack(void)
679 static hf_register_info hf[] = {
683 { "Magic", "njack.magic", FT_STRING, BASE_DEC, NULL,
687 { "Type", "njack.type", FT_UINT8, BASE_HEX, NULL,
691 { &hf_njack_tlv_type,
692 { "TlvType", "njack.tlv.type", FT_UINT8, BASE_HEX, VALS(njack_cmd_vals),
695 { &hf_njack_tlv_length,
696 { "TlvLength", "njack.tlv.length", FT_UINT8, BASE_HEX, NULL,
699 { &hf_njack_tlv_data,
700 { "TlvData", "njack.tlv.data", FT_BYTES, BASE_NONE, NULL,
703 { &hf_njack_tlv_version,
704 { "TlvFwVersion", "njack.tlv.version", FT_IPv4, BASE_NONE, NULL,
707 { &hf_njack_tlv_snmpwrite,
708 { "TlvTypeSnmpwrite", "njack.tlv.snmpwrite", FT_UINT8, BASE_DEC, VALS(&njack_snmpwrite),
711 { &hf_njack_tlv_dhcpcontrol,
712 { "TlvTypeDhcpControl", "njack.tlv.dhcpcontrol", FT_UINT8, BASE_DEC, VALS(&njack_dhcpcontrol),
715 { &hf_njack_tlv_devicemac,
716 { "TlvTypeDeviceMAC", "njack.tlv.devicemac", FT_ETHER, BASE_NONE, NULL,
719 /* XXX dummy entries, to be replaced */
720 { &hf_njack_tlv_typeip,
721 { "TlvTypeIP", "njack.tlv.typeip", FT_IPv4, BASE_NONE, NULL,
724 { &hf_njack_tlv_typestring,
725 { "TlvTypeString", "njack.tlv.typestring", FT_STRING, BASE_DEC, NULL,
729 { &hf_njack_tlv_scheduling,
730 { "TlvTypeScheduling", "njack.tlv.scheduling", FT_UINT8, BASE_DEC, VALS(&njack_scheduling),
733 { &hf_njack_tlv_addtagscheme,
734 { "TlvAddTagScheme", "njack.tlv.addtagscheme", FT_UINT8, BASE_DEC, VALS(&njack_addtagscheme),
737 { &hf_njack_tlv_portingressmode,
738 { "TlvTypePortingressmode", "njack.tlv.portingressmode", FT_UINT8, BASE_DEC, VALS(&njack_portingressmode),
741 { &hf_njack_tlv_maxframesize,
742 { "TlvTypeMaxframesize", "njack.tlv.maxframesize", FT_UINT8, BASE_DEC, VALS(&njack_maxframesize),
745 { &hf_njack_tlv_countermode,
746 { "TlvTypeCountermode", "njack.tlv.contermode", FT_UINT8, BASE_DEC, VALS(&njack_countermode),
749 { &hf_njack_tlv_powerforwarding,
750 { "TlvTypePowerforwarding", "njack.tlv.powerforwarding", FT_UINT8, BASE_DEC, VALS(&njack_powerforwarding),
754 { &hf_njack_set_length,
755 { "SetLength", "njack.set.length", FT_UINT16, BASE_HEX, NULL,
758 { &hf_njack_set_salt,
759 { "Salt", "njack.set.salt", FT_UINT32, BASE_HEX, NULL,
762 { &hf_njack_set_authdata,
763 { "Authdata", "njack.tlv.authdata", FT_BYTES, BASE_NONE, NULL,
766 /* Type 0x08: set result */
767 { &hf_njack_setresult,
768 { "SetResult", "njack.setresult", FT_UINT8, BASE_HEX, VALS(njack_setresult_vals),
773 /* Type 0x0c get response */
774 { &hf_njack_getresp_unknown1,
775 { "Unknown1", "njack.getresp.unknown1", FT_UINT8, BASE_HEX, NULL,
779 static gint *ett[] = {
781 &ett_njack_tlv_header,
784 proto_njack = proto_register_protocol(PROTO_LONG_NAME,
785 PROTO_SHORT_NAME, "njack");
786 proto_register_field_array(proto_njack, hf, array_length(hf));
787 proto_register_subtree_array(ett, array_length(ett));
790 void proto_reg_handoff_njack(void);
793 proto_reg_handoff_njack(void)
795 dissector_handle_t njack_handle;
797 njack_handle = new_create_dissector_handle(dissect_njack_static, proto_njack);
798 dissector_add("udp.port", PORT_NJACK_PC, njack_handle);
799 /* dissector_add("tcp.port", PORT_NJACK_PC, njack_handle); */
800 dissector_add("udp.port", PORT_NJACK_SWITCH, njack_handle);
801 /* dissector_add("tcp.port", PORT_NJACK_SWITCH, njack_handle); */
803 heur_dissector_add("udp", dissect_njack_heur, proto_njack);
804 /* heur_dissector_add("tcp", dissect_njack_heur, proto_njack); */