aboutsummaryrefslogtreecommitdiffstats
path: root/gg_map/gg_map.c
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-15 07:31:51 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-15 07:31:51 +0100
commita5c578e38ff000738770a25a2e7c1e9b858d76e8 (patch)
treecc8b2d7550d0027ce5a413fca2eab6a067197a7d /gg_map/gg_map.c
parentadd -a option to gg_sniff (Active), where gg_sniff uses dns functionnality of (diff)
downloadglouglou-a5c578e38ff000738770a25a2e7c1e9b858d76e8.tar.xz
glouglou-a5c578e38ff000738770a25a2e7c1e9b858d76e8.zip
rename vertice if we receive a glouglou packet PACKET_NAME for it
Diffstat (limited to '')
-rw-r--r--gg_map/gg_map.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gg_map/gg_map.c b/gg_map/gg_map.c
index 13c68c0..261bf16 100644
--- a/gg_map/gg_map.c
+++ b/gg_map/gg_map.c
@@ -204,6 +204,19 @@ _conn_data(int id, u_int8_t pktsize) {
egraph_vertice_send_blob(_egraph, a, b, size, color);
}
+static void
+_conn_name(u_int32_t addr, u_int8_t pktsize, u_char *fqdn) {
+ struct ggnet_node *n;
+ struct in_addr ip;
+
+ ip.s_addr = addr;
+ n = ggnet_node_find(_ggnet, &ip);
+ if (!n)
+ return;
+
+ egraph_vertice_rename(_egraph, ggnet_node_usrdata_get(n), (char *)fqdn);
+}
+
int
_cb_packet(struct gg_client *cli, struct gg_packet *pkt)
{
@@ -242,10 +255,7 @@ _cb_packet(struct gg_client *cli, struct gg_packet *pkt)
printf(" name_len %d\n", pkt->name_len);
printf(" name_name_fqdn %s\n", pkt->name_fqdn);
- //n = node_find(ip);
- //if (n)
- // node_update_name(n, fqdn, len);
- //
+ _conn_name(pkt->name_addr, pkt->name_len, pkt->name_fqdn);
break;
}