Mathieu Xhonneux | 1c1e761 | 2018-05-20 14:58:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * SR-IPv6 implementation |
| 3 | * |
| 4 | * Authors: |
| 5 | * David Lebrun <david.lebrun@uclouvain.be> |
| 6 | * eBPF support: Mathieu Xhonneux <m.xhonneux@gmail.com> |
| 7 | * |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License |
| 11 | * as published by the Free Software Foundation; either version |
| 12 | * 2 of the License, or (at your option) any later version. |
| 13 | */ |
| 14 | |
| 15 | #ifndef _NET_SEG6_LOCAL_H |
| 16 | #define _NET_SEG6_LOCAL_H |
| 17 | |
Mathieu Xhonneux | fe94cc2 | 2018-05-20 14:58:14 +0100 | [diff] [blame] | 18 | #include <linux/percpu.h> |
Mathieu Xhonneux | 1c1e761 | 2018-05-20 14:58:13 +0100 | [diff] [blame] | 19 | #include <linux/net.h> |
| 20 | #include <linux/ipv6.h> |
| 21 | |
| 22 | extern int seg6_lookup_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr, |
| 23 | u32 tbl_id); |
Mathieu Xhonneux | 486cdf2 | 2018-07-26 02:10:40 +0000 | [diff] [blame] | 24 | extern bool seg6_bpf_has_valid_srh(struct sk_buff *skb); |
Mathieu Xhonneux | 1c1e761 | 2018-05-20 14:58:13 +0100 | [diff] [blame] | 25 | |
Mathieu Xhonneux | fe94cc2 | 2018-05-20 14:58:14 +0100 | [diff] [blame] | 26 | struct seg6_bpf_srh_state { |
Mathieu Xhonneux | 486cdf2 | 2018-07-26 02:10:40 +0000 | [diff] [blame] | 27 | struct ipv6_sr_hdr *srh; |
Mathieu Xhonneux | fe94cc2 | 2018-05-20 14:58:14 +0100 | [diff] [blame] | 28 | u16 hdrlen; |
Mathieu Xhonneux | 486cdf2 | 2018-07-26 02:10:40 +0000 | [diff] [blame] | 29 | bool valid; |
Mathieu Xhonneux | fe94cc2 | 2018-05-20 14:58:14 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | DECLARE_PER_CPU(struct seg6_bpf_srh_state, seg6_bpf_srh_states); |
| 33 | |
Mathieu Xhonneux | 1c1e761 | 2018-05-20 14:58:13 +0100 | [diff] [blame] | 34 | #endif |