1
0
mirror of https://github.com/jedisct1/dnsblast.git synced 2024-10-05 18:30:54 +01:00
dnsblast/dns.h

34 lines
578 B
C
Raw Permalink Normal View History

2012-05-06 00:41:52 +01:00
#ifndef __DNS_H__
#define __DNS_H__
#include <sys/types.h>
#include <inttypes.h>
#define TYPE_A 1U
#define TYPE_SOA 6U
#define TYPE_MX 15U
#define TYPE_TXT 16U
#define TYPE_AAAA 28U
#define FLAGS_OPCODE_QUERY 0x0
#define FLAGS_RECURSION_DESIRED 0x100
#define CLASS_IN 1U
typedef struct {
uint16_t id;
uint16_t flags;
uint16_t qdcount;
uint16_t ancount;
uint16_t nscount;
uint16_t arcount;
} __attribute__((__packed__)) DNS_Header;
#define PUT_HTONS(dst, val) do { \
*dst++ = val >> 8; \
*dst++ = val & 0xff; \
} while (0)
#endif