diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-10-24 21:04:19 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-10-25 19:10:57 +0000 |
commit | 90644c83725f979f82e7990792faaf6e847f74ea (patch) | |
tree | 2b0b1eccab4d2bc2296dc446e69f93a494e223bc /epan/dissectors/packet-lbtrm.c | |
parent | c5529dd7f1269e88b4c122fa3c755d5696b58a70 (diff) |
Remove inet_aton() usage everywhere
Including where it says not to in comments. Use IPv4 dotted-decimal
notation.
Change-Id: Iafe1f6fbd2bd5867c41642dc27411f47dff8ce6a
Reviewed-on: https://code.wireshark.org/review/24044
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/dissectors/packet-lbtrm.c')
-rw-r--r-- | epan/dissectors/packet-lbtrm.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c index 2b331e80af..cab81d2c36 100644 --- a/epan/dissectors/packet-lbtrm.c +++ b/epan/dissectors/packet-lbtrm.c @@ -31,7 +31,6 @@ #include <epan/tap.h> #include <epan/conversation.h> #include <epan/to_str.h> -#include <wsutil/inet_aton.h> #include <wsutil/pint.h> #include "packet-lbm.h" #include "packet-lbtrm.h" @@ -1721,7 +1720,7 @@ void proto_register_lbtrm(void) { &ei_lbtrm_analysis_sm_dup, { "lbtrm.analysis.sm.dup", PI_SEQUENCE, PI_NOTE, "Duplicate SM", EXPFILL } }, }; module_t * lbtrm_module; - struct in_addr addr; + guint32 addr; uat_t * tag_uat; expert_module_t * expert_lbtrm; @@ -1734,16 +1733,16 @@ void proto_register_lbtrm(void) expert_register_field_array(expert_lbtrm, ei, array_length(ei)); lbtrm_module = prefs_register_protocol_subtree("29West", proto_lbtrm, proto_reg_handoff_lbtrm); - inet_aton(LBTRM_DEFAULT_MC_ADDRESS_LOW, &addr); - lbtrm_mc_address_low_host = g_ntohl(addr.s_addr); + ws_inet_pton4(LBTRM_DEFAULT_MC_ADDRESS_LOW, &addr); + lbtrm_mc_address_low_host = g_ntohl(addr); prefs_register_string_preference(lbtrm_module, "mc_address_low", "Multicast address range low (default " LBTRM_DEFAULT_MC_ADDRESS_LOW ")", "Set the low end of the LBT-RM multicast address range (context transport_lbtrm_multicast_address_low)", &global_lbtrm_mc_address_low); - inet_aton(LBTRM_DEFAULT_MC_ADDRESS_HIGH, &addr); - lbtrm_mc_address_high_host = g_ntohl(addr.s_addr); + ws_inet_pton4(LBTRM_DEFAULT_MC_ADDRESS_HIGH, &addr); + lbtrm_mc_address_high_host = g_ntohl(addr); prefs_register_string_preference(lbtrm_module, "mc_address_high", "Multicast address range high (default " LBTRM_DEFAULT_MC_ADDRESS_HIGH ")", @@ -1778,16 +1777,16 @@ void proto_register_lbtrm(void) 10, &global_lbtrm_src_port_high); - inet_aton(MIM_DEFAULT_MC_INCOMING_ADDRESS, &addr); - mim_incoming_mc_address_host = g_ntohl(addr.s_addr); + ws_inet_pton4(MIM_DEFAULT_MC_INCOMING_ADDRESS, &addr); + mim_incoming_mc_address_host = g_ntohl(addr); prefs_register_string_preference(lbtrm_module, "mim_incoming_address", "MIM incoming multicast address (default " MIM_DEFAULT_MC_INCOMING_ADDRESS ")", "Set the incoming MIM multicast address (context mim_incoming_address)", &global_mim_incoming_mc_address); - inet_aton(MIM_DEFAULT_MC_OUTGOING_ADDRESS, &addr); - mim_outgoing_mc_address_host = g_ntohl(addr.s_addr); + ws_inet_pton4(MIM_DEFAULT_MC_OUTGOING_ADDRESS, &addr); + mim_outgoing_mc_address_host = g_ntohl(addr); prefs_register_string_preference(lbtrm_module, "mim_outgoing_address", "MIM outgoing multicast address (default " MIM_DEFAULT_MC_OUTGOING_ADDRESS ")", @@ -1860,7 +1859,7 @@ void proto_register_lbtrm(void) void proto_reg_handoff_lbtrm(void) { static gboolean already_registered = FALSE; - struct in_addr addr; + guint32 addr; guint32 dest_addr_h_low; guint32 dest_addr_h_high; @@ -1873,10 +1872,10 @@ void proto_reg_handoff_lbtrm(void) } /* 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); + ws_inet_pton4(global_lbtrm_mc_address_low, &addr); + dest_addr_h_low = g_ntohl(addr); + ws_inet_pton4(global_lbtrm_mc_address_high, &addr); + dest_addr_h_high = g_ntohl(addr); if (dest_addr_h_low <= dest_addr_h_high) { lbtrm_mc_address_low_host = dest_addr_h_low; @@ -1898,10 +1897,10 @@ void proto_reg_handoff_lbtrm(void) } /* 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); + ws_inet_pton4(global_mim_incoming_mc_address, &addr); + mim_incoming_mc_address_host = g_htonl(addr); + ws_inet_pton4(global_mim_outgoing_mc_address, &addr); + mim_outgoing_mc_address_host = g_htonl(addr); /* Add the dissector hooks for the MIM ports. */ mim_incoming_dest_port = global_mim_incoming_dest_port; |