Initial commit to Gerrit
[profile/ivi/ntp.git] / ports / winnt / include / transmitbuff.h
1 #if !defined __transmitbuff_h
2 #define __transmitbuff_h
3
4 #include "ntp.h"
5 #if defined HAVE_IO_COMPLETION_PORT
6 # include "ntp_iocompletionport.h"
7 #endif
8 #include <isc/list.h>
9
10 /*
11  * Format of a transmitbuf.  These are used by the asynchronous receive
12  * routine to store outgoing packets and related information.
13  */
14
15 typedef struct transmitbuf transmitbuf_t;
16
17 typedef struct transmitbuf {
18         ISC_LINK(transmitbuf_t) link;
19
20         WSABUF  wsabuf;
21         time_t  ts;             /* Time stamp for the request */
22
23         /*
24          * union {
25          *      struct  pkt             pkt;
26          *      struct  ntp_control     ctlpkt;
27          *} pkt;
28          */
29         char pkt[512];
30
31 } transmitbuf;
32
33
34 extern  void    init_transmitbuff       P((void));
35
36
37 /* freetransmitbuf - make a single transmitbuf available for reuse
38  */
39 extern  void    free_transmit_buffer    P((transmitbuf_t *));
40
41 /*  Get a free buffer (typically used so an async
42  *  read can directly place data into the buffer
43  *
44  *  The buffer is removed from the free list. Make sure
45  *  you put it back with freetransmitbuf() or 
46  */
47 extern transmitbuf_t *get_free_transmit_buffer P((void));
48
49 #endif /* defined __transmitbuff_h */
50