Commit | Line | Data |
---|---|---|
3616d08b DA |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | #ifndef _IPV6_STUBS_H | |
3 | #define _IPV6_STUBS_H | |
4 | ||
5 | #include <linux/in6.h> | |
6 | #include <linux/netdevice.h> | |
7 | #include <linux/skbuff.h> | |
8 | #include <net/dst.h> | |
9 | #include <net/flow.h> | |
10 | #include <net/neighbour.h> | |
11 | #include <net/sock.h> | |
12 | ||
13 | /* structs from net/ip6_fib.h */ | |
14 | struct fib6_info; | |
1aefd3de DA |
15 | struct fib6_nh; |
16 | struct fib6_config; | |
b1d40991 | 17 | struct fib6_result; |
3616d08b DA |
18 | |
19 | /* This is ugly, ideally these symbols should be built | |
20 | * into the core kernel. | |
21 | */ | |
22 | struct ipv6_stub { | |
23 | int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex, | |
24 | const struct in6_addr *addr); | |
25 | int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex, | |
26 | const struct in6_addr *addr); | |
6c8991f4 SD |
27 | struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net, |
28 | const struct sock *sk, | |
29 | struct flowi6 *fl6, | |
30 | const struct in6_addr *final_dst); | |
3616d08b DA |
31 | int (*ipv6_route_input)(struct sk_buff *skb); |
32 | ||
33 | struct fib6_table *(*fib6_get_table)(struct net *net, u32 id); | |
effda4dd DA |
34 | int (*fib6_lookup)(struct net *net, int oif, struct flowi6 *fl6, |
35 | struct fib6_result *res, int flags); | |
36 | int (*fib6_table_lookup)(struct net *net, struct fib6_table *table, | |
37 | int oif, struct flowi6 *fl6, | |
38 | struct fib6_result *res, int flags); | |
b1d40991 DA |
39 | void (*fib6_select_path)(const struct net *net, struct fib6_result *res, |
40 | struct flowi6 *fl6, int oif, bool oif_match, | |
41 | const struct sk_buff *skb, int strict); | |
b748f260 DA |
42 | u32 (*ip6_mtu_from_fib6)(const struct fib6_result *res, |
43 | const struct in6_addr *daddr, | |
44 | const struct in6_addr *saddr); | |
3616d08b | 45 | |
1aefd3de DA |
46 | int (*fib6_nh_init)(struct net *net, struct fib6_nh *fib6_nh, |
47 | struct fib6_config *cfg, gfp_t gfp_flags, | |
48 | struct netlink_ext_ack *extack); | |
49 | void (*fib6_nh_release)(struct fib6_nh *fib6_nh); | |
cdaa16a4 | 50 | void (*fib6_update_sernum)(struct net *net, struct fib6_info *rt); |
68a9b13d | 51 | int (*ip6_del_rt)(struct net *net, struct fib6_info *rt); |
19a3b7ee DA |
52 | void (*fib6_rt_update)(struct net *net, struct fib6_info *rt, |
53 | struct nl_info *info); | |
54 | ||
3616d08b DA |
55 | void (*udpv6_encap_enable)(void); |
56 | void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr, | |
57 | const struct in6_addr *solicited_addr, | |
58 | bool router, bool solicited, bool override, bool inc_opt); | |
0146dca7 SD |
59 | #if IS_ENABLED(CONFIG_XFRM) |
60 | int (*xfrm6_udp_encap_rcv)(struct sock *sk, struct sk_buff *skb); | |
61 | #endif | |
3616d08b DA |
62 | struct neigh_table *nd_tbl; |
63 | }; | |
64 | extern const struct ipv6_stub *ipv6_stub __read_mostly; | |
65 | ||
66 | /* A stub used by bpf helpers. Similarly ugly as ipv6_stub */ | |
67 | struct ipv6_bpf_stub { | |
68 | int (*inet6_bind)(struct sock *sk, struct sockaddr *uaddr, int addr_len, | |
69 | bool force_bind_address_no_port, bool with_lock); | |
70 | struct sock *(*udp6_lib_lookup)(struct net *net, | |
71 | const struct in6_addr *saddr, __be16 sport, | |
72 | const struct in6_addr *daddr, __be16 dport, | |
73 | int dif, int sdif, struct udp_table *tbl, | |
74 | struct sk_buff *skb); | |
75 | }; | |
76 | extern const struct ipv6_bpf_stub *ipv6_bpf_stub __read_mostly; | |
77 | ||
78 | #endif |