Commit 47397b09 authored by deuce's avatar deuce
Browse files

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

parent 53458cff
......@@ -59,6 +59,7 @@
#include <netdb.h> /* gethostbyname */
#include <sys/types.h> /* For u_int32_t on FreeBSD */
#include <netinet/in.h> /* IPPROTO_IP */
#include <sys/un.h>
/* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */
#ifdef __DARWIN__
#define _BSD_SOCKLEN_T_ int
......@@ -86,6 +87,20 @@ typedef struct {
int value;
} 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 */
/**********************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment