ntp_net.h
imports <sys/socket.h>Declares a C IPv4 socket address
SHA-2560b087875eba3cf72b7ef49c0b37f27928651344065fc1500ae4cdb717c710e86
MaleculeH(Cm)Md(In)
Evidence
1/*
2 * ntp_net.h - definitions for NTP network stuff
3 */
4
5#ifndef NTP_NET_H
6#define NTP_NET_H
7
8#include <sys/types.h>
9#ifdef HAVE_SYS_SOCKET_H
10#include <sys/socket.h>
11#endif
12#ifdef HAVE_NET_IF_H
13#include <net/if.h>
14#endif
15#ifdef HAVE_NETINET_IN_H
16#include <netinet/in.h>
17#endif
18#ifdef HAVE_NET_IF_VAR_H
19#include <net/if_var.h>
20#endif
21#ifdef HAVE_NETINET_IN_VAR_H
22#include <netinet/in_var.h>
23#endif
24
25#include "ntp_rfc2553.h"
26#include "ntp_malloc.h"
27
28typedef union {
29 struct sockaddr sa;
30 struct sockaddr_in sa4;
31 struct sockaddr_in6 sa6;
32} sockaddr_u;
⋯5 lines
105:45… u)))
106
107/* v6 is interface ID scope universal, as with MAC-derived addresses */
108#define IS_IID_UNIV(psau) \
109 (!!(0x02 & NSRCADR6(psau)[8]))
110
111#defi …
138:4… lse \
139 NSRCADR(psau) = 0xffffffff; \
140 } while(0)
141
142/* zero sockaddr_u, fill in family and all-ones (host) mask */
143#define SET_HOSTMASK(psau, family) \
144 do { \
145 ZERO_SOCK(psau) …
153:28… pin6A is higher than *pin6B. IN6ADDR_ANY
154 * is the lowest address (128 zero bits).
155 */
156#define ADDR6_CMP(pin6A, pin6B) \
157 memcmp((pin6A)->s6_a …
211:67… and
212 * u is the unit number. We define some of this here since we will need
213 * some sanity checks to make sure this address isn't interpretted as
214 * that of a normal peer.
215 */
216#define REFCLOCK_ADDR 0x7f7f0000 /* 127.127.0.0 */
217#define REFCLOCK_MASK …