Pull definitions for bpf_skc_lookup_tcp and bpf_sk_check_syncookie.
Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all
Unified · Split
| @@ -2431,6 +2431,38 @@ union bpf_attr { · 2430 unmodified lines | |||
| 2431 | * Return | 2431 | * Return |
| 2432 | * A **struct bpf_sock** pointer on success, or **NULL** in | 2432 | * A **struct bpf_sock** pointer on success, or **NULL** in |
| 2433 | * case of failure. | 2433 | * case of failure. |
| 2434 | * | ||
| 2435 | * struct bpf_sock *bpf_skc_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) | ||
| 2436 | * Description | ||
| 2437 | * Look for TCP socket matching *tuple*, optionally in a child | ||
| 2438 | * network namespace *netns*. The return value must be checked, | ||
| 2439 | * and if non-**NULL**, released via **bpf_sk_release**\ (). | ||
| 2440 | * | ||
| 2441 | * This function is identical to bpf_sk_lookup_tcp, except that it | ||
| 2442 | * also returns timewait or request sockets. Use bpf_sk_fullsock | ||
| 2443 | * or bpf_tcp_socket to access the full structure. | ||
| 2444 | * | ||
| 2445 | * This helper is available only if the kernel was compiled with | ||
| 2446 | * **CONFIG_NET** configuration option. | ||
| 2447 | * Return | ||
| 2448 | * Pointer to **struct bpf_sock**, or **NULL** in case of failure. | ||
| 2449 | * For sockets with reuseport option, the **struct bpf_sock** | ||
| 2450 | * result is from **reuse->socks**\ [] using the hash of the tuple. | ||
| 2451 | * | ||
| 2452 | * int bpf_tcp_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) | ||
| 2453 | * Description | ||
| 2454 | * Check whether iph and th contain a valid SYN cookie ACK for | ||
| 2455 | * the listening socket in sk. | ||
| 2456 | * | ||
| 2457 | * iph points to the start of the IPv4 or IPv6 header, while | ||
| 2458 | * iph_len contains sizeof(struct iphdr) or sizeof(struct ip6hdr). | ||
| 2459 | * | ||
| 2460 | * th points to the start of the TCP header, while th_len contains | ||
| 2461 | * sizeof(struct tcphdr). | ||
| 2462 | * | ||
| 2463 | * Return | ||
| 2464 | * 0 if iph and th are a valid SYN cookie ACK, or a negative error | ||
| 2465 | * otherwise. | ||
| 2434 | */ | 2466 | */ |
| 2435 | #define __BPF_FUNC_MAPPER(FN) \ | 2467 | #define __BPF_FUNC_MAPPER(FN) \ |
| 2436 | FN(unspec), \ | 2468 | FN(unspec), \ |
| @@ -2531,7 +2563,9 @@ union bpf_attr { · 94 unmodified lines | |||
| 2531 | FN(sk_fullsock), \ | 2563 | FN(sk_fullsock), \ |
| 2532 | FN(tcp_sock), \ | 2564 | FN(tcp_sock), \ |
| 2533 | FN(skb_ecn_set_ce), \ | 2565 | FN(skb_ecn_set_ce), \ |
| 2534 | FN(get_listener_sock), | 2566 | FN(get_listener_sock), \ |
| 2567 | FN(skc_lookup_tcp), \ | ||
| 2568 | FN(tcp_check_syncookie), | ||
| 2535 | 2569 | ||
| 2536 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper | 2570 | /* integer value in 'imm' field of BPF_CALL instruction selects which helper |
| 2537 | * function eBPF program intends to call | 2571 | * function eBPF program intends to call |