I'm trying to compile a simple file based on the example introduced in the pf(4).
My code looks like this:
On
Looking at the pfvar.h there is no
at any of the lines specified by the compiler. For example, this is line 151
, this is line 415
, etc. The bottom line is that those errors do not correspond to the src. file.
What am I missing? Thanks.
My code looks like this:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h> // manipulate file descriptor
#include <net/pfvar.h>
#include <net/if.h>
#include <netinet/in.h>
#include <err.h>
int main() {
return 0;
}
On
cc -o pftest pftest.c
I get this:
Code:
In file included from pftest.c:7:
/usr/include/net/pfvar.h:151:18: error: use of undeclared identifier 'IFNAMSIZ'
char ifname[IFNAMSIZ];
^
/usr/include/net/pfvar.h:415:18: error: use of undeclared identifier 'IFNAMSIZ'
char ifname[IFNAMSIZ];
^
/usr/include/net/pfvar.h:568:17: error: use of undeclared identifier 'IFNAMSIZ'
char ifname[IFNAMSIZ];
^
/usr/include/net/pfvar.h:853:16: error: use of undeclared identifier 'IFNAMSIZ'
char ifname[IFNAMSIZ];
^
/usr/include/net/pfvar.h:1130:21: error: use of undeclared identifier 'IFNAMSIZ'
char pfik_name[IFNAMSIZ];
^
/usr/include/net/pfvar.h:1134:21: error: use of undeclared identifier 'IFNAMSIZ'
char pfik_name[IFNAMSIZ];
^
/usr/include/net/pfvar.h:1321:15: error: use of undeclared identifier 'IFNAMSIZ'
char ifname[IFNAMSIZ];
Looking at the pfvar.h there is no
Code:
ifname[IFNAMSIZ];
Code:
#define PF_RULES_ASSERT() rw_assert(&pf_rules_lock, RA_LOCKED)
Code:
SLIST_HEAD(pf_osfp_enlist, pf_osfp_entry) fp_oses; /* list of matches */
What am I missing? Thanks.