summaryrefslogtreecommitdiffstats
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 9b558713447f..e60fff48288b 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -737,33 +737,18 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map)
737} 737}
738#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */ 738#endif /* CONFIG_NET && CONFIG_BPF_SYSCALL */
739 739
740#if defined(CONFIG_STREAM_PARSER) && defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_INET) 740#if defined(CONFIG_BPF_STREAM_PARSER)
741struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); 741int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, u32 which);
742struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); 742int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog);
743int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type);
744int sockmap_get_from_fd(const union bpf_attr *attr, int type,
745 struct bpf_prog *prog);
746#else 743#else
747static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) 744static inline int sock_map_prog_update(struct bpf_map *map,
748{ 745 struct bpf_prog *prog, u32 which)
749 return NULL;
750}
751
752static inline struct sock *__sock_hash_lookup_elem(struct bpf_map *map,
753 void *key)
754{
755 return NULL;
756}
757
758static inline int sock_map_prog(struct bpf_map *map,
759 struct bpf_prog *prog,
760 u32 type)
761{ 746{
762 return -EOPNOTSUPP; 747 return -EOPNOTSUPP;
763} 748}
764 749
765static inline int sockmap_get_from_fd(const union bpf_attr *attr, int type, 750static inline int sock_map_get_from_fd(const union bpf_attr *attr,
766 struct bpf_prog *prog) 751 struct bpf_prog *prog)
767{ 752{
768 return -EINVAL; 753 return -EINVAL;
769} 754}
@@ -839,6 +824,10 @@ extern const struct bpf_func_proto bpf_get_stack_proto;
839extern const struct bpf_func_proto bpf_sock_map_update_proto; 824extern const struct bpf_func_proto bpf_sock_map_update_proto;
840extern const struct bpf_func_proto bpf_sock_hash_update_proto; 825extern const struct bpf_func_proto bpf_sock_hash_update_proto;
841extern const struct bpf_func_proto bpf_get_current_cgroup_id_proto; 826extern const struct bpf_func_proto bpf_get_current_cgroup_id_proto;
827extern const struct bpf_func_proto bpf_msg_redirect_hash_proto;
828extern const struct bpf_func_proto bpf_msg_redirect_map_proto;
829extern const struct bpf_func_proto bpf_sk_redirect_hash_proto;
830extern const struct bpf_func_proto bpf_sk_redirect_map_proto;
842 831
843extern const struct bpf_func_proto bpf_get_local_storage_proto; 832extern const struct bpf_func_proto bpf_get_local_storage_proto;
844 833