Webserver+3d print
dns_common.c File Reference
Common DNS routines. More...
Go to the source code of this file.
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.c.
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
