s/dmg/dns/g

PUBLISHED_FROM=96dc8b0b4001f2206749a401c615f043fc5f6131
This commit is contained in:
Deomid Ryabkov authored and Marko Mikulicic committed 2015-10-21 15:17:11 +02:00
1 parent dcd4e660a3
commit 1eaabdd8e5
5 files changed
+109 -109

No files matched your search

@@ -61,7 +61,7 @@ static uint8_t board_ip[] = {192, 168, 10, 177};
#ifdef WIFI_CC3000
static uint8_t subnet_mask[] = {255, 255, 255, 0};
static uint8_t gateway[] = {192, 168, 10, 254};
static uint8_t dmg_ip[] = {192, 168, 10, 254};
static uint8_t dns_ip[] = {192, 168, 10, 254};
static const char *wlan_ssid = "mynetwork";
static const char *wlan_pwd = "mypassword";
@@ -117,7 +117,7 @@ void setup()
avr_netinit(board_mac, board_ip);
#elif defined(WIFI_CC3000)
if (avr_netinit(wlan_ssid, wlan_pwd, wlan_security, IP2U32(board_ip),
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dmg_ip)) != 0) {
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dns_ip)) != 0) {
Serial.println("Initialization error, check network settings");
return;
};
@@ -59,7 +59,7 @@ static uint8_t board_ip[] = {192, 168, 10, 8};
#ifdef WIFI_CC3000
static uint8_t subnet_mask[] = {255, 255, 255, 0};
static uint8_t gateway[] = {192, 168, 10, 254};
static uint8_t dmg_ip[] = {192, 168, 10, 254};
static uint8_t dns_ip[] = {192, 168, 10, 254};
static const char *wlan_ssid = "mynetwork";
static const char *wlan_pwd = "mypassword";
@@ -116,7 +116,7 @@ void setup() {
avr_netinit(board_mac, board_ip);
#elif defined(WIFI_CC3000)
if (avr_netinit(wlan_ssid, wlan_pwd, wlan_security, IP2U32(board_ip),
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dmg_ip)) != 0) {
IP2U32(subnet_mask), IP2U32(gateway), IP2U32(dns_ip)) != 0) {
Serial.println("Initialization error, check network settings");
return;
};
@@ -17,20 +17,20 @@ static in_addr_t s_our_ip_addr;
static const char *s_listening_addr = "udp://:5533";
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
struct mg_dmg_message *msg;
struct mg_dmg_resource_record *rr;
struct mg_dmg_reply reply;
struct mg_dns_message *msg;
struct mg_dns_resource_record *rr;
struct mg_dns_reply reply;
int i;
switch (ev) {
case MG_DNS_MESSAGE:
msg = (struct mg_dmg_message *) ev_data;
reply = mg_dmg_create_reply(&nc->send_mbuf, msg);
msg = (struct mg_dns_message *) ev_data;
reply = mg_dns_create_reply(&nc->send_mbuf, msg);
for (i = 0; i < msg->num_questions; i++) {
rr = &msg->questions[i];
if (rr->rtype == MG_DNS_A_RECORD) {
mg_dmg_reply_record(&reply, rr, NULL, rr->rtype, 3600,
mg_dns_reply_record(&reply, rr, NULL, rr->rtype, 3600,
&s_our_ip_addr, 4);
}
}
@@ -42,7 +42,7 @@ static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
* See http://goo.gl/QWvufr for a distinction between NXDOMAIN and NODATA.
*/
mg_dmg_send_reply(nc, &reply);
mg_dns_send_reply(nc, &reply);
break;
}
}