diff options
-rw-r--r-- | gg_map/gg_map.c | 18 |
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; } |