Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
dns_common.h File Reference
Common DNS routines. More...
Go to the source code of this file.
Enumerations | |
enum | DnsOpcode |
DNS opcodes. More... | |
enum | DnsReturnCode |
DNS return codes. More... | |
enum | DnsResourceRecordClass { DNS_RR_CLASS_IN = 1, DNS_RR_CLASS_CH = 3, DNS_RR_CLASS_HS = 4, DNS_RR_CLASS_ANY = 255 } |
DNS resource record classes. More... | |
enum | DnsResourceRecordType { DNS_RR_TYPE_A = 1, DNS_RR_TYPE_NS = 2, DNS_RR_TYPE_CNAME = 5, DNS_RR_TYPE_SOA = 6, DNS_RR_TYPE_WKS = 11, DNS_RR_TYPE_PTR = 12, DNS_RR_TYPE_HINFO = 13, DNS_RR_TYPE_MINFO = 14, DNS_RR_TYPE_MX = 15, DNS_RR_TYPE_TXT = 16, DNS_RR_TYPE_AAAA = 28, DNS_RR_TYPE_NB = 32, DNS_RR_TYPE_SRV = 33, DNS_RR_TYPE_NAPTR = 35, DNS_RR_TYPE_NSEC = 47, DNS_RR_TYPE_EUI48 = 108, DNS_RR_TYPE_EUI64 = 109, DNS_RR_TYPE_AXFR = 252, DNS_RR_TYPE_ANY = 255, DNS_RR_TYPE_URI = 256 } |
DNS resource record types. More... | |
Functions | |
size_t | dnsEncodeName (const char_t *src, uint8_t *dest) |
Encode a domain name using the DNS name notation. | |
size_t | dnsParseName (const DnsHeader *message, size_t length, size_t pos, char_t *dest, uint_t level) |
Decode a domain name that uses the DNS name encoding. | |
int_t | dnsCompareName (const DnsHeader *message, size_t length, size_t pos, const char_t *name, uint_t level) |
Compare domain names. | |
int_t | dnsCompareEncodedName (const DnsHeader *message1, size_t length1, size_t pos1, const DnsHeader *message2, size_t length2, size_t pos2, uint_t level) |
Compare domain names encoded with DNS notation. |
Detailed Description
Common DNS routines.
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file dns_common.h.
Enumeration Type Documentation
enum DnsOpcode |
DNS opcodes.
Definition at line 72 of file dns_common.h.
DNS resource record classes.
- Enumerator:
DNS_RR_CLASS_IN Internet.
DNS_RR_CLASS_CH Chaos.
DNS_RR_CLASS_HS Hesiod.
DNS_RR_CLASS_ANY Any class.
Definition at line 101 of file dns_common.h.
DNS resource record types.
- Enumerator:
Definition at line 114 of file dns_common.h.
enum DnsReturnCode |
DNS return codes.
Definition at line 86 of file dns_common.h.
Function Documentation
int_t dnsCompareEncodedName | ( | const DnsHeader * | message1, |
size_t | length1, | ||
size_t | pos1, | ||
const DnsHeader * | message2, | ||
size_t | length2, | ||
size_t | pos2, | ||
uint_t | level | ||
) |
Compare domain names encoded with DNS notation.
- Parameters:
-
[in] message1 Pointer to the first DNS message [in] length1 Length of the first DNS message [in] pos1 Offset of the encoded domain name within the first message [in] message2 Pointer to the second DNS message [in] length2 Length of the second DNS message [in] pos2 Offset of the encoded domain name within the second message [in] level Current level of recursion
- Returns:
- The function returns 0 if the domain names match, -1 if the first domain name lexicographically precedes the second name, or 1 if the second domain name lexicographically precedes the first name
Definition at line 337 of file dns_common.c.
int_t dnsCompareName | ( | const DnsHeader * | message, |
size_t | length, | ||
size_t | pos, | ||
const char_t * | name, | ||
uint_t | level | ||
) |
Compare domain names.
- Parameters:
-
[in] message Pointer to the DNS message [in] length Length of the DNS message [in] pos Offset of the encoded domain name [in] name NULL-terminated string that holds a domain name [in] level Current level of recursion
- Returns:
- The function returns 0 if the domain names match, -1 if the first domain name lexicographically precedes the second name, or 1 if the second domain name lexicographically precedes the first name
Definition at line 238 of file dns_common.c.
size_t dnsEncodeName | ( | const char_t * | src, |
uint8_t * | dest | ||
) |
Encode a domain name using the DNS name notation.
- Parameters:
-
[in] src Pointer to the domain name to encode [out] dest Pointer to the encoded domain name (optional parameter)
- Returns:
- Length of the encoded domain name
Definition at line 54 of file dns_common.c.
size_t dnsParseName | ( | const DnsHeader * | message, |
size_t | length, | ||
size_t | pos, | ||
char_t * | dest, | ||
uint_t | level | ||
) |
Decode a domain name that uses the DNS name encoding.
- Parameters:
-
[in] message Pointer to the DNS message [in] length Length of the DNS message [in] pos Offset of the name to decode [out] dest Pointer to the decoded name (optional) [in] level Current level of recursion
- Returns:
- The position of the resource record that immediately follows the domain name
Definition at line 128 of file dns_common.c.
Generated on Tue Jul 12 2022 17:10:19 by
