MDNS: make a few arguments const where suitable

This commit is contained in:
Dirk Ziegelmeier 2016-08-14 15:31:49 +02:00
parent 306113c8c3
commit a2894ede1c
3 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@ Author: Erik Ekman
Note! The MDNS responder does not have all features required by the standards.
See notes in src/core/mdns.c for what is left. It is however usable in normal
See notes in src/apps/mdns/mdns.c for what is left. It is however usable in normal
cases - but watch out if many devices on the same network try to use the same
host/service instance names.
@ -17,7 +17,7 @@ MDNS supports using IPv4 only, v6 only, or v4+v6.
To enable MDNS responder, set
LWIP_MDNS = 1
in lwipopts.h and add src/core/mdns.c to your list of files to build.
in lwipopts.h and add src/apps/mdns/mdns.c to your list of files to build.
The max number of services supported per netif is defined by MDNS_MAX_SERVICES,
default is 1.

View File

@ -1890,7 +1890,7 @@ mdns_resp_init(void)
* @return ERR_OK if netif was added, an err_t otherwise
*/
err_t
mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl)
mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl)
{
err_t res;
@ -1985,7 +1985,7 @@ mdns_resp_remove_netif(struct netif *netif)
* @return ERR_OK if the service was added to the netif, an err_t otherwise
*/
err_t
mdns_resp_add_service(struct netif *netif, char *name, char *service, u16_t proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_data)
mdns_resp_add_service(struct netif *netif, const char *name, const char *service, u16_t proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_data)
{
int i;
int slot = -1;
@ -2042,7 +2042,7 @@ mdns_resp_add_service(struct netif *netif, char *name, char *service, u16_t prot
* @return ERR_OK if the string was added to the reply, an err_t otherwise
*/
err_t
mdns_resp_add_service_txtitem(struct mdns_service *service, char *txt, int txt_len)
mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, int txt_len)
{
LWIP_ASSERT("mdns_resp_add_service: service != NULL", service);

View File

@ -47,12 +47,12 @@ struct mdns_service;
void mdns_resp_init(void);
err_t mdns_resp_add_netif(struct netif *netif, char *hostname, u32_t dns_ttl);
err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl);
err_t mdns_resp_remove_netif(struct netif *netif);
typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata);
err_t mdns_resp_add_service(struct netif *netif, char *name, char *service, u16_t proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
err_t mdns_resp_add_service_txtitem(struct mdns_service *service, char *txt, int txt_len);
err_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, u16_t proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);
err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, int txt_len);
/* Domain struct and methods - visible for unit tests */