Coverage Report

Created: 2025-02-15 06:25

/src/wireshark/epan/dissectors/packet-ismp.c
Line
Count
Source (jump to first uncovered line)
1
/* packet-ismp.c
2
 * Routines for ISMP dissection
3
 * Enterasys Networks Home: http://www.enterasys.com/
4
 * Copyright 2003, Joshua Craig Douglas <jdouglas@enterasys.com>
5
 *
6
 * Wireshark - Network traffic analyzer
7
 * By Gerald Combs <gerald@wireshark.org>
8
 * Copyright 1998 Gerald Combs
9
 *
10
 * SPDX-License-Identifier: GPL-2.0-or-later
11
 */
12
13
#include "config.h"
14
15
#include <epan/packet.h>
16
#include <epan/expert.h>
17
#include <epan/to_str.h>
18
#include <epan/etypes.h>
19
#include <epan/addr_resolv.h>
20
#include <epan/tfs.h>
21
#include <wsutil/array.h>
22
23
void proto_register_ismp(void);
24
void proto_reg_handoff_ismp(void);
25
26
static dissector_handle_t ismp_handle;
27
28
/* Initialize the protocol and registered fields */
29
static int proto_ismp;
30
static int hf_ismp_version;
31
static int hf_ismp_message_type;
32
static int hf_ismp_seq_num;
33
static int hf_ismp_code_length;
34
static int hf_ismp_auth_data;
35
36
/* Enterasys/Cabletron Discovery Protocol fields*/
37
static int hf_ismp_edp;
38
static int hf_ismp_edp_version;
39
static int hf_ismp_edp_module_ip;
40
static int hf_ismp_edp_module_mac;
41
static int hf_ismp_edp_module_port;
42
static int hf_ismp_edp_chassis_mac;
43
static int hf_ismp_edp_chassis_ip;
44
static int hf_ismp_edp_device_type;
45
static int hf_ismp_edp_module_rev;
46
static int hf_ismp_edp_options;
47
static int hf_ismp_edp_sfs_option_unused1;
48
static int hf_ismp_edp_sfs_option_sfssup;
49
static int hf_ismp_edp_sfs_option_lsp;
50
static int hf_ismp_edp_sfs_option_flood;
51
static int hf_ismp_edp_sfs_option_resolve;
52
static int hf_ismp_edp_sfs_option_unused2;
53
static int hf_ismp_edp_sfs_option_tagflood;
54
static int hf_ismp_edp_sfs_option_calltap;
55
static int hf_ismp_edp_sfs_option_conmsg;
56
static int hf_ismp_edp_sfs_option_redun;
57
static int hf_ismp_edp_sfs_option_isolated;
58
static int hf_ismp_edp_sfs_option_uplink_switch;
59
static int hf_ismp_edp_sfs_option_uplink_core;
60
static int hf_ismp_edp_sfs_option_uplink_port;
61
static int hf_ismp_edp_sfs_option_uplink_flood;
62
static int hf_ismp_edp_rtr_option_ssr;
63
static int hf_ismp_edp_rtr_option_igmp;
64
static int hf_ismp_edp_rtr_option_rip;
65
static int hf_ismp_edp_rtr_option_bgp;
66
static int hf_ismp_edp_rtr_option_ospf;
67
static int hf_ismp_edp_rtr_option_dvmrp;
68
static int hf_ismp_edp_rtr_option_8021q;
69
static int hf_ismp_edp_rtr_option_gvrp;
70
static int hf_ismp_edp_rtr_option_gmrp;
71
static int hf_ismp_edp_rtr_option_igmp_snoop;
72
static int hf_ismp_edp_rtr_option_route;
73
static int hf_ismp_edp_rtr_option_trans;
74
static int hf_ismp_edp_rtr_option_level1;
75
static int hf_ismp_edp_switch_option_8021q;
76
static int hf_ismp_edp_switch_option_gvrp;
77
static int hf_ismp_edp_switch_option_gmrp;
78
static int hf_ismp_edp_switch_option_igmp;
79
static int hf_ismp_edp_switch_option_route;
80
static int hf_ismp_edp_switch_option_trans;
81
static int hf_ismp_edp_switch_option_level1;
82
static int hf_ismp_edp_end_station_option_dhcp;
83
static int hf_ismp_edp_end_station_option_dns;
84
static int hf_ismp_edp_end_station_option_ad;
85
static int hf_ismp_edp_num_neighbors;
86
static int hf_ismp_edp_neighbors;
87
static int hf_ismp_edp_num_tuples;
88
static int hf_ismp_edp_tuples;
89
/* Generated from convert_proto_tree_add_text.pl */
90
static int hf_ismp_assigned_neighbor_state;
91
static int hf_ismp_hold_time;
92
static int hf_ismp_interface_name;
93
static int hf_ismp_tuple_length;
94
static int hf_ismp_neighborhood_mac_address;
95
static int hf_ismp_unknown_tuple_data;
96
static int hf_ismp_tuple_type;
97
static int hf_ismp_system_description;
98
static int hf_ismp_interface_ipx_address;
99
100
101
/* Initialize the subtree pointers */
102
static int ett_ismp;
103
static int ett_ismp_edp;
104
static int ett_ismp_edp_options;
105
static int ett_ismp_edp_neighbors;
106
static int ett_ismp_edp_neighbors_leaf;
107
static int ett_ismp_edp_tuples;
108
static int ett_ismp_edp_tuples_leaf;
109
110
static expert_field ei_ismp_malformed;
111
112
/* ISMP TYPES */
113
0
#define ISMPTYPE_EDP  2
114
115
116
/* EDP DEVICE TYPES */
117
0
#define EDP_DEVICE_TYPE_SFS17   1
118
0
#define EDP_DEVICE_TYPE_SFS18   2
119
0
#define EDP_DEVICE_TYPE_ROUTER    3
120
0
#define EDP_DEVICE_TYPE_BRIDGE    4
121
0
#define EDP_DEVICE_TYPE_VLANMAN   5
122
0
#define EDP_DEVICE_TYPE_NTSERVER  6
123
0
#define EDP_DEVICE_TYPE_NTCLIENT  7
124
0
#define EDP_DEVICE_TYPE_WIN95   8
125
0
#define EDP_DEVICE_TYPE_WIN98   9
126
0
#define EDP_DEVICE_TYPE_UNIXSERVER  10
127
0
#define EDP_DEVICE_TYPE_UNIXCLIENT  11
128
0
#define EDP_DEVICE_TYPE_ACCESSPOINT 12
129
130
131
static const value_string edp_device_types[] = {
132
  { EDP_DEVICE_TYPE_SFS17,       "Network Switch running SecureFast version 1.7 or lower" },
133
  { EDP_DEVICE_TYPE_SFS18,       "Network Switch running SecureFast version 1.8 or greater" },
134
  { EDP_DEVICE_TYPE_ROUTER,      "Router" },
135
  { EDP_DEVICE_TYPE_BRIDGE,      "Bridge" },
136
  { EDP_DEVICE_TYPE_VLANMAN,     "Cabletron VLAN Manager" },
137
  { EDP_DEVICE_TYPE_NTSERVER,    "Network Server (NT)" },
138
  { EDP_DEVICE_TYPE_NTCLIENT,    "Network Workstation (NT)" },
139
  { EDP_DEVICE_TYPE_WIN95,       "Windows95" },
140
  { EDP_DEVICE_TYPE_WIN98,       "Windows98" },
141
  { EDP_DEVICE_TYPE_UNIXSERVER,  "UNIX Server" },
142
  { EDP_DEVICE_TYPE_UNIXCLIENT,  "UNIX Workstation" },
143
  { EDP_DEVICE_TYPE_ACCESSPOINT, "Roamabout wireless access point" },
144
  { 0,      NULL },
145
};
146
147
148
/* EDP SFS Options */
149
14
#define EDP_SFS_OPTION_UNUSED1    0x00000001
150
14
#define EDP_SFS_OPTION_SFSSUP   0x00000002
151
14
#define EDP_SFS_OPTION_LSP          0x00000004
152
14
#define EDP_SFS_OPTION_FLOOD    0x00000008
153
14
#define EDP_SFS_OPTION_RESOLVE    0x00000010
154
14
#define EDP_SFS_OPTION_UNUSED2    0x00000020
155
14
#define EDP_SFS_OPTION_TAGFLOOD   0x00000040
156
14
#define EDP_SFS_OPTION_CALLTAP    0x00000080
157
14
#define EDP_SFS_OPTION_CONMSG   0x00000100
158
14
#define EDP_SFS_OPTION_REDUN    0x00000200
159
14
#define EDP_SFS_OPTION_ISOLATED   0x00000400
160
14
#define EDP_SFS_OPTION_UPLINK_SWITCH  0x00000800
161
14
#define EDP_SFS_OPTION_UPLINK_CORE  0x00001000
162
14
#define EDP_SFS_OPTION_UPLINK_PORT  0x00002000
163
14
#define EDP_SFS_OPTION_UPLINK_FLOOD 0x00004000
164
165
/* EDP Router Options */
166
14
#define EDP_RTR_OPTION_SSR      0x00000001
167
14
#define EDP_RTR_OPTION_IGMP     0x00000002
168
14
#define EDP_RTR_OPTION_RIP      0x00000004
169
14
#define EDP_RTR_OPTION_BGP      0x00000008
170
14
#define EDP_RTR_OPTION_OSPF     0x00000010
171
14
#define EDP_RTR_OPTION_DVMRP    0x00000020
172
14
#define EDP_RTR_OPTION_8021Q    0x00000040
173
14
#define EDP_RTR_OPTION_GVRP     0x00000080
174
14
#define EDP_RTR_OPTION_GMRP     0x00000100
175
14
#define EDP_RTR_OPTION_IGMP_SNOOP 0x00000200
176
14
#define EDP_RTR_OPTION_ROUTE    0x00000400
177
14
#define EDP_RTR_OPTION_TRANS    0x00000800
178
14
#define EDP_RTR_OPTION_LEVEL1   0x00001000
179
180
/* EDP Switch Options */
181
14
#define EDP_SWITCH_OPTION_8021Q   0x00000001
182
14
#define EDP_SWITCH_OPTION_GVRP    0x00000002
183
14
#define EDP_SWITCH_OPTION_GMRP    0x00000004
184
14
#define EDP_SWITCH_OPTION_IGMP    0x00000008
185
14
#define EDP_SWITCH_OPTION_ROUTE   0x00000010
186
14
#define EDP_SWITCH_OPTION_TRANS   0x00000020
187
14
#define EDP_SWITCH_OPTION_LEVEL1  0x00000040
188
189
/* EDP End Station and Server Options */
190
14
#define EDP_END_STATION_OPTION_DHCP 0x1
191
14
#define EDP_END_STATION_OPTION_DNS  0x2
192
14
#define EDP_END_STATION_OPTION_AD 0x4
193
194
/* EDP Tuple Types */
195
0
#define EDP_TUPLE_UNKNOWN   0
196
0
#define EDP_TUPLE_HOLD      1
197
0
#define EDP_TUPLE_INT_NAME    2
198
0
#define EDP_TUPLE_SYS_DESCRIPT  3
199
0
#define EDP_TUPLE_IPX_ADDR    4
200
201
static const value_string edp_tuple_types[] =
202
{
203
  { EDP_TUPLE_UNKNOWN,"Unknown" },
204
  { EDP_TUPLE_HOLD,"Hold Time" },
205
  { EDP_TUPLE_INT_NAME,"Interface Name" },
206
  { EDP_TUPLE_SYS_DESCRIPT,"System Description" },
207
  { EDP_TUPLE_IPX_ADDR,"IPX Address" },
208
  { 0,NULL }
209
};
210
211
static char*
212
ipx_addr_to_str(wmem_allocator_t *scope, const uint32_t net, const uint8_t *ad)
213
0
{
214
0
  char        *buf;
215
0
  const char *name;
216
217
0
  name = get_ether_name_if_known(ad);
218
219
0
  if (name) {
220
0
    buf = wmem_strdup_printf(scope, "%s.%s",
221
0
        get_ipxnet_name(scope, net),
222
0
        name);
223
0
  }
224
0
  else {
225
0
    buf = wmem_strdup_printf(scope, "%s.%s",
226
0
        get_ipxnet_name(scope, net),
227
0
        bytes_to_str_punct(scope, ad, 6, '\0'));
228
0
  }
229
0
  return buf;
230
0
}
231
232
/* Function to dissect EDP portion of ISMP message */
233
static void
234
dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp_tree)
235
0
{
236
  /* local variables used for EDP dissection */
237
0
  int neighbors_count = 0;
238
0
  int tuples_count = 0;
239
0
  uint16_t device_type = 0;
240
0
  uint16_t num_neighbors = 0;
241
0
  uint16_t num_tuples = 0;
242
0
  uint16_t tuple_type = 0;
243
0
  uint32_t tuple_length = 0;
244
0
  char* ipx_addr_str;
245
246
  /* Set up structures needed to add the protocol subtree and manage it */
247
0
  proto_item *edp_ti;
248
0
  proto_tree *edp_tree;
249
250
0
  proto_item *edp_neighbors_ti;
251
0
  proto_tree *edp_neighbors_tree;
252
253
0
  proto_tree *edp_neighbors_leaf_tree;
254
255
0
  proto_item *edp_tuples_ti;
256
0
  proto_tree *edp_tuples_tree;
257
258
0
  proto_tree *edp_tuples_leaf_tree;
259
260
  /* add column information marking this as EDP (Enterasys Discover Protocol */
261
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISMP.EDP");
262
0
  col_clear(pinfo->cinfo, COL_INFO);
263
264
  /* create display subtree for EDP */
265
0
    edp_ti  = proto_tree_add_item(ismp_tree, hf_ismp_edp, tvb, offset, -1, ENC_NA);
266
0
    edp_tree = proto_item_add_subtree(edp_ti, ett_ismp_edp);
267
268
0
    col_add_fstr(pinfo->cinfo, COL_INFO, "MIP %s, MMAC %s, ifIdx %d",
269
0
      tvb_ip_to_str(pinfo->pool, tvb, offset+2),
270
0
      tvb_ether_to_str(pinfo->pool, tvb, offset+6),
271
0
      tvb_get_ntohl(tvb, offset+12));
272
273
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
274
0
    offset += 2;
275
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_module_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
276
0
    offset += 4;
277
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_module_mac, tvb, offset, 6, ENC_NA);
278
0
    offset += 6;
279
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_module_port, tvb, offset, 4, ENC_BIG_ENDIAN);
280
0
    offset += 4;
281
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_chassis_mac, tvb, offset, 6, ENC_NA);
282
0
    offset += 6;
283
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_chassis_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
284
0
    offset += 4;
285
0
    device_type = tvb_get_ntohs(tvb, offset);
286
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_device_type, tvb, offset, 2, ENC_BIG_ENDIAN);
287
0
    offset += 2;
288
0
    proto_tree_add_uint_format_value(edp_tree, hf_ismp_edp_module_rev, tvb, offset, 4, tvb_get_ntohl(tvb, offset),
289
0
      "%02x.%02x.%02x.%02x", tvb_get_uint8(tvb, offset),
290
0
      tvb_get_uint8(tvb, offset+1), tvb_get_uint8(tvb, offset+2), tvb_get_uint8(tvb, offset+3));
291
0
    offset += 4;
292
293
    /* depending on device_type, show the appropriate options */
294
0
    switch (device_type) {
295
0
      case EDP_DEVICE_TYPE_SFS17:
296
0
      case EDP_DEVICE_TYPE_SFS18:
297
0
                {
298
0
            static int * const options[] = {
299
0
              &hf_ismp_edp_sfs_option_uplink_flood,
300
0
              &hf_ismp_edp_sfs_option_uplink_port,
301
0
              &hf_ismp_edp_sfs_option_uplink_core,
302
0
              &hf_ismp_edp_sfs_option_uplink_switch,
303
0
              &hf_ismp_edp_sfs_option_isolated,
304
0
              &hf_ismp_edp_sfs_option_redun,
305
0
              &hf_ismp_edp_sfs_option_conmsg,
306
0
              &hf_ismp_edp_sfs_option_calltap,
307
0
              &hf_ismp_edp_sfs_option_tagflood,
308
0
              &hf_ismp_edp_sfs_option_unused2,
309
0
              &hf_ismp_edp_sfs_option_resolve,
310
0
              &hf_ismp_edp_sfs_option_flood,
311
0
              &hf_ismp_edp_sfs_option_lsp,
312
0
              &hf_ismp_edp_sfs_option_sfssup,
313
0
              &hf_ismp_edp_sfs_option_unused1,
314
0
                NULL
315
0
            };
316
0
            proto_tree_add_bitmask(edp_tree, tvb, offset, hf_ismp_edp_options, ett_ismp_edp_options, options, ENC_BIG_ENDIAN);
317
0
                }
318
0
        break;
319
0
      case EDP_DEVICE_TYPE_ROUTER:
320
0
                {
321
0
            static int * const options[] = {
322
0
              &hf_ismp_edp_rtr_option_level1,
323
0
              &hf_ismp_edp_rtr_option_trans,
324
0
              &hf_ismp_edp_rtr_option_route,
325
0
              &hf_ismp_edp_rtr_option_igmp_snoop,
326
0
              &hf_ismp_edp_rtr_option_gmrp,
327
0
              &hf_ismp_edp_rtr_option_gvrp,
328
0
              &hf_ismp_edp_rtr_option_8021q,
329
0
              &hf_ismp_edp_rtr_option_dvmrp,
330
0
              &hf_ismp_edp_rtr_option_ospf,
331
0
              &hf_ismp_edp_rtr_option_bgp,
332
0
              &hf_ismp_edp_rtr_option_rip,
333
0
              &hf_ismp_edp_rtr_option_igmp,
334
0
              &hf_ismp_edp_rtr_option_ssr,
335
0
                NULL
336
0
            };
337
338
0
            proto_tree_add_bitmask(edp_tree, tvb, offset, hf_ismp_edp_options, ett_ismp_edp_options, options, ENC_BIG_ENDIAN);
339
0
                }
340
0
        break;
341
0
      case EDP_DEVICE_TYPE_BRIDGE:
342
0
                {
343
0
            static int * const options[] = {
344
0
              &hf_ismp_edp_switch_option_level1,
345
0
              &hf_ismp_edp_switch_option_trans,
346
0
              &hf_ismp_edp_switch_option_route,
347
0
              &hf_ismp_edp_switch_option_igmp,
348
0
              &hf_ismp_edp_switch_option_gmrp,
349
0
              &hf_ismp_edp_switch_option_gvrp,
350
0
              &hf_ismp_edp_switch_option_8021q,
351
0
                NULL
352
0
            };
353
354
0
            proto_tree_add_bitmask(edp_tree, tvb, offset, hf_ismp_edp_options, ett_ismp_edp_options, options, ENC_BIG_ENDIAN);
355
0
                }
356
0
        break;
357
0
      case EDP_DEVICE_TYPE_NTSERVER:
358
0
      case EDP_DEVICE_TYPE_NTCLIENT:
359
0
      case EDP_DEVICE_TYPE_WIN95:
360
0
      case EDP_DEVICE_TYPE_WIN98:
361
0
      case EDP_DEVICE_TYPE_UNIXSERVER:
362
0
      case EDP_DEVICE_TYPE_UNIXCLIENT:
363
0
                {
364
0
            static int * const options[] = {
365
0
              &hf_ismp_edp_end_station_option_ad,
366
0
              &hf_ismp_edp_end_station_option_dns,
367
0
              &hf_ismp_edp_end_station_option_dhcp,
368
0
                NULL
369
0
            };
370
371
0
            proto_tree_add_bitmask(edp_tree, tvb, offset, hf_ismp_edp_options, ett_ismp_edp_options, options, ENC_BIG_ENDIAN);
372
0
                }
373
0
        break;
374
0
      case EDP_DEVICE_TYPE_VLANMAN:
375
0
      case EDP_DEVICE_TYPE_ACCESSPOINT:
376
0
      default:
377
0
            proto_tree_add_item(edp_tree, hf_ismp_edp_options, tvb, offset, 4, ENC_BIG_ENDIAN);
378
0
        break;
379
0
    }
380
0
    offset += 4;
381
382
    /* determine the number of neighbors and create EDP neighbors subtree */
383
0
    num_neighbors = tvb_get_ntohs(tvb, offset);
384
0
    proto_tree_add_item(edp_tree, hf_ismp_edp_num_neighbors, tvb, offset, 2, ENC_BIG_ENDIAN);
385
0
    offset += 2;
386
0
    if (num_neighbors > 0)
387
0
    {
388
0
      edp_neighbors_ti = proto_tree_add_item(edp_tree, hf_ismp_edp_neighbors, tvb,
389
0
                    offset, num_neighbors*10, ENC_NA);
390
0
      edp_neighbors_tree = proto_item_add_subtree(edp_neighbors_ti, ett_ismp_edp_neighbors);
391
0
      while ( neighbors_count < num_neighbors && tvb_reported_length_remaining(tvb, offset) >= 10)
392
0
      {
393
0
        edp_neighbors_leaf_tree = proto_tree_add_subtree_format(edp_neighbors_tree, tvb, offset, 10,
394
0
                    ett_ismp_edp_neighbors_leaf, NULL, "Neighbor%d", (neighbors_count+1));
395
396
0
        proto_tree_add_item(edp_neighbors_leaf_tree, hf_ismp_neighborhood_mac_address, tvb, offset, 6, ENC_NA);
397
0
        proto_tree_add_item(edp_neighbors_leaf_tree, hf_ismp_assigned_neighbor_state, tvb, offset, 4, ENC_BIG_ENDIAN);
398
0
        offset += 10;
399
0
        neighbors_count++;
400
0
      }
401
0
      if (neighbors_count != num_neighbors)
402
0
      {
403
0
        proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, -1);
404
0
        return;
405
0
      }
406
0
    }
407
408
    /* determine data remains, if so, count tuples
409
       and create EDP tuples subtree */
410
0
    if (tvb_reported_length_remaining(tvb, offset) != 0 &&
411
0
      tvb_reported_length_remaining(tvb, offset) >= 2)
412
0
    {
413
0
      num_tuples = tvb_get_ntohs(tvb, offset);
414
0
      proto_tree_add_item(edp_tree, hf_ismp_edp_num_tuples, tvb, offset, 2, ENC_BIG_ENDIAN);
415
0
      offset += 2;
416
0
    }
417
0
    else if (tvb_reported_length_remaining(tvb, offset) > 0) {
418
0
      proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, -1);
419
0
      return;
420
0
    }
421
0
    else
422
0
    {
423
0
      return;
424
0
    }
425
426
    /* start populating tuple information */
427
0
    if (num_tuples && tvb_reported_length_remaining(tvb, offset) >= 4)
428
0
    {
429
0
      edp_tuples_ti = proto_tree_add_bytes_format(edp_tree, hf_ismp_edp_tuples, tvb,
430
0
        offset, -1, NULL, "Tuples");
431
0
      edp_tuples_tree = proto_item_add_subtree(edp_tuples_ti, ett_ismp_edp_tuples);
432
433
0
      while ( (tuples_count < num_tuples) && (tvb_reported_length_remaining(tvb, offset) >= 4) )
434
0
      {
435
436
0
        edp_tuples_leaf_tree = proto_tree_add_subtree_format(edp_tuples_tree, tvb, offset, 4,
437
0
          ett_ismp_edp_tuples_leaf, NULL, "Tuple%d", tuples_count+1);
438
439
0
        tuple_type = tvb_get_ntohs(tvb, offset);
440
0
        proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_tuple_type, tvb, offset, 2, ENC_BIG_ENDIAN);
441
0
        offset += 2;
442
0
        proto_tree_add_item_ret_uint(edp_tuples_leaf_tree, hf_ismp_tuple_length, tvb, offset, 2, ENC_BIG_ENDIAN, &tuple_length);
443
0
        if (tuple_length < 4) {
444
0
          proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, 2);
445
0
          return;
446
0
        }
447
0
        offset += 2;
448
0
        proto_item_set_len(edp_tuples_leaf_tree, tuple_length);
449
0
        tuple_length -= 4;
450
451
0
        if ((unsigned)tvb_reported_length_remaining(tvb, offset) >= tuple_length)
452
0
        {
453
0
          switch (tuple_type)
454
0
          {
455
0
            case EDP_TUPLE_HOLD:
456
0
              proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_hold_time, tvb, offset, tuple_length, ENC_BIG_ENDIAN);
457
0
              break;
458
0
            case EDP_TUPLE_INT_NAME:
459
0
              proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_interface_name, tvb, offset, tuple_length, ENC_NA|ENC_ASCII);
460
0
              col_append_fstr(pinfo->cinfo, COL_INFO, ", ifName %s",
461
0
                tvb_format_text(pinfo->pool, tvb, offset, tuple_length));
462
0
              break;
463
0
            case EDP_TUPLE_SYS_DESCRIPT:
464
0
              proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_system_description, tvb, offset, tuple_length, ENC_NA|ENC_ASCII);
465
0
              break;
466
0
            case EDP_TUPLE_IPX_ADDR:
467
0
              if (tuple_length != 4+6) {
468
0
                proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, tuple_length);
469
0
                return;
470
0
              }
471
0
              ipx_addr_str = ipx_addr_to_str(pinfo->pool, tvb_get_ntohl(tvb, offset), tvb_get_ptr(tvb, offset+4, tuple_length-4));
472
0
              proto_tree_add_string(edp_tuples_leaf_tree, hf_ismp_interface_ipx_address ,tvb, offset, tuple_length, ipx_addr_str);
473
0
              break;
474
0
            case EDP_TUPLE_UNKNOWN:
475
0
            default:
476
0
              proto_tree_add_item(edp_tuples_leaf_tree, hf_ismp_unknown_tuple_data, tvb, offset, tuple_length, ENC_NA|ENC_ASCII);
477
0
              break;
478
0
          }
479
0
        }
480
0
        offset += tuple_length;
481
482
0
        tuples_count++;
483
0
      }
484
0
      if (tuples_count != num_tuples)
485
0
        proto_tree_add_expert(edp_tree, pinfo, &ei_ismp_malformed, tvb, offset, -1);
486
487
0
      return;
488
0
    }
489
0
}
490
491
492
/* Code to actually dissect the packets */
493
static int
494
dissect_ismp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
495
0
{
496
0
  int offset = 0;
497
0
  uint16_t message_type = 0;
498
0
  uint8_t code_length = 0;
499
0
  uint8_t weird_stuff[3] = { 0x42, 0x42, 0x03 };
500
501
/* Set up structures needed to add the protocol subtree and manage it */
502
0
  proto_item *ti;
503
0
  proto_tree *ismp_tree;
504
505
/* Make entries in Protocol column and Info column on summary display */
506
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISMP");
507
0
  col_clear(pinfo->cinfo, COL_INFO);
508
509
  /*
510
   * XXX - I've seen captures with packets that have the ISMP
511
   * Ethernet frame type, but with the payload being 0x42 0x42 0x03
512
   * followed by what appears to be an ISMP frame.
513
   *
514
   * 0x4242 is not a valid ISMP version number.
515
   */
516
0
  if (tvb_memeql(tvb, offset, weird_stuff, sizeof weird_stuff) == 0)
517
0
    offset += 3; /* skip the weird stuff, for now */
518
519
  /* create display subtree for ismp */
520
0
  ti = proto_tree_add_item(tree, proto_ismp, tvb, offset, -1, ENC_NA);
521
0
  ismp_tree = proto_item_add_subtree(ti, ett_ismp);
522
523
  /* add an items to the subtree */
524
0
  proto_tree_add_item(ismp_tree, hf_ismp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
525
0
  offset += 2;
526
0
  message_type = tvb_get_ntohs(tvb, offset);
527
0
  proto_tree_add_item(ismp_tree, hf_ismp_message_type, tvb, offset, 2, ENC_BIG_ENDIAN);
528
0
  offset += 2;
529
0
  proto_tree_add_item(ismp_tree, hf_ismp_seq_num, tvb, offset, 2, ENC_BIG_ENDIAN);
530
0
  offset += 2;
531
0
  code_length = tvb_get_uint8(tvb, offset);
532
0
  proto_tree_add_item(ismp_tree, hf_ismp_code_length, tvb, offset, 1, ENC_BIG_ENDIAN);
533
0
  offset += 1;
534
0
  proto_tree_add_item(ismp_tree, hf_ismp_auth_data, tvb, offset, code_length, ENC_NA);
535
0
  offset += code_length;
536
537
  /* if Enterasys Discover Protocol, dissect it */
538
0
  if(message_type == ISMPTYPE_EDP)
539
0
    dissect_ismp_edp(tvb, pinfo, offset, tree);
540
541
0
  return tvb_captured_length(tvb);
542
0
}
543
544
545
/* Register this protocol with Wireshark */
546
void
547
proto_register_ismp(void)
548
14
{
549
550
/* Setup list of header fields  See Section 1.6.1 for details*/
551
14
  static hf_register_info hf[] = {
552
14
    { &hf_ismp_version,
553
14
      { "Version",           "ismp.version",
554
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
555
14
      NULL, HFILL }
556
14
    },
557
14
    { &hf_ismp_message_type,
558
14
      { "Message Type", "ismp.msgtype",
559
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
560
14
      NULL, HFILL }
561
14
    },
562
14
    { &hf_ismp_seq_num,
563
14
      { "Sequence Number", "ismp.seqnum",
564
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
565
14
      NULL, HFILL }
566
14
    },
567
14
    { &hf_ismp_code_length,
568
14
      { "Auth Code Length", "ismp.codelen",
569
14
      FT_UINT8, BASE_DEC, NULL, 0x0,
570
14
      NULL, HFILL }
571
14
    },
572
14
    { &hf_ismp_auth_data,
573
14
      { "Auth Data", "ismp.authdata",
574
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
575
14
      NULL, HFILL }
576
14
    },
577
14
    { &hf_ismp_edp,
578
14
      { "EDP", "ismp.edp",
579
14
      FT_PROTOCOL, BASE_NONE, NULL, 0x0,
580
14
      "Enterasys Discovery Protocol", HFILL }
581
14
    },
582
14
    { &hf_ismp_edp_version,
583
14
      { "Version", "ismp.edp.version",
584
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
585
14
      NULL, HFILL }
586
14
    },
587
14
    { &hf_ismp_edp_module_ip,
588
14
      { "Module IP Address", "ismp.edp.modip",
589
14
      FT_IPv4, BASE_NONE, NULL, 0x0,
590
14
      NULL, HFILL }
591
14
    },
592
14
    { &hf_ismp_edp_module_mac,
593
14
      { "Module MAC Address", "ismp.edp.modmac",
594
14
      FT_ETHER, BASE_NONE, NULL, 0x0,
595
14
      NULL, HFILL }
596
14
    },
597
14
    { &hf_ismp_edp_module_port,
598
14
      { "Module Port (ifIndex num)", "ismp.edp.modport",
599
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
600
14
      NULL, HFILL }
601
14
    },
602
14
    { &hf_ismp_edp_chassis_mac,
603
14
      { "Chassis MAC Address", "ismp.edp.chassismac",
604
14
      FT_ETHER, BASE_NONE, NULL, 0x0,
605
14
      NULL, HFILL }
606
14
    },
607
14
    { &hf_ismp_edp_chassis_ip,
608
14
      { "Chassis IP Address", "ismp.edp.chassisip",
609
14
      FT_IPv4, BASE_NONE, NULL, 0x0,
610
14
      NULL, HFILL }
611
14
    },
612
14
    { &hf_ismp_edp_device_type,
613
14
      { "Device Type", "ismp.edp.devtype",
614
14
      FT_UINT16, BASE_DEC, VALS(edp_device_types), 0x0,
615
14
      NULL, HFILL }
616
14
    },
617
14
    { &hf_ismp_edp_module_rev,
618
14
      { "Module Firmware Revision", "ismp.edp.rev",
619
14
      FT_UINT32, BASE_DEC, NULL, 0x0,
620
14
      NULL, HFILL }
621
14
    },
622
14
    { &hf_ismp_edp_options,
623
14
      { "Device Options", "ismp.edp.options",
624
14
      FT_UINT32, BASE_HEX, NULL, 0x0,
625
14
      NULL, HFILL }
626
14
    },
627
14
    { &hf_ismp_edp_sfs_option_unused1,
628
14
      { "Unused", "ismp.edp.sfs_option_unused1",
629
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UNUSED1,
630
14
      NULL, HFILL }
631
14
    },
632
14
    { &hf_ismp_edp_sfs_option_sfssup,
633
14
      { "SFS Support", "ismp.edp.sfs_option_sfssup",
634
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_SFSSUP,
635
14
      NULL, HFILL }
636
14
    },
637
14
    { &hf_ismp_edp_sfs_option_lsp,
638
14
      { "LSP Support", "ismp.edp.sfs_option_lsp",
639
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_LSP,
640
14
      NULL, HFILL }
641
14
    },
642
14
    { &hf_ismp_edp_sfs_option_flood,
643
14
      { "Flood Path Support", "ismp.edp.sfs_option_flood",
644
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_FLOOD,
645
14
      NULL, HFILL }
646
14
    },
647
14
    { &hf_ismp_edp_sfs_option_resolve,
648
14
      { "Resolve Support", "ismp.edp.sfs_option_resolve",
649
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_RESOLVE,
650
14
      NULL, HFILL }
651
14
    },
652
14
    { &hf_ismp_edp_sfs_option_unused2,
653
14
      { "Unused", "ismp.edp.sfs_option_unused2",
654
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UNUSED2,
655
14
      NULL, HFILL }
656
14
    },
657
14
    { &hf_ismp_edp_sfs_option_tagflood,
658
14
      { "Tagged Flood Support", "ismp.edp.sfs_option_tagflood",
659
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_TAGFLOOD,
660
14
      NULL, HFILL }
661
14
    },
662
14
    { &hf_ismp_edp_sfs_option_calltap,
663
14
      { "Call Tap Support", "ismp.edp.sfs_option_calltap",
664
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_CALLTAP,
665
14
      NULL, HFILL }
666
14
    },
667
14
    { &hf_ismp_edp_sfs_option_conmsg,
668
14
      { "Connection Message Support", "ismp.edp.sfs_option_conmsg",
669
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_CONMSG,
670
14
      NULL, HFILL }
671
14
    },
672
14
    { &hf_ismp_edp_sfs_option_redun,
673
14
      { "Redundant Access Support", "ismp.edp.sfs_option_redun",
674
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_REDUN,
675
14
      NULL, HFILL }
676
14
    },
677
14
    { &hf_ismp_edp_sfs_option_isolated,
678
14
      { "Isolated Switch", "ismp.edp.sfs_option_isolated",
679
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_ISOLATED,
680
14
      NULL, HFILL }
681
14
    },
682
14
    { &hf_ismp_edp_sfs_option_uplink_switch,
683
14
      { "Uplink Switch", "ismp.edp.sfs_option_uplink_switch",
684
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UPLINK_SWITCH,
685
14
      NULL, HFILL }
686
14
    },
687
14
    { &hf_ismp_edp_sfs_option_uplink_core,
688
14
      { "Uplink Core", "ismp.edp.sfs_option_uplink_core",
689
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UPLINK_CORE,
690
14
      NULL, HFILL }
691
14
    },
692
14
    { &hf_ismp_edp_sfs_option_uplink_port,
693
14
      { "Uplink Port", "ismp.edp.sfs_option_uplink_port",
694
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UPLINK_PORT,
695
14
      NULL, HFILL }
696
14
    },
697
14
    { &hf_ismp_edp_sfs_option_uplink_flood,
698
14
      { "Uplink Flood Support", "ismp.edp.sfs_option_uplink_flood",
699
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SFS_OPTION_UPLINK_FLOOD,
700
14
      NULL, HFILL }
701
14
    },
702
14
    { &hf_ismp_edp_rtr_option_ssr,
703
14
      { "SSR Type Device", "ismp.edp.rtr_option_ssr",
704
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_SSR,
705
14
      NULL, HFILL }
706
14
    },
707
14
    { &hf_ismp_edp_rtr_option_igmp,
708
14
      { "IGMP Active", "ismp.edp.rtr_option_igmp",
709
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_IGMP,
710
14
      NULL, HFILL }
711
14
    },
712
14
    { &hf_ismp_edp_rtr_option_rip,
713
14
      { "RIP Active", "ismp.edp.rtr_option_rip",
714
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_RIP,
715
14
      NULL, HFILL }
716
14
    },
717
14
    { &hf_ismp_edp_rtr_option_bgp,
718
14
      { "BGP Active", "ismp.edp.rtr_option_bgp",
719
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_BGP,
720
14
      NULL, HFILL }
721
14
    },
722
14
    { &hf_ismp_edp_rtr_option_ospf,
723
14
      { "OSPF Active", "ismp.edp.rtr_option_ospf",
724
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_OSPF,
725
14
      NULL, HFILL }
726
14
    },
727
14
    { &hf_ismp_edp_rtr_option_dvmrp,
728
14
      { "DVMRP Active", "ismp.edp.rtr_option_dvmrp",
729
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_DVMRP,
730
14
      NULL, HFILL }
731
14
    },
732
14
    { &hf_ismp_edp_rtr_option_8021q,
733
14
      { "802.1Q Support", "ismp.edp.rtr_option_8021q",
734
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_8021Q,
735
14
      NULL, HFILL }
736
14
    },
737
14
    { &hf_ismp_edp_rtr_option_gvrp,
738
14
      { "GVRP Support", "ismp.edp.rtr_option_gvrp",
739
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_GVRP,
740
14
      NULL, HFILL }
741
14
    },
742
14
    { &hf_ismp_edp_rtr_option_gmrp,
743
14
      { "GMRP Support", "ismp.edp.rtr_option_gmrp",
744
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_GMRP,
745
14
      NULL, HFILL }
746
14
    },
747
14
    { &hf_ismp_edp_rtr_option_igmp_snoop,
748
14
      { "IGMP Snooping Support", "ismp.edp.rtr_option_igmp_snoop",
749
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_IGMP_SNOOP,
750
14
      NULL, HFILL }
751
14
    },
752
14
    { &hf_ismp_edp_rtr_option_route,
753
14
      { "Route Bridging", "ismp.edp.rtr_option_route",
754
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_ROUTE,
755
14
      NULL, HFILL }
756
14
    },
757
14
    { &hf_ismp_edp_rtr_option_trans,
758
14
      { "Transparent Bridging", "ismp.edp.rtr_option_trans",
759
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_TRANS,
760
14
      NULL, HFILL }
761
14
    },
762
14
    { &hf_ismp_edp_rtr_option_level1,
763
14
      { "Level 1 Functionality", "ismp.edp.rtr_option_level1",
764
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_RTR_OPTION_LEVEL1,
765
14
      NULL, HFILL }
766
14
    },
767
14
    { &hf_ismp_edp_switch_option_8021q,
768
14
      { "802.1Q Support", "ismp.edp.switch_option_8021q",
769
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_8021Q,
770
14
      NULL, HFILL }
771
14
    },
772
14
    { &hf_ismp_edp_switch_option_gvrp,
773
14
      { "GVRP Support", "ismp.edp.switch_option_gvrp",
774
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_GVRP,
775
14
      NULL, HFILL }
776
14
    },
777
14
    { &hf_ismp_edp_switch_option_gmrp,
778
14
      { "GMRP Support", "ismp.edp.switch_option_gmrp",
779
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_GMRP,
780
14
      NULL, HFILL }
781
14
    },
782
14
    { &hf_ismp_edp_switch_option_igmp,
783
14
      { "IGMP Snooping Support", "ismp.edp.switch_option_igmp",
784
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_IGMP,
785
14
      NULL, HFILL }
786
14
    },
787
14
    { &hf_ismp_edp_switch_option_route,
788
14
      { "Route Bridging", "ismp.edp.switch_option_route",
789
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_ROUTE,
790
14
      NULL, HFILL }
791
14
    },
792
14
    { &hf_ismp_edp_switch_option_trans,
793
14
      { "Transparent Bridging", "ismp.edp.switch_option_trans",
794
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_TRANS,
795
14
      NULL, HFILL }
796
14
    },
797
14
    { &hf_ismp_edp_switch_option_level1,
798
14
      { "Level 1 Functionality", "ismp.edp.switch_option_level1",
799
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_SWITCH_OPTION_LEVEL1,
800
14
      NULL, HFILL }
801
14
    },
802
14
    { &hf_ismp_edp_end_station_option_dhcp,
803
14
      { "DHCP Enabled", "ismp.edp.end_station_option_dhcp",
804
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_END_STATION_OPTION_DHCP,
805
14
      NULL, HFILL }
806
14
    },
807
14
    { &hf_ismp_edp_end_station_option_dns,
808
14
      { "DNS Enabled", "ismp.edp.end_station_option_dns",
809
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_END_STATION_OPTION_DNS,
810
14
      NULL, HFILL }
811
14
    },
812
14
    { &hf_ismp_edp_end_station_option_ad,
813
14
      { "Active Directory Enabled", "ismp.edp.end_station_option_ad",
814
14
      FT_BOOLEAN, 32, TFS(&tfs_set_notset), EDP_END_STATION_OPTION_AD,
815
14
      NULL, HFILL }
816
14
    },
817
14
    { &hf_ismp_edp_num_neighbors,
818
14
      { "Number of Known Neighbors", "ismp.edp.maccount",
819
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
820
14
      NULL, HFILL }
821
14
    },
822
14
    { &hf_ismp_edp_neighbors,
823
14
      { "Neighbors", "ismp.edp.nbrs",
824
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
825
14
      NULL, HFILL }
826
14
    },
827
14
    { &hf_ismp_edp_num_tuples,
828
14
      { "Number of Tuples", "ismp.edp.numtups",
829
14
      FT_UINT16, BASE_DEC, NULL, 0x0,
830
14
      NULL, HFILL }
831
14
    },
832
14
    { &hf_ismp_edp_tuples,
833
14
      { "Number of Tuples", "ismp.edp.tups",
834
14
      FT_BYTES, BASE_NONE, NULL, 0x0,
835
14
      NULL, HFILL }
836
14
    },
837
838
    /* Generated from convert_proto_tree_add_text.pl */
839
14
    { &hf_ismp_neighborhood_mac_address, { "MAC Address", "ismp.neighborhood_mac_address", FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
840
14
    { &hf_ismp_assigned_neighbor_state, { "Assigned Neighbor State", "ismp.assigned_neighbor_state", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
841
14
    { &hf_ismp_tuple_type, { "Tuple Type", "ismp.tuple_type", FT_UINT16, BASE_DEC, VALS(edp_tuple_types), 0x0, NULL, HFILL }},
842
14
    { &hf_ismp_tuple_length, { "Tuple Length", "ismp.tuple_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
843
14
    { &hf_ismp_hold_time, { "Hold Time", "ismp.hold_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
844
14
    { &hf_ismp_interface_name, { "Interface Name", "ismp.interface_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
845
14
    { &hf_ismp_system_description, { "System Description", "ismp.system_description", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
846
14
    { &hf_ismp_interface_ipx_address, { "Interface IPX_address", "ismp.interface_ipx_address", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
847
14
    { &hf_ismp_unknown_tuple_data, { "Unknown Tuple Data", "ismp.unknown_tuple_data", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
848
14
  };
849
850
/* Setup protocol subtree array */
851
14
  static int *ett[] = {
852
14
    &ett_ismp,
853
14
    &ett_ismp_edp,
854
14
    &ett_ismp_edp_options,
855
14
    &ett_ismp_edp_neighbors,
856
14
    &ett_ismp_edp_neighbors_leaf,
857
14
    &ett_ismp_edp_tuples,
858
14
    &ett_ismp_edp_tuples_leaf,
859
14
  };
860
861
14
  static ei_register_info ei[] = {
862
14
    { &ei_ismp_malformed, { "ismp.malformed", PI_MALFORMED, PI_ERROR, "Malformed packet", EXPFILL }},
863
14
  };
864
865
14
  expert_module_t* expert_ismp;
866
867
/* Register the protocol name and description */
868
14
  proto_ismp = proto_register_protocol("InterSwitch Message Protocol",
869
14
      "ISMP", "ismp");
870
871
/* Required function calls to register the header fields and subtrees used */
872
14
  proto_register_field_array(proto_ismp, hf, array_length(hf));
873
14
  proto_register_subtree_array(ett, array_length(ett));
874
14
  expert_ismp = expert_register_protocol(proto_ismp);
875
14
  expert_register_field_array(expert_ismp, ei, array_length(ei));
876
877
14
  ismp_handle = register_dissector("ismp", dissect_ismp, proto_ismp);
878
14
}
879
880
881
/* If this dissector uses sub-dissector registration add a registration routine.
882
   This format is required because a script is used to find these routines and
883
   create the code that calls these routines.
884
*/
885
void
886
proto_reg_handoff_ismp(void)
887
14
{
888
14
  dissector_add_uint("ethertype", ETHERTYPE_ISMP, ismp_handle);
889
14
}
890
891
/*
892
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
893
 *
894
 * Local variables:
895
 * c-basic-offset: 8
896
 * tab-width: 8
897
 * indent-tabs-mode: t
898
 * End:
899
 *
900
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
901
 * :indentSize=8:tabSize=8:noTabs=false:
902
 */