Netmap linux error netmap_user.h not found

Hello, I’m a new user.
I want to make a homemade firewall,
iptables + suricata IPS mode.
as I understand from the documentation, the Netmap mode suits me. Since the other modes in the IPS work on L2 in copy mode.

when I build suricata:

./configure --enable-netmap --with-netmap-includes=/usr/local/include/net/

I get this error:

checking whether SOF_TIMESTAMPING_RAW_HARDWARE is declared... yes
checking for elf_begin in -lelf... yes
checking for xdp/xsk.h... no
checking for xsk_umem__create in -lxdp... no
checking for bpf_xdp_query_id... no
checking for net/netmap_user.h... no
configure: error: net/netmap_user.h not found.

There are files in the directory

ls -l /usr/local/include/net/
-rw-r--r-- 1 root root 35638 Jan 27 18:30 netmap.h
-rw-r--r-- 1 root root  9720 Jan 27 18:30 netmap_legacy.h
-rw-r--r-- 1 root root 31627 Jan 27 18:30 netmap_user.h
-rw-r--r-- 1 root root  3981 Jan 27 18:30 netmap_virt.h

Suricata version: I downloaded the main branch
Ubuntu 22.04.3 LTS

On Linux with iptables you’ll be after the NFQ support, not Netfilter. So you just need the libnetfilter-queue-dev package and the --enable-nfqueue build flag.

This what what our documentation recommends for L3 IPS usage: 15. Setting up IPS/inline for Linux — Suricata 8.0.0-dev documentation

Thank you. I need to understand if Netmap can work in l3 or only in NFQ? ))

If you still want to use netmap, try adjusting the netmap include path to /usr/local/include

It didn’t help (

I tried it:

./configure --enable-netmap --with-netmap-includes=/usr/local/include
./configure --enable-netmap --with-netmap-includes=/usr/local/include/

Can you DM or post the config.log file? It’s in the same directory as configure

config.log (175.4 KB)

It’s locating the include file correctly; it’s failing compilation of a test program that includes the file.

configure:22147: checking for net/netmap_user.h
configure:22147: gcc -c -g -O2 -fPIC -std=c11 -march=native   -I/usr/local/include conftest.c >&5
In file included from /usr/local/include/net/netmap_user.h:104,
                 from conftest.c:191:
/usr/local/include/net/netmap.h:375:33: error: 'IFNAMSIZ' undeclared here (not in a function); did you mean 'IF_NAMESIZE'?
  375 |         char            ni_name[IFNAMSIZ]; /* name of the interface. */
      |                                 ^~~~~~~~
      |                                 IF_NAMESIZE
1 Like