Lines Matching defs:packet
37 #include <netpacket/packet.h>
359 static int packet_parse(const ArpPacket *packet, size_t packet_len, ArpPacketInfo *info) {
362 assert(packet);
363 p = (uint8_t *)packet->ether_payload;
459 /* Linux 'packet socket' specific implementation */
506 static int send_packet(int fd, int iface, ArpPacket *packet, size_t packet_len) {
510 assert(packet);
520 if (sendto(fd, packet->ether_payload, packet_len, 0, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
528 static int recv_packet(int fd, ArpPacket **packet, size_t *packet_len) {
535 assert(packet);
538 *packet = NULL;
548 *packet = packet_new(s);
551 if ((r = recvfrom(fd, (*packet)->ether_payload, s, 0, (struct sockaddr*) &sa, &sa_len)) < 0) {
561 if (*packet) {
562 avahi_free(*packet);
563 *packet = NULL;
741 * We trick avahi into allocating sizeof(packet) + sizeof(ether_header),
745 send_packet(int fd __unused, int iface __unused, ArpPacket *packet,
751 assert(packet != NULL);
753 eh = (struct ether_header *)packet->ether_header;
762 recv_packet(int fd __unused, ArpPacket **packet, size_t *packet_len)
771 assert(packet != NULL);
774 *packet = NULL;
782 *packet = ap;
787 * err == 1: Just drop bogus packets (>1500 for an arp packet!?)
1209 /* Send announcement packet */
1243 daemon_log(LOG_WARNING, "Failed to parse incoming ARP packet.");
1250 daemon_log(LOG_INFO, "Received conflicting normal ARP packet.");
1256 daemon_log(LOG_INFO, "Received conflicting probe ARP packet.");
1282 DEBUG(daemon_log(LOG_DEBUG, "Ignoring irrelevant ARP packet."));
1315 /* Send announcement packet */