Minor cleanup

- Remove unneeded #includes;
- Move proto_reg_handoff...(() to the end of the file as per convention;
- Use dissector_add_handle() instead of using dissector_add_uint(..., 0, ...);
- #if 0 an unused global function (which caused a [-Wmissing-prototypes] warning);
- Remove an empty proto_reg-handoff...();
- 'if (already_registered)' not required in one case.

Change-Id: I74f267c2721df13eb4d52d7f19a6ded423218a39
Reviewed-on: https://code.wireshark.org/review/1277
Reviewed-by: Bill Meier <wmeier@newsguy.com>
This commit is contained in:
Bill Meier 2014-04-22 10:48:41 -04:00
parent 085b37d9b6
commit 2d774c6f84
12 changed files with 220 additions and 293 deletions

View File

@ -25,12 +25,9 @@
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include <epan/proto.h>
#include <epan/prefs.h>
#include "packet-lbm.h"
void proto_register_lbm(void);
void proto_reg_handoff_lbm(void);
/* Protocol handle */
static int lbm_protocol_handle = -1;
@ -68,16 +65,10 @@ static void lbm_init(void)
lbm_channel_reset();
}
/* The registration hand-off routine */
void proto_reg_handoff_lbm(void)
{
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbm(void)
{
lbm_protocol_handle = proto_register_protocol("LBM Protocol", "LBM", "lbm");
(void)prefs_register_protocol_subtree("29West", lbm_protocol_handle, proto_reg_handoff_lbm);
lbm_protocol_handle = proto_register_protocol("LBM Protocol", "LBM", "lbm"); /* XXX: not used/needed ? */
register_init_routine(lbm_init);
}
@ -218,6 +209,7 @@ gboolean lbm_channel_is_known(guint64 channel)
return (!lbm_channel_is_unknown_transport_lbttcp(channel) && !lbm_channel_is_unknown_stream_tcp(channel));
}
#if 0 /* XXX:not used ?? */
guint64 lbm_channel_id(guint64 channel)
{
guint64 id;
@ -225,6 +217,7 @@ guint64 lbm_channel_id(guint64 channel)
id = (channel & LBM_CHANNEL_VALUE_MASK) >> LBM_CHANNEL_VALUE_SHIFT_COUNT;
return (id);
}
#endif
/*----------------------------------------------------------------------------*/
/* Frame/SQN interface. */

View File

@ -25,19 +25,10 @@
#ifndef PACKET_LBM_H_INCLUDED
#define PACKET_LBM_H_INCLUDED
#include "config.h"
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <netinet/in.h>
#endif
#include <errno.h>
#include <glib.h>
#include <wsutil/inet_aton.h>
#include <epan/address.h>
#include <epan/packet.h>
#include <epan/wmem/wmem.h>
#include <epan/tfs.h>
#include <epan/value_string.h>
typedef guint8 lbm_uint8_t;
typedef guint16 lbm_uint16_t;

View File

@ -26,11 +26,8 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/expert.h>
#include <epan/tap.h>
#include <epan/tfs.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include <epan/to_str.h>
#include "packet-lbm.h"
@ -11629,19 +11626,14 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr
return (len_dissected);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmc(void)
int lbmc_get_minimum_length(void)
{
static gboolean already_registered = FALSE;
return (O_LBMC_HDR_T_MSGLEN + L_LBMC_HDR_T_MSGLEN);
}
if (!already_registered)
{
lbmc_data_dissector_handle = find_dissector("data");
lbmc_uim_tap_handle = register_tap("lbm_uim");
lbmc_stream_tap_handle = register_tap("lbm_stream");
}
already_registered = TRUE;
guint16 lbmc_get_message_length(tvbuff_t * tvb, int offset)
{
return (tvb_get_ntohs(tvb, offset + O_LBMC_HDR_T_MSGLEN));
}
/* Register all the bits needed with the filtering engine */
@ -14331,14 +14323,12 @@ void proto_register_lbmc(void)
lbmc_message_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
}
int lbmc_get_minimum_length(void)
/* The registration hand-off routine */
void proto_reg_handoff_lbmc(void)
{
return (O_LBMC_HDR_T_MSGLEN + L_LBMC_HDR_T_MSGLEN);
}
guint16 lbmc_get_message_length(tvbuff_t * tvb, int offset)
{
return (tvb_get_ntohs(tvb, offset + O_LBMC_HDR_T_MSGLEN));
lbmc_data_dissector_handle = find_dissector("data");
lbmc_uim_tap_handle = register_tap("lbm_uim");
lbmc_stream_tap_handle = register_tap("lbm_stream");
}
/*

View File

@ -25,10 +25,6 @@
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include <epan/proto.h>
#include <epan/expert.h>
#include <epan/tap.h>
#include <epan/value_string.h>
#include <wsutil/nstime.h>
#include <epan/wmem/wmem.h>
#include "packet-lbm.h"
@ -44,7 +40,6 @@
#define PDM_MSG_HDR_LE_MAGIC_BYTE_4 0xA7
void proto_register_lbmpdm(void);
void proto_reg_handoff_lbmpdm(void);
/*------------*/
/* PDM header */
@ -1339,15 +1334,9 @@ int lbmpdm_dissect_lbmpdm_payload(tvbuff_t * tvb, int offset, packet_info * pinf
return (dissected_len);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmpdm(void)
int lbmpdm_get_minimum_length(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{}
already_registered = TRUE;
return (L_LBMPDM_MSG_HDR_T);
}
/* Register all the bits needed with the filtering engine */
@ -1506,11 +1495,6 @@ void proto_register_lbmpdm(void)
lbmpdm_definition_table = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
}
int lbmpdm_get_minimum_length(void)
{
return (L_LBMPDM_MSG_HDR_T);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -23,12 +23,10 @@
*/
#include "config.h"
#include <stdlib.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/uat.h>
#include <epan/address.h>
@ -124,14 +122,14 @@ static lbmtcp_transport_t * lbmtcp_transport_add(const address * address1, guint
#define LBMPDM_TCP_DEFAULT_PORT_HIGH 14390
/* Global preferences variables (altered by the preferences dialog). */
static guint32 global_lbmpdm_tcp_port_low = LBMPDM_TCP_DEFAULT_PORT_LOW;
static guint32 global_lbmpdm_tcp_port_low = LBMPDM_TCP_DEFAULT_PORT_LOW;
static guint32 global_lbmpdm_tcp_port_high = LBMPDM_TCP_DEFAULT_PORT_HIGH;
static gboolean global_lbmpdm_tcp_use_tag = FALSE;
static gboolean global_lbmpdm_tcp_use_tag = FALSE;
/* Local preferences variables (used by the dissector). */
static guint32 lbmpdm_tcp_port_low = LBMPDM_TCP_DEFAULT_PORT_LOW;
static guint32 lbmpdm_tcp_port_low = LBMPDM_TCP_DEFAULT_PORT_LOW;
static guint32 lbmpdm_tcp_port_high = LBMPDM_TCP_DEFAULT_PORT_HIGH;
static gboolean lbmpdm_tcp_use_tag = FALSE;
static gboolean lbmpdm_tcp_use_tag = FALSE;
/* Tag definitions. */
typedef struct
@ -370,30 +368,6 @@ static gboolean test_lbmpdm_tcp_packet(tvbuff_t * tvb, packet_info * pinfo, prot
return (TRUE);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmpdm_tcp(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbmpdm_tcp_dissector_handle = create_dissector_handle(dissect_lbmpdm_tcp, lbmpdm_tcp_protocol_handle);
dissector_add_uint("tcp.port", 0, lbmpdm_tcp_dissector_handle);
heur_dissector_add("tcp", test_lbmpdm_tcp_packet, lbmpdm_tcp_protocol_handle);
}
/* Make sure the port low is <= the port high. If not, don't change them. */
if (global_lbmpdm_tcp_port_low <= global_lbmpdm_tcp_port_high)
{
lbmpdm_tcp_port_low = global_lbmpdm_tcp_port_low;
lbmpdm_tcp_port_high = global_lbmpdm_tcp_port_high;
}
lbmpdm_tcp_use_tag = global_lbmpdm_tcp_use_tag;
already_registered = TRUE;
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbmpdm_tcp(void)
{
@ -456,6 +430,30 @@ void proto_register_lbmpdm_tcp(void)
tag_uat);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmpdm_tcp(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbmpdm_tcp_dissector_handle = create_dissector_handle(dissect_lbmpdm_tcp, lbmpdm_tcp_protocol_handle);
dissector_add_handle("tcp.port", lbmpdm_tcp_dissector_handle); /* for "decode as" */
heur_dissector_add("tcp", test_lbmpdm_tcp_packet, lbmpdm_tcp_protocol_handle);
}
/* Make sure the port low is <= the port high. If not, don't change them. */
if (global_lbmpdm_tcp_port_low <= global_lbmpdm_tcp_port_high)
{
lbmpdm_tcp_port_low = global_lbmpdm_tcp_port_low;
lbmpdm_tcp_port_high = global_lbmpdm_tcp_port_high;
}
lbmpdm_tcp_use_tag = global_lbmpdm_tcp_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -31,15 +31,13 @@
#endif
#include <glib.h>
#include <epan/packet.h>
#include <epan/address.h>
#include <epan/strutil.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/tap.h>
#include <epan/stats_tree.h>
#include <epan/expert.h>
#include <epan/uat.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include <epan/to_str.h>
#include <wsutil/inet_aton.h>
#include <wsutil/pint.h>
@ -5620,41 +5618,6 @@ static gboolean test_lbmr_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tree
return (FALSE);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmr(void)
{
static gboolean already_registered = FALSE;
struct in_addr addr;
if (!already_registered)
{
lbmr_dissector_handle = new_create_dissector_handle(dissect_lbmr, proto_lbmr);
dissector_add_uint("udp.port", 0, lbmr_dissector_handle);
heur_dissector_add("udp", test_lbmr_packet, proto_lbmr);
}
lbmr_mc_incoming_udp_port = global_lbmr_mc_incoming_udp_port;
lbmr_mc_outgoing_udp_port = global_lbmr_mc_outgoing_udp_port;
inet_aton(global_lbmr_mc_incoming_address, &addr);
lbmr_mc_incoming_address_host = g_ntohl(addr.s_addr);
inet_aton(global_lbmr_mc_outgoing_address, &addr);
lbmr_mc_outgoing_address_host = g_ntohl(addr.s_addr);
/* Make sure the low port is <= the high port. If not, don't change them. */
if (global_lbmr_uc_port_low <= global_lbmr_uc_port_high)
{
lbmr_uc_port_high = global_lbmr_uc_port_high;
lbmr_uc_port_low = global_lbmr_uc_port_low;
}
lbmr_uc_dest_port = global_lbmr_uc_dest_port;
inet_aton(global_lbmr_uc_address, &addr);
lbmr_uc_address_host = g_ntohl(addr.s_addr);
lbmr_use_tag = global_lbmr_use_tag;
already_registered = TRUE;
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbmr(void)
{
@ -6834,6 +6797,41 @@ void proto_register_lbmr(void)
lbtrdma_transport_init();
}
/* The registration hand-off routine */
void proto_reg_handoff_lbmr(void)
{
static gboolean already_registered = FALSE;
struct in_addr addr;
if (!already_registered)
{
lbmr_dissector_handle = new_create_dissector_handle(dissect_lbmr, proto_lbmr);
dissector_add_handle("udp.port", lbmr_dissector_handle); /* for "decode as" */
heur_dissector_add("udp", test_lbmr_packet, proto_lbmr);
}
lbmr_mc_incoming_udp_port = global_lbmr_mc_incoming_udp_port;
lbmr_mc_outgoing_udp_port = global_lbmr_mc_outgoing_udp_port;
inet_aton(global_lbmr_mc_incoming_address, &addr);
lbmr_mc_incoming_address_host = g_ntohl(addr.s_addr);
inet_aton(global_lbmr_mc_outgoing_address, &addr);
lbmr_mc_outgoing_address_host = g_ntohl(addr.s_addr);
/* Make sure the low port is <= the high port. If not, don't change them. */
if (global_lbmr_uc_port_low <= global_lbmr_uc_port_high)
{
lbmr_uc_port_high = global_lbmr_uc_port_high;
lbmr_uc_port_low = global_lbmr_uc_port_low;
}
lbmr_uc_dest_port = global_lbmr_uc_dest_port;
inet_aton(global_lbmr_uc_address, &addr);
lbmr_uc_address_host = g_ntohl(addr.s_addr);
lbmr_use_tag = global_lbmr_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -32,10 +32,8 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/expert.h>
#include <epan/uat.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include <epan/tap.h>
#include <epan/conversation.h>
@ -1626,67 +1624,6 @@ static gboolean test_lbtrm_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tre
return (FALSE);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbtrm(void)
{
static gboolean already_registered = FALSE;
struct in_addr addr;
guint32 dest_addr_h_low;
guint32 dest_addr_h_high;
if (!already_registered)
{
lbtrm_dissector_handle = new_create_dissector_handle(dissect_lbtrm, proto_lbtrm);
dissector_add_uint("udp.port", 0, lbtrm_dissector_handle);
heur_dissector_add("udp", test_lbtrm_packet, proto_lbtrm);
lbtrm_tap_handle = register_tap("lbtrm");
}
/* Make sure the low MC address is <= the high MC address. If not, don't change them. */
inet_aton(global_lbtrm_mc_address_low, &addr);
dest_addr_h_low = g_ntohl(addr.s_addr);
inet_aton(global_lbtrm_mc_address_high, &addr);
dest_addr_h_high = g_ntohl(addr.s_addr);
if (dest_addr_h_low <= dest_addr_h_high)
{
lbtrm_mc_address_low_host = dest_addr_h_low;
lbtrm_mc_address_high_host = dest_addr_h_high;
}
/* Make sure the low destination port is <= the high destination port. If not, don't change them. */
if (global_lbtrm_dest_port_low <= global_lbtrm_dest_port_high)
{
lbtrm_dest_port_low = global_lbtrm_dest_port_low;
lbtrm_dest_port_high = global_lbtrm_dest_port_high;
}
/* Make sure the low source port is <= the high source port. If not, don't change them. */
if (global_lbtrm_src_port_low <= global_lbtrm_src_port_high)
{
lbtrm_src_port_low = global_lbtrm_src_port_low;
lbtrm_src_port_high = global_lbtrm_src_port_high;
}
/* Add the dissector hooks for the MIM MC groups. */
inet_aton(global_mim_incoming_mc_address, &addr);
mim_incoming_mc_address_host = g_htonl(addr.s_addr);
inet_aton(global_mim_outgoing_mc_address, &addr);
mim_outgoing_mc_address_host = g_htonl(addr.s_addr);
/* Add the dissector hooks for the MIM ports. */
mim_incoming_dest_port = global_mim_incoming_dest_port;
mim_outgoing_dest_port = global_mim_outgoing_dest_port;
lbtrm_expert_separate_naks = global_lbtrm_expert_separate_naks;
lbtrm_expert_separate_ncfs = global_lbtrm_expert_separate_ncfs;
lbtrm_sequence_analysis = global_lbtrm_sequence_analysis;
lbtrm_use_tag = global_lbtrm_use_tag;
already_registered = TRUE;
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbtrm(void)
{
@ -1980,6 +1917,67 @@ void proto_register_lbtrm(void)
tag_uat);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbtrm(void)
{
static gboolean already_registered = FALSE;
struct in_addr addr;
guint32 dest_addr_h_low;
guint32 dest_addr_h_high;
if (!already_registered)
{
lbtrm_dissector_handle = new_create_dissector_handle(dissect_lbtrm, proto_lbtrm);
dissector_add_handle("udp.port", lbtrm_dissector_handle); /* for "decode as* */
heur_dissector_add("udp", test_lbtrm_packet, proto_lbtrm);
lbtrm_tap_handle = register_tap("lbtrm");
}
/* Make sure the low MC address is <= the high MC address. If not, don't change them. */
inet_aton(global_lbtrm_mc_address_low, &addr);
dest_addr_h_low = g_ntohl(addr.s_addr);
inet_aton(global_lbtrm_mc_address_high, &addr);
dest_addr_h_high = g_ntohl(addr.s_addr);
if (dest_addr_h_low <= dest_addr_h_high)
{
lbtrm_mc_address_low_host = dest_addr_h_low;
lbtrm_mc_address_high_host = dest_addr_h_high;
}
/* Make sure the low destination port is <= the high destination port. If not, don't change them. */
if (global_lbtrm_dest_port_low <= global_lbtrm_dest_port_high)
{
lbtrm_dest_port_low = global_lbtrm_dest_port_low;
lbtrm_dest_port_high = global_lbtrm_dest_port_high;
}
/* Make sure the low source port is <= the high source port. If not, don't change them. */
if (global_lbtrm_src_port_low <= global_lbtrm_src_port_high)
{
lbtrm_src_port_low = global_lbtrm_src_port_low;
lbtrm_src_port_high = global_lbtrm_src_port_high;
}
/* Add the dissector hooks for the MIM MC groups. */
inet_aton(global_mim_incoming_mc_address, &addr);
mim_incoming_mc_address_host = g_htonl(addr.s_addr);
inet_aton(global_mim_outgoing_mc_address, &addr);
mim_outgoing_mc_address_host = g_htonl(addr.s_addr);
/* Add the dissector hooks for the MIM ports. */
mim_incoming_dest_port = global_mim_incoming_dest_port;
mim_outgoing_dest_port = global_mim_outgoing_dest_port;
lbtrm_expert_separate_naks = global_lbtrm_expert_separate_naks;
lbtrm_expert_separate_ncfs = global_lbtrm_expert_separate_ncfs;
lbtrm_sequence_analysis = global_lbtrm_sequence_analysis;
lbtrm_use_tag = global_lbtrm_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -25,13 +25,6 @@
#ifndef PACKET_LBTRM_H_INCLUDED
#define PACKET_LBTRM_H_INCLUDED
#include "config.h"
#include <glib.h>
#include <epan/address.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include "packet-lbm.h"
typedef struct
{
address source_address;

View File

@ -26,11 +26,8 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/expert.h>
#include <epan/uat.h>
#include <epan/tfs.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include <epan/conversation.h>
#include <epan/to_str.h>
@ -634,9 +631,9 @@ static const value_string lbtru_next_header[] =
/*----------------------------------------------------------------------------*/
/* Preferences default values. */
#define LBTRU_DEFAULT_SOURCE_PORT_LOW 14380
#define LBTRU_DEFAULT_SOURCE_PORT_HIGH 14389
#define LBTRU_DEFAULT_RECEIVER_PORT_LOW 14360
#define LBTRU_DEFAULT_SOURCE_PORT_LOW 14380
#define LBTRU_DEFAULT_SOURCE_PORT_HIGH 14389
#define LBTRU_DEFAULT_RECEIVER_PORT_LOW 14360
#define LBTRU_DEFAULT_RECEIVER_PORT_HIGH 14379
/* Global preferences variables (altered by the preferences dialog). */
@ -1690,42 +1687,6 @@ static gboolean test_lbtru_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tre
return (FALSE);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbtru(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbtru_dissector_handle = new_create_dissector_handle(dissect_lbtru, proto_lbtru);
dissector_add_uint("udp.port", 0, lbtru_dissector_handle);
heur_dissector_add("udp", test_lbtru_packet, proto_lbtru);
}
/* Make sure the low source port is <= the high source port. If not, don't change them. */
if (global_lbtru_source_port_low <= global_lbtru_source_port_high)
{
lbtru_source_port_low = global_lbtru_source_port_low;
lbtru_source_port_high = global_lbtru_source_port_high;
}
/* Make sure the low receiver port is <= the high receiver port. If not, don't change them. */
if (global_lbtru_receiver_port_low <= global_lbtru_receiver_port_high)
{
lbtru_receiver_port_low = global_lbtru_receiver_port_low;
lbtru_receiver_port_high = global_lbtru_receiver_port_high;
}
lbtru_expert_separate_naks = global_lbtru_expert_separate_naks;
lbtru_expert_separate_ncfs = global_lbtru_expert_separate_ncfs;
lbtru_sequence_analysis = global_lbtru_sequence_analysis;
lbtru_use_tag = global_lbtru_use_tag;
already_registered = TRUE;
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbtru(void)
{
@ -2022,6 +1983,42 @@ void proto_register_lbtru(void)
tag_uat);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbtru(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbtru_dissector_handle = new_create_dissector_handle(dissect_lbtru, proto_lbtru);
dissector_add_handle("udp.port", lbtru_dissector_handle); /* for "decode as" */
heur_dissector_add("udp", test_lbtru_packet, proto_lbtru);
}
/* Make sure the low source port is <= the high source port. If not, don't change them. */
if (global_lbtru_source_port_low <= global_lbtru_source_port_high)
{
lbtru_source_port_low = global_lbtru_source_port_low;
lbtru_source_port_high = global_lbtru_source_port_high;
}
/* Make sure the low receiver port is <= the high receiver port. If not, don't change them. */
if (global_lbtru_receiver_port_low <= global_lbtru_receiver_port_high)
{
lbtru_receiver_port_low = global_lbtru_receiver_port_low;
lbtru_receiver_port_high = global_lbtru_receiver_port_high;
}
lbtru_expert_separate_naks = global_lbtru_expert_separate_naks;
lbtru_expert_separate_ncfs = global_lbtru_expert_separate_ncfs;
lbtru_sequence_analysis = global_lbtru_sequence_analysis;
lbtru_use_tag = global_lbtru_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -25,13 +25,6 @@
#ifndef PACKET_LBTRU_H_INCLUDED
#define PACKET_LBTRU_H_INCLUDED
#include "config.h"
#include <glib.h>
#include <epan/address.h>
#include <epan/value_string.h>
#include <epan/wmem/wmem.h>
#include "packet-lbm.h"
typedef struct
{
address source_address;

View File

@ -23,11 +23,9 @@
*/
#include "config.h"
#include <stdio.h>
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/uat.h>
#include <epan/wmem/wmem.h>
@ -37,9 +35,8 @@
#include "packet-lbm.h"
#include "packet-lbttcp.h"
void proto_register_lbttc(void);
void proto_reg_handoff_lbttc(void);
void proto_register_lbttcp(void);
void proto_reg_handoff_lbttcp(void);
/* Protocol handle */
static int proto_lbttcp = -1;
@ -701,44 +698,6 @@ static gboolean test_lbttcp_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tr
return (TRUE);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbttcp(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbttcp_dissector_handle = new_create_dissector_handle(dissect_lbttcp, proto_lbttcp);
dissector_add_uint("tcp.port", 0, lbttcp_dissector_handle);
heur_dissector_add("tcp", test_lbttcp_packet, proto_lbttcp);
}
/* Make sure the source port low is <= the source port high. If not, don't change them. */
if (global_lbttcp_source_port_low <= global_lbttcp_source_port_high)
{
lbttcp_source_port_low = global_lbttcp_source_port_low;
lbttcp_source_port_high = global_lbttcp_source_port_high;
}
/* Make sure the request port low is <= the request port high. If not, don't change them. */
if (global_lbttcp_request_port_low <= global_lbttcp_request_port_high)
{
lbttcp_request_port_low = global_lbttcp_request_port_low;
lbttcp_request_port_high = global_lbttcp_request_port_high;
}
/* Make sure the store port low is <= the store port high. If not, don't change them. */
if (global_lbttcp_store_port_low <= global_lbttcp_store_port_high)
{
lbttcp_store_port_low = global_lbttcp_store_port_low;
lbttcp_store_port_high = global_lbttcp_store_port_high;
}
lbttcp_use_tag = global_lbttcp_use_tag;
already_registered = TRUE;
}
/* Register all the bits needed with the filtering engine */
void proto_register_lbttcp(void)
{
@ -834,6 +793,44 @@ void proto_register_lbttcp(void)
tag_uat);
}
/* The registration hand-off routine */
void proto_reg_handoff_lbttcp(void)
{
static gboolean already_registered = FALSE;
if (!already_registered)
{
lbttcp_dissector_handle = new_create_dissector_handle(dissect_lbttcp, proto_lbttcp);
dissector_add_handle("tcp.port", lbttcp_dissector_handle); /* for decode as */
heur_dissector_add("tcp", test_lbttcp_packet, proto_lbttcp);
}
/* Make sure the source port low is <= the source port high. If not, don't change them. */
if (global_lbttcp_source_port_low <= global_lbttcp_source_port_high)
{
lbttcp_source_port_low = global_lbttcp_source_port_low;
lbttcp_source_port_high = global_lbttcp_source_port_high;
}
/* Make sure the request port low is <= the request port high. If not, don't change them. */
if (global_lbttcp_request_port_low <= global_lbttcp_request_port_high)
{
lbttcp_request_port_low = global_lbttcp_request_port_low;
lbttcp_request_port_high = global_lbttcp_request_port_high;
}
/* Make sure the store port low is <= the store port high. If not, don't change them. */
if (global_lbttcp_store_port_low <= global_lbttcp_store_port_high)
{
lbttcp_store_port_low = global_lbttcp_store_port_low;
lbttcp_store_port_high = global_lbttcp_store_port_high;
}
lbttcp_use_tag = global_lbttcp_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*

View File

@ -25,11 +25,6 @@
#ifndef PACKET_LBTTCP_H_INCLUDED
#define PACKET_LBTTCP_H_INCLUDED
#include "config.h"
#include <glib.h>
#include <epan/address.h>
#include <epan/wmem/wmem.h>
typedef struct
{
address source_address;