Webserver+3d print
mdns_common.h File Reference
Functions common to mDNS client and mDNS responder. More...
Go to the source code of this file.
Data Structures | |
struct | MdnsMessage |
mDNS message More... | |
Functions | |
error_t | mdnsInit (NetInterface *interface) |
mDNS related initialization | |
void | mdnsProcessMessage (NetInterface *interface, const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, const NetBuffer *buffer, size_t offset, void *params) |
Process incoming mDNS message. | |
void | mdnsProcessResponse (NetInterface *interface, MdnsMessage *response) |
Process mDNS response message. | |
bool_t | mdnsCheckSourceAddr (NetInterface *interface, const IpPseudoHeader *pseudoHeader) |
Source address check. | |
error_t | mdnsCreateMessage (MdnsMessage *message, bool_t queryResponse) |
Create an empty mDNS message. | |
void | mdnsDeleteMessage (MdnsMessage *message) |
release a mDNS message | |
error_t | mdnsSendMessage (NetInterface *interface, const MdnsMessage *message, const IpAddr *destIpAddr, uint_t destPort) |
Send mDNS message. | |
size_t | mdnsEncodeName (const char_t *instance, const char_t *service, const char_t *domain, uint8_t *dest) |
Encode instance, service and domain names using the DNS name notation. | |
int_t | mdnsCompareName (const DnsHeader *message, size_t length, size_t pos, const char_t *instance, const char_t *service, const char_t *domain, uint_t level) |
Compare instance, service and domain names. | |
int_t | mdnsCompareRecord (const MdnsMessage *message1, size_t offset1, const DnsResourceRecord *record1, const MdnsMessage *message2, size_t offset2, const DnsResourceRecord *record2) |
Compare resource records. | |
bool_t | mdnsCheckDuplicateRecord (const MdnsMessage *message, const char_t *instance, const char_t *service, const char_t *domain, uint16_t rtype) |
Check for duplicate resource records. |
Detailed Description
Functions common to mDNS client and mDNS responder.
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 mdns_common.h.
Function Documentation
bool_t mdnsCheckDuplicateRecord | ( | const MdnsMessage * | message, |
const char_t * | instance, | ||
const char_t * | service, | ||
const char_t * | domain, | ||
uint16_t | rtype | ||
) |
Check for duplicate resource records.
- Parameters:
-
[in] message Pointer to the mDNS message [in] instance Instance name [in] service Service name [in] domain Domain name [in] rtype Resource record type
- Returns:
- The function returns TRUE is the specified resource record is a duplicate. Otherwise FALSE is returned
Definition at line 887 of file mdns_common.c.
bool_t mdnsCheckSourceAddr | ( | NetInterface * | interface, |
const IpPseudoHeader * | pseudoHeader | ||
) |
Source address check.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader UDP pseudo header
- Returns:
- TRUE if the source address is valid, else FALSE
Definition at line 270 of file mdns_common.c.
int_t mdnsCompareName | ( | const DnsHeader * | message, |
size_t | length, | ||
size_t | pos, | ||
const char_t * | instance, | ||
const char_t * | service, | ||
const char_t * | domain, | ||
uint_t | level | ||
) |
Compare instance, service and domain names.
- Parameters:
-
[in] message Pointer to the DNS message [in] length Length of the DNS message [in] pos Offset of the encoded name [in] instance Instance name [in] service Service name [in] domain 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 628 of file mdns_common.c.
int_t mdnsCompareRecord | ( | const MdnsMessage * | message1, |
size_t | offset1, | ||
const DnsResourceRecord * | record1, | ||
const MdnsMessage * | message2, | ||
size_t | offset2, | ||
const DnsResourceRecord * | record2 | ||
) |
Compare resource records.
- Parameters:
-
[in] message1 Pointer to the first mDNS message [in] offset1 Offset of the first but of the resource record [in] record1 Pointer the first resource record [in] message2 Pointer to the second mDNS message [in] offset2 Offset of the first but of the resource record [in] record2 Pointer the second resource record
- Returns:
- The function returns 0 if the resource records match, -1 if the first resource record lexicographically precedes the second one, or 1 if the second resource record lexicographically precedes the first one
Definition at line 781 of file mdns_common.c.
error_t mdnsCreateMessage | ( | MdnsMessage * | message, |
bool_t | queryResponse | ||
) |
Create an empty mDNS message.
- Parameters:
-
[in,out] message Newly created mDNS message [in] queryResponse This flag specifies whether the message is a query or a response
- Returns:
- Error code
Definition at line 352 of file mdns_common.c.
void mdnsDeleteMessage | ( | MdnsMessage * | message ) |
release a mDNS message
- Parameters:
-
[in] message mDNS message to be released
Definition at line 428 of file mdns_common.c.
size_t mdnsEncodeName | ( | const char_t * | instance, |
const char_t * | service, | ||
const char_t * | domain, | ||
uint8_t * | dest | ||
) |
Encode instance, service and domain names using the DNS name notation.
- Parameters:
-
[in] instance Instance name [in] service Service name [in] domain Domain name [out] dest Pointer to the encoded name (optional parameter)
- Returns:
- Length of the encoded domain name
Definition at line 538 of file mdns_common.c.
error_t mdnsInit | ( | NetInterface * | interface ) |
mDNS related initialization
- Parameters:
-
[in] interface Underlying network interface
- Returns:
- Error code
Definition at line 70 of file mdns_common.c.
void mdnsProcessMessage | ( | NetInterface * | interface, |
const IpPseudoHeader * | pseudoHeader, | ||
const UdpHeader * | udpHeader, | ||
const NetBuffer * | buffer, | ||
size_t | offset, | ||
void * | params | ||
) |
Process incoming mDNS message.
- Parameters:
-
[in] interface Underlying network interface [in] pseudoHeader UDP pseudo header [in] udpHeader UDP header [in] buffer Multi-part buffer containing the incoming mDNS message [in] offset Offset to the first byte of the mDNS message [in] params Callback function parameter (not used)
Definition at line 111 of file mdns_common.c.
void mdnsProcessResponse | ( | NetInterface * | interface, |
MdnsMessage * | response | ||
) |
Process mDNS response message.
- Parameters:
-
[in] interface Underlying network interface [in] response Incoming mDNS response message
Definition at line 176 of file mdns_common.c.
error_t mdnsSendMessage | ( | NetInterface * | interface, |
const MdnsMessage * | message, | ||
const IpAddr * | destIpAddr, | ||
uint_t | destPort | ||
) |
Send mDNS message.
- Parameters:
-
[in] interface Underlying network interface [in] message mDNS message to be sent [in] destIpAddr Destination IP address (optional parameter) [in] destPort Destination port
- Returns:
- Error code
Definition at line 452 of file mdns_common.c.
Generated on Tue Jul 12 2022 17:10:20 by
