diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-18 07:06:11 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-18 07:06:11 -0400 |
| commit | 036fdaad9f341e1bd380d2eb6de048b49486f912 (patch) | |
| tree | 639835e0fcd1e4df567feb83c31243dc68e7e46a /lib/mpls.h | |
| parent | f890b1461dc1e342fe5fbeeacbe94a219405f815 (diff) | |
lib, zebra: Move label conversion strings to lib
The mpls_label2str and mpls_str2label functions should not
be zebra exclusive functions. Move them to lib/mpls.c
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/mpls.h')
| -rw-r--r-- | lib/mpls.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/mpls.h b/lib/mpls.h index 9e5d7e508d..ff6f1d6c98 100644 --- a/lib/mpls.h +++ b/lib/mpls.h @@ -196,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 |
