2006-11-18 10:41:20 +11:00
/*
ctdb database library
Copyright ( C ) Andrew Tridgell 2006
2007-05-31 13:50:53 +10:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 15:29:31 +10:00
the Free Software Foundation ; either version 3 of the License , or
2007-05-31 13:50:53 +10:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
2006-11-18 10:41:20 +11:00
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2007-05-31 13:50:53 +10:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 15:29:31 +10:00
along with this program ; if not , see < http : //www.gnu.org/licenses/>.
2006-11-18 10:41:20 +11:00
*/
2011-11-11 12:41:24 +11:00
# ifndef _CTDB_TCP_H
# define _CTDB_TCP_H
2006-11-27 21:38:13 +11:00
/* ctdb_tcp main state */
struct ctdb_tcp {
2008-02-19 14:44:48 +11:00
struct ctdb_context * ctdb ;
2006-11-27 21:38:13 +11:00
int listen_fd ;
2006-11-18 11:21:40 +11:00
} ;
2006-11-18 13:45:04 +11:00
/*
2006-11-27 21:38:13 +11:00
state associated with one tcp node
2006-11-18 13:45:04 +11:00
*/
2006-11-27 21:38:13 +11:00
struct ctdb_tcp_node {
2019-08-09 15:06:34 +10:00
int out_fd ;
2007-07-02 14:26:50 +10:00
struct ctdb_queue * out_queue ;
2019-08-09 15:29:36 +10:00
2015-10-26 16:50:09 +11:00
struct tevent_fd * connect_fde ;
struct tevent_timer * connect_te ;
2019-08-09 15:29:36 +10:00
struct ctdb_context * ctdb ;
struct ctdb_queue * in_queue ;
2006-11-18 13:45:04 +11:00
} ;
2006-11-28 11:51:33 +11:00
/* prototypes internal to tcp transport */
2006-11-28 14:15:46 +11:00
int ctdb_tcp_queue_pkt ( struct ctdb_node * node , uint8_t * data , uint32_t length ) ;
2006-11-28 11:51:33 +11:00
int ctdb_tcp_listen ( struct ctdb_context * ctdb ) ;
2015-10-26 16:50:09 +11:00
void ctdb_tcp_node_connect ( struct tevent_context * ev , struct tevent_timer * te ,
2007-04-13 20:38:24 +10:00
struct timeval t , void * private_data ) ;
2007-04-10 19:33:21 +10:00
void ctdb_tcp_read_cb ( uint8_t * data , size_t cnt , void * args ) ;
2007-04-13 20:38:24 +10:00
void ctdb_tcp_tnode_cb ( uint8_t * data , size_t cnt , void * private_data ) ;
2020-02-28 11:36:00 +01:00
void ctdb_tcp_stop_outgoing ( struct ctdb_node * node ) ;
2020-02-29 11:54:51 +01:00
void ctdb_tcp_stop_incoming ( struct ctdb_node * node ) ;
2006-12-19 12:07:07 +11:00
# define CTDB_TCP_ALIGNMENT 8
2011-11-11 12:41:24 +11:00
# endif /* _CTDB_TCP_H */