diff options
author | miau <miaukatzemiau@priveasy.de> | 2011-12-05 20:46:56 (GMT) |
---|---|---|
committer | miau <miaukatzemiau@priveasy.de> | 2011-12-05 20:46:56 (GMT) |
commit | dcce1a8d1335e89dcf9d64bb2202e34d8f58f3cd (patch) | |
tree | 12d31d3fd80edb05be8c0b19883266bd4173a382 /common.h | |
parent | 7563a58379c27532fe7c086881d8b6c562d28ac1 (diff) |
remove OpenWRT-specific Makefile; move src/ to /
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/common.h b/common.h new file mode 100644 index 0000000..5ce3c61 --- /dev/null +++ b/common.h @@ -0,0 +1,28 @@ +#ifndef UDP_BROADCAST_COMMON +#define UDP_BROADCAST_COMMON + +#include <arpa/inet.h> +#include <errno.h> +#include <netinet/in.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/types.h> + +/* the port users will be connecting to */ +#define SERVERPORT 4950 +#define SERVERPORT_S "4950" + +/* RFC 2460 requires IPv6 link MTU >= 1280, IPv6 UDP headers sum up to + 48 byte, the rest is for us. One extra byte is for the final \0 + (not transmitted) */ +#define MAXBUFLEN 1233 + +#define ENP(Cmd, Msg) \ + if ((Cmd) == -1) { \ + perror(Msg); \ + exit(1); \ + } + +#endif // UDP_BROADCAST_COMMON |