Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mdns_priv.h Source File

mdns_priv.h

Go to the documentation of this file.
00001 /**
00002  * @file
00003  * MDNS responder private definitions
00004  */
00005 
00006  /*
00007  * Copyright (c) 2015 Verisure Innovation AB
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without modification,
00011  * are permitted provided that the following conditions are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright notice,
00014  *    this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright notice,
00016  *    this list of conditions and the following disclaimer in the documentation
00017  *    and/or other materials provided with the distribution.
00018  * 3. The name of the author may not be used to endorse or promote products
00019  *    derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00023  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
00024  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00026  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00029  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00030  * OF SUCH DAMAGE.
00031  *
00032  * This file is part of the lwIP TCP/IP stack.
00033  *
00034  * Author: Erik Ekman <erik@kryo.se>
00035  *
00036  */
00037 #ifndef LWIP_HDR_MDNS_PRIV_H
00038 #define LWIP_HDR_MDNS_PRIV_H
00039 
00040 #include "lwip/apps/mdns_opts.h"
00041 #include "lwip/pbuf.h"
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 #if LWIP_MDNS_RESPONDER
00048 
00049 /* Domain struct and methods - visible for unit tests */
00050 
00051 #define MDNS_DOMAIN_MAXLEN 256
00052 #define MDNS_READNAME_ERROR 0xFFFF
00053 
00054 struct mdns_domain {
00055   /* Encoded domain name */
00056   u8_t name[MDNS_DOMAIN_MAXLEN];
00057   /* Total length of domain name, including zero */
00058   u16_t length;
00059   /* Set if compression of this domain is not allowed */
00060   u8_t skip_compression;
00061 };
00062 
00063 err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len);
00064 u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain);
00065 int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b);
00066 u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain);
00067 
00068 #endif /* LWIP_MDNS_RESPONDER */
00069 
00070 #ifdef __cplusplus
00071 }
00072 #endif
00073 
00074 #endif /* LWIP_HDR_MDNS_PRIV_H */