Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mdns_client.h Source File

mdns_client.h

Go to the documentation of this file.
00001 /**
00002  * @file mdns_client.h
00003  * @brief mDNS client (Multicast DNS)
00004  *
00005  * @section License
00006  *
00007  * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
00008  *
00009  * This file is part of CycloneTCP Open.
00010  *
00011  * This program is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU General Public License
00013  * as published by the Free Software Foundation; either version 2
00014  * of the License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024  *
00025  * @author Oryx Embedded SARL (www.oryx-embedded.com)
00026  * @version 1.7.6
00027  **/
00028 
00029 #ifndef _MDNS_CLIENT_H
00030 #define _MDNS_CLIENT_H
00031 
00032 //Dependencies
00033 #include "core/net.h"
00034 #include "core/socket.h"
00035 #include "core/udp.h"
00036 #include "dns/dns_cache.h"
00037 #include "dns/dns_common.h"
00038 
00039 //mDNS client support
00040 #ifndef MDNS_CLIENT_SUPPORT
00041    #define MDNS_CLIENT_SUPPORT DISABLED
00042 #elif (MDNS_CLIENT_SUPPORT != ENABLED && MDNS_CLIENT_SUPPORT != DISABLED)
00043    #error MDNS_CLIENT_SUPPORT parameter is not valid
00044 #endif
00045 
00046 //Maximum number of retransmissions of mDNS queries
00047 #ifndef MDNS_CLIENT_MAX_RETRIES
00048    #define MDNS_CLIENT_MAX_RETRIES 3
00049 #elif (MDNS_CLIENT_MAX_RETRIES < 1)
00050    #error MDNS_CLIENT_MAX_RETRIES parameter is not valid
00051 #endif
00052 
00053 //Initial retransmission timeout
00054 #ifndef MDNS_CLIENT_INIT_TIMEOUT
00055    #define MDNS_CLIENT_INIT_TIMEOUT 1000
00056 #elif (MDNS_CLIENT_INIT_TIMEOUT < 1000)
00057    #error MDNS_CLIENT_INIT_TIMEOUT parameter is not valid
00058 #endif
00059 
00060 //Maximum retransmission timeout
00061 #ifndef MDNS_CLIENT_MAX_TIMEOUT
00062    #define MDNS_CLIENT_MAX_TIMEOUT 1000
00063 #elif (MDNS_CLIENT_MAX_TIMEOUT < 1000)
00064    #error MDNS_CLIENT_MAX_TIMEOUT parameter is not valid
00065 #endif
00066 
00067 //Maximum cache lifetime for mDNS entries
00068 #ifndef MDNS_MAX_LIFETIME
00069    #define MDNS_MAX_LIFETIME 60000
00070 #elif (MDNS_MAX_LIFETIME < 1000)
00071    #error MDNS_MAX_LIFETIME parameter is not valid
00072 #endif
00073 
00074 //mDNS related functions
00075 error_t mdnsClientResolve(NetInterface *interface,
00076    const char_t *name, HostType type, IpAddr *ipAddr);
00077 
00078 error_t mdnsClientSendQuery(DnsCacheEntry *entry);
00079 
00080 void mdnsClientParseAnRecord(NetInterface *interface,
00081    const MdnsMessage *message, size_t offset, const DnsResourceRecord *record);
00082 
00083 #endif
00084