12874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 21c1e761eSMathieu Xhonneux /* 31c1e761eSMathieu Xhonneux * SR-IPv6 implementation 41c1e761eSMathieu Xhonneux * 51c1e761eSMathieu Xhonneux * Authors: 61c1e761eSMathieu Xhonneux * David Lebrun <david.lebrun@uclouvain.be> 71c1e761eSMathieu Xhonneux * eBPF support: Mathieu Xhonneux <m.xhonneux@gmail.com> 81c1e761eSMathieu Xhonneux */ 91c1e761eSMathieu Xhonneux 101c1e761eSMathieu Xhonneux #ifndef _NET_SEG6_LOCAL_H 111c1e761eSMathieu Xhonneux #define _NET_SEG6_LOCAL_H 121c1e761eSMathieu Xhonneux 13fe94cc29SMathieu Xhonneux #include <linux/percpu.h> 141c1e761eSMathieu Xhonneux #include <linux/net.h> 151c1e761eSMathieu Xhonneux #include <linux/ipv6.h> 161c1e761eSMathieu Xhonneux 171c1e761eSMathieu Xhonneux extern int seg6_lookup_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr, 181c1e761eSMathieu Xhonneux u32 tbl_id); 19486cdf21SMathieu Xhonneux extern bool seg6_bpf_has_valid_srh(struct sk_buff *skb); 201c1e761eSMathieu Xhonneux 21fe94cc29SMathieu Xhonneux struct seg6_bpf_srh_state { 22*d1542d4aSSebastian Andrzej Siewior local_lock_t bh_lock; 23486cdf21SMathieu Xhonneux struct ipv6_sr_hdr *srh; 24fe94cc29SMathieu Xhonneux u16 hdrlen; 25486cdf21SMathieu Xhonneux bool valid; 26fe94cc29SMathieu Xhonneux }; 27fe94cc29SMathieu Xhonneux 28fe94cc29SMathieu Xhonneux DECLARE_PER_CPU(struct seg6_bpf_srh_state, seg6_bpf_srh_states); 29fe94cc29SMathieu Xhonneux 301c1e761eSMathieu Xhonneux #endif 31