Skip to content
Snippets Groups Projects
Commit 47397b09 authored by deuce's avatar deuce
Browse files

Create a union for all the different sockaddr_* types we may use.

parent 53458cff
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#include <netdb.h> /* gethostbyname */ #include <netdb.h> /* gethostbyname */
#include <sys/types.h> /* For u_int32_t on FreeBSD */ #include <sys/types.h> /* For u_int32_t on FreeBSD */
#include <netinet/in.h> /* IPPROTO_IP */ #include <netinet/in.h> /* IPPROTO_IP */
#include <sys/un.h>
/* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */ /* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */
#ifdef __DARWIN__ #ifdef __DARWIN__
#define _BSD_SOCKLEN_T_ int #define _BSD_SOCKLEN_T_ int
...@@ -86,6 +87,20 @@ typedef struct { ...@@ -86,6 +87,20 @@ typedef struct {
int value; int value;
} socket_option_t; } socket_option_t;
/*
* Fancy sockaddr_* union
*/
union xp_sockaddr {
struct sockaddr addr;
struct sockaddr_in in;
struct sockaddr_in6 in6;
#ifndef _WIN32
struct sockaddr_un un;
#endif
struct sockaddr_storage store;
};
/**********************************/ /**********************************/
/* Socket Implementation-specific */ /* Socket Implementation-specific */
/**********************************/ /**********************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment