version 1.1.1.1.2.3, 2011/10/10 13:56:30
|
version 1.1.1.1.2.4, 2011/10/10 14:15:40
|
Line 84 PrepareL2(const char *psDev, int *bpflen)
|
Line 84 PrepareL2(const char *psDev, int *bpflen)
|
return -1; |
return -1; |
} |
} |
|
|
|
/* |
n = fcntl(h, F_GETFL); |
n = fcntl(h, F_GETFL); |
fcntl(h, F_SETFL, n | O_NONBLOCK); |
fcntl(h, F_SETFL, n | O_NONBLOCK); |
|
*/ |
|
|
VERB(3) LOG("Openned device handle %d with bpf buflen %d", h, *bpflen); |
VERB(3) LOG("Openned device handle %d with bpf buflen %d", h, *bpflen); |
return h; |
return h; |
Line 354 pktRecv(int s, u_int * __restrict crypted, u_char * __
|
Line 356 pktRecv(int s, u_int * __restrict crypted, u_char * __
|
if (data) { |
if (data) { |
memset(data, 0, *datlen); |
memset(data, 0, *datlen); |
*datlen = ntohs(hdr->ansh_len) - sizeof(struct ansh_hdr); |
*datlen = ntohs(hdr->ansh_len) - sizeof(struct ansh_hdr); |
memcpy(data, hdr + sizeof(struct ansh_hdr), *datlen); | memcpy(data, buf + bpf->bh_hdrlen + ETHER_HDR_LEN + sizeof(struct ansh_hdr), *datlen); |
} |
} |
|
|
ret = (char) hdr->ansh_flg; |
ret = (char) hdr->ansh_flg; |