{
proto_tree *ip_tree = NULL, *field_tree;
proto_item *ti = NULL, *tf;
- guint32 src_naddr, dst_naddr;
+ guint32 addr;
int offset = 0;
guint hlen, optlen;
guint16 flags;
if (tree) {
const char *src_host;
- memcpy(&src_naddr, iph->ip_src.data, 4);
- src_host = get_hostname(src_naddr);
+ memcpy(&addr, iph->ip_src.data, 4);
+ src_host = get_hostname(addr);
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Src: %s (%s)", src_host, ip_to_str(iph->ip_src.data));
}
- proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, src_naddr);
- item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, src_naddr);
+ proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, addr);
+ item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 12, 4, addr);
PROTO_ITEM_SET_HIDDEN(item);
item = proto_tree_add_string(ip_tree, hf_ip_src_host, tvb, offset + 12, 4, src_host);
PROTO_ITEM_SET_GENERATED(item);
if (tree) {
const char *dst_host;
- memcpy(&dst_naddr, iph->ip_dst.data, 4);
- dst_host = get_hostname(dst_naddr);
+ memcpy(&addr, iph->ip_dst.data, 4);
+ dst_host = get_hostname(addr);
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Dst: %s (%s)", dst_host, ip_to_str(iph->ip_dst.data));
}
- proto_tree_add_ipv4(ip_tree, hf_ip_dst, tvb, offset + 16, 4, dst_naddr);
- item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 16, 4, dst_naddr);
+ proto_tree_add_ipv4(ip_tree, hf_ip_dst, tvb, offset + 16, 4, addr);
+ item = proto_tree_add_ipv4(ip_tree, hf_ip_addr, tvb, offset + 16, 4, addr);
PROTO_ITEM_SET_HIDDEN(item);
item = proto_tree_add_string(ip_tree, hf_ip_dst_host, tvb, offset + 16, 4, dst_host);
PROTO_ITEM_SET_GENERATED(item);
#ifdef HAVE_GEOIP
if (tree && ip_use_geoip) {
for (dbnum = 0; dbnum < geoip_num_dbs(); dbnum++) {
- geoip_src_str = geoip_db_lookup_ipv4(dbnum, src_naddr, NULL);
- geoip_dst_str = geoip_db_lookup_ipv4(dbnum, dst_naddr, NULL);
+ geoip_src_str = geoip_db_lookup_ipv4(dbnum, src32, NULL);
+ geoip_dst_str = geoip_db_lookup_ipv4(dbnum, dst32, NULL);
switch (geoip_db_type(dbnum)) {
case GEOIP_COUNTRY_EDITION:
#include <epan/strutil.h>
#ifdef HAVE_GEOIP
#include <epan/geoip_db.h>
+#include <epan/pint.h>
#endif
#include "../simple_dialog.h"
/* Filled in from the GeoIP config, if any */
for (i = 0; i < NUM_GEOIP_COLS; i++) {
if (i < geoip_num_dbs() && talker->address.type == AT_IPv4) {
- const guchar *name = geoip_db_lookup_ipv4(i, *(guint32*)talker->address.data, "-");
+ const guchar *name = geoip_db_lookup_ipv4(i, pntohl(talker->address.data), "-");
g_snprintf(geoip[i], COL_STR_LEN, "%s", format_text (name, strlen(name)));
entries[NUM_BUILTIN_COLS + i] = geoip[i];
gtk_clist_set_column_visibility(hl->table, NUM_BUILTIN_COLS + i, TRUE);