]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/net/dst_metadata.h
1 #ifndef __NET_DST_METADATA_H
2 #define __NET_DST_METADATA_H 1
4 #include <linux/skbuff.h>
5 #include <net/ip_tunnels.h>
12 struct ip_tunnel_info tun_info
;
16 static inline struct metadata_dst
*skb_metadata_dst(struct sk_buff
*skb
)
18 struct metadata_dst
*md_dst
= (struct metadata_dst
*) skb_dst(skb
);
20 if (md_dst
&& md_dst
->dst
.flags
& DST_METADATA
)
26 static inline struct ip_tunnel_info
*skb_tunnel_info(struct sk_buff
*skb
)
28 struct metadata_dst
*md_dst
= skb_metadata_dst(skb
);
29 struct dst_entry
*dst
;
32 return &md_dst
->u
.tun_info
;
35 if (dst
&& dst
->lwtstate
)
36 return lwt_tun_info(dst
->lwtstate
);
41 static inline bool skb_valid_dst(const struct sk_buff
*skb
)
43 struct dst_entry
*dst
= skb_dst(skb
);
45 return dst
&& !(dst
->flags
& DST_METADATA
);
48 struct metadata_dst
*metadata_dst_alloc(u8 optslen
, gfp_t flags
);
49 struct metadata_dst __percpu
*metadata_dst_alloc_percpu(u8 optslen
, gfp_t flags
);
51 #endif /* __NET_DST_METADATA_H */