diff options
Diffstat (limited to 'libglouglou/libggnet.c')
-rw-r--r-- | libglouglou/libggnet.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libglouglou/libggnet.c b/libglouglou/libggnet.c index 5f9810b..160ac8b 100644 --- a/libglouglou/libggnet.c +++ b/libglouglou/libggnet.c @@ -118,7 +118,7 @@ ggnet_free(struct ggnet *net) } struct ggnet_node * -ggnet_node_add(struct ggnet *net, struct in_addr *addr) +ggnet_node_add(struct ggnet *net, struct in_addr *addr, int allow_grouping) { struct ggnet_node *n; @@ -133,16 +133,17 @@ ggnet_node_add(struct ggnet *net, struct in_addr *addr) n->net = net; n->addr.s_addr = addr->s_addr; n->lastseen = net->time; + //n->allow_grouping = allow_grouping; XXX IN PROGRESS why segfault ?? LIST_INSERT_HEAD(&net->node_list, n, entry); net->node_count++; - if (net->use_grouping) + if (net->use_grouping && allow_grouping) nodegroup_set(net, n); if (net->use_dns) n->dns_req = ggnet_dns_reverse(net->ggdns, &n->addr, _cb_dns_reverse, n); if (net->use_traceroute) { struct addr ip; addr_aton(inet_ntoa(*addr), &ip); - printf("XXX calling trace on %s\n", inet_ntoa(*addr)); + printf("XXX calling trace on %x\n", ip.addr_ip); n->traceroute_req = ggnet_traceroute_trace_tcp(net->ggtraceroute, &ip, 80, _cb_traceroute_trace, NULL, n); } @@ -228,7 +229,7 @@ ggnet_conn_add(struct ggnet *net, struct in_addr *src, int src_port, struct ggnet_node *dstnode; int id; - if (net->debug) + // XXX if (net->debug) printf("ggnet_conn_add, %x:%d->%x:%d %d [%d]\n", src->s_addr, src_port, dst->s_addr, dst_port, proto, size); @@ -245,13 +246,13 @@ ggnet_conn_add(struct ggnet *net, struct in_addr *src, int src_port, srcnode = ggnet_node_find(net, src); if (!srcnode) - srcnode = ggnet_node_add(net, src); + srcnode = ggnet_node_add(net, src, 1); srcnode->used++; if (srcnode->group) srcnode->group->conn_count++; dstnode = ggnet_node_find(net, dst); if (!dstnode) - dstnode = ggnet_node_add(net, dst); + dstnode = ggnet_node_add(net, dst, 1); dstnode->used++; if (dstnode->group) dstnode->group->conn_count++; |