#include <isc/buffer.h>
#include <isc/lang.h>
#include <isc/socket.h>
Go to the source code of this file.
Data Structures | |
struct | isccc_ccmsg |
ISCCC Message Structure. More... | |
Defines | |
#define | ISCCC_CCMSG_H 1 |
Typedefs | |
typedef struct isccc_ccmsg | isccc_ccmsg_t |
Functions | |
ISC_LANG_BEGINDECLS void | isccc_ccmsg_init (isc_mem_t *mctx, isc_socket_t *sock, isccc_ccmsg_t *ccmsg) |
void | isccc_ccmsg_setmaxsize (isccc_ccmsg_t *ccmsg, unsigned int maxsize) |
Associate a cc message state with a given memory context and TCP socket. | |
isc_result_t | isccc_ccmsg_readmessage (isccc_ccmsg_t *ccmsg, isc_task_t *task, isc_taskaction_t action, void *arg) |
Set the maximum packet size to "maxsize". | |
void | isccc_ccmsg_cancelread (isccc_ccmsg_t *ccmsg) |
Schedule an event to be delivered when a command channel message is readable, or when an error occurs on the socket. | |
void | isccc_ccmsg_invalidate (isccc_ccmsg_t *ccmsg) |
Cancel a readmessage() call. The event will still be posted with a CANCELED result code. |
Definition in file ccmsg.h.
typedef struct isccc_ccmsg isccc_ccmsg_t |
ISC_LANG_BEGINDECLS void isccc_ccmsg_init | ( | isc_mem_t * | mctx, | |
isc_socket_t * | sock, | |||
isccc_ccmsg_t * | ccmsg | |||
) |
Definition at line 136 of file ccmsg.c.
References isc_buffer::base, isccc_ccmsg::buffer, CCMSG_MAGIC, ISC_R_UNEXPECTED, isc_buffer::length, isccc_ccmsg::magic, isccc_ccmsg::maxsize, isccc_ccmsg::mctx, REQUIRE, isccc_ccmsg::result, isccc_ccmsg::size, isccc_ccmsg::sock, and isccc_ccmsg::task.
Referenced by newconnection(), and rndc_connected().
void isccc_ccmsg_setmaxsize | ( | isccc_ccmsg_t * | ccmsg, | |
unsigned int | maxsize | |||
) |
Associate a cc message state with a given memory context and TCP socket.
Requires:
Definition at line 157 of file ccmsg.c.
References isccc_ccmsg::maxsize, REQUIRE, and VALID_CCMSG.
Referenced by rndc_connected().
isc_result_t isccc_ccmsg_readmessage | ( | isccc_ccmsg_t * | ccmsg, | |
isc_task_t * | task, | |||
isc_taskaction_t | action, | |||
void * | arg | |||
) |
Set the maximum packet size to "maxsize".
Requires:
Definition at line 165 of file ccmsg.c.
References isccc_ccmsg::action, isccc_ccmsg::arg, isc_region::base, isc_buffer::base, isccc_ccmsg::buffer, isccc_ccmsg::event, ISC_EVENT_INIT, isc_mem_put, ISC_R_SUCCESS, ISC_R_UNEXPECTED, isc_socket_recv(), ISCCC_EVENT_CCMSG, isc_region::length, isc_buffer::length, isccc_ccmsg::mctx, recv_length(), REQUIRE, isccc_ccmsg::result, isccc_ccmsg::size, isccc_ccmsg::sock, isccc_ccmsg::task, and VALID_CCMSG.
Referenced by control_senddone(), newconnection(), rndc_connected(), and rndc_recvnonce().
void isccc_ccmsg_cancelread | ( | isccc_ccmsg_t * | ccmsg | ) |
Schedule an event to be delivered when a command channel message is readable, or when an error occurs on the socket.
Requires:
Definition at line 203 of file ccmsg.c.
References ISC_SOCKCANCEL_RECV, isc_socket_cancel(), REQUIRE, isccc_ccmsg::sock, and VALID_CCMSG.
Referenced by maybe_free_connection(), and rndc_recvnonce().
void isccc_ccmsg_invalidate | ( | isccc_ccmsg_t * | ccmsg | ) |
Cancel a readmessage() call. The event will still be posted with a CANCELED result code.
Requires:
Definition at line 224 of file ccmsg.c.
References isc_buffer::base, isccc_ccmsg::buffer, isc_mem_put, isc_buffer::length, isccc_ccmsg::magic, isccc_ccmsg::mctx, REQUIRE, and VALID_CCMSG.
Referenced by control_recvmessage(), main(), and newconnection().