Update to libbgpdump-1.4.99.14.

This commit is contained in:
ajacoutot 2015-07-19 01:46:18 +00:00
parent 14d0a24f2d
commit cedd515c41
5 changed files with 189 additions and 17 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.7 2015/03/16 18:07:52 naddy Exp $
# $OpenBSD: Makefile,v 1.8 2015/07/19 01:46:18 ajacoutot Exp $
COMMENT= library to analyze MRT-format BGP dump files
DISTNAME= libbgpdump-1.4.99.13
DISTNAME= libbgpdump-1.4.99.14
EXTRACT_SUFX= .tgz
REVISION= 0
SHARED_LIBS= bgpdump 0.0
@ -24,8 +23,6 @@ CONFIGURE_ENV= CFLAGS="${CFLAGS}"
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
MAKE_FLAGS+= LIBbgpdump_VERSION=${LIBbgpdump_VERSION}
NO_TEST= Yes
pre-configure:
perl -pi -e s,libbgpdump\.so,libbgpdump.so.${LIBbgpdump_VERSION},g \
${WRKSRC}/Makefile.in

View File

@ -1,2 +1,2 @@
SHA256 (libbgpdump-1.4.99.13.tgz) = dVGihfpcCIWuxykOHzFuWJaLqrcKTzRn+PcIaNM4MR4=
SIZE (libbgpdump-1.4.99.13.tgz) = 84083
SHA256 (libbgpdump-1.4.99.14.tgz) = z6PUwN+FrK+QYSrpN0+4jgGWi6SdP41XoICzkIUAmwg=
SIZE (libbgpdump-1.4.99.14.tgz) = 120580

View File

@ -0,0 +1,171 @@
$OpenBSD: patch-bgpdump_c,v 1.1 2015/07/19 01:46:18 ajacoutot Exp $
warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t'
--- bgpdump.c.orig Tue Mar 24 12:45:07 2015
+++ bgpdump.c Sun Jul 19 03:41:58 2015
@@ -862,7 +862,7 @@ void process(BGPDUMP_ENTRY *entry) {
fmt_ipv6(entry->body.zebra_state_change.source_ip,prefix);
if (mode == 1)
- printf("BGP4MP|%ld|STATE|%s|%u|%d|%d\n",
+ printf("BGP4MP|%lld|STATE|%s|%u|%d|%d\n",
entry->time,
prefix,
entry->body.zebra_state_change.source_as,
@@ -880,7 +880,7 @@ void process(BGPDUMP_ENTRY *entry) {
case AFI_IP:
default:
if (mode == 1)
- printf("BGP4MP|%ld|STATE|%s|%u|%d|%d\n",
+ printf("BGP4MP|%lld|STATE|%s|%u|%d|%d\n",
entry->time,
inet_ntoa(entry->body.zebra_state_change.source_ip.v4_addr),
entry->body.zebra_state_change.source_as,
@@ -962,7 +962,7 @@ void process_bgpdump_mrtd_bgp(BGPDUMP_ENTRY *entry) {
bgp_state_name[entry->body.mrtd_state_change.new_state]);
}
else if (mode == 1) {
- printf("BGP|%ld|STATE|%s|%u|%d|%d\n",
+ printf("BGP|%lld|STATE|%s|%u|%d|%d\n",
entry->time,
inet_ntoa(entry->body.mrtd_state_change.destination_ip),
entry->body.mrtd_state_change.destination_as,
@@ -991,7 +991,7 @@ void mrtd_table_line_withdraw(struct prefix *prefix, i
for (i = 0; i < count; i++) {
if (mode == 1)
- printf("BGP|%ld", entry->time);
+ printf("BGP|%lld", entry->time);
else
printf("BGP|%s", time_str);
@@ -1008,7 +1008,7 @@ void mrtd_table_line_announce(struct prefix *prefix, i
for (i = 0; i < count; i++) {
if (mode == 1)
- printf("BGP|%ld", entry->time);
+ printf("BGP|%lld", entry->time);
else
printf("BGP|%s", time_str);
@@ -1262,7 +1262,7 @@ static void table_line_withdraw(struct prefix *prefix,
{
#ifdef BGPDUMP_HAVE_IPV6
case AFI_IP6:
- printf("BGP4MP|%ld|W|%s|%u|",
+ printf("BGP4MP|%lld|W|%s|%u|",
entry->time,
fmt_ipv6(entry->body.zebra_message.source_ip,buf),
entry->body.zebra_message.source_as);
@@ -1270,7 +1270,7 @@ static void table_line_withdraw(struct prefix *prefix,
#endif
case AFI_IP:
default:
- printf("BGP4MP|%ld|W|%s|%u|",
+ printf("BGP4MP|%lld|W|%s|%u|",
entry->time,
inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),
entry->body.zebra_message.source_as);
@@ -1319,7 +1319,7 @@ static void table_line_withdraw6(struct prefix *prefix
switch(entry->body.zebra_message.address_family)
{
case AFI_IP6:
- printf("BGP4MP|%ld|W|%s|%u|%s/%d\n",
+ printf("BGP4MP|%lld|W|%s|%u|%s/%d\n",
entry->time,
fmt_ipv6(entry->body.zebra_message.source_ip,buf1),
entry->body.zebra_message.source_as,
@@ -1327,7 +1327,7 @@ static void table_line_withdraw6(struct prefix *prefix
break;
case AFI_IP:
default:
- printf("BGP4MP|%ld|W|%s|%u|%s/%d\n",
+ printf("BGP4MP|%lld|W|%s|%u|%s/%d\n",
entry->time,
fmt_ipv4(entry->body.zebra_message.source_ip,buf1),
entry->body.zebra_message.source_as,
@@ -1383,12 +1383,12 @@ static void table_line_announce(struct prefix *prefix,
{
#ifdef BGPDUMP_HAVE_IPV6
case AFI_IP6:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
break;
#endif
case AFI_IP:
default:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
break;
}
printf("%s/%d|%s|%s|",inet_ntoa(prefix[idx].address.v4_addr),prefix[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
@@ -1453,12 +1453,12 @@ static void table_line_announce_1(struct mp_nlri *pref
{
#ifdef BGPDUMP_HAVE_IPV6
case AFI_IP6:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
break;
#endif
case AFI_IP:
default:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
break;
}
printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
@@ -1484,12 +1484,12 @@ static void table_line_announce_1(struct mp_nlri *pref
{
#ifdef BGPDUMP_HAVE_IPV6
case AFI_IP6:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf),entry->body.zebra_message.source_as);
break;
#endif
case AFI_IP:
default:
- printf("BGP4MP|%ld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
+ printf("BGP4MP|%lld|A|%s|%u|",entry->time,inet_ntoa(entry->body.zebra_message.source_ip.v4_addr),entry->body.zebra_message.source_as);
break;
}
printf("%s/%d|%s|%s|",inet_ntoa(prefix->nlri[idx].address.v4_addr),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
@@ -1567,7 +1567,7 @@ static void table_line_announce6(struct mp_nlri *prefi
if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC) ) ==0)
nmed=0;
- printf("BGP4MP|%ld|A|%s|%u|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
+ printf("BGP4MP|%lld|A|%s|%u|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv6(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
break;
case AFI_IP:
default:
@@ -1580,7 +1580,7 @@ static void table_line_announce6(struct mp_nlri *prefi
nmed=0;
//printf("%s|%d|%d|",inet_ntoa(entry->attr->nexthop),nprof,nmed);
- printf("BGP4MP|%ld|A|%s|%u|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
+ printf("BGP4MP|%lld|A|%s|%u|%s/%d|%s|%s|%s|%u|%u|",entry->time,fmt_ipv4(entry->body.zebra_message.source_ip,buf1),entry->body.zebra_message.source_as,fmt_ipv6(prefix->nlri[idx].address,buf2),prefix->nlri[idx].len,attr_aspath(entry->attr),describe_origin(entry->attr->origin),fmt_ipv6(prefix->nexthop,buf),npref,nmed);
break;
}
if( (entry->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES) ) !=0)
@@ -1646,9 +1646,9 @@ static void table_line_mrtd_route(BGPDUMP_MRTD_TABLE_D
if (mode == 1)
{
if(timetype==0){
- printf("TABLE_DUMP|%ld|B|%s|%u|",entry->time,peer,route->peer_as);
+ printf("TABLE_DUMP|%lld|B|%s|%u|",entry->time,peer,route->peer_as);
}else if(timetype==1){
- printf("TABLE_DUMP|%ld|B|%s|%u|",route->uptime,peer,route->peer_as);
+ printf("TABLE_DUMP|%lld|B|%s|%u|",route->uptime,peer,route->peer_as);
}
printf("%s/%d|%s|%s|",prefix,route->mask,attr_aspath(entry->attr),describe_origin(entry->attr->origin));
@@ -1740,7 +1740,7 @@ static void table_line_dump_v2_prefix(BGPDUMP_TABLE_DU
if (mode == 1)
{
if(timetype==0){
- printf("TABLE_DUMP2|%ld|B|%s|%u|",entry->time,peer,e->entries[i].peer->peer_as);
+ printf("TABLE_DUMP2|%lld|B|%s|%u|",entry->time,peer,e->entries[i].peer->peer_as);
}else if(timetype==1){
printf("TABLE_DUMP2|%u|B|%s|%u|",e->entries[i].originated_time,peer,e->entries[i].peer->peer_as);
}

View File

@ -1,11 +1,15 @@
$OpenBSD: patch-bgpdump_lib_c,v 1.2 2010/10/29 13:53:35 sthen Exp $
--- bgpdump_lib.c.orig Thu Sep 23 13:06:19 2010
+++ bgpdump_lib.c Fri Oct 29 14:35:34 2010
@@ -42,6 +42,7 @@ this license is included with libbgpdump.
$OpenBSD: patch-bgpdump_lib_c,v 1.3 2015/07/19 01:46:18 ajacoutot Exp $
warning: implicit declaration of function ...
--- bgpdump_lib.c.orig Tue Mar 24 12:45:07 2015
+++ bgpdump_lib.c Sun Jul 19 03:43:57 2015
@@ -42,6 +42,8 @@ this license is included with libbgpdump.
#include <assert.h>
void bgpdump_free_attr(attributes_t *attr);
+static void bgpdump_free_mp_info(struct mp_info *info);
+static int process_mrtd_bgp(struct mstream *s, BGPDUMP_ENTRY *entry);
static int process_mrtd_table_dump(struct mstream *s,BGPDUMP_ENTRY *entry);
static int process_mrtd_table_dump_v2(struct mstream *s,BGPDUMP_ENTRY *entry);
static int process_mrtd_table_dump_v2_peer_index_table(struct mstream *s,BGPDUMP_ENTRY *entry);

View File

@ -1,15 +1,15 @@
$OpenBSD: patch-configure,v 1.2 2010/10/29 13:53:35 sthen Exp $
$OpenBSD: patch-configure,v 1.3 2015/07/19 01:46:18 ajacoutot Exp $
Don't hardcode -O3
--- configure.orig Thu Oct 21 10:51:02 2010
+++ configure Fri Oct 29 14:30:05 2010
@@ -1688,7 +1688,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
--- configure.orig Thu Apr 2 10:13:57 2015
+++ configure Sun Jul 19 03:37:43 2015
@@ -1780,7 +1780,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers bgpdump-config.h"
-CFLAGS="$CFLAGS -g -O3 -Wall"
+CFLAGS="$CFLAGS -Wall"
-CFLAGS="-g -O3 $CFLAGS -Wall"
+CFLAGS="-g $CFLAGS -Wall"
CFLAGS="$CFLAGS -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align"
CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"