21 #ifndef COSA_INET_DNS_HH 22 #define COSA_INET_DNS_HH 34 static const uint16_t
PORT = 53;
84 __attribute__((always_inline))
97 __attribute__((always_inline))
108 RESPONSE_FLAG = (1<<15),
109 QUERY_RESPONSE_MASK = (1<<15),
110 OPCODE_STANDARD_QUERY = (0),
111 OPCODE_INVERSE_QUERY = (1<<11),
112 OPCODE_STATUS_REQUEST = (2<<11),
113 OPCODE_MASK = (15<<11),
114 AUTHORITATIVE_FLAG = (1<<10),
115 TRUNCATION_FLAG = (1<<9),
116 RECURSION_DESIRED_FLAG = (1<<8),
117 RECURSION_AVAILABLE_FLAG = (1<<7),
119 RESP_FORMAT_ERROR = (1),
120 RESP_SERVER_FAILURE = (2),
121 RESP_NAME_ERROR = (3),
122 RESP_NOT_IMPLEMENTED = (4),
127 LABEL_COMPRESSION_MASK = (0xC0)
159 static const uint16_t TIMEOUT = 300;
160 static const uint8_t RETRY_MAX = 8;
161 static const uint16_t ID = 0xC05AU;
173 int gethostbyname(
const char* hostname, uint8_t ip[4],
bool progmem);
bool begin(Socket *sock, uint8_t server[4])
DNS(Socket *sock, uint8_t server[4])
const class prog_str * str_P
int gethostbyname_P(str_P hostname, uint8_t ip[4])
static const uint16_t PORT
int gethostbyname(const char *hostname, uint8_t ip[4])