int
if_openrawsocket(struct interface *ifp, uint16_t protocol)
{
- struct dhcp_state *state;
+ struct ipv4_state *state;
int fd = -1;
struct ifreq ifr;
int ibuf_len = 0;
if (fd == -1)
return -1;
- state = D_STATE(ifp);
-
+ state = IPV4_STATE(ifp);
memset(&pv, 0, sizeof(pv));
if (ioctl(fd, BIOCVERSION, &pv) == -1)
goto eexit;
struct bpf_hdr packet;
ssize_t bytes;
const unsigned char *payload;
- struct dhcp_state *state;
+ struct ipv4_state *state;
- state = D_STATE(ifp);
+ state = IPV4_STATE(ifp);
fd = ipv4_protocol_fd(ifp, protocol);
*flags = 0;
struct ipv4_state {
struct ipv4_addrhead addrs;
struct rt_head routes;
+
+#ifdef BSD
+ /* Buffer for BPF */
+ size_t buffer_size, buffer_len, buffer_pos;
+ unsigned char *buffer;
+#endif
};
#define IPV4_STATE(ifp) \