mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
common: third iteration of ipv6 netadr_t, now binary compatible with v4-to-v6 mapped addresses
This commit is contained in:
parent
1a5a76a201
commit
a1299e1dfe
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
NA_UNUSED,
|
NA_UNUSED = 0,
|
||||||
NA_LOOPBACK,
|
NA_LOOPBACK,
|
||||||
NA_BROADCAST,
|
NA_BROADCAST,
|
||||||
NA_IP,
|
NA_IP,
|
||||||
@ -50,23 +50,20 @@ typedef struct netadr_s
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint8_t ip[4];
|
|
||||||
uint8_t ipx[10];
|
|
||||||
};
|
};
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
#if XASH_LITTLE_ENDIAN
|
#if XASH_LITTLE_ENDIAN
|
||||||
uint16_t type6;
|
uint16_t type6;
|
||||||
uint8_t ip6_0[2];
|
uint8_t ip6_10[2]; // or 10-th two IPv6 octets
|
||||||
#elif XASH_BIG_ENDIAN
|
#elif XASH_BIG_ENDIAN
|
||||||
uint8_t ip6_0[2];
|
uint8_t ip6_10[2]; // or 10-th two IPv6 octets
|
||||||
uint16_t type6;
|
uint16_t type6;
|
||||||
#else
|
|
||||||
#error
|
|
||||||
#endif
|
#endif
|
||||||
uint8_t ip6_1[14];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
uint8_t ip[4]; // or last 4 IPv6 octets
|
||||||
|
uint8_t ipx[10]; // or first 10 IPv6 octets
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
} netadr_t;
|
} netadr_t;
|
||||||
#pragma pack( pop )
|
#pragma pack( pop )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user