diff options
Diffstat (limited to 'lib/mpls.h')
| -rw-r--r-- | lib/mpls.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/mpls.h b/lib/mpls.h index 4e5c70cf8c..ff6f1d6c98 100644 --- a/lib/mpls.h +++ b/lib/mpls.h @@ -28,6 +28,10 @@ #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] */ @@ -192,5 +196,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 |
