Home | History | Annotate | Download | only in l2_packet

Lines Matching full:eth

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