|
iPXE
|
DNS protocol. More...
Go to the source code of this file.
Data Structures | |
| struct | dns_name |
| An RFC1035-encoded DNS name. More... | |
| struct | dns_header |
| A DNS packet header. More... | |
| struct | dns_question |
| A DNS question. More... | |
| struct | dns_rr_common |
| A DNS resource record. More... | |
| struct | dns_rr_a |
| A DNS "A" record. More... | |
| struct | dns_rr_aaaa |
| A DNS "AAAA" record. More... | |
| struct | dns_rr_cname |
| A DNS "CNAME" record. More... | |
| union | dns_rr |
| A DNS resource record. More... | |
Macros | |
| #define | DNS_PORT 53 |
| DNS server port. | |
| #define | DNS_IS_COMPRESSED(byte) |
| Test for a DNS compression pointer. | |
| #define | DNS_COMPRESSED_OFFSET(word) |
| Extract DNS compression pointer. | |
| #define | DNS_LABEL_LEN(byte) |
| Extract DNS label length. | |
| #define | DNS_MAX_LABEL_LEN 0x3f |
| Maximum length of a single DNS label. | |
| #define | DNS_MAX_NAME_LEN 255 |
| Maximum length of a DNS name (mandated by RFC1035 section 2.3.4) | |
| #define | DNS_MAX_CNAME_RECURSION 32 |
| Maximum depth of CNAME recursion. | |
| #define | DNS_FLAG_RD 0x0100 |
| Recursion desired flag. | |
| #define | DNS_CLASS_IN 1 |
| DNS class "IN". | |
| #define | DNS_TYPE_A 1 |
| Type of a DNS "A" record. | |
| #define | DNS_TYPE_AAAA 28 |
| Type of a DNS "AAAA" record. | |
| #define | DNS_TYPE_CNAME 5 |
| Type of a DNS "NAME" record. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | dns_encode (const char *string, struct dns_name *name) |
| Encode a DNS name using RFC1035 encoding. | |
| int | dns_decode (struct dns_name *name, char *data, size_t len) |
| Decode RFC1035-encoded DNS name. | |
| int | dns_compare (struct dns_name *first, struct dns_name *second) |
| Compare DNS names for equality. | |
| int | dns_copy (struct dns_name *src, struct dns_name *dst) |
| Copy a DNS name. | |
| int | dns_skip (struct dns_name *name) |
| Skip RFC1035-encoded DNS name. | |
DNS protocol.
Definition in file dns.h.
| #define DNS_PORT 53 |
| #define DNS_IS_COMPRESSED | ( | byte | ) |
Test for a DNS compression pointer.
| byte | Initial byte |
| is_compressed | Is a compression pointer |
Definition at line 35 of file dns.h.
Referenced by dns_label().
| #define DNS_COMPRESSED_OFFSET | ( | word | ) |
Extract DNS compression pointer.
| word | Initial word |
| offset | Offset |
Definition at line 43 of file dns.h.
Referenced by dns_label().
| #define DNS_LABEL_LEN | ( | byte | ) |
| #define DNS_MAX_LABEL_LEN 0x3f |
Maximum length of a single DNS label.
Definition at line 54 of file dns.h.
Referenced by dns_encode().
| #define DNS_MAX_NAME_LEN 255 |
| #define DNS_MAX_CNAME_RECURSION 32 |
Maximum depth of CNAME recursion.
This is a policy decision.
Definition at line 63 of file dns.h.
Referenced by dns_xfer_deliver().
| #define DNS_FLAG_RD 0x0100 |
| #define DNS_CLASS_IN 1 |
| #define DNS_TYPE_A 1 |
Type of a DNS "A" record.
Definition at line 108 of file dns.h.
Referenced by dns_resolv(), dns_type(), and dns_xfer_deliver().
| #define DNS_TYPE_AAAA 28 |
Type of a DNS "AAAA" record.
Definition at line 119 of file dns.h.
Referenced by dns_resolv(), and dns_type().
| #define DNS_TYPE_CNAME 5 |
Type of a DNS "NAME" record.
Definition at line 130 of file dns.h.
Referenced by dns_type(), and dns_xfer_deliver().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Encode a DNS name using RFC1035 encoding.
| string | DNS name as a string |
| name | DNS name to fill in |
| len | Length of DNS name, or negative error |
Definition at line 101 of file dns.c.
References DNS_MAX_LABEL_LEN, EINVAL, end, len, name, and start.
Referenced by apply_dns_search(), dns_encode_fail_okx(), dns_encode_okx(), and dns_resolv().
Decode RFC1035-encoded DNS name.
| name | DNS name |
| data | Output buffer |
| len | Length of output buffer |
| len | Length of decoded DNS name, or negative error |
Definition at line 217 of file dns.c.
References data, dns_label(), EINVAL, len, memcpy(), name, and offset.
Referenced by dns_decode_fail_okx(), dns_decode_okx(), dns_list_okx(), dns_name(), dns_progress(), and format_dnssl_setting().
Compare DNS names for equality.
| first | First DNS name |
| second | Second DNS name |
| rc | Return status code |
Definition at line 268 of file dns.c.
References dns_name::data, dns_label(), EINVAL, ENOENT, first, len, dns_name::offset, and tolower().
Referenced by dns_compare_fail_okx(), dns_compare_okx(), and dns_xfer_deliver().
Copy a DNS name.
| src | Source DNS name |
| dst | Destination DNS name |
| len | Length of copied DNS name, or negative error |
Definition at line 322 of file dns.c.
References dns_name::data, dns_label(), EINVAL, dns_name::len, len, memcpy(), dns_name::offset, and src.
Referenced by dns_copy_fail_okx(), dns_copy_okx(), dns_question(), and dns_xfer_deliver().
|
extern |
Skip RFC1035-encoded DNS name.
| name | DNS name |
| offset | Offset to next name, or negative error |
Definition at line 365 of file dns.c.
References dns_label(), EINVAL, name, and offset.
Referenced by dns_list_okx(), dns_skip_search(), and dns_xfer_deliver().