TODO SMB2 NegotiateContext....
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Sep 2014 21:13:29 +0000 (23:13 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 20 Jan 2019 22:14:58 +0000 (23:14 +0100)
Change-Id: Iff854f2d3824c8bf9f85ce7f160979bc707df222

epan/dissectors/packet-smb2.c

index d8a8c46..7594d61 100644 (file)
@@ -186,6 +186,7 @@ static int hf_smb2_create_rep_flags_reparse_point = -1;
 static int hf_smb2_next_offset = -1;
 static int hf_smb2_negotiate_context_type = -1;
 static int hf_smb2_negotiate_context_data_length = -1;
+static int hf_smb2_negotiate_context = -1;
 static int hf_smb2_negotiate_context_offset = -1;
 static int hf_smb2_negotiate_context_count = -1;
 static int hf_smb2_hash_alg_count = -1;
@@ -1452,6 +1453,11 @@ dissect_smb2_olb_buffer(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *t
        len    = olb->len;
        off    = olb->off;
 
+       if (len == -1) {
+               len = tvb_reported_length_remaining(tvb, off);
+               olb->len = len;
+       }
+
        /* sanity check */
        tvb_ensure_bytes_exist(tvb, off, len);
        if (((off+len)<off)
@@ -4386,8 +4392,27 @@ dissect_smb2_negotiate_context(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
        }
 
        return offset;
-}
+       //negotiate_context_data_dissectors_t *dissectors = NULL;
+       //negotiate_context_data_dissector_t   dissector  = NULL;
+       //struct negotiate_context_data_type_dissectors *type_dissectors;
+       //type_dissectors = get_negotiate_context_data_type_dissectors(type);
+
+
+       //if (tvb_reported_length_remaining(tvb, offset) == 0) {
+       //      return;
+       //}
 
+       //next_tvb = tvb_new_subset_remaining(tvb, offset);
+
+       //dissect_smb2_negotiate_context(next_tvb, pinfo, parent_tree, si);
+
+       ///* data */
+       //dissectors = &tag_dissectors->dissectors;
+       //if (dissectors)
+       //      dissector = (si->flags & SMB2_FLAGS_RESPONSE) ? dissectors->response : dissectors->request;
+
+       //dissect_smb2_olb_buffer(pinfo, sub_tree, tvb, &data_olb, si, dissector);
+}
 static int
 dissect_smb2_negotiate_protocol_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, smb2_info_t *si _U_)
 {
@@ -10274,6 +10299,10 @@ proto_register_smb2(void)
                        NULL, 0, NULL, HFILL }
                },
 
+               { &hf_smb2_negotiate_context,
+                 { "NegotiateContext", "smb2.negotiate.context", FT_NONE, BASE_NONE,
+                   NULL, 0, "Negotiate Context", HFILL }},
+
                { &hf_smb2_negotiate_context_offset,
                        { "NegotiateContextOffset", "smb2.negotiate_context.offset", FT_UINT16, BASE_HEX,
                        NULL, 0, NULL, HFILL }