]> git.ipfire.org Git - thirdparty/chrony.git/blame - addressing.h
examples: harden systemd services
[thirdparty/chrony.git] / addressing.h
CommitLineData
88840341 1/*
88840341
RC
2 chronyd/chronyc - Programs for keeping computer clocks accurate.
3
4 **********************************************************************
5 * Copyright (C) Richard P. Curnow 1997-2002
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of version 2 of the GNU General Public License as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
8e23110a 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
88840341
RC
19 *
20 **********************************************************************
21
22 =======================================================================
23
24 Types used for addressing sources etc
25 */
26
27#ifndef GOT_ADDRESSING_H
28#define GOT_ADDRESSING_H
29
8265ff28
ML
30#include "sysincl.h"
31
32/* This type is used to represent an IPv4 address or IPv6 address.
84902d0e 33 Addresses which are not resolved yet can be represented with an ID.
8265ff28
ML
34 All parts are in HOST order, NOT network order. */
35
36#define IPADDR_UNSPEC 0
37#define IPADDR_INET4 1
38#define IPADDR_INET6 2
84902d0e 39#define IPADDR_ID 3
8265ff28 40
88840341 41typedef struct {
8265ff28
ML
42 union {
43 uint32_t in4;
44 uint8_t in6[16];
84902d0e 45 uint32_t id;
8265ff28
ML
46 } addr;
47 uint16_t family;
5e92aaf8 48 uint16_t _pad;
8265ff28
ML
49} IPAddr;
50
51typedef struct {
52 IPAddr ip_addr;
ca969464
ML
53 uint16_t port;
54} IPSockAddr;
55
56typedef IPSockAddr NTP_Remote_Address;
88840341 57
86acea5c
ML
58#define INVALID_IF_INDEX -1
59
308de812
ML
60typedef struct {
61 IPAddr ip_addr;
86acea5c 62 int if_index;
9a657cd4 63 int sock_fd;
308de812
ML
64} NTP_Local_Address;
65
88840341
RC
66#endif /* GOT_ADDRESSING_H */
67