numam-dpdk/lib/bpf/bpf_stub.c
David Marchand d6024c0a67 build: cleanup libpcap dependent components
The RTE_PORT_PCAP variable is used to signal libpcap availability,
though its name seems to refer to pcap support in the port library.
Prefer a generic name and add explicit link dependencies where needed.

Fixes: 7a944656b3 ("test/pcapng: test pcapng library")
Fixes: 2eccf6afbe ("bpf: add function to convert classic BPF to DPDK BPF")
Fixes: cbb44143be ("app/dumpcap: add new packet capture application")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-11-10 11:42:34 +01:00

46 lines
907 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2018-2021 Intel Corporation
*/
#include "bpf_impl.h"
#include <rte_errno.h>
/**
* Contains stubs for unimplemented public API functions
*/
#ifndef RTE_LIBRTE_BPF_ELF
struct rte_bpf *
rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
const char *sname)
{
if (prm == NULL || fname == NULL || sname == NULL) {
rte_errno = EINVAL;
return NULL;
}
RTE_BPF_LOG(ERR, "%s() is not supported with current config\n"
"rebuild with libelf installed\n",
__func__);
rte_errno = ENOTSUP;
return NULL;
}
#endif
#ifndef RTE_HAS_LIBPCAP
struct rte_bpf_prm *
rte_bpf_convert(const struct bpf_program *prog)
{
if (prog == NULL) {
rte_errno = EINVAL;
return NULL;
}
RTE_BPF_LOG(ERR, "%s() is not supported with current config\n"
"rebuild with libpcap installed\n",
__func__);
rte_errno = ENOTSUP;
return NULL;
}
#endif