Skip to content

Commit face018

Browse files
roopa-prabhudavem330
authored andcommitted
mpls: export mpls functions for use by mpls iptunnels
Signed-off-by: Roopa Prabhu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 74a0f2f commit face018

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

net/mpls/af_mpls.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,26 @@ static inline struct mpls_dev *mpls_dev_get(const struct net_device *dev)
5858
return rcu_dereference_rtnl(dev->mpls_ptr);
5959
}
6060

61-
static bool mpls_output_possible(const struct net_device *dev)
61+
bool mpls_output_possible(const struct net_device *dev)
6262
{
6363
return dev && (dev->flags & IFF_UP) && netif_carrier_ok(dev);
6464
}
65+
EXPORT_SYMBOL_GPL(mpls_output_possible);
6566

6667
static unsigned int mpls_rt_header_size(const struct mpls_route *rt)
6768
{
6869
/* The size of the layer 2.5 labels to be added for this route */
6970
return rt->rt_labels * sizeof(struct mpls_shim_hdr);
7071
}
7172

72-
static unsigned int mpls_dev_mtu(const struct net_device *dev)
73+
unsigned int mpls_dev_mtu(const struct net_device *dev)
7374
{
7475
/* The amount of data the layer 2 frame can hold */
7576
return dev->mtu;
7677
}
78+
EXPORT_SYMBOL_GPL(mpls_dev_mtu);
7779

78-
static bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
80+
bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
7981
{
8082
if (skb->len <= mtu)
8183
return false;
@@ -85,6 +87,7 @@ static bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu)
8587

8688
return true;
8789
}
90+
EXPORT_SYMBOL_GPL(mpls_pkt_too_big);
8891

8992
static bool mpls_egress(struct mpls_route *rt, struct sk_buff *skb,
9093
struct mpls_entry_decoded dec)
@@ -626,6 +629,7 @@ int nla_put_labels(struct sk_buff *skb, int attrtype,
626629

627630
return 0;
628631
}
632+
EXPORT_SYMBOL_GPL(nla_put_labels);
629633

630634
int nla_get_labels(const struct nlattr *nla,
631635
u32 max_labels, u32 *labels, u32 label[])
@@ -671,6 +675,7 @@ int nla_get_labels(const struct nlattr *nla,
671675
*labels = nla_labels;
672676
return 0;
673677
}
678+
EXPORT_SYMBOL_GPL(nla_get_labels);
674679

675680
static int rtm_to_route_config(struct sk_buff *skb, struct nlmsghdr *nlh,
676681
struct mpls_route_config *cfg)

net/mpls/internal.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ static inline struct mpls_entry_decoded mpls_entry_decode(struct mpls_shim_hdr *
5050
return result;
5151
}
5252

53-
int nla_put_labels(struct sk_buff *skb, int attrtype, u8 labels, const u32 label[]);
54-
int nla_get_labels(const struct nlattr *nla, u32 max_labels, u32 *labels, u32 label[]);
53+
int nla_put_labels(struct sk_buff *skb, int attrtype, u8 labels,
54+
const u32 label[]);
55+
int nla_get_labels(const struct nlattr *nla, u32 max_labels, u32 *labels,
56+
u32 label[]);
57+
bool mpls_output_possible(const struct net_device *dev);
58+
unsigned int mpls_dev_mtu(const struct net_device *dev);
59+
bool mpls_pkt_too_big(const struct sk_buff *skb, unsigned int mtu);
5560

5661
#endif /* MPLS_INTERNAL_H */

0 commit comments

Comments
 (0)