summaryrefslogtreecommitdiffstats
path: root/ctdb/include
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@ronnie>2007-07-11 17:43:51 +1000
committerRonnie Sahlberg <sahlberg@ronnie>2007-07-11 17:43:51 +1000
commitaa080f66d93c40094beb06906e5f9cc69fc2c129 (patch)
treec60a493d1a79142ddf3e2b288114e4288c782d11 /ctdb/include
parent0c44e0ad46870e00417c24dd492f07e08a10dfc0 (diff)
first cut at a better and more scalable socketkiller
that can kill multiple connections asynchronously using one listening socket (This used to be ctdb commit 22bb44f3d745aa354becd75d30774992f6c40b3a)
Diffstat (limited to 'ctdb/include')
-rw-r--r--ctdb/include/ctdb_private.h31
1 files changed, 25 insertions, 6 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index e41035f5cb..13e3323b66 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -307,6 +307,7 @@ struct ctdb_context {
struct ctdb_takeover takeover;
struct ctdb_tcp_list *tcp_list;
struct ctdb_client_ip *client_ip_list;
+ struct ctdb_kill_tcp *killtcp;
};
struct ctdb_db_context {
@@ -1032,11 +1033,29 @@ void ctdb_start_freeze(struct ctdb_context *ctdb);
bool parse_ip_port(const char *s, struct sockaddr_in *ip);
-int ctdb_kill_tcp_callback(struct ctdb_context *ctdb,
- struct timeval timeout,
- TALLOC_CTX *mem_ctx,
- void (*callback)(struct ctdb_context *, int, struct sockaddr_in *, struct sockaddr_in *),
- struct sockaddr_in *dst,
- struct sockaddr_in *src);
+
+/*
+ list of tcp connections to kill
+ */
+struct ctdb_killtcp_connection {
+ struct ctdb_killtcp_connection *prev, *next;
+ struct ctdb_context *ctdb;
+ struct sockaddr_in src;
+ struct sockaddr_in dst;
+ int count;
+};
+
+/* structure containing the listening socket and the list of tcp connections
+ that the ctdb daemon is to kill
+*/
+struct ctdb_kill_tcp {
+ struct ctdb_context *ctdb;
+ int fd;
+ struct fd_event *fde;
+ struct ctdb_killtcp_connection *connections;
+};
+int ctdb_sys_open_capture_socket(void);
+int killtcp_add_connection(struct ctdb_context *ctdb, struct sockaddr_in *src, struct sockaddr_in *dst);
+int sys_read_tcp_packet(struct ctdb_kill_tcp *killtcp);
#endif