DEBUG epan/dissectors/packet-xml.c
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Oct 2017 15:18:19 +0000 (17:18 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 20 Jan 2019 22:14:58 +0000 (23:14 +0100)
Change-Id: Icfe833203cbcfabd68eb267eabd6659d140cd68f

epan/dissectors/packet-xml.c

index 746f8e8..44b71eb 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <string.h>
 #include <errno.h>
+#include <stdio.h>
 
 #include <epan/packet.h>
 #include <epan/tvbparse.h>
@@ -399,7 +400,12 @@ static void after_token(void *tvbparse_data, const void *wanted_data _U_, tvbpar
             const gchar *s = "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ";
             size_t l = strlen(s);
             gint c;
+            printf("METZE:ValueType=>[%p][%u]\n", value_type->value, value_type->length);
             c = tvb_strneql(value_type->value, 0, s, l);
+            printf("METZE:ValueType=>[%p][%u][%d]\n", value_type->value, value_type->length, c);
+
+            //printf("METZE:ValueType=>[%s]\n",
+            //            tvb_format_text(value_type->value, 0, value_type->length));
             if (c == 0) {
                 tvbuff_t *ssp_tvb = base64_to_tvb(new_frame->value, text);
                 add_new_data_source(current_frame->pinfo, ssp_tvb, "GSSAPI Data");
@@ -477,7 +483,7 @@ static void before_tag(void *tvbparse_data, const void *wanted_data _U_, tvbpars
     GPtrArray       *stack         = (GPtrArray *)tvbparse_data;
     xml_frame_t     *current_frame = (xml_frame_t *)g_ptr_array_index(stack, stack->len - 1);
     tvbparse_elem_t *name_tok      = tok->sub->next;
-    gchar           *root_name;
+    gchar           *root_name     = NULL;
     gchar           *name          = NULL, *name_orig_case = NULL;
     xml_ns_t        *ns;
     xml_frame_t     *new_frame;
@@ -495,7 +501,11 @@ static void before_tag(void *tvbparse_data, const void *wanted_data _U_, tvbpars
 
         nameroot_ns = (xml_ns_t *)wmem_map_lookup(xml_ns.elements, root_name);
 
+printf("%s:%s:%u: nameroot_ns[%p] root_name[%s]\n", __FILE__, G_STRFUNC, __LINE__,
+        nameroot_ns, root_name);
         if(nameroot_ns) {
+printf("%s:%s:%u: nameroot_ns_name[%s]\n", __FILE__, G_STRFUNC, __LINE__,
+          nameroot_ns->name);
             ns = (xml_ns_t *)wmem_map_lookup(nameroot_ns->elements, name);
             if (!ns) {
                 ns = &unknown_ns;
@@ -545,6 +555,10 @@ static void before_tag(void *tvbparse_data, const void *wanted_data _U_, tvbpars
 
     g_ptr_array_add(stack, new_frame);
 
+printf("%s:%s:%u: root_name[%s]\n", __FILE__, G_STRFUNC, __LINE__, root_name);
+printf("%s:%s:%u: new_frame->name[%s][%s]\n", __FILE__, G_STRFUNC, __LINE__, name, name_orig_case);
+printf("%s:%s:%u: ns_name[%s]\n", __FILE__, G_STRFUNC, __LINE__,
+          ns->name);
 }
 
 static void after_open_tag(void *tvbparse_data, const void *wanted_data _U_, tvbparse_elem_t *tok _U_)
@@ -1138,6 +1152,7 @@ static void register_dtd(dtd_build_data_t *dtd_data, GString *errors)
             g_ptr_array_add(element_names, wmem_strdup(wmem_epan_scope(), element->name));
         }
 
+printf("%s:%s:%u: element_name[%s]\n", __FILE__, G_STRFUNC, __LINE__, element->name);
         g_free(nl->name);
         g_free(nl);
     }
@@ -1147,6 +1162,7 @@ static void register_dtd(dtd_build_data_t *dtd_data, GString *errors)
         dtd_named_list_t *nl      = (dtd_named_list_t *)g_ptr_array_remove_index(dtd_data->attributes, 0);
         xml_ns_t         *element = (xml_ns_t *)wmem_map_lookup(elements, nl->name);
 
+printf("%s:%s:%u: nl_name[%s] element[%p]\n", __FILE__, G_STRFUNC, __LINE__, nl->name, element);
         if (element) {
             while(nl->list->len) {
                 gchar *name = (gchar *)g_ptr_array_remove_index(nl->list, 0);
@@ -1171,6 +1187,7 @@ static void register_dtd(dtd_build_data_t *dtd_data, GString *errors)
         root_name = wmem_strdup(wmem_epan_scope(), dtd_data->proto_root);
     }
 
+printf("%s:%s:%u: root_name[%s]\n", __FILE__, G_STRFUNC, __LINE__, root_name);
     /* we use a stack with the names to avoid recurring infinitelly */
     hier = g_ptr_array_new();
 
@@ -1295,6 +1312,8 @@ static void register_dtd(dtd_build_data_t *dtd_data, GString *errors)
         ett_p = &root_element->ett;
         g_array_append_val(etts, ett_p);
 
+printf("%s:%s:%u: short_name[%s] full_name[%s] root_name[%s]\n", __FILE__, G_STRFUNC, __LINE__,
+        short_name, full_name, root_name);
         add_xml_field(hfs, &root_element->hf_cdata, root_element->name, root_element->fqn);
 
         root_element->hf_tag = proto_register_protocol(full_name, short_name, short_name);
@@ -1365,7 +1384,7 @@ static void init_xml_names(void)
 
                     g_string_truncate(errors, 0);
                     preparsed = dtd_preparse(dirname, filename, errors);
-
+printf("%s:%s:%u: dirname[%s] filename[%s]\n", __FILE__, G_STRFUNC, __LINE__, dirname, filename);
                     if (errors->len) {
                         report_failure("Dtd Preparser in file %s%c%s: %s",
                                        dirname, G_DIR_SEPARATOR, filename, errors->str);