diff options
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/log.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 9cf7b38fa94..6d84eb1cf4d 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.78 2004/01/22 21:08:59 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.79 2004/01/23 21:17:51 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -292,6 +292,7 @@ void fatal(const char *); void fatalx(const char *); void fatal_ensure(const char *, int, const char *); char *log_ntoa(in_addr_t); +char *log_addr(struct bgpd_addr *); /* parse.y */ int cmdline_symset(char *); diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index 40669a22521..da69ff0ce33 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.21 2004/01/22 21:09:00 henning Exp $ */ +/* $OpenBSD: log.c,v 1.22 2004/01/23 21:17:51 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -381,3 +381,13 @@ log_ntoa(in_addr_t ip) ina.s_addr = ip; return (inet_ntoa(ina)); } + +char * +log_addr(struct bgpd_addr *addr) { + switch (addr->af) { + case AF_INET: + return (inet_ntoa(addr->v4)); + default: + return ("(unknown address family)"); + } +} |