mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-04-08 17:56:50 +02:00
add sockaddr storage struct from libevent by Niels Provos and Nick Mathewson
This commit is contained in:
parent
4a6a522e33
commit
b41e0a03c2
@ -29,12 +29,26 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
/* TCP options (nagle algorithm disable) */
|
/* TCP options (nagle algorithm disable) */
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
|
#ifndef PSP
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#else
|
||||||
#ifndef HAVE_GETADDRINFO
|
#ifndef HAVE_GETADDRINFO
|
||||||
#include "getaddrinfo.h"
|
#include "getaddrinfo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Replacement for sockaddr storage that we can use internally on platforms
|
||||||
|
* that lack it. It is not space-efficient, but neither is sockaddr_storage.
|
||||||
|
*/
|
||||||
|
struct sockaddr_storage {
|
||||||
|
union {
|
||||||
|
struct sockaddr ss_sa;
|
||||||
|
struct sockaddr_in ss_sin;
|
||||||
|
struct sockaddr_in6 ss_sin6;
|
||||||
|
char ss_padding[128];
|
||||||
|
} ss_union;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SO_REUSEPORT
|
#ifndef SO_REUSEPORT
|
||||||
#define SO_REUSEPORT SO_REUSEADDR
|
#define SO_REUSEPORT SO_REUSEADDR
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user