diff options
Diffstat (limited to 'epan/dissectors/packet-lbttcp.c')
-rw-r--r-- | epan/dissectors/packet-lbttcp.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/epan/dissectors/packet-lbttcp.c b/epan/dissectors/packet-lbttcp.c index 92603db943..c21c45a6de 100644 --- a/epan/dissectors/packet-lbttcp.c +++ b/epan/dissectors/packet-lbttcp.c @@ -24,7 +24,7 @@ void proto_register_lbttcp(void); void proto_reg_handoff_lbttcp(void); /* Protocol handle */ -static int proto_lbttcp = -1; +static int proto_lbttcp; /* Dissector handle */ static dissector_handle_t lbttcp_dissector_handle; @@ -47,7 +47,7 @@ lbttcp_transport_t * lbttcp_transport_find(const address * source_address, guint conversation_t * conv = NULL; lbttcp_transport_conv_data_t * conv_data = NULL; - conv = find_conversation(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = find_conversation(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); if (conv != NULL) { conv_data = (lbttcp_transport_conv_data_t *) conversation_get_proto_data(conv, proto_lbttcp); @@ -79,10 +79,10 @@ lbttcp_transport_t * lbttcp_transport_add(const address * source_address, guint1 conversation_t * conv = NULL; lbttcp_transport_conv_data_t * conv_data = NULL; - conv = find_conversation(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = find_conversation(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); if (conv == NULL) { - conv = conversation_new(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = conversation_new(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); } conv_data = (lbttcp_transport_conv_data_t *) conversation_get_proto_data(conv, proto_lbttcp); if (conv_data == NULL) @@ -112,7 +112,7 @@ static lbttcp_client_transport_t * lbttcp_client_transport_find(lbttcp_transport { return (NULL); } - client_conv = find_conversation(frame, &(transport->source_address), receiver_address, ENDPOINT_TCP, transport->source_port, receiver_port, 0); + client_conv = find_conversation(frame, &(transport->source_address), receiver_address, CONVERSATION_TCP, transport->source_port, receiver_port, 0); if (client_conv != NULL) { wmem_tree_t * session_tree = NULL; @@ -147,10 +147,10 @@ static lbttcp_client_transport_t * lbttcp_client_transport_add(lbttcp_transport_ entry->id = transport->next_client_id++; /* See if a conversation for this address/port pair exists. */ - client_conv = find_conversation(frame, &(transport->source_address), receiver_address, ENDPOINT_TCP, transport->source_port, receiver_port, 0); + client_conv = find_conversation(frame, &(transport->source_address), receiver_address, CONVERSATION_TCP, transport->source_port, receiver_port, 0); if (client_conv == NULL) { - client_conv = conversation_new(frame, &(transport->source_address), receiver_address, ENDPOINT_TCP, transport->source_port, receiver_port, 0); + client_conv = conversation_new(frame, &(transport->source_address), receiver_address, CONVERSATION_TCP, transport->source_port, receiver_port, 0); session_tree = wmem_tree_new(wmem_file_scope()); conversation_add_proto_data(client_conv, proto_lbttcp, (void *) session_tree); } @@ -173,11 +173,11 @@ char * lbttcp_transport_source_string(const address * source_address, guint16 so if (session_id == 0) { - bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), source_address), source_port); + bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" PRIu16, address_to_str(wmem_packet_scope(), source_address), source_port); } else { - bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" G_GUINT16_FORMAT ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); + bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" PRIu16 ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); } return (bufptr); } @@ -188,7 +188,7 @@ gboolean lbttcp_transport_sid_find(const address * source_address, guint16 sourc lbttcp_transport_conv_data_t * conv_data = NULL; lbttcp_transport_t * transport = NULL; - conv = find_conversation(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = find_conversation(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); if (conv == NULL) { return (FALSE); @@ -217,10 +217,10 @@ void lbttcp_transport_sid_add(const address * source_address, guint16 source_por lbttcp_transport_conv_data_t * conv_data = NULL; lbttcp_transport_t * transport = NULL; - conv = find_conversation(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = find_conversation(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); if (conv == NULL) { - conv = conversation_new(frame, source_address, &lbttcp_null_address, ENDPOINT_TCP, source_port, 0, 0); + conv = conversation_new(frame, source_address, &lbttcp_null_address, CONVERSATION_TCP, source_port, 0, 0); } conv_data = (lbttcp_transport_conv_data_t *) conversation_get_proto_data(conv, proto_lbttcp); if (conv_data == NULL) @@ -314,7 +314,7 @@ static uat_field_t lbttcp_tag_array[] = /*----------------------------------------------------------------------------*/ /* UAT callback functions. */ /*----------------------------------------------------------------------------*/ -static gboolean lbttcp_tag_update_cb(void * record, char * * error_string) +static bool lbttcp_tag_update_cb(void * record, char * * error_string) { lbttcp_tag_entry_t * tag = (lbttcp_tag_entry_t *)record; @@ -409,14 +409,14 @@ static char * lbttcp_tag_find(packet_info * pinfo) /*----------------------------------------------------------------------------*/ /* Dissector tree handles */ -static gint ett_lbttcp = -1; -static gint ett_lbttcp_channel = -1; +static gint ett_lbttcp; +static gint ett_lbttcp_channel; /* Dissector field handles */ -static int hf_lbttcp_tag = -1; -static int hf_lbttcp_channel = -1; -static int hf_lbttcp_channel_id = -1; -static int hf_lbttcp_channel_client = -1; +static int hf_lbttcp_tag; +static int hf_lbttcp_channel; +static int hf_lbttcp_channel_id; +static int hf_lbttcp_channel_client; static gboolean lbttcp_packet_is_transport_source(packet_info * pinfo, const lbttcp_tag_entry_t * tag) { @@ -714,6 +714,8 @@ void proto_register_lbttcp(void) proto_register_field_array(proto_lbttcp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + lbttcp_dissector_handle = register_dissector("lbttcp", dissect_lbttcp, proto_lbttcp); + lbttcp_module = prefs_register_protocol_subtree("29West", proto_lbttcp, proto_reg_handoff_lbttcp); prefs_register_uint_preference(lbttcp_module, "source_port_low", @@ -790,7 +792,6 @@ void proto_reg_handoff_lbttcp(void) if (!already_registered) { - lbttcp_dissector_handle = create_dissector_handle(dissect_lbttcp, proto_lbttcp); dissector_add_for_decode_as_with_preference("tcp.port", lbttcp_dissector_handle); heur_dissector_add("tcp", test_lbttcp_packet, "LBT over TCP", "lbttcp_tcp", proto_lbttcp, HEURISTIC_ENABLE); } |