diff options
author | Cy Schubert <cy@FreeBSD.org> | 2020-06-24 00:20:45 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2020-06-24 00:20:45 +0000 |
commit | 3914721463f70500ecc1f59312b122d8788465cf (patch) | |
tree | f253e72838d762e229ca71912a4a928e96cac2bd /include | |
parent | 5171bc9b11192d9ad273db7854787eaa65eb9997 (diff) |
Notes
Diffstat (limited to 'include')
-rw-r--r-- | include/l_stdlib.h | 9 | ||||
-rw-r--r-- | include/ntp.h | 2 | ||||
-rw-r--r-- | include/ntp_config.h | 10 | ||||
-rw-r--r-- | include/recvbuff.h | 30 |
4 files changed, 33 insertions, 18 deletions
diff --git a/include/l_stdlib.h b/include/l_stdlib.h index 073ea4641236..fbf57c53aa9d 100644 --- a/include/l_stdlib.h +++ b/include/l_stdlib.h @@ -221,4 +221,13 @@ extern int errno; extern int h_errno; #endif +#ifndef HAVE_MEMCHR +extern void *memchr(const void *s, int c, size_t n); +#endif + +#ifndef HAVE_STRNLEN +extern size_t strnlen(const char *s, size_t n); +#endif + + #endif /* L_STDLIB_H */ diff --git a/include/ntp.h b/include/ntp.h index 97f0d5f9e2de..8e0ea2b202a7 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -128,7 +128,7 @@ typedef char s_char; #define MAX_TTL 8 /* max ttl mapping vector size */ #define BEACON 7200 /* manycast beacon interval */ #define NTP_MAXEXTEN 2048 /* max extension field size */ -#define NTP_ORPHWAIT 300 /* orphan wair (s) */ +#define NTP_ORPHWAIT 300 /* orphan wait (s) */ /* * Miscellaneous stuff diff --git a/include/ntp_config.h b/include/ntp_config.h index b414466930ad..53546df8d6ca 100644 --- a/include/ntp_config.h +++ b/include/ntp_config.h @@ -277,16 +277,6 @@ typedef struct settrap_parms_tag { /* - * Poll Skew List - */ - -psl_item psl[17-3+1]; /* values for polls 3-17 */ - /* To simplify the runtime code we */ - /* don't want to have to special-case */ - /* dealing with a default */ - - -/* ** Data Minimization Items */ diff --git a/include/recvbuff.h b/include/recvbuff.h index 42597153eea2..2a4c84c5afc3 100644 --- a/include/recvbuff.h +++ b/include/recvbuff.h @@ -10,10 +10,26 @@ /* * recvbuf memory management */ -#define RECV_INIT 10 /* 10 buffers initially */ +#define RECV_INIT 64 /* 64 buffers initially */ #define RECV_LOWAT 3 /* when we're down to three buffers get more */ -#define RECV_INC 5 /* get 5 more at a time */ -#define RECV_TOOMANY 40 /* this is way too many buffers */ +#define RECV_INC 32 /* [power of 2] get 32 more at a time */ +#define RECV_BATCH 128 /* [power of 2] max increment in one sweep */ +#define RECV_TOOMANY 4096 /* this should suffice, really. TODO: tos option? */ + +/* If we have clocks, keep an iron reserve of receive buffers for + * clocks only. + */ +#if defined(REFCLOCK) +# if !defined(RECV_CLOCK) || RECV_CLOCK == 0 +# undef RECV_CLOCK +# define RECV_CLOCK 16 +# endif +#else +# if defined(RECV_CLOCK) +# undef RECV_CLOCK +# endif +# define RECV_CLOCK 0 +#endif #if defined HAVE_IO_COMPLETION_PORT # include "ntp_iocompletionport.h" @@ -90,10 +106,10 @@ extern void freerecvbuf(struct recvbuf *); * you put it back with freerecvbuf() or */ -/* signal safe - no malloc */ -extern struct recvbuf *get_free_recv_buffer(void); -/* signal unsafe - may malloc, never returs NULL */ -extern struct recvbuf *get_free_recv_buffer_alloc(void); +/* signal safe - no malloc, returns NULL when no bufs */ +extern struct recvbuf *get_free_recv_buffer(int /*BOOL*/ urgent); +/* signal unsafe - may malloc, returns NULL when no bufs */ +extern struct recvbuf *get_free_recv_buffer_alloc(int /*BOOL*/ urgent); /* Add a buffer to the full list */ |