.. | .. |
---|
2 | 2 | #ifndef _INET_COMMON_H |
---|
3 | 3 | #define _INET_COMMON_H |
---|
4 | 4 | |
---|
| 5 | +#include <linux/indirect_call_wrapper.h> |
---|
| 6 | + |
---|
5 | 7 | extern const struct proto_ops inet_stream_ops; |
---|
6 | 8 | extern const struct proto_ops inet_dgram_ops; |
---|
7 | 9 | |
---|
.. | .. |
---|
23 | 25 | int addr_len, int flags); |
---|
24 | 26 | int inet_accept(struct socket *sock, struct socket *newsock, int flags, |
---|
25 | 27 | bool kern); |
---|
| 28 | +int inet_send_prepare(struct sock *sk); |
---|
26 | 29 | int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size); |
---|
27 | 30 | ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
---|
28 | 31 | size_t size, int flags); |
---|
.. | .. |
---|
32 | 35 | int inet_listen(struct socket *sock, int backlog); |
---|
33 | 36 | void inet_sock_destruct(struct sock *sk); |
---|
34 | 37 | int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); |
---|
| 38 | +/* Don't allocate port at this moment, defer to connect. */ |
---|
| 39 | +#define BIND_FORCE_ADDRESS_NO_PORT (1 << 0) |
---|
| 40 | +/* Grab and release socket lock. */ |
---|
| 41 | +#define BIND_WITH_LOCK (1 << 1) |
---|
| 42 | +/* Called from BPF program. */ |
---|
| 43 | +#define BIND_FROM_BPF (1 << 2) |
---|
35 | 44 | int __inet_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len, |
---|
36 | | - bool force_bind_address_no_port, bool with_lock); |
---|
| 45 | + u32 flags); |
---|
37 | 46 | int inet_getname(struct socket *sock, struct sockaddr *uaddr, |
---|
38 | 47 | int peer); |
---|
39 | 48 | int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
---|
.. | .. |
---|
54 | 63 | sock_release(sk->sk_socket); |
---|
55 | 64 | } |
---|
56 | 65 | |
---|
| 66 | +#define indirect_call_gro_receive(f2, f1, cb, head, skb) \ |
---|
| 67 | +({ \ |
---|
| 68 | + unlikely(gro_recursion_inc_test(skb)) ? \ |
---|
| 69 | + NAPI_GRO_CB(skb)->flush |= 1, NULL : \ |
---|
| 70 | + INDIRECT_CALL_2(cb, f2, f1, head, skb); \ |
---|
| 71 | +}) |
---|
| 72 | + |
---|
57 | 73 | #endif |
---|