#endif
#ifndef BIOCIMMEDIATE
-#define BIOCIMMEDIATE (2147762800)
+# define BIOCIMMEDIATE (2147762800)
#endif
/*
/*
* The number of bytes in an ethernet (MAC) address.
*/
-#define ETHER_ADDR_LEN 6
+#define ETHER_ADDR_LEN 6
/*
* Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
#define AUTH_HDR_LEN 20
+# ifdef HAVE_LIBPCAP
typedef enum {
PCAP_INVALID = 0,
PCAP_INTERFACE_IN,
int fr_pcap_open(fr_pcap_t *handle);
int fr_pcap_apply_filter(fr_pcap_t *handle, char const *expression);
char *fr_pcap_device_names(TALLOC_CTX *ctx, fr_pcap_t *handle, char c);
-ssize_t fr_pcap_link_layer_offset(uint8_t const *data, size_t len, int link_type);
+# endif
+
+ssize_t fr_link_layer_offset(uint8_t const *data, size_t len, int link_type);
uint16_t fr_udp_checksum(uint8_t const *data, uint16_t len, uint16_t checksum,
struct in_addr const src_addr, struct in_addr const dst_addr);
#endif
-
return buff;
}
+#endif /* HAVE_LIBPCAP */
/** Returns the length of the link layer header
*
* @param link_type value returned from pcap_linktype.
* @return the length of the header, or -1 on error.
*/
-ssize_t fr_pcap_link_layer_offset(uint8_t const *data, size_t len, int link_type)
+ssize_t fr_link_layer_offset(uint8_t const *data, size_t len, int link_type)
{
uint8_t const *p = data;
return ((uint16_t) ~sum);
}
-#endif
rs_time_print(timestr, sizeof(timestr), &header->ts);
}
- len = fr_pcap_link_layer_offset(data, header->caplen, event->in->link_type);
+ len = fr_link_layer_offset(data, header->caplen, event->in->link_type);
if (len < 0) {
REDEBUG("Failed determining link layer header offset");
return;