mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-10 18:49:18 +02:00
query is now an enum for compile-time checks
This commit is contained in:
parent
1a46808b8a
commit
ef43ef6293
|
@ -201,7 +201,7 @@ dns_send_version(int dns_fd, int version)
|
|||
}
|
||||
|
||||
int
|
||||
dns_encode(char *buf, size_t buflen, struct query *q, int qr, char *data, size_t datalen)
|
||||
dns_encode(char *buf, size_t buflen, struct query *q, qr_t qr, char *data, size_t datalen)
|
||||
{
|
||||
HEADER *header;
|
||||
short name;
|
||||
|
@ -273,7 +273,7 @@ dns_encode(char *buf, size_t buflen, struct query *q, int qr, char *data, size_t
|
|||
}
|
||||
|
||||
int
|
||||
dns_decode(char *buf, size_t buflen, struct query *q, int qr, char *packet, size_t packetlen)
|
||||
dns_decode(char *buf, size_t buflen, struct query *q, qr_t qr, char *packet, size_t packetlen)
|
||||
{
|
||||
char rdata[4*1024];
|
||||
HEADER *header;
|
||||
|
|
12
src/dns.h
12
src/dns.h
|
@ -17,6 +17,11 @@
|
|||
#ifndef _DNS_H_
|
||||
#define _DNS_H_
|
||||
|
||||
typedef enum {
|
||||
QR_QUERY = 0,
|
||||
QR_ANSWER = 1
|
||||
} qr_t;
|
||||
|
||||
int open_dns(int, in_addr_t);
|
||||
int dns_settarget(const char*);
|
||||
void dns_set_topdomain(const char*);
|
||||
|
@ -29,8 +34,8 @@ void dns_send_version(int, int);
|
|||
void dns_login(int, char *, int);
|
||||
int dns_read(int, char *, int);
|
||||
int dns_encode_hostname(const char *, char *, int);
|
||||
int dns_encode(char *, size_t, struct query *, int, char *, size_t);
|
||||
int dns_decode(char *, size_t, struct query *, int, char *, size_t);
|
||||
int dns_encode(char *, size_t, struct query *, qr_t, char *, size_t);
|
||||
int dns_decode(char *, size_t, struct query *, qr_t, char *, size_t);
|
||||
|
||||
extern struct sockaddr_in peer;
|
||||
|
||||
|
@ -44,7 +49,4 @@ void dnsd_queuepacket(const char *, const int);
|
|||
|
||||
int dns_parse_reply(char *, int, char *, int);
|
||||
|
||||
#define QR_QUERY 0
|
||||
#define QR_ANSWER 1
|
||||
|
||||
#endif /* _DNS_H_ */
|
||||
|
|
Loading…
Reference in New Issue