dns-trace/src/common.h
2025-01-22 19:25:57 +01:00

50 lines
742 B
C

#ifndef H_COMMON
#define H_COMMON
#define QNAME_SIZE 128
#define REQ_QUERY 0x00
#define REQ_ANSWER 0x01
struct dnshdr {
uint16_t transactionID;
uint16_t flags;
uint16_t nbQuestions;
uint16_t nbAnswerRRs;
uint16_t nbAuthorityRRs;
uint16_t nbAdditionalRRs;
};
/*struct dns_query {
char *name;
uint16_t type;
uint16_t class;
};*/
struct event {
uint32_t client;
int dport;
int sport;
uint16_t tid;
int req_type;
char qname[QNAME_SIZE];
int class;
int type;
uint32_t ans;
};
struct query_section{
char qname[QNAME_SIZE];
int class;
int type;
};
struct dns_answer {
uint16_t tid;
char qname[QNAME_SIZE];
char ip[32];
int ttl;
};
#endif