23 void DNSClient::onReceive(uint16_t len)
35 DNSClient::DNSClient()
49 timer = DNS_TIMEOUT_QUERY;
54 uint8_t* b = queryPtr;
58 for (*label = 0; *name != 0; name++, b++)
88 *((uint32_t*)b) = 0x01000100;
100 void DNSClient::tick()
109 timer = DNS_TIMEOUT_QUERY;
117 bool DNSClient::sendPacket()
119 uint16_t dataChecksum = 0;
uint16_t release()
Releases one fragment of data
uint16_t write(uint16_t len, const byte *data)
In the case of TCP, writes the given data buffer to the socket.
static EthBuffer packet
in-memory packet buffer currently being processed.
nint16_t remotePort
remote TCP or UDP port
void tick()
This is a timer function that is called every NETWORK_TIMER_RESOLUTION milliseconds on every service...
bool send()
Sends the packet currently in the outgoing buffer
static uint16_t calc(uint16_t len, const uint8_t *data)
Calculates the checksum of the specified buffer in memory
byte udpData[566-sizeof(EthernetHeader)-sizeof(IPHeader)-sizeof(UDPHeader)]
represents an IP address in memory
SharedBuffer buffer
output buffer for this socket
void prepareUDPPacket(uint16_t dataLength, uint16_t dataChecksum)
Fills out the UDP header and calculates the datagram checksum
static IPAddress dnsIP
IP address of the DNS server to use.
bool isEmpty()
Determines whether this buffer is empty
uint16_t resolve(const char *name)
Resolves a host name to an IP address
static bool sendIPPacket(uint16_t length)
Puts the current in-memory packet in the network
IPAddress remoteIP
remote IP address to connect to (TCP) or send the next packet to (UDP)
uint16_t fillTxBuffer(uint16_t dstOffset, uint16_t &checksum, uint16_t count=0xFFFF)
Copies up to count fragments to the transmit buffer via DMA, concatenating them starting at given off...