21
#ifndef PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H
22
#define PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H
21
#ifndef LIBDRIZZLE_NET_SERV_H
22
#define LIBDRIZZLE_NET_SERV_H
25
#define net_new_transaction(net) ((net)->pkt_nr=0)
26
29
#include <stdint.h>
28
namespace drizzle_protocol
31
31
#define LIBDRIZZLE_ERRMSG_SIZE 512
32
32
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
34
38
typedef struct st_net {
36
40
unsigned char *buff,*buff_end,*write_pos,*read_pos;
71
bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
72
void drizzleclient_net_end(NET *net);
73
void drizzleclient_net_clear(NET *net, bool clear_buffer);
74
bool drizzleclient_net_flush(NET *net);
75
bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
76
bool drizzleclient_net_write_command(NET *net,unsigned char command,
77
const unsigned char *header, size_t head_len,
78
const unsigned char *packet, size_t len);
79
uint32_t drizzleclient_net_read(NET *net);
80
void drizzleclient_net_close(NET *net);
81
bool drizzleclient_net_init_sock(NET * net, int sock, int flags,
82
uint32_t buffer_length);
83
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
84
void drizzleclient_net_keepalive(NET *net, bool flag);
85
int drizzleclient_net_get_sd(NET *net);
86
bool drizzleclient_net_more_data(NET *net);
88
void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
89
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
90
void drizzleclient_drizzleclient_net_clear_error(NET *net);
92
} /* namespace drizzle_protocol */
94
#endif /* PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H */
75
bool drizzleclient_net_init(NET *net, Vio* vio);
76
void drizzleclient_net_local_init(NET *net);
77
void drizzleclient_net_end(NET *net);
78
void drizzleclient_net_clear(NET *net, bool clear_buffer);
79
bool drizzleclient_net_realloc(NET *net, size_t length);
80
bool drizzleclient_net_flush(NET *net);
81
bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
82
bool drizzleclient_net_write_command(NET *net,unsigned char command,
83
const unsigned char *header, size_t head_len,
84
const unsigned char *packet, size_t len);
85
int32_t drizzleclient_net_real_write(NET *net,const unsigned char *packet, size_t len);
86
uint32_t drizzleclient_net_read(NET *net);
87
void drizzleclient_net_close(NET *net);
88
bool drizzleclient_net_init_sock(NET * net, int sock, int flags);
89
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
90
void drizzleclient_net_keepalive(NET *net, bool flag);
91
int drizzleclient_net_get_sd(NET *net);
92
bool drizzleclient_net_should_close(NET *net);
93
bool drizzleclient_net_more_data(NET *net);
95
void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
96
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
97
void drizzleclient_drizzleclient_net_clear_error(NET *net);