]>
Commit | Line | Data |
---|---|---|
5b497af4 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
25cd9ba0 SH |
2 | /* |
3 | * Copyright (c) 2014 Nicira, Inc. | |
25cd9ba0 SH |
4 | */ |
5 | ||
6 | #ifndef _NET_MPLS_H | |
7 | #define _NET_MPLS_H 1 | |
8 | ||
9 | #include <linux/if_ether.h> | |
10 | #include <linux/netdevice.h> | |
11 | ||
12 | #define MPLS_HLEN 4 | |
13 | ||
9095e10e JB |
14 | struct mpls_shim_hdr { |
15 | __be32 label_stack_entry; | |
16 | }; | |
17 | ||
25cd9ba0 SH |
18 | static inline bool eth_p_mpls(__be16 eth_type) |
19 | { | |
20 | return eth_type == htons(ETH_P_MPLS_UC) || | |
21 | eth_type == htons(ETH_P_MPLS_MC); | |
22 | } | |
23 | ||
9095e10e JB |
24 | static inline struct mpls_shim_hdr *mpls_hdr(const struct sk_buff *skb) |
25 | { | |
26 | return (struct mpls_shim_hdr *)skb_network_header(skb); | |
27 | } | |
25cd9ba0 | 28 | #endif |