]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/net/bpf_sk_storage.h
Merge tag 'devicetree-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-jammy-kernel.git] / include / net / bpf_sk_storage.h
CommitLineData
6ac99e8f
MKL
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Copyright (c) 2019 Facebook */
3#ifndef _BPF_SK_STORAGE_H
4#define _BPF_SK_STORAGE_H
5
f836a56e
KS
6#include <linux/rculist.h>
7#include <linux/list.h>
8#include <linux/hash.h>
4cc9ce4e
KS
9#include <linux/types.h>
10#include <linux/spinlock.h>
f836a56e
KS
11#include <linux/bpf.h>
12#include <net/sock.h>
13#include <uapi/linux/sock_diag.h>
14#include <uapi/linux/btf.h>
450af8d0 15#include <linux/bpf_local_storage.h>
4cc9ce4e 16
6ac99e8f
MKL
17struct sock;
18
19void bpf_sk_storage_free(struct sock *sk);
20
21extern const struct bpf_func_proto bpf_sk_storage_get_proto;
22extern const struct bpf_func_proto bpf_sk_storage_delete_proto;
8e4597c6
MKL
23extern const struct bpf_func_proto bpf_sk_storage_get_tracing_proto;
24extern const struct bpf_func_proto bpf_sk_storage_delete_tracing_proto;
6ac99e8f 25
f836a56e 26struct bpf_local_storage_elem;
1ed4d924
MKL
27struct bpf_sk_storage_diag;
28struct sk_buff;
29struct nlattr;
30struct sock;
31
8f51dfc7
SF
32#ifdef CONFIG_BPF_SYSCALL
33int bpf_sk_storage_clone(const struct sock *sk, struct sock *newsk);
1ed4d924
MKL
34struct bpf_sk_storage_diag *
35bpf_sk_storage_diag_alloc(const struct nlattr *nla_stgs);
36void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag);
37int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
38 struct sock *sk, struct sk_buff *skb,
39 int stg_array_type,
40 unsigned int *res_diag_size);
8f51dfc7
SF
41#else
42static inline int bpf_sk_storage_clone(const struct sock *sk,
43 struct sock *newsk)
44{
45 return 0;
46}
1ed4d924
MKL
47static inline struct bpf_sk_storage_diag *
48bpf_sk_storage_diag_alloc(const struct nlattr *nla)
49{
50 return NULL;
51}
52static inline void bpf_sk_storage_diag_free(struct bpf_sk_storage_diag *diag)
53{
54}
55static inline int bpf_sk_storage_diag_put(struct bpf_sk_storage_diag *diag,
56 struct sock *sk, struct sk_buff *skb,
57 int stg_array_type,
58 unsigned int *res_diag_size)
59{
60 return 0;
61}
8f51dfc7
SF
62#endif
63
6ac99e8f 64#endif /* _BPF_SK_STORAGE_H */