ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
dns_wire.h File Reference

The DNS name on the wire (RFC 1035 sec 3.1, sec 4.1.4): labels in, dotted string out. More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  DnsWireMsgArgs
 The message a name is read out of, and where its dotted text lands (RFC 1035 sec 4.1). More...
 
struct  DnsWireTextArgs
 The dotted name to write, and where its label sequence lands (RFC 1035 sec 3.1). More...
 
struct  DnsWireCmpArgs
 The pair a case-insensitive compare judges (RFC 1035 sec 2.3.3). More...
 
struct  DnsWireVars
 
struct  DnsWireNs
 The entries. More...
 

Macros

#define PROTOCORE_DNS_LABEL_MAX   63u
 Longest label a name may carry, the six bits a length octet leaves (RFC 1035 sec 2.3.4).
 
#define PROTOCORE_DNS_PTR_HOPS   8u
 Pointers one name may follow before it is read as a loop (RFC 1035 sec 4.1.4).
 

Functions

void protocore_dns_wire_decode (uint8_t *work)
 
void protocore_dns_wire_encode (uint8_t *work)
 
void protocore_dns_wire_eq (uint8_t *work)
 

Variables

DnsWireVars DnsWireV
 The operands and the outcome.
 

Detailed Description

The DNS name on the wire (RFC 1035 sec 3.1, sec 4.1.4): labels in, dotted string out.

RFC 1035 sec 3.1: a domain name is a sequence of labels, each one a length octet followed by that many octets, ending in the null label of the root, which is a zero length octet. The high order two bits of a length octet are 00 for a label. RFC 1035 sec 4.1.4 gives 11 to a pointer, a two octet sequence whose remaining fourteen bits are the OFFSET of a prior occurrence of the same name in the message, and reserves 10 and 01.

Every DNS-shaped protocol carries that encoding, so it is written once here: the unicast server answering a query and the multicast responder advertising a service read and write names through this handle.

Names compare case-insensitively (RFC 1035 sec 2.3.3), which is a property of the encoding rather than of either caller, so the comparison sits here too.

Pure: no state, no allocation, no I/O.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file dns_wire.h.

Macro Definition Documentation

◆ PROTOCORE_DNS_LABEL_MAX

#define PROTOCORE_DNS_LABEL_MAX   63u

Longest label a name may carry, the six bits a length octet leaves (RFC 1035 sec 2.3.4).

Definition at line 35 of file dns_wire.h.

◆ PROTOCORE_DNS_PTR_HOPS

#define PROTOCORE_DNS_PTR_HOPS   8u

Pointers one name may follow before it is read as a loop (RFC 1035 sec 4.1.4).

Definition at line 38 of file dns_wire.h.

Function Documentation

◆ protocore_dns_wire_decode()

void protocore_dns_wire_decode ( uint8_t *  work)

◆ protocore_dns_wire_encode()

void protocore_dns_wire_encode ( uint8_t *  work)

◆ protocore_dns_wire_eq()

void protocore_dns_wire_eq ( uint8_t *  work)

Variable Documentation

◆ DnsWireV

DnsWireVars DnsWireV
extern

The operands and the outcome.