summaryrefslogtreecommitdiff
path: root/src/wy_singleflow_keepalive.h
diff options
context:
space:
mode:
author[email protected] <[email protected]>2021-11-02 12:34:05 +0800
committer[email protected] <[email protected]>2021-11-02 12:34:05 +0800
commit31f55f0b88d4af34a8a36497f5e49c69b88b2fbf (patch)
tree63515b3ceb361369cdc88ae6db1a808fc80e5b42 /src/wy_singleflow_keepalive.h
Diffstat (limited to 'src/wy_singleflow_keepalive.h')
-rw-r--r--src/wy_singleflow_keepalive.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/wy_singleflow_keepalive.h b/src/wy_singleflow_keepalive.h
new file mode 100644
index 0000000..00937a0
--- /dev/null
+++ b/src/wy_singleflow_keepalive.h
@@ -0,0 +1,53 @@
+#ifndef __WY_SINGLE_FLOW_KEEPALIVE_H__
+#define __WY_SINGLE_FLOW_KEEPALIVE_H__
+
+#include <event.h>
+
+#include "nirvana_conhash.h"
+
+struct time_event
+{
+ struct event timer_event;
+ struct consistent_hash *conhash;
+};
+
+struct function_node
+{
+ char *dst_ip_str;
+ int32_t udp_sockfd;
+ int32_t ip_as_bucketid;
+ int32_t conhash_inserted;
+ int32_t retry_times;
+ struct sockaddr_in sinaddr;
+
+ struct event msgevent;
+ struct event alive_detect_timer;
+ struct event send_bfd_timer;
+
+ struct judian_as_group *parent;
+};
+
+struct forward_nodes
+{
+ char *dst_ip_str;
+ int32_t udp_sockfd;
+ int32_t dst_ip;
+ struct sockaddr_in sinaddr;
+ struct judian_as_group *parent;
+};
+
+struct judian_as_group
+{
+ char groupname[64];
+ struct function_node *func_nodes;
+ struct forward_nodes *fwd_nodes;
+ int32_t func_nodes_num;
+ int32_t fwd_nodes_num;
+ struct consistent_hash *conhash;
+};
+
+
+void *thread_funcnode_keepalive(void *arg);
+
+#endif
+