Lines Matching defs:sll
101 #include "pcap/sll.h"
1219 linux_check_direction(const pcap_t *handle, const struct sockaddr_ll *sll)
1223 if (sll->sll_pkttype == PACKET_OUTGOING) {
1230 if (sll->sll_ifindex == handlep->lo_ifindex)
1248 if (sll->sll_hatype == ARPHRD_CAN &&
3836 struct sockaddr_ll *sll;
3874 /* if required build in place the sll header*/
3875 sll = (void *)(frame + TPACKET_ALIGN(handlep->tp_hdrlen));
3882 * space for an sll header; back up the packet
3894 * the sll header.
3900 "cooked-mode frame doesn't have room for sll header");
3905 * OK, that worked; construct the sll header.
3908 hdrp->sll2_protocol = sll->sll_protocol;
3910 hdrp->sll2_if_index = htonl(sll->sll_ifindex);
3911 hdrp->sll2_hatype = htons(sll->sll_hatype);
3912 hdrp->sll2_pkttype = sll->sll_pkttype;
3913 hdrp->sll2_halen = sll->sll_halen;
3914 memcpy(hdrp->sll2_addr, sll->sll_addr, SLL_ADDRLEN);
3922 * space for an sll header; back up the packet
3934 * the sll header.
3940 "cooked-mode frame doesn't have room for sll header");
3945 * OK, that worked; construct the sll header.
3948 hdrp->sll_pkttype = htons(sll->sll_pkttype);
3949 hdrp->sll_hatype = htons(sll->sll_hatype);
3950 hdrp->sll_halen = htons(sll->sll_halen);
3951 memcpy(hdrp->sll_addr, sll->sll_addr, SLL_ADDRLEN);
3952 hdrp->sll_protocol = sll->sll_protocol;
3959 * sll->sll_hatype is ARPHRD_CAN, then, as we're
3965 if (sll->sll_hatype == ARPHRD_CAN) {
3967 uint16_t protocol = ntohs(sll->sll_protocol);
3970 * Check the protocol field from the sll header.
4151 if (!linux_check_direction(handle, sll))
4160 /* if required build in place the sll header*/
4727 struct sockaddr_ll sll;
4731 memset(&sll, 0, sizeof(sll));
4732 sll.sll_family = AF_PACKET;
4733 sll.sll_ifindex = ifindex < 0 ? 0 : ifindex;
4734 sll.sll_protocol = protocol;
4736 if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) == -1) {