summaryrefslogtreecommitdiff
path: root/ldpd/logmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldpd/logmsg.c')
-rw-r--r--ldpd/logmsg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ldpd/logmsg.c b/ldpd/logmsg.c
index 2c9fbf0dae..6427d0e13b 100644
--- a/ldpd/logmsg.c
+++ b/ldpd/logmsg.c
@@ -485,3 +485,25 @@ pw_type_name(uint16_t pw_type)
return (buf);
}
}
+
+const char *
+pw_error_code(uint8_t status)
+{
+ static char buf[16];
+
+ switch (status) {
+ case F_PW_NO_ERR:
+ return ("No Error");
+ case F_PW_LOCAL_NOT_FWD:
+ return ("local not forwarding");
+ case F_PW_REMOTE_NOT_FWD:
+ return ("remote not forwarding");
+ case F_PW_NO_REMOTE_LABEL:
+ return ("no remote label");
+ case F_PW_MTU_MISMATCH:
+ return ("mtu mismatch between peers");
+ default:
+ snprintf(buf, sizeof(buf), "[%0x]", status);
+ return (buf);
+ }
+}