diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-11-13 23:33:47 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-11-13 23:33:47 +0000 |
commit | a42a82ed1d0a1d9b53c59652066dde539d9ef3cd (patch) | |
tree | e5b568fbccd99fdba43a8e547755849bffe83e87 /epan/dissectors/packet-xmpp.c | |
parent | a6ccc83e221ff4c5560ed031938a3f41df60d5ac (diff) |
Don't use generic shared function/typedef/struct names;
Remove unneeded #includes;
Cleanup trailing whitespace.
svn path=/trunk/; revision=39823
Diffstat (limited to 'epan/dissectors/packet-xmpp.c')
-rw-r--r-- | epan/dissectors/packet-xmpp.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/epan/dissectors/packet-xmpp.c b/epan/dissectors/packet-xmpp.c index 7edd166454..627e9f765b 100644 --- a/epan/dissectors/packet-xmpp.c +++ b/epan/dissectors/packet-xmpp.c @@ -1,6 +1,6 @@ /* packet-xmpp.c * Wireshark's XMPP dissector. - * + * * Copyright 2011, Mariusz Okroj <okrojmariusz[]gmail.com> * * $Id$ @@ -28,15 +28,13 @@ #include "config.h" #endif -#include<stdio.h> -#include<string.h> +#include <string.h> + #include <glib.h> #include <epan/packet.h> -#include <epan/proto.h> #include <epan/emem.h> #include <epan/conversation.h> -#include <epan/strutil.h> #include <epan/expert.h> #include <epan/prefs.h> @@ -375,7 +373,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *xmpp_tree = NULL; proto_item *xmpp_item = NULL; - element_t *packet = NULL; + xmpp_element_t *packet = NULL; /*check if desegment * now it checks that last char is '>', @@ -413,14 +411,14 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /*if tree == NULL then xmpp_item and xmpp_tree will also NULL*/ xmpp_item = proto_tree_add_item(tree, proto_xmpp, tvb, 0, -1, ENC_NA); xmpp_tree = proto_item_add_subtree(xmpp_item, ett_xmpp); - + call_dissector(xml_handle,tvb,pinfo,xmpp_tree); /*if stream end occurs then return*/ if(xmpp_stream_close(xmpp_tree,tvb, pinfo)) { if(xmpp_tree) - proto_tree_hide_first_child(xmpp_tree); + xmpp_proto_tree_hide_first_child(xmpp_tree); return; } @@ -429,7 +427,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /*data from XML dissector*/ xml_frame = ((xml_frame_t*)pinfo->private_data)->first_child; - + if(!xml_frame) return; @@ -445,7 +443,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { conversation_add_proto_data(conversation, proto_xmpp, (void *) xmpp_info); } - + if (pinfo->match_uint == pinfo->destport) out_packet = TRUE; else @@ -453,7 +451,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { while(xml_frame) { - packet = xml_frame_to_element_t(xml_frame, NULL, tvb); + packet = xmpp_xml_frame_to_element_t(xml_frame, NULL, tvb); DISSECTOR_ASSERT(packet); if (strcmp(packet->name, "iq") == 0) { @@ -478,7 +476,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /*it hides tree generated by XML dissector*/ - proto_tree_hide_first_child(xmpp_tree); + xmpp_proto_tree_hide_first_child(xmpp_tree); if (strcmp(packet->name, "iq") == 0) { xmpp_iq(xmpp_tree, tvb, pinfo, packet); @@ -507,7 +505,7 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { }else if (strcmp(packet->name, "proceed") == 0) { xmpp_proceed(xmpp_tree, tvb, pinfo, packet); }else { - proto_tree_show_first_child(xmpp_tree); + xmpp_proto_tree_show_first_child(xmpp_tree); expert_add_info_format(pinfo, xmpp_tree, PI_UNDECODED, PI_NOTE, "Unknown packet: %s", packet->name); col_clear(pinfo->cinfo, COL_INFO); col_append_fstr(pinfo->cinfo, COL_INFO, "UNKNOWN PACKET "); @@ -515,17 +513,17 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /*appends to COL_INFO information about src or dst*/ if (pinfo->match_uint == pinfo->destport) { - attr_t *to = get_attr(packet, "to"); + xmpp_attr_t *to = xmpp_get_attr(packet, "to"); if (to) col_append_fstr(pinfo->cinfo, COL_INFO, "> %s ", to->value); } else { - attr_t *from = get_attr(packet, "from"); + xmpp_attr_t *from = xmpp_get_attr(packet, "from"); if (from) col_append_fstr(pinfo->cinfo, COL_INFO, "< %s ", from->value); } } - element_t_tree_free(packet); + xmpp_element_t_tree_free(packet); xml_frame = xml_frame->next_sibling; } } @@ -1383,7 +1381,7 @@ proto_register_xmpp(void) { ett_unknown_ptr[i] = &ett_unknown[i]; } - + proto_xmpp = proto_register_protocol( "XMPP Protocol", /* name */ @@ -1411,7 +1409,6 @@ proto_reg_handoff_xmpp(void) { xml_handle = find_dissector("xml"); - /*xmpp_handle = create_dissector_handle(dissect_xmpp, proto_xmpp);*/ xmpp_handle = find_dissector("xmpp"); dissector_add_uint("tcp.port", XMPP_PORT, xmpp_handle); |