+// SPDX-License-Identifier: GPL-2.0-or-later
/* BGP dump to ascii converter
* Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
lim = s->getp + len;
- printf("attr_parse s->getp %zd, len %d, lim %d\n", s->getp, len, lim);
+ printf("%s s->getp %zd, len %d, lim %d\n", __func__, s->getp, len, lim);
while (s->getp < lim) {
flag = stream_getc(s);
case BGP_ATTR_AS_PATH: {
struct aspath *aspath;
- aspath = aspath_parse(s, length, 1);
+ aspath = aspath_parse(s, length, 1,
+ bgp_get_asnotation(NULL));
printf("ASPATH: %s\n", aspath->str);
aspath_free(aspath);
} break;
case BGP_ATTR_NEXT_HOP: {
struct in_addr nexthop;
nexthop.s_addr = stream_get_ipv4(s);
- printf("NEXTHOP: %s\n", inet_ntoa(nexthop));
+ printf("NEXTHOP: %pI4\n", &nexthop);
} break;
default:
stream_getw_from(s, length);
while (s->getp < len - 16) {
p.prefix.s_addr = stream_get_ipv4(s);
p.prefixlen = stream_getc(s);
- printf("PREFIX: %s/%d\n", inet_ntoa(p.prefix),
+ printf("PREFIX: %pI4/%d\n", &p.prefix,
p.prefixlen);
status = stream_getc(s);
peer.s_addr = stream_get_ipv4(s);
source_as = stream_getw(s);
- printf("FROM: %s AS%d\n", inet_ntoa(peer),
- source_as);
+ printf("FROM: %pI4 AS%d\n", &peer, source_as);
printf("ORIGINATED: %s", ctime(&originated));
attrlen = stream_getw(s);
sip.s_addr = stream_get_ipv4(s);
dip.s_addr = stream_get_ipv4(s);
- printf("saddr: %s\n", inet_ntoa(sip));
- printf("daddr: %s\n", inet_ntoa(dip));
+ printf("saddr: %pI4\n", &sip);
+ printf("daddr: %pI4\n", &dip);
printf("\n");
}