summaryrefslogtreecommitdiffstats
path: root/include/ntp_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ntp_io.h')
-rw-r--r--include/ntp_io.h51
1 files changed, 45 insertions, 6 deletions
diff --git a/include/ntp_io.h b/include/ntp_io.h
index 983c6c7..920fd0d 100644
--- a/include/ntp_io.h
+++ b/include/ntp_io.h
@@ -1,5 +1,5 @@
-#if !defined _NTP_IO_H
-#define _NTP_IO_H
+#ifndef NTP_IO_H
+#define NTP_IO_H
/*
* POSIX says use <fnct.h> to get O_* symbols and
* SEEK_SET symbol form <unistd.h>.
@@ -8,9 +8,7 @@
# include <config.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -30,6 +28,17 @@
# include "win32_io.h"
#endif
+#include <isc/boolean.h>
+#include <isc/netaddr.h>
+
+#if defined(HAVE_NETINET_IN_H) && defined(HAVE_NETINET_IP_H)
+# include <netinet/in.h>
+# ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+# endif
+# include <netinet/ip.h>
+#endif
+
/*
* Define FNDELAY and FASYNC using O_NONBLOCK and O_ASYNC if we need
* to (and can). This is here initially for QNX, but may help for
@@ -47,4 +56,34 @@
# endif
#endif
-#endif
+
+/*
+ * NIC rule match types
+ */
+typedef enum {
+ MATCH_ALL,
+ MATCH_IPV4,
+ MATCH_IPV6,
+ MATCH_WILDCARD,
+ MATCH_IFNAME,
+ MATCH_IFADDR
+} nic_rule_match;
+
+
+/*
+ * NIC rule actions
+ */
+typedef enum {
+ ACTION_LISTEN,
+ ACTION_IGNORE,
+ ACTION_DROP
+} nic_rule_action;
+
+
+isc_boolean_t get_broadcastclient_flag(void);
+extern int is_ip_address(const char *, sockaddr_u *);
+extern void sau_from_netaddr(sockaddr_u *, const isc_netaddr_t *);
+extern void add_nic_rule(nic_rule_match match_type, const char *if_name,
+ int prefixlen, nic_rule_action action);
+
+#endif /* NTP_IO_H */
OpenPOWER on IntegriCloud