4af4471606ccf2b0cb7f5d0711f9be25435d8efc |
|
14-May-2017 |
David Ahern <dsahern@gmail.com> |
ip: add support for more MPLS labels Kernel now supports up to 30 labels but not defined as part of the uapi. iproute2 handles up to 8 labels but in a non-consistent way. Update ip to handle more labels, but in a more programmatic way. For the MPLS address family, the data field in inet_prefix is used for labels. Increase that field to 64 u32's -- 64 as nothing more than a convenient power of 2 number. Update mpls_pton to take the length of the address field, convert that length to number of labels and add better error handling to the parsing of the user supplied string. Signed-off-by: David Ahern <dsahern@gmail.com> Reviewed-by: Simon Horman <simon.horman@netronome.com>
/external/iproute2/lib/mpls_pton.c
|
dacc5d4197c1f8ac12938a594f7e4131cb937cb2 |
|
15-Mar-2015 |
Eric W. Biederman <ebiederm@xmission.com> |
add basic mpls support to iproute - Pull in the uapi mpls.h - Update rtnetlink.h to include the mpls rtnetlink notification multicast group. - Define AF_MPLS in utils.h if it is not defined from elsewhere as is done with AF_DECnet The address syntax for multiple mpls labels is a complete invention. When I looked there seemed to be no wide spread convention for talking about an mpls label stack in text for. Sometimes people did: "{ Label1, Label2, Label3 }", sometimes people would do: "[ label3, label2, label1 ]", and most of the time label stacks were not explicitly shown at all. The syntax I wound up using, so it would not have spaces and so it would visually distinct from other kinds of addresses is. label1/label2/label3 Where label1 is the label at the top of the label stack and label3 is the label at the bottom on the label stack. When there is a single label this matches what seems to be convention with other tools. Just print out the numeric value of the mpls label. The netlink protocol for labels uses the on the wire format for a label stack. The ttl and traffic class are expected to be 0. Using the on the wire format is common and what happens with other address types. BGP when passing label stacks also uses this technique with the exception that the ttl byte is not included making each label in a BGP label stack 3 bytes instead of 4. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
/external/iproute2/lib/mpls_pton.c
|