Add IPv6 support

This commit is contained in:
Miroslav Lichvar
2009-10-09 15:00:59 +02:00
parent 183d56fd40
commit 8265ff2890
32 changed files with 1709 additions and 770 deletions

View File

@@ -31,17 +31,28 @@
#ifndef GOT_ADDRESSING_H
#define GOT_ADDRESSING_H
/* This type is used to represent an IPv4 address and port
number. Both parts are in HOST order, NOT network order. */
#include "sysincl.h"
/* This type is used to represent an IPv4 address or IPv6 address.
All parts are in HOST order, NOT network order. */
#define IPADDR_UNSPEC 0
#define IPADDR_INET4 1
#define IPADDR_INET6 2
typedef struct {
unsigned long ip_addr;
unsigned long local_ip_addr;
union {
uint32_t in4;
uint8_t in6[16];
} addr;
uint16_t family;
} IPAddr;
typedef struct {
IPAddr ip_addr;
IPAddr local_ip_addr;
unsigned short port;
} NTP_Remote_Address;
#if 0
unsigned long NTP_IP_Address;
#endif
#endif /* GOT_ADDRESSING_H */