A clear and concise list of steps describing how to describe the issue.
Output of [radiusd|freeradius] -X showing issue occurring
In file included from src/lib/pcap.c:27:0:
src/freeradius-devel/pcap.h:72:16: error: ‘PCAP_ERRBUF_SIZE’ undeclared here (not in a function)
char errbuf[PCAP_ERRBUF_SIZE]; //!< Last error on this interface.
^
src/freeradius-devel/pcap.h:81:2: error: unknown type name ‘pcap_t’
pcap_t handle; //!< libpcap handle.
^
src/freeradius-devel/pcap.h:82:2: error: unknown type name ‘pcap_dumper_t’
pcap_dumper_t dumper; //!< libpcap dumper handle.
^
src/freeradius-devel/pcap.h:87:19: error: field ‘pstats’ has incomplete type
struct pcap_stat pstats; //!< The last set of pcap stats for this handle.
^
src/freeradius-devel/pcap.h:92:43: error: unknown type name ‘pcap_if_t’
int fr_pcap_if_link_layer(char errbuff, pcap_if_t dev);
^
src/lib/pcap.c: In function ‘_free_pcap’:
src/lib/pcap.c:52:4: warning: implicit declaration of function ‘pcap_close’ [-Wimplicit-function-declaration]
pcap_close(pcap->handle);
^
src/lib/pcap.c:64:4: warning: implicit declaration of function ‘pcap_dump_flush’ [-Wimplicit-function-declaration]
pcap_dump_flush(pcap->dumper);
^
src/lib/pcap.c:65:4: warning: implicit declaration of function ‘pcap_dump_close’ [-Wimplicit-function-declaration]
pcap_dump_close(pcap->dumper);
^
src/lib/pcap.c: At top level:
src/lib/pcap.c:86:42: error: unknown type name ‘pcap_if_t’
int fr_pcap_if_link_layer(char errbuff, pcap_if_t dev)
^
src/lib/pcap.c: In function ‘fr_pcap_open’:
src/lib/pcap.c:135:3: warning: implicit declaration of function ‘pcap_create’ [-Wimplicit-function-declaration]
pcap->handle = pcap_create(pcap->name, pcap->errbuf);
^
src/lib/pcap.c:140:3: warning: implicit declaration of function ‘pcap_set_snaplen’ [-Wimplicit-function-declaration]
if (pcap_set_snaplen(pcap->handle, SNAPLEN) != 0) {
^
src/lib/pcap.c:142:4: warning: implicit declaration of function ‘pcap_geterr’ [-Wimplicit-function-declaration]
fr_strerror_printf("%s", pcap_geterr(pcap->handle));
^
src/lib/pcap.c:142:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=]
src/lib/pcap.c:147:3: warning: implicit declaration of function ‘pcap_set_timeout’ [-Wimplicit-function-declaration]
if (pcap_set_timeout(pcap->handle, PCAP_NONBLOCK_TIMEOUT) != 0) {
^
src/lib/pcap.c:150:3: warning: implicit declaration of function ‘pcap_set_promisc’ [-Wimplicit-function-declaration]
if (pcap_set_promisc(pcap->handle, pcap->promiscuous) != 0) {
^
src/lib/pcap.c:154:3: warning: implicit declaration of function ‘pcap_set_buffer_size’ [-Wimplicit-function-declaration]
if (pcap_set_buffer_size(pcap->handle, SNAPLEN
^
src/lib/pcap.c:158:3: warning: implicit declaration of function ‘pcap_activate’ [-Wimplicit-function-declaration]
if (pcap_activate(pcap->handle) != 0) {
^
src/lib/pcap.c:176:3: warning: implicit declaration of function ‘pcap_setnonblock’ [-Wimplicit-function-declaration]
if (pcap_setnonblock(pcap->handle, true, pcap->errbuf) != 0) {
^
src/lib/pcap.c:184:3: warning: implicit declaration of function ‘pcap_get_selectable_fd’ [-Wimplicit-function-declaration]
pcap->fd = pcap_get_selectable_fd(pcap->handle);
^
src/lib/pcap.c:185:3: warning: implicit declaration of function ‘pcap_datalink’ [-Wimplicit-function-declaration]
pcap->link_layer = pcap_datalink(pcap->handle);
^
src/lib/pcap.c:198:3: warning: implicit declaration of function ‘pcap_open_offline’ [-Wimplicit-function-declaration]
pcap->handle = pcap_open_offline(pcap->name, pcap->errbuf);
^
src/lib/pcap.c:210:23: error: ‘DLT_EN10MB’ undeclared (first use in this function)
pcap->link_layer = DLT_EN10MB;
^
src/lib/pcap.c:210:23: note: each undeclared identifier is reported only once for each function it appears in
src/lib/pcap.c:212:3: warning: implicit declaration of function ‘pcap_open_dead’ [-Wimplicit-function-declaration]
pcap->handle = pcap_open_dead(pcap->link_layer, SNAPLEN);
^
src/lib/pcap.c:212:16: warning: assignment makes pointer from integer without a cast [enabled by default]
pcap->handle = pcap_open_dead(pcap->link_layer, SNAPLEN);
^
src/lib/pcap.c:218:3: warning: implicit declaration of function ‘pcap_dump_open’ [-Wimplicit-function-declaration]
pcap->dumper = pcap_dump_open(pcap->handle, pcap->name);
^
src/lib/pcap.c:218:16: warning: assignment makes pointer from integer without a cast [enabled by default]
pcap->dumper = pcap_dump_open(pcap->handle, pcap->name);
^
src/lib/pcap.c:220:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=]
fr_strerror_printf("%s", pcap_geterr(pcap->handle));
^
src/lib/pcap.c:228:3: warning: implicit declaration of function ‘pcap_fopen_offline’ [-Wimplicit-function-declaration]
pcap->handle = pcap_fopen_offline(stdin, pcap->errbuf);
^
src/lib/pcap.c:246:3: warning: implicit declaration of function ‘pcap_dump_fopen’ [-Wimplicit-function-declaration]
pcap->dumper = pcap_dump_fopen(pcap->handle, stdout);
^
src/lib/pcap.c:246:16: warning: assignment makes pointer from integer without a cast [enabled by default]
pcap->dumper = pcap_dump_fopen(pcap->handle, stdout);
^
src/lib/pcap.c:248:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=]
fr_strerror_printf("%s", pcap_geterr(pcap->handle));
^
src/lib/pcap.c: In function ‘fr_pcap_apply_filter’:
src/lib/pcap.c:277:2: error: unknown type name ‘bpf_u_int32’
bpf_u_int32 mask = 0; / Our netmask /
^
src/lib/pcap.c:278:2: error: unknown type name ‘bpf_u_int32’
bpf_u_int32 net = 0; / Our IP /
^
src/lib/pcap.c:279:21: error: storage size of ‘fp’ isn’t known
struct bpf_program fp;
^
src/lib/pcap.c:298:3: warning: implicit declaration of function ‘pcap_lookupnet’ [-Wimplicit-function-declaration]
if (pcap_lookupnet(pcap->name, &net, &mask, pcap->errbuf) < 0) {
^
src/lib/pcap.c:304:2: warning: implicit declaration of function ‘pcap_compile’ [-Wimplicit-function-declaration]
if (pcap_compile(pcap->handle, &fp, expression, 0, net) < 0) {
^
src/lib/pcap.c:305:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=]
fr_strerror_printf("%s", pcap_geterr(pcap->handle));
^
src/lib/pcap.c:310:2: warning: implicit declaration of function ‘pcap_setfilter’ [-Wimplicit-function-declaration]
if (pcap_setfilter(pcap->handle, &fp) < 0) {
^
src/lib/pcap.c:311:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=]
fr_strerror_printf("%s", pcap_geterr(pcap->handle));
^
src/lib/pcap.c:279:21: warning: unused variable ‘fp’ [-Wunused-variable]
struct bpf_program fp;
^
src/lib/pcap.c: In function ‘fr_pcap_link_layer_supported’:
src/lib/pcap.c:362:7: error: ‘DLT_EN10MB’ undeclared (first use in this function)
case DLT_EN10MB:
^
src/lib/pcap.c:363:7: error: ‘DLT_RAW’ undeclared (first use in this function)
case DLT_RAW:
^
src/lib/pcap.c:364:7: error: ‘DLT_NULL’ undeclared (first use in this function)
case DLT_NULL:
^
src/lib/pcap.c:365:7: error: ‘DLT_LOOP’ undeclared (first use in this function)
case DLT_LOOP:
^
src/lib/pcap.c:369:7: error: ‘DLT_PFLOG’ undeclared (first use in this function)
case DLT_PFLOG:
^
src/lib/pcap.c: In function ‘fr_pcap_link_layer_offset’:
src/lib/pcap.c:398:7: error: ‘DLT_RAW’ undeclared (first use in this function)
case DLT_RAW:
^
src/lib/pcap.c:401:7: error: ‘DLT_NULL’ undeclared (first use in this function)
case DLT_NULL:
^
src/lib/pcap.c:402:7: error: ‘DLT_LOOP’ undeclared (first use in this function)
case DLT_LOOP:
^
src/lib/pcap.c:412:7: error: ‘DLT_EN10MB’ undeclared (first use in this function)
case DLT_EN10MB:
^
src/lib/pcap.c:460:7: error: ‘DLT_PFLOG’ undeclared (first use in this function)
case DLT_PFLOG:
^
src/lib/pcap.c: At top level:
cc1: warning: unrecognized command line option "-Wno-date-time" [enabled by default]
make: *** [build/objs/src/lib/pcap.lo] Error 1
Issue type
compile problem of HAVE_LIBPCAP
Defect
./configure make
A clear and concise list of steps describing how to describe the issue.
Output of
[radiusd|freeradius] -X
showing issue occurringIn file included from src/lib/pcap.c:27:0: src/freeradius-devel/pcap.h:72:16: error: ‘PCAP_ERRBUF_SIZE’ undeclared here (not in a function) char errbuf[PCAP_ERRBUF_SIZE]; //!< Last error on this interface. ^ src/freeradius-devel/pcap.h:81:2: error: unknown type name ‘pcap_t’ pcap_t handle; //!< libpcap handle. ^ src/freeradius-devel/pcap.h:82:2: error: unknown type name ‘pcap_dumper_t’ pcap_dumper_t dumper; //!< libpcap dumper handle. ^ src/freeradius-devel/pcap.h:87:19: error: field ‘pstats’ has incomplete type struct pcap_stat pstats; //!< The last set of pcap stats for this handle. ^ src/freeradius-devel/pcap.h:92:43: error: unknown type name ‘pcap_if_t’ int fr_pcap_if_link_layer(char errbuff, pcap_if_t dev); ^ src/lib/pcap.c: In function ‘_free_pcap’: src/lib/pcap.c:52:4: warning: implicit declaration of function ‘pcap_close’ [-Wimplicit-function-declaration] pcap_close(pcap->handle); ^ src/lib/pcap.c:64:4: warning: implicit declaration of function ‘pcap_dump_flush’ [-Wimplicit-function-declaration] pcap_dump_flush(pcap->dumper); ^ src/lib/pcap.c:65:4: warning: implicit declaration of function ‘pcap_dump_close’ [-Wimplicit-function-declaration] pcap_dump_close(pcap->dumper); ^ src/lib/pcap.c: At top level: src/lib/pcap.c:86:42: error: unknown type name ‘pcap_if_t’ int fr_pcap_if_link_layer(char errbuff, pcap_if_t dev) ^ src/lib/pcap.c: In function ‘fr_pcap_open’: src/lib/pcap.c:135:3: warning: implicit declaration of function ‘pcap_create’ [-Wimplicit-function-declaration] pcap->handle = pcap_create(pcap->name, pcap->errbuf); ^ src/lib/pcap.c:140:3: warning: implicit declaration of function ‘pcap_set_snaplen’ [-Wimplicit-function-declaration] if (pcap_set_snaplen(pcap->handle, SNAPLEN) != 0) { ^ src/lib/pcap.c:142:4: warning: implicit declaration of function ‘pcap_geterr’ [-Wimplicit-function-declaration] fr_strerror_printf("%s", pcap_geterr(pcap->handle)); ^ src/lib/pcap.c:142:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=] src/lib/pcap.c:147:3: warning: implicit declaration of function ‘pcap_set_timeout’ [-Wimplicit-function-declaration] if (pcap_set_timeout(pcap->handle, PCAP_NONBLOCK_TIMEOUT) != 0) { ^ src/lib/pcap.c:150:3: warning: implicit declaration of function ‘pcap_set_promisc’ [-Wimplicit-function-declaration] if (pcap_set_promisc(pcap->handle, pcap->promiscuous) != 0) { ^ src/lib/pcap.c:154:3: warning: implicit declaration of function ‘pcap_set_buffer_size’ [-Wimplicit-function-declaration] if (pcap_set_buffer_size(pcap->handle, SNAPLEN ^ src/lib/pcap.c:158:3: warning: implicit declaration of function ‘pcap_activate’ [-Wimplicit-function-declaration] if (pcap_activate(pcap->handle) != 0) { ^ src/lib/pcap.c:176:3: warning: implicit declaration of function ‘pcap_setnonblock’ [-Wimplicit-function-declaration] if (pcap_setnonblock(pcap->handle, true, pcap->errbuf) != 0) { ^ src/lib/pcap.c:184:3: warning: implicit declaration of function ‘pcap_get_selectable_fd’ [-Wimplicit-function-declaration] pcap->fd = pcap_get_selectable_fd(pcap->handle); ^ src/lib/pcap.c:185:3: warning: implicit declaration of function ‘pcap_datalink’ [-Wimplicit-function-declaration] pcap->link_layer = pcap_datalink(pcap->handle); ^ src/lib/pcap.c:198:3: warning: implicit declaration of function ‘pcap_open_offline’ [-Wimplicit-function-declaration] pcap->handle = pcap_open_offline(pcap->name, pcap->errbuf); ^ src/lib/pcap.c:210:23: error: ‘DLT_EN10MB’ undeclared (first use in this function) pcap->link_layer = DLT_EN10MB; ^ src/lib/pcap.c:210:23: note: each undeclared identifier is reported only once for each function it appears in src/lib/pcap.c:212:3: warning: implicit declaration of function ‘pcap_open_dead’ [-Wimplicit-function-declaration] pcap->handle = pcap_open_dead(pcap->link_layer, SNAPLEN); ^ src/lib/pcap.c:212:16: warning: assignment makes pointer from integer without a cast [enabled by default] pcap->handle = pcap_open_dead(pcap->link_layer, SNAPLEN); ^ src/lib/pcap.c:218:3: warning: implicit declaration of function ‘pcap_dump_open’ [-Wimplicit-function-declaration] pcap->dumper = pcap_dump_open(pcap->handle, pcap->name); ^ src/lib/pcap.c:218:16: warning: assignment makes pointer from integer without a cast [enabled by default] pcap->dumper = pcap_dump_open(pcap->handle, pcap->name); ^ src/lib/pcap.c:220:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=] fr_strerror_printf("%s", pcap_geterr(pcap->handle)); ^ src/lib/pcap.c:228:3: warning: implicit declaration of function ‘pcap_fopen_offline’ [-Wimplicit-function-declaration] pcap->handle = pcap_fopen_offline(stdin, pcap->errbuf); ^ src/lib/pcap.c:246:3: warning: implicit declaration of function ‘pcap_dump_fopen’ [-Wimplicit-function-declaration] pcap->dumper = pcap_dump_fopen(pcap->handle, stdout); ^ src/lib/pcap.c:246:16: warning: assignment makes pointer from integer without a cast [enabled by default] pcap->dumper = pcap_dump_fopen(pcap->handle, stdout); ^ src/lib/pcap.c:248:4: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=] fr_strerror_printf("%s", pcap_geterr(pcap->handle)); ^ src/lib/pcap.c: In function ‘fr_pcap_apply_filter’: src/lib/pcap.c:277:2: error: unknown type name ‘bpf_u_int32’ bpf_u_int32 mask = 0; / Our netmask / ^ src/lib/pcap.c:278:2: error: unknown type name ‘bpf_u_int32’ bpf_u_int32 net = 0; / Our IP / ^ src/lib/pcap.c:279:21: error: storage size of ‘fp’ isn’t known struct bpf_program fp; ^ src/lib/pcap.c:298:3: warning: implicit declaration of function ‘pcap_lookupnet’ [-Wimplicit-function-declaration] if (pcap_lookupnet(pcap->name, &net, &mask, pcap->errbuf) < 0) { ^ src/lib/pcap.c:304:2: warning: implicit declaration of function ‘pcap_compile’ [-Wimplicit-function-declaration] if (pcap_compile(pcap->handle, &fp, expression, 0, net) < 0) { ^ src/lib/pcap.c:305:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=] fr_strerror_printf("%s", pcap_geterr(pcap->handle)); ^ src/lib/pcap.c:310:2: warning: implicit declaration of function ‘pcap_setfilter’ [-Wimplicit-function-declaration] if (pcap_setfilter(pcap->handle, &fp) < 0) { ^ src/lib/pcap.c:311:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘int’ [-Wformat=] fr_strerror_printf("%s", pcap_geterr(pcap->handle)); ^ src/lib/pcap.c:279:21: warning: unused variable ‘fp’ [-Wunused-variable] struct bpf_program fp; ^ src/lib/pcap.c: In function ‘fr_pcap_link_layer_supported’: src/lib/pcap.c:362:7: error: ‘DLT_EN10MB’ undeclared (first use in this function) case DLT_EN10MB: ^ src/lib/pcap.c:363:7: error: ‘DLT_RAW’ undeclared (first use in this function) case DLT_RAW: ^ src/lib/pcap.c:364:7: error: ‘DLT_NULL’ undeclared (first use in this function) case DLT_NULL: ^ src/lib/pcap.c:365:7: error: ‘DLT_LOOP’ undeclared (first use in this function) case DLT_LOOP: ^ src/lib/pcap.c:369:7: error: ‘DLT_PFLOG’ undeclared (first use in this function) case DLT_PFLOG: ^ src/lib/pcap.c: In function ‘fr_pcap_link_layer_offset’: src/lib/pcap.c:398:7: error: ‘DLT_RAW’ undeclared (first use in this function) case DLT_RAW: ^ src/lib/pcap.c:401:7: error: ‘DLT_NULL’ undeclared (first use in this function) case DLT_NULL: ^ src/lib/pcap.c:402:7: error: ‘DLT_LOOP’ undeclared (first use in this function) case DLT_LOOP: ^ src/lib/pcap.c:412:7: error: ‘DLT_EN10MB’ undeclared (first use in this function) case DLT_EN10MB: ^ src/lib/pcap.c:460:7: error: ‘DLT_PFLOG’ undeclared (first use in this function) case DLT_PFLOG: ^ src/lib/pcap.c: At top level: cc1: warning: unrecognized command line option "-Wno-date-time" [enabled by default] make: *** [build/objs/src/lib/pcap.lo] Error 1
Full backtrace from LLDB or GDB