recvbuff.h (ntp-4.2.8p14) | : | recvbuff.h (ntp-4.2.8p15) | ||
---|---|---|---|---|
skipping to change at line 13 | skipping to change at line 13 | |||
#include "ntp.h" | #include "ntp.h" | |||
#include "ntp_net.h" | #include "ntp_net.h" | |||
#include "ntp_lists.h" | #include "ntp_lists.h" | |||
#include <isc/result.h> | #include <isc/result.h> | |||
/* | /* | |||
* recvbuf memory management | * 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_LOWAT 3 /* when we're down to three buffers get more */ | |||
#define RECV_INC 5 /* get 5 more at a time */ | #define RECV_INC 32 /* [power of 2] get 32 more at a time */ | |||
#define RECV_TOOMANY 40 /* this is way too many buffers */ | #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 | #if defined HAVE_IO_COMPLETION_PORT | |||
# include "ntp_iocompletionport.h" | # include "ntp_iocompletionport.h" | |||
# include "ntp_timer.h" | # include "ntp_timer.h" | |||
# define RECV_BLOCK_IO() EnterCriticalSection(&RecvCritSection) | # define RECV_BLOCK_IO() EnterCriticalSection(&RecvCritSection) | |||
# define RECV_UNBLOCK_IO() LeaveCriticalSection(&RecvCritSection) | # define RECV_UNBLOCK_IO() LeaveCriticalSection(&RecvCritSection) | |||
/* Return the event which is set when items are added to the full list | /* Return the event which is set when items are added to the full list | |||
*/ | */ | |||
skipping to change at line 91 | skipping to change at line 107 | |||
*/ | */ | |||
extern void freerecvbuf(struct recvbuf *); | extern void freerecvbuf(struct recvbuf *); | |||
/* Get a free buffer (typically used so an async | /* Get a free buffer (typically used so an async | |||
* read can directly place data into the buffer | * read can directly place data into the buffer | |||
* | * | |||
* The buffer is removed from the free list. Make sure | * The buffer is removed from the free list. Make sure | |||
* you put it back with freerecvbuf() or | * you put it back with freerecvbuf() or | |||
*/ | */ | |||
/* signal safe - no malloc */ | /* signal safe - no malloc, returns NULL when no bufs */ | |||
extern struct recvbuf *get_free_recv_buffer(void); | extern struct recvbuf *get_free_recv_buffer(int /*BOOL*/ urgent); | |||
/* signal unsafe - may malloc, never returs NULL */ | /* signal unsafe - may malloc, returns NULL when no bufs */ | |||
extern struct recvbuf *get_free_recv_buffer_alloc(void); | extern struct recvbuf *get_free_recv_buffer_alloc(int /*BOOL*/ urgent); | |||
/* Add a buffer to the full list | /* Add a buffer to the full list | |||
*/ | */ | |||
extern void add_full_recv_buffer(struct recvbuf *); | extern void add_full_recv_buffer(struct recvbuf *); | |||
/* number of recvbufs on freelist */ | /* number of recvbufs on freelist */ | |||
extern u_long free_recvbuffs(void); | extern u_long free_recvbuffs(void); | |||
extern u_long full_recvbuffs(void); | extern u_long full_recvbuffs(void); | |||
extern u_long total_recvbuffs(void); | extern u_long total_recvbuffs(void); | |||
extern u_long lowater_additions(void); | extern u_long lowater_additions(void); | |||
End of changes. 3 change blocks. | ||||
7 lines changed or deleted | 24 lines changed or added |