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