addressing: introduce identifiers for unresolved addresses

Add a new type of address for NTP sources that don't have a resolved
address yet. This will allow the sources to be displayed, modified and
deleted by chronyc.

Update utility functions to support the new addresses.
This commit is contained in:
Miroslav Lichvar
2020-02-18 10:35:41 +01:00
parent f7f3667bcb
commit 84902d0e00
3 changed files with 48 additions and 0 deletions

View File

@@ -30,16 +30,19 @@
#include "sysincl.h"
/* This type is used to represent an IPv4 address or IPv6 address.
Addresses which are not resolved yet can be represented with an ID.
All parts are in HOST order, NOT network order. */
#define IPADDR_UNSPEC 0
#define IPADDR_INET4 1
#define IPADDR_INET6 2
#define IPADDR_ID 3
typedef struct {
union {
uint32_t in4;
uint8_t in6[16];
uint32_t id;
} addr;
uint16_t family;
uint16_t _pad;