#ifndef _QUAGGA_MPLS_H
#define _QUAGGA_MPLS_H
+#include <zebra.h>
#include <arpa/inet.h>
#ifdef MPLS_LABEL_MAX
#undef MPLS_LABEL_MAX
#endif
+#define MPLS_LABEL_HELPSTR \
+ "Specify label(s) for this route\nOne or more " \
+ "labels in the range (16-1048575) separated by '/'\n"
+
/* Well-known MPLS label values (RFC 3032 etc). */
#define MPLS_LABEL_IPV4_EXPLICIT_NULL 0 /* [RFC3032] */
#define MPLS_LABEL_ROUTER_ALERT 1 /* [RFC3032] */
strlcpy(buf, "Router Alert", len);
return (buf);
case MPLS_LABEL_IPV6_EXPLICIT_NULL:
- strlcpy(buf, "IPv6 Explict Null", len);
+ strlcpy(buf, "IPv6 Explicit Null", len);
return (buf);
case MPLS_LABEL_IMPLICIT_NULL:
strlcpy(buf, "implicit-null", len);
}
}
+/*
+ * String to label conversion, labels separated by '/'.
+ */
+int mpls_str2label(const char *label_str, uint8_t *num_labels,
+ mpls_label_t *labels);
+
+/*
+ * Label to string conversion, labels in string separated by '/'.
+ */
+char *mpls_label2str(uint8_t num_labels, mpls_label_t *labels, char *buf,
+ int len, int pretty);
#endif