diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-01-05 11:30:16 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-01-07 01:09:35 +0000 |
commit | f410121cf2a94ef06fa42863352a77ba42a5fdf7 (patch) | |
tree | d0c6acefca85ec9dbb758950cc6d48c79252970c /ui/qt/follow_stream_dialog.cpp | |
parent | 7888c43a5711710222343ee8fca8c5e500b5ed3a (diff) | |
download | wireshark-f410121cf2a94ef06fa42863352a77ba42a5fdf7.tar.gz |
Remove some unnecessary dependencies and cleanup some code
No need for the GTK dependency on dissectors/packet-ipv6.h.
Add the stream_addr typedef in follow.h to make some code simpler.
Change-Id: I1cf906f58734a90263141362f2da33a140f93533
Reviewed-on: https://code.wireshark.org/review/13063
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/follow_stream_dialog.cpp')
-rw-r--r-- | ui/qt/follow_stream_dialog.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 058e70ab30..1e74d92eef 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -1145,17 +1145,11 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) follow_stats(&stats); if (stats.is_ipv6) { - struct e_in6_addr ipaddr; - memcpy(&ipaddr, stats.ip_address[0], 16); - hostname0 = get_hostname6(&ipaddr); - memcpy(&ipaddr, stats.ip_address[1], 16); - hostname1 = get_hostname6(&ipaddr); + hostname0 = get_hostname6(&stats.ip_address[0].ipv6); + hostname1 = get_hostname6(&stats.ip_address[1].ipv6); } else { - guint32 ipaddr; - memcpy(&ipaddr, stats.ip_address[0], 4); - hostname0 = get_hostname(ipaddr); - memcpy(&ipaddr, stats.ip_address[1], 4); - hostname1 = get_hostname(ipaddr); + hostname0 = get_hostname(stats.ip_address[0].ipv4); + hostname1 = get_hostname(stats.ip_address[1].ipv4); } switch (follow_type_) @@ -1175,8 +1169,8 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) follow_info_.is_ipv6 = stats.is_ipv6; if ((follow_info_.client_port == stats.port[0]) && - ((stats.is_ipv6 && (memcmp(follow_info_.client_ip.data, stats.ip_address[0], 16) == 0)) || - (!stats.is_ipv6 && (memcmp(follow_info_.client_ip.data, stats.ip_address[0], 4) == 0)))) { + ((stats.is_ipv6 && (memcmp(follow_info_.client_ip.data, &stats.ip_address[0], 16) == 0)) || + (!stats.is_ipv6 && (memcmp(follow_info_.client_ip.data, &stats.ip_address[0], 4) == 0)))) { server_to_client_string = QString("%1:%2 %3 %4:%5 (%6)") .arg(hostname0).arg(port0) |