summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-24 19:21:21 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-24 19:21:21 +0000
commita95e87402a8612e43a4cc1cfe6c200a20a620e64 (patch)
treecbba80a4a552f07dcf193663af04f5a6cc8957fc
parentcb2d1c8b665acdf6d0b00a50f47ceda75653023a (diff)
add log_kroute()
-rw-r--r--usr.sbin/bgpd/bgpd.h3
-rw-r--r--usr.sbin/bgpd/log.c14
2 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 16a4c307887..890cba6752d 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.16 2003/12/24 13:49:21 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.17 2003/12/24 19:21:20 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -279,6 +279,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);
+void log_kroute(int, const char *, struct kroute *);
/* parse.y */
int cmdline_symset(char *);
diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c
index 80ab0d4cecf..7957c87af21 100644
--- a/usr.sbin/bgpd/log.c
+++ b/usr.sbin/bgpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.4 2003/12/21 23:17:53 henning Exp $ */
+/* $OpenBSD: log.c,v 1.5 2003/12/24 19:21:20 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -308,3 +308,15 @@ log_conn_attempt(struct peer *peer, struct in_addr remote)
free(p);
}
}
+
+void
+log_kroute(int pri, const char *lmsg, struct kroute *kr)
+{
+ char *ip;
+ struct in_addr ina;
+
+ ina.s_addr = kr->prefix;
+
+ ip = inet_ntoa(ina);
+ logit(pri, "%s %s/%u", lmsg, ip, kr->prefixlen);
+}