Philip Gladstone 3a5e5f10e2 Take 2: Add regular sends to mdns. Check for (some) buffer overflows. Make it handle unicast
Merging as suggested by @TerryE (and squashing at the same time. Turns out that this feature is enabled for this repo).

* Squashed commit of the following:

commit f985f10d9d2ee035f5a6ee6245c60d9904d98cc1
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 27 21:52:46 2016 -0400

    Better mdns code

commit 6ee49ee106274bc63f6309047e57f7bc9828523e
Author: philip <philip@gladstonefamily.net>
Date:   Fri Mar 25 23:25:11 2016 -0400

    Update the docs

commit 7e455541c6f2531824cfb2419d051f1306935fdf
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 24 21:58:16 2016 -0400

    Add retries and buffer checking to mdns

    Get the length right

    Now it seems to work

* Might work for combined mode

* Fix crash

* Simplified various bits of code. Changed the LUA interface

Added checking (to some degree) incoming quyery types

Move the defaults to the right place

Added reference to the RFC`
2016-04-03 14:10:52 -04:00

50 lines
1.2 KiB
C

/*
* c_string.h
*
* Definitions for memory and string functions.
*/
#ifndef _C_STRING_H_
#define _C_STRING_H_
#include "c_stddef.h"
#include "osapi.h"
#ifndef NULL
#define NULL 0
#endif
#define c_memcmp os_memcmp
#define c_memcpy os_memcpy
#define c_memset os_memset
#define c_strcat os_strcat
#define c_strchr os_strchr
#define c_strcmp os_strcmp
#define c_strcpy os_strcpy
#define c_strlen os_strlen
#define c_strncmp os_strncmp
#define c_strncpy os_strncpy
// #define c_strstr os_strstr
#define c_strncasecmp c_strncmp
#define c_strstr strstr
#define c_strncat strncat
#define c_strcspn strcspn
#define c_strpbrk strpbrk
#define c_strcoll strcoll
#define c_strrchr strrchr
// const char *c_strstr(const char * __s1, const char * __s2);
// char *c_strncat(char * __restrict /*s1*/, const char * __restrict /*s2*/, size_t n);
// size_t c_strcspn(const char * s1, const char * s2);
// const char *c_strpbrk(const char * /*s1*/, const char * /*s2*/);
// int c_strcoll(const char * /*s1*/, const char * /*s2*/);
//
extern size_t c_strlcpy(char *dst, const char *src, size_t siz);
extern size_t c_strlcat(char *dst, const char *src, size_t siz);
extern char *c_strdup(const char *src);
#endif /* _C_STRING_H_ */