}
void
-dns_handle_packet(struct interface *iface, uint8_t *buffer, int len, int unicast)
+dns_handle_packet(struct interface *iface, struct sockaddr *s, uint16_t port, uint8_t *buffer, int len)
{
struct dns_header *h;
uint8_t *b = buffer;
#define _DNS_H__
#include <stdint.h>
+#include <arpa/inet.h>
#define FLAG_RESPONSE 0x8000
#define FLAG_AUTHORATIVE 0x0400
void dns_add_answer(int type, const uint8_t *rdata, uint16_t rdlength, int ttl);
void dns_send_answer(struct interface *iface, const char *answer);
const char* dns_type_string(uint16_t type);
-void dns_handle_packet(struct interface *iface, uint8_t *buf, int len, int unicast);
+void dns_handle_packet(struct interface *iface, struct sockaddr *s, uint16_t port, uint8_t *buf, int len);
#endif
if (inp->ipi_ifindex != iface->ifindex)
fprintf(stderr, "invalid iface index %d != %d\n", ifindex, iface->ifindex);
else
- dns_handle_packet(iface, buffer, len, 0);
+ dns_handle_packet(iface, (struct sockaddr *) &from, from.sin_port, buffer, len);
}
static void
if (inp->ipi6_ifindex != iface->ifindex)
fprintf(stderr, "invalid iface index %d != %d\n", ifindex, iface->ifindex);
else
- dns_handle_packet(iface, buffer, len, 0);
+ dns_handle_packet(iface, (struct sockaddr *) &from, from.sin6_port, buffer, len);
}
static int