Coverage Report

Created: 2026-07-12 07:10

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-ns-mep.c
Line
Count
Source
1
/* packet-ns-mep.c
2
 * Routines for netscaler GSLB metric exchange protocol dissection
3
 * Copyright 2006, Ravi Kondamuru <Ravi.Kondamuru@citrix.com>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 */
11
12
#include "config.h"
13
14
#include <epan/packet.h>
15
#include <epan/to_str.h>
16
#include <epan/unit_strings.h>
17
18
#include <wsutil/array.h>
19
#include "packet-tcp.h"
20
21
void proto_register_ns_mep(void);
22
void proto_reg_handoff_ns_mep(void);
23
24
static dissector_handle_t nsmep_handle;
25
26
static int proto_ns_mep;
27
28
static int ett_nsmep;
29
static int ett_nsmep_mfu;
30
static int ett_nsmep_nwu;
31
32
static int hf_nsmep_majver;
33
static int hf_nsmep_minver;
34
static int hf_nsmep_msgtype;
35
static int hf_nsmep_msglen;
36
static int hf_nsmep_errcode;
37
static int hf_nsmep_mfu_state;
38
39
40
static int hf_ns_metricUpdate;
41
static int hf_ns_forceUpdateRequest;
42
static int hf_ns_forceUpdateResp;
43
static int hf_ns_currentOpenConn;
44
static int hf_ns_currentSurgeCount;
45
static int hf_ns_currentIOHCount;
46
static int hf_ns_currentReusePool;
47
static int hf_ns_currentServerConn;
48
static int hf_ns_currentClientConn;
49
static int hf_ns_TotalReq;
50
static int hf_ns_TotalReqBytes;
51
static int hf_ns_TotalResp;
52
static int hf_ns_TotalRespBytes;
53
static int hf_ns_networkMetrics;
54
static int hf_ns_roundTripTime;
55
static int hf_ns_hops;
56
static int hf_ns_persistenceInfo;
57
static int hf_ns_persistenceGslbServIp;
58
static int hf_ns_persistenceGslbServPort;
59
static int hf_ns_persistenceId;
60
static int hf_ns_sitePersistenceDom;
61
static int hf_ns_gslbDomNamelen;
62
static int hf_ns_gslbServPreflen;
63
static int hf_ns_gslbCookieDomNamelen;
64
static int hf_ns_gslbCookieTimeout;
65
static int hf_ns_gslbVidlen;
66
static int hf_ns_gslbFlags;
67
static int hf_ns_gslbCookieDomName;
68
static int hf_ns_gslbVs;
69
static int hf_ns_gslbPrefix;
70
static int hf_ns_sitePersistenceFlushDom;
71
static int hf_ns_gslbDomName;
72
static int hf_ns_sitePersistenceFlushServ;
73
static int hf_ns_sitePersisGetServReq;
74
static int hf_ns_siteDomTTL;
75
static int hf_ns_sitePersistenceGetServResp;
76
77
78
79
static int hf_nsmep_mfu_ip;
80
static int hf_nsmep_mfu_port;
81
static int hf_nsmep_mfu_svctype;
82
static int hf_nsmep_mfu_eff_state;
83
static int hf_nsmep_mfu_mepflag;
84
static int hf_nsmep_mfu_reqflag;
85
86
static int hf_nsmep_adv_ip;
87
88
static int hf_nsmep_ldns_ip;
89
static int hf_nsmep_site_persistence;
90
static dissector_handle_t nsrpc_handle;
91
92
/*GSLB MEP message types */
93
#define nslist_gslbmessage_VALUE_STRING_LIST(V) \
94
  V(GSLB_MSG_NONE, 0, "NONE")\
95
  V(GSLB_MSG_SITE_METRIC_UPDATE, 1, "SITE METRIC UPDATE") \
96
  V(GSLB_MSG_SITE_METRIC_FORCE_REQ, 2, "SITE METRIC FORCE REQ")\
97
  V(GSLB_MSG_SITE_ADV_IP_ADDR, 3, "SITE ADV IP ADDR")\
98
  V(GSLB_MSG_SITE_ADV_IP_ACK, 4, "SITE ADV IP ACK")\
99
  V(GSLB_MSG_SITE_ADV_IP_NACK, 5, "SITE ADV IP NACK")\
100
  V(GSLB_MSG_SITE_METRIC_FORCE_UPDATE, 6, "SITE METRIC FORCE UPDATE")\
101
  V(GSLB_MSG_NETW_METRIC_UPDATE, 7, "NETWORK METRIC UPDATE")\
102
  V(GSLB_MSG_PERSIST_RECORD, 8, "PERSIST RECORD")\
103
  V(GSLB_MSG_KEEP_ALIVE, 9, "KEEP ALIVE")\
104
  V(GSLB_MSG_CNAME_PERSIST_RECORD, 10, "CNAME PERSIST RECORD")\
105
  V(GSLB_MSG_LBNODE_DOM_INFO, 11, "DOMAIN INFO")\
106
  V(GSLB_MSG_LBNODE_SITE_INFO, 12, "SITE INFO")\
107
  V(GSLB_MSG_LBNODE_FLUSH_SVC_INFO, 13, "FLUSH SVC")\
108
  V(GSLB_MSG_LBNODE_FLUSH_DOM_INFO, 14, "FLUSH DOMAIN")\
109
  V(GSLB_MSG_LBNODE_GETSVC, 15, "GET SVC")\
110
  V(GSLB_MSG_LBNODE_GETSVC_RESP, 16, "GET SVC RESP")\
111
112
VALUE_STRING_ENUM(nslist_gslbmessage);
113
VALUE_STRING_ARRAY(nslist_gslbmessage);
114
115
static const value_string ns_entity_state_vals[] = {
116
  { 0x01, "SERVER_STATE_DOWN" },
117
  { 0x02, "SERVER_STATE_UNKNOWN" },
118
  { 0x03, "SERVER_STATE_BUSY" },
119
  { 0x04, "SERVER_STATE_OFS" },
120
  { 0x05, "SERVER_STATE_TROFS" },
121
  { 0x07, "SERVER_STATE_UP" },
122
  { 0x08, "SERVER_STATE_TROFS_DOWN" },
123
124
  { 0,        NULL }
125
};
126
127
128
static const value_string ns_svc_type_vals[] = {
129
  { 0x00, "NSSVC_HTTP"},
130
  { 0x01, "NSSVC_FTP"},
131
  { 0x02, "NSSVC_TCP"},
132
  { 0x03, "NSSVC_UDP"},
133
  { 0x04, "NSSVC_SSL_BRIDGE"},
134
  { 0x05, "NSSVC_MONITOR"},
135
  { 0x06, "NSSVC_MONITOR_UDP"},
136
  { 0x07, "NSSVC_NNTP"},
137
  { 0x08, "NSSVC_HTTPSVR"},
138
  { 0x09, "NSSVC_HTTPCLNT"},
139
  { 0x0a, "NSSVC_RPCSVR"},
140
  { 0x0b, "NSSVC_RPCCLNT"},
141
  { 0x0c, "NSSVC_NAT"},
142
  { 0x0d, "NSSVC_ANY"},
143
  { 0x0e, "NSSVC_SSL"},
144
  { 0x0f, "NSSVC_DNS"},
145
  { 0x10, "NSSVC_ADNS"},
146
  { 0x11, "NSSVC_SNMP"},
147
  { 0x12, "NSSVC_HA"},
148
  { 0x13, "NSSVC_MONITOR_PING"},
149
  { 0x14, "NSSVC_SSL_TCP"},
150
  { 0x15, "NSSVC_AAA"},
151
  { 0x16, "NSSVC_SINCTCP"},
152
  { 0x17, "NSSVC_VPN_AFTP"},
153
  { 0x18, "NSSVC_MONITORS"},
154
  { 0x19, "NSSVC_SSLVPNUDP"},
155
  { 0x1a, "NSSVC_SINCUDP"},
156
  { 0x1b, "NSSVC_RIP"},
157
  { 0x1c, "NSSVC_DNSCLT"},
158
  { 0x1d, "NSSVC_SASP"},
159
  { 0x1e, "NSSVC_RPCSVRS"},
160
  { 0x1f, "NSSVC_RPCCLNTS"},
161
  { 0x20, "NSSVC_WINS_RESOLVER"},
162
  { 0x21, "NSSVC_DHCPRA"},
163
  { 0x22, "NSSVC_ROUTE"},
164
  { 0x23, "NSSVC_AUDIT"},
165
  { 0x24, "NSSVC_SIP_UDP"},
166
  { 0x25, "NSSVC_STA_HTTP"},
167
  { 0x26, "NSSVC_STA_SSL"},
168
  { 0x27, "NSSVC_DNS_RESOLV"},
169
  { 0x28, "NSSVC_RTSP"},
170
171
  { 0, NULL }
172
};
173
174
static const value_string ns_rpc_errcode_vals[] = {
175
  { 0x000, "SUCCESS" },
176
177
  { 0x101, "PERM ERR" },
178
  { 0x10C, "NO MEM" },
179
  { 0x135, "CONN ABORTED" },
180
  { 0x150, "AUTH ERR" },
181
  { 0x153, "NOCODE" },
182
  { 0x154, "NOT SUPERUSER" },
183
  { 0x155, "LARGE DATA"},
184
  { 0x156, "SMALL DATA" },
185
  { 0x160, "LOGIN REQD" },
186
  { 0x161, "INVALID ARG" },
187
  { 0x162, "INVALID USER/ PASSWD" },
188
  { 0x163, "INVALID USER/ PASSWD" },
189
190
  { 0x413, "INTERNAL ERR" },
191
192
  { 0x6FF, "DH REQ" },
193
194
  { 0, NULL }
195
};
196
197
static const value_string value_site_persistence[] = {
198
  { 0x00, "NONE"},
199
  { 0x01, "CONN-PROXY"},
200
  { 0x02, "HTTP-REDIRECT"},
201
  { 0, NULL}
202
};
203
204
0
#define GSLIB_EXCHANGE_DATA_SIZE    72
205
0
#define GSLB_FORCE_VIP_SIZE         12
206
0
#define GSLIB_NET_MET_TABLE_SIZE    8
207
208
0
#define NS_PERSIST_INFO_SIZE            12
209
0
#define NS_GSLB_DOM_INFO_MIN_SIZE       23
210
0
#define NS_GSLB_FLUSH_DOM_INFO_MIN_SIZE 9
211
0
#define Ns_GSLB_MSG_SITE_METRIC_UPDATE_SIZE 16
212
213
/* XXX - for informational purposes only */
214
typedef struct nsgslb_dom_info {
215
  uint32_t public_ip;
216
  uint16_t  public_port;
217
  uint16_t protocol;
218
  uint8_t domainlen;
219
  uint8_t prefixlen;
220
  uint8_t cookiedomlen;
221
  uint8_t site_persistence;
222
  uint8_t cookietimeout;
223
  uint8_t vidlen;
224
  uint8_t flags;
225
  uint16_t reserved;
226
}nsgslb_dom_info_t;
227
228
/*gslb domain info flag values */
229
#define NSGSLB_DOMINFO_DOGSLB 0x01
230
#define NSGSLB_DOMINFO_REDIRECT 0x02
231
0
#define NSGSLB_DOMINFO_FLUSH_ALL_GSLBINFO 0x4
232
233
static void
234
dissect_ns_mep_v02xx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
235
0
{
236
0
  uint32_t maj_ver, min_ver, mesgtype, mesglen, errcode;
237
0
  uint32_t public_port, svctype, domainlen;
238
0
  proto_item *ti;
239
0
  proto_tree *ns_mep_tree;
240
0
  int offset = 0, start_offset;
241
0
  char* version_str;
242
243
0
  col_set_str(pinfo->cinfo, COL_PROTOCOL, "NS-MEP");
244
0
  col_clear(pinfo->cinfo, COL_INFO);
245
246
0
  ti = proto_tree_add_item(tree, proto_ns_mep, tvb, 0, -1, ENC_NA);
247
0
  ns_mep_tree = proto_item_add_subtree(ti, ett_nsmep);
248
249
0
  proto_tree_add_item_ret_uint(ns_mep_tree, hf_nsmep_majver, tvb, offset, 1, ENC_LITTLE_ENDIAN, &maj_ver);
250
0
  offset +=1;
251
0
  proto_tree_add_item_ret_uint(ns_mep_tree, hf_nsmep_minver, tvb, offset, 1, ENC_LITTLE_ENDIAN, &min_ver);
252
0
  offset +=1;
253
0
  proto_tree_add_item_ret_uint(ns_mep_tree, hf_nsmep_msgtype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &mesgtype);
254
0
  offset +=2;
255
0
  version_str = wmem_strdup_printf(pinfo->pool, "v%d.%d %s", maj_ver, min_ver, val_to_str(pinfo->pool, mesgtype, nslist_gslbmessage, "Unknown Mesg Type:  0x%02X"));
256
0
  proto_item_append_text(ti, ", %s", version_str);
257
0
  proto_tree_add_item_ret_uint(ns_mep_tree, hf_nsmep_msglen, tvb, offset, 2, ENC_LITTLE_ENDIAN, &mesglen);
258
0
  offset +=2;
259
0
  proto_tree_add_item_ret_uint(ns_mep_tree, hf_nsmep_errcode, tvb, offset, 2, ENC_LITTLE_ENDIAN, &errcode);
260
0
  offset +=2;
261
262
0
  col_add_fstr(pinfo->cinfo, COL_INFO, "Mesg: %s; Len: %d", version_str, mesglen);
263
264
0
  switch (mesgtype)
265
0
  {
266
0
  case GSLB_MSG_SITE_METRIC_UPDATE:
267
0
  {
268
0
    proto_item *tf;
269
0
    proto_tree *ns_mep_mfu_tree;
270
271
0
    while (tvb_reported_length_remaining(tvb, offset) >= Ns_GSLB_MSG_SITE_METRIC_UPDATE_SIZE)
272
0
    {
273
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_metricUpdate, tvb, offset, Ns_GSLB_MSG_SITE_METRIC_UPDATE_SIZE, ENC_NA);
274
0
      ns_mep_mfu_tree = proto_item_add_subtree(tf, ett_nsmep_mfu);
275
276
      /* proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_cmd, tvb, offset, 2, ENC_LITTLE_ENDIAN); */
277
0
      offset +=2;
278
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_state, tvb, offset, 2, ENC_LITTLE_ENDIAN);
279
0
      offset +=2;
280
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
281
0
      offset +=4;
282
0
      proto_tree_add_item_ret_uint(ns_mep_mfu_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
283
0
      offset +=2;
284
0
      proto_tree_add_item_ret_uint(ns_mep_mfu_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
285
0
      offset +=2;
286
287
0
      proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
288
0
      if ((maj_ver > 2) || ((maj_ver==2) && (min_ver > 2)))
289
0
      {
290
0
        proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_eff_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
291
0
        offset +=1;
292
0
        proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_mepflag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
293
0
        offset +=1;
294
0
        offset +=2;
295
0
      } else
296
0
      {
297
0
        offset +=4;
298
0
      }
299
0
    }
300
0
  }
301
0
  break;
302
0
  case GSLB_MSG_SITE_METRIC_FORCE_REQ:
303
0
  {
304
0
    proto_item *tf;
305
0
    proto_tree *ns_mep_mfr_tree;
306
307
0
    while (tvb_reported_length_remaining(tvb, offset) >= GSLB_FORCE_VIP_SIZE)
308
0
    {
309
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_forceUpdateRequest, tvb, offset, GSLB_FORCE_VIP_SIZE, ENC_NA);
310
0
      ns_mep_mfr_tree = proto_item_add_subtree(tf, ett_nsmep_mfu);
311
312
0
      proto_tree_add_item(ns_mep_mfr_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
313
0
      offset +=4;
314
0
      proto_tree_add_item_ret_uint(ns_mep_mfr_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
315
0
      offset +=2;
316
0
      proto_tree_add_item_ret_uint(ns_mep_mfr_tree, hf_nsmep_mfu_svctype, tvb, offset, 4, ENC_LITTLE_ENDIAN, &svctype);
317
0
      offset +=4;
318
319
0
      proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
320
321
0
      if ((maj_ver > 2) || ((maj_ver==2) && (min_ver > 2)))
322
0
      {
323
0
        proto_tree_add_item(ns_mep_mfr_tree, hf_nsmep_mfu_reqflag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
324
0
        offset +=1;
325
0
        offset +=1;
326
0
      } else
327
0
      {
328
0
        offset +=2;
329
0
      }
330
0
    }
331
0
  }
332
0
  break;
333
0
  case GSLB_MSG_SITE_ADV_IP_ADDR:
334
0
    proto_tree_add_item(ns_mep_tree, hf_nsmep_adv_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
335
0
    break;
336
0
  case GSLB_MSG_SITE_ADV_IP_ACK:
337
0
    break;
338
0
  case GSLB_MSG_SITE_ADV_IP_NACK:
339
0
    break;
340
0
  case GSLB_MSG_SITE_METRIC_FORCE_UPDATE:
341
0
  {
342
0
    proto_item *tf;
343
0
    proto_tree *ns_mep_mfu_tree;
344
345
0
    while (tvb_reported_length_remaining(tvb, offset) >= GSLIB_EXCHANGE_DATA_SIZE)
346
0
    {
347
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_forceUpdateResp, tvb, offset, GSLIB_EXCHANGE_DATA_SIZE, ENC_NA);
348
0
      ns_mep_mfu_tree = proto_item_add_subtree(tf, ett_nsmep_mfu);
349
350
      /* proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_cmd, tvb, offset, 2, ENC_LITTLE_ENDIAN); */
351
0
      offset +=2;
352
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_state, tvb, offset, 2, ENC_LITTLE_ENDIAN);
353
0
      offset +=2;
354
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
355
0
      offset +=4;
356
0
      proto_tree_add_item_ret_uint(ns_mep_mfu_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
357
0
      offset +=2;
358
0
      proto_tree_add_item_ret_uint(ns_mep_mfu_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
359
0
      offset +=2;
360
361
0
      proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
362
363
0
      if ((maj_ver > 2) || ((maj_ver==2) && (min_ver > 2)))
364
0
      {
365
0
        proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_eff_state, tvb, offset, 1, ENC_LITTLE_ENDIAN);
366
0
        offset +=1;
367
0
        proto_tree_add_item(ns_mep_mfu_tree, hf_nsmep_mfu_mepflag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
368
0
        offset +=1;
369
0
        offset +=2;
370
0
      } else
371
0
      {
372
0
        offset +=4;
373
0
      }
374
375
      /* All the counters */
376
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentOpenConn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
377
0
      offset += 4;
378
379
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentSurgeCount, tvb, offset, 4, ENC_LITTLE_ENDIAN);
380
0
      offset += 4;
381
382
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentIOHCount, tvb, offset, 4, ENC_LITTLE_ENDIAN);
383
0
      offset += 4;
384
385
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentReusePool, tvb, offset, 4, ENC_LITTLE_ENDIAN);
386
0
      offset += 4;
387
388
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentServerConn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
389
0
      offset += 4;
390
391
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_currentClientConn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
392
0
      offset += 4;
393
394
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_TotalReq, tvb, offset, 8, ENC_LITTLE_ENDIAN);
395
0
      offset += 8;
396
397
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_TotalReqBytes, tvb, offset, 8, ENC_LITTLE_ENDIAN);
398
0
      offset += 8;
399
400
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_TotalResp, tvb, offset, 8, ENC_LITTLE_ENDIAN);
401
0
      offset += 8;
402
403
0
      proto_tree_add_item(ns_mep_mfu_tree, hf_ns_TotalRespBytes, tvb, offset, 8, ENC_LITTLE_ENDIAN);
404
0
      offset += 8;
405
0
    }
406
0
  }
407
0
  break;
408
0
  case GSLB_MSG_NETW_METRIC_UPDATE:
409
0
  {
410
0
    proto_item *tf;
411
0
    proto_tree *ns_mep_nwu_tree;
412
413
0
    while (tvb_reported_length_remaining(tvb, offset) >= GSLIB_NET_MET_TABLE_SIZE)
414
0
    {
415
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_networkMetrics, tvb, offset, GSLIB_NET_MET_TABLE_SIZE, ENC_NA);
416
0
      proto_item_append_text(tf, " of %s", tvb_address_to_str(pinfo->pool, tvb, AT_IPv4, offset));
417
0
      ns_mep_nwu_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
418
419
0
      proto_tree_add_item(ns_mep_nwu_tree, hf_nsmep_ldns_ip, tvb, offset, 4, ENC_LITTLE_ENDIAN);
420
0
      offset += 4;
421
422
0
      proto_tree_add_item(ns_mep_tree, hf_ns_roundTripTime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
423
0
      offset += 2;
424
425
0
      proto_tree_add_item(ns_mep_tree, hf_ns_hops, tvb, offset, 1, ENC_LITTLE_ENDIAN);
426
0
      offset += 1;
427
0
      offset += 1;
428
0
    }
429
0
  }
430
0
  break;
431
0
  case GSLB_MSG_PERSIST_RECORD:
432
0
  {
433
0
    proto_item *tf;
434
0
    proto_tree *ns_mep_pr_tree;
435
436
0
    while (tvb_reported_length_remaining(tvb, offset) >= NS_PERSIST_INFO_SIZE)
437
0
    {
438
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_persistenceInfo, tvb, offset, NS_PERSIST_INFO_SIZE, ENC_NA);
439
0
      proto_item_append_text(tf, " %s", tvb_address_to_str(pinfo->pool, tvb, AT_IPv4, offset));
440
0
      ns_mep_pr_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
441
442
0
      proto_tree_add_item(ns_mep_pr_tree, hf_nsmep_ldns_ip, tvb, offset, 4, ENC_LITTLE_ENDIAN);
443
0
      offset +=4;
444
445
0
      proto_tree_add_item(ns_mep_tree, hf_ns_persistenceGslbServIp, tvb, offset, 4, ENC_BIG_ENDIAN);
446
0
      offset += 4;
447
448
0
      proto_tree_add_item(ns_mep_tree, hf_ns_persistenceGslbServPort, tvb, offset, 2, ENC_LITTLE_ENDIAN);
449
0
      offset += 2;
450
451
0
      proto_tree_add_item(ns_mep_tree, hf_ns_persistenceId, tvb, offset, 2, ENC_LITTLE_ENDIAN);
452
0
      offset += 2;
453
0
    }
454
0
  }
455
0
  break;
456
0
  case GSLB_MSG_LBNODE_DOM_INFO:
457
0
  {
458
0
    proto_item *tf;
459
0
    proto_tree *ns_mep_di_tree;
460
0
    uint32_t prefixlen, cookiedomlen, flags, vidlen;
461
462
0
    while (tvb_reported_length_remaining(tvb, offset) >= NS_GSLB_DOM_INFO_MIN_SIZE)
463
0
    {
464
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_sitePersistenceDom, tvb, offset, NS_GSLB_DOM_INFO_MIN_SIZE, ENC_NA);
465
0
      ns_mep_di_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
466
0
      start_offset = offset;
467
468
0
      proto_tree_add_item(ns_mep_di_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
469
0
      offset += 4;
470
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
471
0
      offset += 2;
472
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
473
0
      offset += 2;
474
475
0
      proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
476
477
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbDomNamelen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &domainlen);
478
0
      offset += 1;
479
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbServPreflen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &prefixlen);
480
0
      offset += 1;
481
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbCookieDomNamelen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &cookiedomlen);
482
0
      offset += 1;
483
0
      proto_tree_add_item(ns_mep_di_tree, hf_nsmep_site_persistence, tvb, offset, 1, ENC_LITTLE_ENDIAN);
484
0
      offset += 1;
485
0
      proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbCookieTimeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
486
0
      offset += 4;
487
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbVidlen, tvb, offset, 4, ENC_LITTLE_ENDIAN, &vidlen);
488
0
      offset += 4;
489
0
      tf = proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbFlags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
490
0
      if (flags == NSGSLB_DOMINFO_FLUSH_ALL_GSLBINFO)
491
0
      {
492
0
        proto_item_append_text(tf, "Flush all gslb information");
493
0
      }
494
0
      else if (flags)
495
0
      {
496
0
        proto_item_append_text(tf, "Undefined");
497
0
      }
498
0
      offset += 1;
499
0
      offset += 2; /* Skip reserved */
500
501
0
      proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbDomName, tvb, offset, domainlen, ENC_ASCII);
502
0
      offset += domainlen;
503
0
      if (cookiedomlen)
504
0
      {
505
0
        proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbCookieDomName, tvb, offset, cookiedomlen, ENC_ASCII);
506
0
        offset += cookiedomlen;
507
0
      }
508
509
0
      proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbVs, tvb, offset, vidlen, ENC_ASCII);
510
0
      offset += vidlen;
511
0
      if (prefixlen)
512
0
      {
513
0
        proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbPrefix, tvb, offset, prefixlen, ENC_ASCII);
514
0
        offset += prefixlen;
515
0
      }
516
0
      proto_item_set_len(tf, offset-start_offset);
517
0
    }
518
0
    break;
519
0
  }
520
0
  case GSLB_MSG_LBNODE_FLUSH_DOM_INFO:
521
0
  {
522
0
    proto_item *tf;
523
0
    proto_tree *ns_mep_di_tree;
524
525
0
    while (tvb_reported_length_remaining(tvb, offset) >= NS_GSLB_FLUSH_DOM_INFO_MIN_SIZE)
526
0
    {
527
0
      tf = proto_tree_add_item(ns_mep_tree, hf_ns_sitePersistenceFlushDom, tvb, offset, 9, ENC_NA);
528
0
      ns_mep_di_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
529
0
      start_offset = offset;
530
531
0
      proto_tree_add_item(ns_mep_di_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
532
0
      offset += 4;
533
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
534
0
      offset += 2;
535
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
536
0
      offset += 2;
537
538
0
      proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
539
540
0
      proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbDomNamelen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &domainlen);
541
0
      offset += 1;
542
0
      proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbDomName, tvb, offset, domainlen, ENC_ASCII);
543
0
      offset += domainlen;
544
545
0
      proto_item_set_len(tf, offset-start_offset);
546
547
      /* XXX - Do we really have a full domain info message here? */
548
0
    }
549
0
    break;
550
0
  }
551
0
  case GSLB_MSG_LBNODE_FLUSH_SVC_INFO:
552
0
  {
553
0
    proto_item *tf;
554
0
    proto_tree *ns_mep_di_tree;
555
556
0
    tf = proto_tree_add_item(ns_mep_tree, hf_ns_sitePersistenceFlushServ, tvb, offset, 8, ENC_NA);
557
0
    ns_mep_di_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
558
559
0
    proto_tree_add_item(ns_mep_di_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
560
0
    offset += 4;
561
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
562
0
    offset += 2;
563
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
564
0
    offset += 2;
565
566
0
    proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
567
0
    break;
568
0
  }
569
0
  case GSLB_MSG_LBNODE_GETSVC:
570
0
  {
571
0
    proto_item *tf;
572
0
    proto_tree *ns_mep_di_tree;
573
574
0
    tf = proto_tree_add_item(ns_mep_tree, hf_ns_sitePersisGetServReq, tvb, offset, 9, ENC_NA);
575
0
    ns_mep_di_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
576
0
    start_offset = offset;
577
578
0
    proto_tree_add_item(ns_mep_di_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
579
0
    offset += 4;
580
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
581
0
    offset += 2;
582
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
583
0
    offset += 2;
584
585
0
    proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
586
587
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbDomNamelen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &domainlen);
588
0
    offset += 1;
589
0
    proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbDomName, tvb, offset, domainlen, ENC_ASCII);
590
0
    offset += domainlen;
591
592
0
    proto_item_set_len(tf, start_offset - offset);
593
    /* XXX - Do we really have a full domain info message here? */
594
0
    break;
595
0
  }
596
0
  case GSLB_MSG_LBNODE_GETSVC_RESP:
597
0
  {
598
0
    proto_item *tf;
599
0
    proto_tree *ns_mep_di_tree;
600
601
0
    tf = proto_tree_add_item(ns_mep_tree, hf_ns_sitePersistenceGetServResp, tvb, offset, 9, ENC_NA);
602
0
    ns_mep_di_tree = proto_item_add_subtree(tf, ett_nsmep_nwu);
603
0
    start_offset = offset;
604
605
0
    proto_tree_add_item(ns_mep_di_tree, hf_nsmep_mfu_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
606
0
    offset += 4;
607
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_port, tvb, offset, 2, ENC_BIG_ENDIAN, &public_port);
608
0
    offset += 2;
609
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_nsmep_mfu_svctype, tvb, offset, 2, ENC_LITTLE_ENDIAN, &svctype);
610
0
    offset += 2;
611
612
0
    proto_item_append_text(tf, " for %s:%d:%s", tvb_address_to_str(pinfo->pool, tvb, FT_IPv4, offset-8), public_port, val_to_str(pinfo->pool, svctype, ns_svc_type_vals, "0x%02X"));
613
614
0
    proto_tree_add_item_ret_uint(ns_mep_di_tree, hf_ns_gslbDomNamelen, tvb, offset, 1, ENC_LITTLE_ENDIAN, &domainlen);
615
0
    offset += 1;
616
0
    proto_tree_add_item(ns_mep_di_tree, hf_ns_siteDomTTL, tvb, offset, 4, ENC_LITTLE_ENDIAN);
617
0
    offset += 4;
618
0
    proto_tree_add_item(ns_mep_di_tree, hf_ns_gslbDomName, tvb, offset, domainlen, ENC_ASCII);
619
0
    offset += domainlen;
620
621
0
    proto_item_set_len(tf, start_offset - offset);
622
0
    break;
623
0
  }
624
0
  case GSLB_MSG_KEEP_ALIVE:
625
0
  default:
626
0
    break;
627
0
  }
628
0
}
629
630
static int
631
dissect_ns_mep_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
632
0
{
633
0
  uint16_t ver;
634
0
  uint8_t maj_ver, min_ver;
635
636
0
  ver = tvb_get_letohs(tvb, 0);
637
0
  maj_ver = tvb_get_uint8(tvb, 0);
638
0
  min_ver = tvb_get_uint8(tvb, 1);
639
0
  switch(ver)
640
0
  {
641
0
  case 0x0001:
642
0
  case 0x0102:
643
0
  case 0x0202:
644
0
  case 0x0302:
645
0
  case 0x0402:
646
0
  case 0x0502:
647
0
  case 0x0602:
648
0
    dissect_ns_mep_v02xx(tvb, pinfo, tree);
649
0
    return tvb_captured_length(tvb);
650
651
0
  default:
652
    /* It is netscaler mep packet of unknown mep version. */
653
0
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "NS-MEP");
654
0
    col_clear(pinfo->cinfo, COL_INFO);
655
0
    col_add_fstr(pinfo->cinfo, COL_INFO, "The v%d.%d MEP Dissector unavailable", maj_ver, min_ver);
656
0
    break;
657
0
  }
658
659
0
  return tvb_captured_length(tvb);
660
0
}
661
662
static unsigned
663
get_ns_mep_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
664
0
{
665
  /* Get the length of the data from the header. */
666
0
  return tvb_get_letohs(tvb, offset + 4);
667
0
}
668
669
static int
670
dissect_ns_mep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
671
0
{
672
0
  uint16_t ns_rpc_sig;
673
674
0
  if (tvb_reported_length(tvb) >= 6)
675
0
  {
676
    /* Get the signature */
677
0
    ns_rpc_sig = tvb_get_letohs(tvb, 4);
678
0
    if (ns_rpc_sig == 0xA5A5)
679
0
    {
680
      /* If the signature is present, it is a netscaler-rpc connection. call
681
      the nsrpc dissector.  */
682
0
      call_dissector(nsrpc_handle, tvb, pinfo, tree);
683
0
      return tvb_captured_length(tvb);
684
0
    }
685
0
  }
686
687
0
  tcp_dissect_pdus(tvb, pinfo, tree, true, 6, get_ns_mep_pdu_len, dissect_ns_mep_pdu, data);
688
0
  return tvb_captured_length(tvb);
689
0
}
690
691
void
692
proto_register_ns_mep(void)
693
15
{
694
15
  static hf_register_info hf_nsmep[] = {
695
15
    { &hf_nsmep_majver,
696
15
      { "Major Version", "nstrace.mep.maj", FT_UINT8, BASE_DEC, NULL, 0x0,
697
15
      NULL, HFILL }},
698
699
15
    { &hf_nsmep_minver,
700
15
      { "Minor Version", "nstrace.mep.min", FT_UINT8, BASE_DEC, NULL, 0x0,
701
15
      NULL, HFILL }},
702
703
15
    { &hf_nsmep_msgtype,
704
15
      { "Message Type", "nstrace.mep.type", FT_UINT16, BASE_HEX,  VALS(nslist_gslbmessage), 0x0,
705
15
      NULL, HFILL }},
706
707
15
    { &hf_nsmep_msglen,
708
15
      { "Message Length", "nstrace.mep.len", FT_UINT16, BASE_DEC,  NULL, 0x0,
709
15
      NULL, HFILL }},
710
711
15
    { &hf_nsmep_errcode,
712
15
      { "Status Code", "nstrace.mep.errcode", FT_UINT16, BASE_HEX, VALS(ns_rpc_errcode_vals), 0x0,
713
15
      NULL, HFILL }},
714
715
    //added newly
716
15
    { &hf_ns_metricUpdate,
717
15
      { "Metric Update", "nstrace.mep.mfu.metricUpdate", FT_NONE, BASE_NONE, NULL, 0x0,
718
15
      NULL, HFILL } },
719
15
    { &hf_ns_forceUpdateRequest,
720
15
      { "Force Update Request", "nstrace.mep.mfu.forceUpdateRequest", FT_NONE, BASE_NONE, NULL, 0x0,
721
15
      NULL, HFILL } },
722
15
    { &hf_ns_forceUpdateResp,
723
15
      { "Force Update Response", "nstrace.mep.mfu.mep_mfu_force_update", FT_NONE, BASE_NONE, NULL, 0x0,
724
15
      NULL, HFILL } },
725
15
    { &hf_ns_currentOpenConn,
726
15
      { "Current Open Estd Conn", "nstrace.mep.mfu.currentOpenConn", FT_UINT32, BASE_DEC, NULL, 0x0,
727
15
      NULL, HFILL } },
728
15
    { &hf_ns_currentSurgeCount,
729
15
      { "Current Surge Count", "nstrace.mep.mfu.currentSurgeCount", FT_UINT32, BASE_DEC, NULL, 0x0,
730
15
      NULL, HFILL } },
731
15
    { &hf_ns_currentIOHCount,
732
15
      { "Current IOH Count", "nstrace.mep.mfu.currentIOHCount", FT_UINT32, BASE_DEC, NULL, 0x0,
733
15
      NULL, HFILL } },
734
15
    { &hf_ns_currentReusePool,
735
15
      { "Current Reuse pool", "nstrace.mep.mfu.currentReusePool", FT_UINT32, BASE_DEC, NULL, 0x0,
736
15
      NULL, HFILL } },
737
15
    { &hf_ns_currentServerConn,
738
15
      { "Current Server Conn", "nstrace.mep.mfu.currentServerConn", FT_UINT32, BASE_DEC, NULL, 0x0,
739
15
      NULL, HFILL } },
740
15
    { &hf_ns_currentClientConn,
741
15
      { "Current Client Conn", "nstrace.mep.mfu.currentClientConn", FT_UINT32, BASE_DEC, NULL, 0x0,
742
15
      NULL, HFILL } },
743
15
    { &hf_ns_TotalReq,
744
15
      { "Total Requests", "nstrace.mep.mfu.TotalReq", FT_UINT64, BASE_DEC, NULL, 0x0,
745
15
      NULL, HFILL } },
746
15
    { &hf_ns_TotalReqBytes,
747
15
      { "Total Requests Bytes", "nstrace.mep.mfu.TotalReqBytes", FT_UINT64, BASE_DEC, NULL, 0x0,
748
15
      NULL, HFILL } },
749
15
    { &hf_ns_TotalResp,
750
15
      { "Total Responses", "nstrace.mep.mfu.TotalResp", FT_UINT64, BASE_DEC, NULL, 0x0,
751
15
      NULL, HFILL } },
752
15
    { &hf_ns_TotalRespBytes,
753
15
      { "Total Responses Bytes", "nstrace.mep.mfu.TotalRespBytes", FT_UINT64, BASE_DEC, NULL, 0x0,
754
15
      NULL, HFILL } },
755
15
    { &hf_ns_networkMetrics,
756
15
      { "Network Metrics", "nstrace.mep.mfu.networkMetrics", FT_NONE, BASE_NONE, NULL, 0x0,
757
15
      NULL, HFILL } },
758
15
    { &hf_ns_roundTripTime,
759
15
      { "Round Trip Time", "nstrace.mep.mfu.roundTripTime", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0,
760
15
      NULL, HFILL } },
761
15
    { &hf_ns_hops,
762
15
      { "Hops", "nstrace.mep.mfu.hops", FT_UINT8, BASE_DEC, NULL, 0x0,
763
15
      NULL, HFILL } },
764
15
    { &hf_ns_persistenceInfo,
765
15
      { "Persistence Info for LDNS IP", "nstrace.mep.mfu.persistenceInfo", FT_NONE, BASE_NONE, NULL, 0x0,
766
15
      NULL, HFILL } },
767
15
    { &hf_ns_persistenceGslbServIp,
768
15
      { "Persistence GSLB Service IP", "nstrace.mep.mfu.persistenceGslbServIp", FT_IPv4, BASE_NONE, NULL, 0x0,
769
15
      NULL, HFILL } },
770
15
    { &hf_ns_persistenceGslbServPort,
771
15
      { "Persistence GSLB Service Port", "nstrace.mep.mfu.persistenceGslbServPort", FT_UINT16, BASE_DEC, NULL, 0x0,
772
15
      NULL, HFILL } },
773
15
    { &hf_ns_persistenceId,
774
15
      { "Persistence Id", "nstrace.mep.mfu.persistenceId", FT_UINT16, BASE_DEC, NULL, 0x0,
775
15
      NULL, HFILL } },
776
15
    { &hf_ns_sitePersistenceDom,
777
15
      { "Site persistence Domain Info", "nstrace.mep.mfu.sitePersistenceDom", FT_NONE, BASE_NONE, NULL, 0x0,
778
15
      NULL, HFILL } },
779
15
    { &hf_ns_gslbDomNamelen,
780
15
      { "GSLB Domain Name length", "nstrace.mep.mfu.gslbDomNamelen", FT_UINT8, BASE_DEC, NULL, 0x0,
781
15
      NULL, HFILL } },
782
15
    { &hf_ns_gslbServPreflen,
783
15
      { "GSLB Service Prefix length", "nstrace.mep.mfu.gslbServPreflen", FT_UINT8, BASE_DEC, NULL, 0x0,
784
15
      NULL, HFILL } },
785
15
    { &hf_ns_gslbCookieDomNamelen,
786
15
      { "GSLB Cookie domain name length", "nstrace.mep.mfu.gslbCookieDomNamelen", FT_UINT8, BASE_DEC, NULL, 0x0,
787
15
      NULL, HFILL } },
788
15
    { &hf_ns_gslbCookieTimeout,
789
15
      { "GSLB cookie timeout", "nstrace.mep.mfu.gslbCookieTimeout", FT_UINT32, BASE_DEC, NULL, 0x0,
790
15
      NULL, HFILL } },
791
15
    { &hf_ns_gslbVidlen,
792
15
      { "GSLB vserver ID length", "nstrace.mep.mfu.gslbVidlen", FT_UINT32, BASE_DEC, NULL, 0x0,
793
15
      NULL, HFILL } },
794
15
    { &hf_ns_gslbFlags,
795
15
      { "Flags", "nstrace.mep.mfu.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
796
15
      NULL, HFILL } },
797
15
    { &hf_ns_gslbCookieDomName,
798
15
      { "GSLB Cookie Domain Name", "nstrace.mep.mfu.gslbCookieDomName", FT_STRING, BASE_NONE, NULL, 0x0,
799
15
      NULL, HFILL } },
800
15
    { &hf_ns_gslbVs,
801
15
      { "GSLB Vserver ID", "nstrace.mep.mfu.gslbVs", FT_STRING, BASE_NONE, NULL, 0x0,
802
15
      NULL, HFILL } },
803
15
    { &hf_ns_gslbPrefix,
804
15
      { "GSLB service prefix", "nstrace.mep.mfu.gslbPrefix", FT_STRING, BASE_NONE, NULL, 0x0,
805
15
      NULL, HFILL } },
806
15
    { &hf_ns_sitePersistenceFlushDom,
807
15
      { "Site persistence Flush Domain Info", "nstrace.mep.mfu.sitePersistenceFlushDom", FT_NONE, BASE_NONE, NULL, 0x0,
808
15
      NULL, HFILL } },
809
15
    { &hf_ns_gslbDomName,
810
15
      { "GSLB Domain Name", "nstrace.mep.mfu.gslbDomName", FT_STRING, BASE_NONE, NULL, 0x0,
811
15
      NULL, HFILL } },
812
15
    { &hf_ns_sitePersistenceFlushServ,
813
15
      { "Site persistence Flush Service", "nstrace.mep.mfu.sitePersistenceFlushServ", FT_NONE, BASE_NONE, NULL, 0x0,
814
15
      NULL, HFILL } },
815
15
    { &hf_ns_sitePersisGetServReq,
816
15
      { "Site persistence Get Service request", "nstrace.mep.mfu.sitePersisGetServReq", FT_NONE, BASE_NONE, NULL, 0x0,
817
15
      NULL, HFILL } },
818
15
    { &hf_ns_sitePersistenceGetServResp,
819
15
      { "Site persistence Get Service response", "nstrace.mep.mfu.sitePersistenceGetServResp", FT_NONE, BASE_NONE, NULL, 0x0,
820
15
      NULL, HFILL } },
821
15
    { &hf_ns_siteDomTTL,
822
15
      { "Site Domain TTL", "nstrace.mep.mfu.siteDomTTL", FT_UINT32, BASE_DEC, NULL, 0x0,
823
15
      NULL, HFILL } },
824
825
15
    { &hf_nsmep_mfu_state,
826
15
      { "Service State", "nstrace.mep.mfu.state", FT_UINT16, BASE_HEX, VALS(ns_entity_state_vals), 0x0,
827
15
      NULL, HFILL }},
828
829
15
    { &hf_nsmep_mfu_eff_state,
830
15
      { "Service Effective State", "nstrace.mep.mfu.effstate", FT_UINT8, BASE_HEX, VALS(ns_entity_state_vals), 0x0,
831
15
      NULL, HFILL }},
832
833
15
    { &hf_nsmep_mfu_mepflag,
834
15
      { "MEP Flags", "nstrace.mep.mfu.mepflag", FT_UINT8, BASE_HEX, NULL, 0x0,
835
15
      NULL, HFILL }},
836
837
15
    { &hf_nsmep_mfu_ip,
838
15
      { "Service IP Address", "nstrace.mep.mfu.ip", FT_IPv4, BASE_NONE,  NULL, 0x0,
839
15
      NULL, HFILL }},
840
841
15
    { &hf_nsmep_mfu_port,
842
15
      { "Service Port", "nstrace.mep.mfu.port", FT_UINT16, BASE_DEC_HEX,  NULL, 0x0,
843
15
      NULL, HFILL }},
844
845
15
    { &hf_nsmep_mfu_svctype,
846
15
      { "Service Type", "nstrace.mep.mfu.svctype", FT_UINT32, BASE_HEX, VALS(ns_svc_type_vals), 0x0,
847
15
      NULL, HFILL }},
848
849
15
    { &hf_nsmep_mfu_reqflag,
850
15
      { "Request Flags", "nstrace.mep.mfu.reqflag", FT_UINT8, BASE_HEX, NULL, 0x0,
851
15
      NULL, HFILL }},
852
853
15
    { &hf_nsmep_adv_ip,
854
15
      { "Advertise Local IP Address", "nstrace.mep.adv.ip", FT_IPv4, BASE_NONE,  NULL, 0x0,
855
15
      NULL, HFILL }},
856
857
15
    { &hf_nsmep_ldns_ip,
858
15
      { "LDNS IP Address", "nstrace.mep.ldns.ip", FT_IPv4, BASE_NONE,  NULL, 0x0,
859
15
      NULL, HFILL }},
860
861
15
    { &hf_nsmep_site_persistence,
862
15
      { "Site Persistence", "nstrace.mep.mfu.sitepers", FT_UINT16, BASE_HEX, VALS(value_site_persistence), 0x0,
863
15
      NULL, HFILL }},
864
15
  };
865
866
15
  static int *ett[] = {
867
15
    &ett_nsmep,
868
15
    &ett_nsmep_mfu,
869
15
    &ett_nsmep_nwu,
870
15
  };
871
872
15
  proto_ns_mep = proto_register_protocol("NetScaler Metric Exchange Protocol", "NetScaler MEP", "nstrace.mep");
873
15
  proto_register_field_array(proto_ns_mep, hf_nsmep, array_length(hf_nsmep));
874
15
  proto_register_subtree_array(ett, array_length(ett));
875
876
15
  nsmep_handle = register_dissector("nstrace.mep", dissect_ns_mep, proto_ns_mep);
877
15
}
878
879
void proto_reg_handoff_ns_mep(void)
880
15
{
881
15
  nsrpc_handle = find_dissector_add_dependency("nsrpc", proto_ns_mep);
882
15
  dissector_add_for_decode_as("tcp.port", nsmep_handle);
883
15
}
884
885
/*
886
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
887
 *
888
 * Local variables:
889
 * c-basic-offset: 8
890
 * tab-width: 8
891
 * indent-tabs-mode: t
892
 * End:
893
 *
894
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
895
 * :indentSize=8:tabSize=8:noTabs=false:
896
 */