Embedded TCP/IP stack: fnet_mdns.h Source File

FNET

fnet_mdns.h
1 /**************************************************************************
2 *
3 * Copyright 2016-2017 by Andrey Butok. FNET Community.
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * mDNS (Bonjour) Server/Responder API.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_MDNS_H_
26 
27 #define _FNET_MDNS_H_
28 
29 #if FNET_CFG_MDNS || defined(__DOXYGEN__)
30 
55 /**************************************************************************/
59 {
63  fnet_uint32_t rr_ttl;
65  const fnet_char_t *name;
66 };
67 
68 /**************************************************************************/
75 typedef struct fnet_mdns_txt_key
76 {
80 
81 /**************************************************************************/
86 typedef struct fnet_mdns_service
87 {
88  const char *service_type;
89  fnet_uint16_t service_port;
90  const fnet_mdns_txt_key_t *(*service_get_txt)(void);
95 
96 /**************************************************************************/
100 typedef void *fnet_mdns_desc_t;
101 
102 /**************************************************************************/
107 
108 #if defined(__cplusplus)
109 extern "C" {
110 #endif
111 
112 /***************************************************************************/
134 
135 /***************************************************************************/
151 void fnet_mdns_release(fnet_mdns_desc_t mdns_desc);
152 
153 /***************************************************************************/
174 
175 /***************************************************************************/
190 
191 /***************************************************************************/
211 fnet_mdns_service_desc_t fnet_mdns_service_get_by_type(fnet_mdns_desc_t mdns_desc, const char *service_type);
212 
213 /***************************************************************************/
232 void fnet_mdns_announce(fnet_mdns_desc_t mdns_desc);
233 
234 /***************************************************************************/
250 
251 /***************************************************************************/
270 
271 #if defined(__cplusplus)
272 }
273 #endif
274 
277 #endif /* FNET_CFG_MDNS */
278 
279 #endif /* _FNET_MDNS_H_ */
Initialization parameters for the fnet_mdns_init() function.
Definition: fnet_mdns.h:58
fnet_address_family_t addr_family
Address family (IPv6 or IPv4 or both) the server will listen for MDNS query (it is optional)...
Definition: fnet_mdns.h:61
fnet_mdns_desc_t fnet_mdns_get_by_netif(fnet_netif_desc_t netif)
Looks for a mDNS Server assigned to the specified network interface.
void fnet_mdns_announce(fnet_mdns_desc_t mdns_desc)
Sends unsolicited mDNS announcement.
struct fnet_mdns_service fnet_mdns_service_t
The mDNS Service structure defining application-specific service, advertised by the mDNS server...
fnet_uint16_t service_port
Service Port number (in network byte order).
Definition: fnet_mdns.h:89
fnet_mdns_service_desc_t fnet_mdns_service_register(fnet_mdns_desc_t mdns_desc, const fnet_mdns_service_t *service)
Registers application-specific service in the mDNS server.
fnet_netif_desc_t netif_desc
Network interface descriptor to be used by the mDNS server.
Definition: fnet_mdns.h:60
void fnet_mdns_release(fnet_mdns_desc_t mdns_desc)
Releases the Multicast DNS (mDNS) server/responder.
void fnet_mdns_service_unregister(fnet_mdns_service_desc_t service_desc)
Unregisters application service from the mDNS server.
const char * service_type
Service Type. Null-terminated string. Example "_http._tcp".
Definition: fnet_mdns.h:88
const fnet_char_t * key_name
TXT key name string (null-terminated).
Definition: fnet_mdns.h:77
const fnet_char_t * key_value
TXT key value string (null-terminated).
Definition: fnet_mdns.h:78
The mDNS Service structure defining application-specific service, advertised by the mDNS server...
Definition: fnet_mdns.h:86
void * fnet_mdns_desc_t
mDNS server descriptor.
Definition: fnet_mdns.h:100
fnet_bool_t
Boolean type.
Definition: fnet_stdlib.h:81
fnet_uint32_t rr_ttl
TTL value that indicates for how many seconds mDNS resource records is valid for mDNS querier...
Definition: fnet_mdns.h:63
TXT key.
Definition: fnet_mdns.h:75
fnet_mdns_service_desc_t fnet_mdns_service_get_by_type(fnet_mdns_desc_t mdns_desc, const char *service_type)
Looks for a registered mDNS application service according to the specified type.
const fnet_char_t * name
Name used as a host-name and service-names, advertised by the MDNS server.
Definition: fnet_mdns.h:65
fnet_bool_t fnet_mdns_is_enabled(fnet_mdns_desc_t desc)
Detects if the mDNS Server is enabled or disabled.
struct fnet_mdns_txt_key fnet_mdns_txt_key_t
TXT key.
char fnet_char_t
Type representing the charecter.
Definition: fnet_stdlib.h:76
fnet_mdns_desc_t fnet_mdns_init(struct fnet_mdns_params *params)
Initializes Multicast DNS (mDNS) server/responder.
void * fnet_mdns_service_desc_t
mDNS advertised-service descriptor.
Definition: fnet_mdns.h:106
void * fnet_netif_desc_t
Network interface descriptor.
Definition: fnet_netif.h:71
fnet_uint16_t fnet_address_family_t
Address family type.
Definition: fnet_socket.h:139

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net