Only in libbgpdump-1.4-patched: bgpdump diff -u libbgpdump-1.4/bgpdump.c libbgpdump-1.4-patched/bgpdump.c --- libbgpdump-1.4/bgpdump.c 2004-02-09 12:12:57.000000000 +0100 +++ libbgpdump-1.4-patched/bgpdump.c 2004-07-02 17:54:43.000000000 +0200 @@ -1382,6 +1382,9 @@ int npref; int nmed; char time_str[10]; + char peer[BGPDUMP_ADDRSTRLEN]; + char prefix[BGPDUMP_ADDRSTRLEN + 4]; + char nexthop[BGPDUMP_ADDRSTRLEN]; switch (entry->attr->origin) { @@ -1401,14 +1404,29 @@ else sprintf(tmp2,"NAG"); +#ifdef BGPDUMP_HAVE_IPV6 + if (entry->subtype == AFI_IP6) { + inet_ntop(AF_INET6, &route->peer_ip.v6_addr, peer, sizeof(peer)); + inet_ntop(AF_INET6, &route->prefix.v6_addr, prefix, sizeof(prefix)); + inet_ntop(AF_INET6, &entry->attr->mp_info->announce[AFI_IP6][SAFI_UNICAST]->nexthop.v6_addr, + nexthop, sizeof(nexthop)); + } else { +#else + sprintf(peer, "%s", inet_ntoa(route->peer_ip.v4_addr)); + sprintf(prefix, "%s", inet_ntoa(route->prefix.v4_addr)); + sprintf(nexthop, "%s", inet_ntoa(entry->attr->nexthop)); +#endif +#ifdef BGPDUMP_HAVE_IPV6 + } +#endif if (mode == 1) { if(timetype==0){ - printf("TABLE_DUMP|%ld|B|%s|%d|",entry->time,inet_ntoa(route->peer_ip.v4_addr),route->peer_as); + printf("TABLE_DUMP|%ld|B|%s|%d|",entry->time,peer,route->peer_as); }else if(timetype==1){ - printf("TABLE_DUMP|%ld|B|%s|%d|",route->uptime,inet_ntoa(route->peer_ip.v4_addr),route->peer_as); + printf("TABLE_DUMP|%ld|B|%s|%d|",route->uptime,peer,route->peer_as); } - printf("%s/%d|%s|%s|",inet_ntoa(route->prefix.v4_addr),route->mask,entry->attr->aspath->str,tmp1); + printf("%s/%d|%s|%s|",prefix,route->mask,entry->attr->aspath->str,tmp1); npref=entry->attr->local_pref; if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF) ) ==0) @@ -1417,7 +1435,7 @@ if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0) nmed=0; - printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),npref,nmed); + printf("%s|%d|%d|",nexthop,npref,nmed); if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0) printf("%s|%s|",entry->attr->community->str+1,tmp2); else @@ -1436,8 +1454,8 @@ time=gmtime(&route->uptime); } time2str(time,time_str); - printf("TABLE_DUMP|%s|A|%s|%d|",time_str,inet_ntoa(route->peer_ip.v4_addr),route->peer_as); - printf("%s/%d|%s|%s\n",inet_ntoa(route->prefix.v4_addr),route->mask,entry->attr->aspath->str,tmp1); + printf("TABLE_DUMP|%s|A|%s|%d|",time_str,peer,route->peer_as); + printf("%s/%d|%s|%s\n",prefix,route->mask,entry->attr->aspath->str,tmp1); }