Skip to content

Commit cc99870

Browse files
geky0xc0170
authored andcommitted
Refactored dns-query to match style of the rest of the nsapi
Internal API changes: dnsQuery -> nsapi_dns_query Additionally restructured query code to emit/parse network structures in stream form to hopefully document the underlying structure more explicitly.
1 parent 776e81b commit cc99870

File tree

6 files changed

+359
-261
lines changed

6 files changed

+359
-261
lines changed

features/net/network-socket/DnsQuery/DnsQuery.cpp

Lines changed: 0 additions & 216 deletions
This file was deleted.

features/net/network-socket/DnsQuery/DnsQuery.h

Lines changed: 0 additions & 41 deletions
This file was deleted.

features/net/network-socket/NetworkStack.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include "NetworkStack.h"
18-
#include "DnsQuery.h"
18+
#include "nsapi_dns.h"
1919
#include "mbed.h"
2020
#include "stddef.h"
2121
#include <new>
@@ -24,13 +24,13 @@
2424
// Default NetworkStack operations
2525
int NetworkStack::gethostbyname(SocketAddress *address, const char *name)
2626
{
27-
char buffer[NSAPI_IP_SIZE];
28-
int err = dnsQuery(this, name, buffer);
27+
nsapi_addr_t addr;
28+
int err = nsapi_dns_query(this, &addr, name);
2929
if (err) {
3030
return err;
3131
}
3232

33-
address->set_ip_address(buffer);
33+
address->set_addr(addr);
3434
return 0;
3535
}
3636

0 commit comments

Comments
 (0)