Lines Matching refs:eth
31 eth_t *eth; member
55 l2->eth = eth_open(l2->ifname); in l2_packet_init_libdnet()
56 if (!l2->eth) { in l2_packet_init_libdnet()
63 if (eth_get(l2->eth, &own_addr) < 0) { in l2_packet_init_libdnet()
67 eth_close(l2->eth); in l2_packet_init_libdnet()
68 l2->eth = NULL; in l2_packet_init_libdnet()
82 struct l2_ethhdr *eth; in l2_packet_send() local
91 ret = eth_send(l2->eth, buf, len); in l2_packet_send()
94 size_t mlen = sizeof(*eth) + len; in l2_packet_send()
95 eth = os_malloc(mlen); in l2_packet_send()
96 if (eth == NULL) in l2_packet_send()
99 os_memcpy(eth->h_dest, dst_addr, ETH_ALEN); in l2_packet_send()
100 os_memcpy(eth->h_source, l2->own_addr, ETH_ALEN); in l2_packet_send()
101 eth->h_proto = htons(proto); in l2_packet_send()
102 os_memcpy(eth + 1, buf, len); in l2_packet_send()
105 ret = pcap_sendpacket(l2->pcap, (u8 *) eth, mlen); in l2_packet_send()
107 ret = eth_send(l2->eth, (u8 *) eth, mlen); in l2_packet_send()
110 os_free(eth); in l2_packet_send()
305 eth_close(l2->eth); in l2_packet_init()
335 if (l2->eth) in l2_packet_deinit()
336 eth_close(l2->eth); in l2_packet_deinit()