diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-26 14:27:59 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-26 14:27:59 +0000 |
commit | d4a36771ff62c1fc846cdb4a763b27f466182177 (patch) | |
tree | 3689acfd7b2bd2412ddd330bc0cae8c05f3de393 | |
parent | 009bf3e7fd7d1e17d765aa17f31979538e741441 (diff) |
+ log_ntoa, a simple helper funtion that doesn't require a struct in_addr...
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/bgpd/log.c | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 714081da817..4a9801af9fc 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.32 2003/12/26 14:26:02 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.33 2003/12/26 14:27:58 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -288,6 +288,7 @@ void log_statechange(struct peer *, enum session_state, void log_notification(struct peer *, u_int8_t, u_int8_t, u_char *, u_int16_t); void log_conn_attempt(struct peer *, struct in_addr); +char *log_ntoa(in_addr_t); /* parse.y */ int cmdline_symset(char *); diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index 43230c1d976..257e24224e5 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.6 2003/12/26 14:26:02 henning Exp $ */ +/* $OpenBSD: log.c,v 1.7 2003/12/26 14:27:58 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -308,3 +308,12 @@ log_conn_attempt(struct peer *peer, struct in_addr remote) free(p); } } + +char * +log_ntoa(in_addr_t ip) +{ + struct in_addr ina; + + ina.s_addr = ip; + return (inet_ntoa(ina)); +} |