summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd/log.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-05-23 15:47:25 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-05-23 15:47:25 +0000
commita8a96cd447891d5735f0abe394ea42248990a978 (patch)
tree39748540aa9735fa8c290940ed267522b3500e74 /usr.sbin/ldpd/log.c
parent1925d6cae40f02e2372badc8099240102bbbdd35 (diff)
Move some code around.
This patch doesn't introduce any logical change.
Diffstat (limited to 'usr.sbin/ldpd/log.c')
-rw-r--r--usr.sbin/ldpd/log.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/ldpd/log.c b/usr.sbin/ldpd/log.c
index bca642bd070..7a6d096f87d 100644
--- a/usr.sbin/ldpd/log.c
+++ b/usr.sbin/ldpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.17 2016/05/23 15:26:35 renato Exp $ */
+/* $OpenBSD: log.c,v 1.18 2016/05/23 15:47:24 renato Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -30,6 +30,7 @@
#include <unistd.h>
#include "ldpd.h"
+#include "ldpe.h"
#include "lde.h"
#include "log.h"
@@ -315,6 +316,25 @@ pw_type_name(u_int16_t pw_type)
}
}
+char *
+log_hello_src(const struct hello_source *src)
+{
+ static char buffer[64];
+
+ switch (src->type) {
+ case HELLO_LINK:
+ snprintf(buffer, sizeof(buffer), "iface %s",
+ src->link.iface->name);
+ break;
+ case HELLO_TARGETED:
+ snprintf(buffer, sizeof(buffer), "source %s",
+ inet_ntoa(src->target->addr));
+ break;
+ }
+
+ return (buffer);
+}
+
const char *
log_map(struct map *map)
{