Skip to content

Commit 3bc42db

Browse files
anilkumar911AndersBroman
authored andcommitted
Netscaler: Add support to read MTCP record.
Change-Id: I73aadb10e44aa64c6f4c9cc2145a63f5bd9c74e5 Reviewed-on: https://code.wireshark.org/review/8580 Reviewed-by: Anders Broman <a.broman58@gmail.com>
1 parent 1942039 commit 3bc42db

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

epan/dissectors/packet-nstrace.c

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ typedef struct nspr_rec_ssl_s
101101
guint8 appseq[4];
102102
} nspr_rec_ssl_t;
103103

104+
typedef struct nspr_rec_mptcp_s
105+
{
106+
nspr_tracerechdr_t rechdr;
107+
guint8 subflowid;
108+
}nspr_rec_mptcp_t;
104109

105110
/* Netscaler Record types */
106111
#define NSREC_NULL 0x00
@@ -120,6 +125,7 @@ typedef struct nspr_rec_ssl_s
120125
#define NSREC_SSL 0x87
121126
#define NSREC_APPFW 0x88
122127
#define NSREC_POL 0x89
128+
#define NSREC_MPTCP 0x8A
123129
#define UNKNOWN_LAST 0xFF
124130

125131
/* Packet error codes */
@@ -151,7 +157,7 @@ typedef struct nspr_rec_ssl_s
151157
#define APP_RDP 0x11
152158
#define APP_TFTP 0x12
153159
#define APP_PPTP 0x13
154-
#define APP_MPTCP 0x14
160+
#define APP_MPTCPIN 0x14
155161
#define APP_HTTP2 0x15
156162
#define APP_IPSEC 0x16
157163
#define APP_TEST 0x17
@@ -163,6 +169,7 @@ typedef struct nspr_rec_ssl_s
163169
#define APP_IP6 0x1D
164170
#define APP_ARP 0x1E
165171
#define APP_SSLENC 0x1F
172+
#define APP_MPTCPOUT 0x20
166173

167174
void proto_register_ns(void);
168175
void proto_reg_handoff_ns(void);
@@ -219,6 +226,9 @@ static int hf_ns_inforec_info = -1;
219226
static int hf_ns_sslrec = -1;
220227
static int hf_ns_sslrec_seq = -1;
221228

229+
static int hf_ns_mptcprec = -1;
230+
static int hf_ns_mptcprec_subflowid = -1;
231+
222232
static int hf_ns_vmnamerec = -1;
223233
static int hf_ns_vmnamerec_srcvmname = -1;
224234
static int hf_ns_vmnamerec_dstvmname = -1;
@@ -240,6 +250,7 @@ static gint ett_ns_activity_flags = -1;
240250
static gint ett_ns_tcpdebug = -1;
241251
static gint ett_ns_inforec = -1;
242252
static gint ett_ns_sslrec = -1;
253+
static gint ett_ns_mptcprec = -1;
243254
static gint ett_ns_vmnamerec = -1;
244255
static gint ett_ns_clusterrec = -1;
245256
static gint ett_ns_clu_clflags = -1;
@@ -269,7 +280,7 @@ static const value_string ns_app_vals[] = {
269280
{ APP_SMPP, "SMPP" },
270281
{ APP_TFTP, "TFTP" },
271282
{ APP_PPTP, "PPTP" },
272-
{ APP_MPTCP, "MPTCP" },
283+
{ APP_MPTCPIN,"MPTCP-IN" },
273284
{ APP_HTTP2, "HTTP2" },
274285
{ APP_IPSEC, "IPSEC" },
275286
{ APP_TEST, "TEST" },
@@ -281,6 +292,7 @@ static const value_string ns_app_vals[] = {
281292
{ APP_IP6, "IP6" },
282293
{ APP_ARP, "ARP" },
283294
{ APP_SSLENC,"SSL-ENC"},
295+
{ APP_MPTCPOUT,"MPTCP-OUT" },
284296
{ APP_NULL, NULL },
285297
};
286298

@@ -398,6 +410,7 @@ void add35records(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tre
398410
#define CLUSTERRECOFFSET(field) (guint)(offsetof(nspr_rec_cluster_t, field))
399411
#define VMNAMERECOFFSET(field) (guint)(offsetof(nspr_rec_vmname_t, field))
400412
#define SSLRECOFFSET(field) (guint)(offsetof(nspr_rec_ssl_t, field))
413+
#define MPTCPRECOFFSET(field) (guint)(offsetof(nspr_rec_mptcp_t, field))
401414
static void
402415
dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
403416
{
@@ -637,6 +650,21 @@ void add35records(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tre
637650
cur_record = nextrec;
638651
}
639652
break;
653+
case NSREC_MPTCP:
654+
{
655+
proto_item *mptcpItem=NULL;
656+
proto_tree *mptcpTree=NULL;
657+
int reclen = tvb_get_letohs(tvb,offset+NSHDR_RECOFFSET_35(rec_len));
658+
int nextrec = tvb_get_guint8(tvb,offset+NSHDR_RECOFFSET_35(nextrec_type));
659+
660+
mptcpItem = proto_tree_add_item(ns_tree, hf_ns_mptcprec, tvb, offset, reclen, ENC_NA);
661+
mptcpTree = proto_item_add_subtree(mptcpItem, ett_ns_mptcprec);
662+
proto_tree_add_item(mptcpTree, hf_ns_mptcprec_subflowid, tvb, offset+MPTCPRECOFFSET(subflowid), 1, ENC_LITTLE_ENDIAN);
663+
664+
offset += reclen;
665+
cur_record = nextrec;
666+
}
667+
break;
640668
case NSREC_VMNAMES:
641669
{
642670
proto_item *vmnameItem=NULL;
@@ -945,20 +973,32 @@ proto_register_ns(void)
945973
NULL, HFILL}
946974
},
947975

976+
{ &hf_ns_mptcprec,
977+
{ "mptcp record", "nstrace.mptcp",
978+
FT_NONE, BASE_NONE, NULL, 0x0,
979+
NULL, HFILL}
980+
},
981+
982+
{ &hf_ns_mptcprec_subflowid,
983+
{ "MPTCP subflow id", "nstrace.sslrec.subflow",
984+
FT_UINT8, BASE_HEX, NULL, 0x0,
985+
NULL, HFILL}
986+
},
987+
948988
{ &hf_ns_vmnamerec,
949989
{ "vmname record", "nstrace.vmnames",
950990
FT_NONE, BASE_NONE, NULL, 0x0,
951991
NULL, HFILL}
952992
},
953993

954994
{ &hf_ns_vmnamerec_srcvmname,
955-
{ "info", "nstrace.vmnames.srcvmname",
995+
{ "SrcVmName", "nstrace.vmnames.srcvmname",
956996
FT_STRING, STR_ASCII, NULL, 0x0,
957997
NULL, HFILL}
958998
},
959999

9601000
{ &hf_ns_vmnamerec_dstvmname,
961-
{ "info", "nstrace.vmnames.dstvmnames",
1001+
{ "DstVmName", "nstrace.vmnames.dstvmnames",
9621002
FT_STRING, STR_ASCII, NULL, 0x0,
9631003
NULL, HFILL}
9641004
},
@@ -1047,6 +1087,7 @@ proto_register_ns(void)
10471087
&ett_ns_clusterrec,
10481088
&ett_ns_clu_clflags,
10491089
&ett_ns_sslrec,
1090+
&ett_ns_mptcprec,
10501091
&ett_ns_capflags,
10511092
};
10521093

0 commit comments

Comments
 (0)