linux/kernel/bpf/reuseport_array.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2018 Facebook
 */
#include <linux/bpf.h>
#include <linux/err.h>
#include <linux/sock_diag.h>
#include <net/sock_reuseport.h>
#include <linux/btf_ids.h>

struct reuseport_array {};

static struct reuseport_array *reuseport_array(struct bpf_map *map)
{}

/* The caller must hold the reuseport_lock */
void bpf_sk_reuseport_detach(struct sock *sk)
{}

static int reuseport_array_alloc_check(union bpf_attr *attr)
{}

static void *reuseport_array_lookup_elem(struct bpf_map *map, void *key)
{}

/* Called from syscall only */
static long reuseport_array_delete_elem(struct bpf_map *map, void *key)
{}

static void reuseport_array_free(struct bpf_map *map)
{}

static struct bpf_map *reuseport_array_alloc(union bpf_attr *attr)
{}

int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key,
				       void *value)
{}

static int
reuseport_array_update_check(const struct reuseport_array *array,
			     const struct sock *nsk,
			     const struct sock *osk,
			     const struct sock_reuseport *nsk_reuse,
			     u32 map_flags)
{}

/*
 * Called from syscall only.
 * The "nsk" in the fd refcnt.
 * The "osk" and "reuse" are protected by reuseport_lock.
 */
int bpf_fd_reuseport_array_update_elem(struct bpf_map *map, void *key,
				       void *value, u64 map_flags)
{}

/* Called from syscall */
static int reuseport_array_get_next_key(struct bpf_map *map, void *key,
					void *next_key)
{}

static u64 reuseport_array_mem_usage(const struct bpf_map *map)
{}

BTF_ID_LIST_SINGLE(reuseport_array_map_btf_ids, struct, reuseport_array)
const struct bpf_map_ops reuseport_array_ops =;