diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-03-04 02:13:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-04 06:26:06 +0100 |
commit | 966bae3349da22bb6286f6f3874c279177b8633f (patch) | |
tree | 26201a85773baac274b0c05ffa20ded79429ab15 /net/mpls/internal.h | |
parent | mpls: Basic support for adding and removing routes (diff) | |
download | linux-966bae3349da22bb6286f6f3874c279177b8633f.tar.xz linux-966bae3349da22bb6286f6f3874c279177b8633f.zip |
mpls: Functions for reading and wrinting mpls labels over netlink
Reading and writing addresses in network byte order in netlink is
traditional and I see no reason to change that. MPLS is interesting
as effectively it has variabely length addresses (the MPLS label
stack). To represent these variable length addresses in netlink
I use a valid MPLS label stack (complete with stop bit).
This achieves two things: a well defined existing format is used,
and the data can be interpreted without looking at it's length.
Not needed to look at the length to decode the variable length
network representation allows existing userspace functions
such as inet_ntop to be used without needed to change their
prototype.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls/internal.h')
-rw-r--r-- | net/mpls/internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mpls/internal.h b/net/mpls/internal.h index c2944cb84d48..fb6de92052c4 100644 --- a/net/mpls/internal.h +++ b/net/mpls/internal.h @@ -53,4 +53,7 @@ static inline struct mpls_entry_decoded mpls_entry_decode(struct mpls_shim_hdr * return result; } +int nla_put_labels(struct sk_buff *skb, int attrtype, u8 labels, const u32 label[]); +int nla_get_labels(const struct nlattr *nla, u32 max_labels, u32 *labels, u32 label[]); + #endif /* MPLS_INTERNAL_H */ |