]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/mpls.h
isisd: implemented the 'sequence-number-skipped' notification
[mirror_frr.git] / lib / mpls.h
index 4e5c70cf8cf73be7c44007a5c5d078333bfab2dc..61469856105fb0b35a2108172ca41672bde19412 100644 (file)
 #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] */
@@ -166,7 +171,7 @@ static inline char *label2str(mpls_label_t label, char *buf, size_t len)
                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);
@@ -192,5 +197,16 @@ static inline char *label2str(mpls_label_t label, char *buf, size_t 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