diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/ntp.h | 10 | ||||
| -rw-r--r-- | include/ntp_keyacc.h | 6 | ||||
| -rw-r--r-- | include/ntp_refclock.h | 3 | ||||
| -rw-r--r-- | include/ntp_stdlib.h | 2 | ||||
| -rw-r--r-- | include/ntp_types.h | 7 | ||||
| -rw-r--r-- | include/ntp_worker.h | 6 | ||||
| -rw-r--r-- | include/recvbuff.h | 4 |
7 files changed, 32 insertions, 6 deletions
diff --git a/include/ntp.h b/include/ntp.h index 6a4e9aa6f386..cad30039451d 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -175,6 +175,7 @@ typedef struct interface endpt; struct interface { endpt * elink; /* endpt list link */ endpt * mclink; /* per-AF_* multicast list */ + void * ioreg_ctx; /* IO registration context */ SOCKET fd; /* socket descriptor */ SOCKET bfd; /* for receiving broadcasts */ u_int32 ifnum; /* endpt instance count */ @@ -242,6 +243,13 @@ struct interface { #define PEER_TEST_MASK (TEST10 | TEST11 | TEST12 | TEST13) /* + * Unused flags + */ +#define TEST14 0x2000 +#define TEST15 0x4000 +#define TEST16 0x8000 + +/* * The peer structure. Holds state information relating to the guys * we are peering with. Most of this stuff is from section 3.2 of the * spec. @@ -391,6 +399,7 @@ struct peer { u_long received; /* packets received */ u_long processed; /* packets processed */ u_long badauth; /* bad authentication (TEST5) */ + u_long badNAK; /* invalid crypto-NAK */ u_long bogusorg; /* bogus origin (TEST2, TEST3) */ u_long oldpkt; /* old duplicate (TEST1) */ u_long seldisptoolarge; /* bad header (TEST6, TEST7) */ @@ -545,6 +554,7 @@ struct pkt { l_fp rec; /* receive time stamp */ l_fp xmt; /* transmit time stamp */ +#define MIN_V4_PKT_LEN (12 * sizeof(u_int32)) /* min header length */ #define LEN_PKT_NOMAC (12 * sizeof(u_int32)) /* min header length */ #define MIN_MAC_LEN (1 * sizeof(u_int32)) /* crypto_NAK */ #define MAX_MD5_LEN (5 * sizeof(u_int32)) /* MD5 */ diff --git a/include/ntp_keyacc.h b/include/ntp_keyacc.h index 730c310ac0fe..7e6650431228 100644 --- a/include/ntp_keyacc.h +++ b/include/ntp_keyacc.h @@ -10,4 +10,10 @@ struct keyaccess { sockaddr_u addr; }; +extern KeyAccT* keyacc_new_push(KeyAccT *head, const sockaddr_u *addr); +extern KeyAccT* keyacc_pop_free(KeyAccT *head); +extern KeyAccT* keyacc_all_free(KeyAccT *head); +extern int keyacc_contains(const KeyAccT *head, const sockaddr_u *addr, + int res_on_empty_list); + #endif /* NTP_KEYACC_H */ diff --git a/include/ntp_refclock.h b/include/ntp_refclock.h index b264dfaa0d1a..4b807e5f369e 100644 --- a/include/ntp_refclock.h +++ b/include/ntp_refclock.h @@ -105,7 +105,8 @@ struct refclockio { int active; /* nonzero when in use */ #ifdef HAVE_IO_COMPLETION_PORT - void * device_context; /* device-related data for i/o subsystem */ + void * ioreg_ctx; /* IO registration context */ + void * device_ctx; /* device-related data for i/o subsystem */ #endif }; diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 98ac69eb4697..5a20a83fa618 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -200,7 +200,7 @@ extern int authnumfreekeys; extern keyid_t cache_keyid; /* key identifier */ extern int cache_type; /* key type */ extern u_char * cache_secret; /* secret */ -extern u_short cache_secretsize; /* secret octets */ +extern size_t cache_secretsize; /* secret octets */ extern u_short cache_flags; /* KEY_ bit flags */ /* getopt.c */ diff --git a/include/ntp_types.h b/include/ntp_types.h index 7ff31254720d..969b325b5db7 100644 --- a/include/ntp_types.h +++ b/include/ntp_types.h @@ -35,6 +35,13 @@ # define FALSE 0 #endif +#ifdef HAVE_STDBOOL_H +# include <stdbool.h> +#else +typedef int bool; /* Can't use enum TRUE/FALSE because of above */ +#endif + + /* * This is another naming conflict. * On NetBSD for MAC the macro "mac" is defined as 1 diff --git a/include/ntp_worker.h b/include/ntp_worker.h index 7720b8c85370..49ffef4cf64b 100644 --- a/include/ntp_worker.h +++ b/include/ntp_worker.h @@ -119,11 +119,11 @@ typedef struct blocking_child_tag { int resp_write_pipe; /* child */ int ispipe; void * resp_read_ctx; /* child */ - volatile u_int resp_ready_seen; /* signal/scan */ - volatile u_int resp_ready_done; /* consumer/mainloop */ #else sem_ref responses_pending; /* signalling */ #endif + volatile u_int resp_ready_seen; /* signal/scan */ + volatile u_int resp_ready_done; /* consumer/mainloop */ sema_type sem_table[4]; thread_type thr_table[1]; } blocking_child; @@ -171,6 +171,8 @@ extern void close_all_except(int); extern void kill_asyncio (int); #endif +extern void worker_global_lock(int inOrOut); + # ifdef WORK_PIPE typedef void (*addremove_io_fd_func)(int, int, int); extern addremove_io_fd_func addremove_io_fd; diff --git a/include/recvbuff.h b/include/recvbuff.h index 92188f5990cd..fa2d9ccc41bf 100644 --- a/include/recvbuff.h +++ b/include/recvbuff.h @@ -91,7 +91,7 @@ extern void freerecvbuf(struct recvbuf *); /* signal safe - no malloc */ extern struct recvbuf *get_free_recv_buffer(void); -/* signal unsafe - may malloc */ +/* signal unsafe - may malloc, never returs NULL */ extern struct recvbuf *get_free_recv_buffer_alloc(void); /* Add a buffer to the full list @@ -113,7 +113,7 @@ extern struct recvbuf *get_full_recv_buffer(void); * purge_recv_buffers_for_fd() - purges any previously-received input * from a given file descriptor. */ -extern void purge_recv_buffers_for_fd(SOCKET); +extern void purge_recv_buffers_for_fd(int); /* * Checks to see if there are buffers to process |
