summaryrefslogtreecommitdiff
path: root/include/mrl_io.h
diff options
context:
space:
mode:
authorlijie <[email protected]>2019-01-21 20:46:44 +0800
committerlijie <[email protected]>2019-01-21 20:46:44 +0800
commita558cf074391f1f4b3581c9a4b5d6c6241d21c28 (patch)
tree81e5921620171d742214cd38a238cbf7e7e1c526 /include/mrl_io.h
parenta5495b25b06223bf1b78eb7886c61042416a6c5c (diff)
修改无法支持dnat_policy中IP相同端口不同的策略问题v2.0.1
Diffstat (limited to 'include/mrl_io.h')
-rw-r--r--include/mrl_io.h121
1 files changed, 61 insertions, 60 deletions
diff --git a/include/mrl_io.h b/include/mrl_io.h
index 69946ee..2dc076f 100644
--- a/include/mrl_io.h
+++ b/include/mrl_io.h
@@ -1,60 +1,61 @@
-#ifndef __MRL_PACKET_H_
-#define __MRL_PACKET_H_
-
-#include "stream.h"
-#include "MESA_htable.h"
-#include "mrl_utils.h"
-
-struct mrl_nominee_key{
-char sip[MRL_STR_IP_LEN];
-char dip[MRL_STR_IP_LEN];
-uint16_t sport;//host order
-uint16_t dport;//host order
-};
-
-struct mrl_dnat_policy_key{
-char original_ip[MRL_STR_IP_LEN];
-uint16_t original_port;
-};
-
-struct user_data
-{
- char detect_ip[MRL_STR_IP_LEN];
- int nominee_type;
-};
-
-MESA_htable_handle mrl_htable_init(void * fn_data_free_cb);
-
-void ht_nominee_free_cb(void * data);
-void ht_snat_candidate_free_cb(void * data);
-
-void ht_dnat_candidate_free_cb(void * data);
-
-void ht_dnat_policy_free_cb(void * data);
-void ht_vxlan_info_free_cb(void * data);
-void ht_mrl_ip_info_free_cb(void * data);
-void ht_link_identity_free_cb(void * data);
-long ht_nominee_search_cb(void *data, const uchar *key, uint size, void *user_arg);
-
-//long ht_dnat_policy_search_cb(void *data, const uchar *key, uint size, void *user_arg);
-
-
-int mrl_htable_add(MESA_htable_handle htable,const unsigned char* key,unsigned int key_len,const void* value);
-int mrl_htable_delete(MESA_htable_handle htable,const unsigned char* key,unsigned int key_len);
-
-void mrl_socket_init();
-void mrl_socket_close();
-
-bool mrl_snat_pkt_identify(struct streaminfo *mystream, struct mrl_tuple *tuple);
-
-bool mrl_dnat_pkt_identify(struct streaminfo *mystream, struct mrl_tuple *tuple);
-
-void mrl_send_to_gdev(int thread_seq, struct mrl_vxlan_info * vxlan_info, const char *payload, size_t payload_len);
-int mrl_send_to_mgw(void *raw_pkt, int thread_seq);
-void *mrl_recv_from_mgw(void *arg);
-
-void *mrl_detect_action(void *arg);
-
-#endif
-
-
+#ifndef __MRL_PACKET_H_
+#define __MRL_PACKET_H_
+
+#include "stream.h"
+#include "MESA_htable.h"
+#include "mrl_utils.h"
+
+struct mrl_nominee_key{
+char sip[MRL_STR_IP_LEN];
+char dip[MRL_STR_IP_LEN];
+uint16_t sport;//host order
+uint16_t dport;//host order
+};
+
+struct mrl_dnat_policy_key{
+ char original_ip[MRL_STR_IP_LEN];
+ uint16_t original_port;
+ int original_protocol;
+};
+
+struct user_data
+{
+ char detect_ip[MRL_STR_IP_LEN];
+ int nominee_type;
+};
+
+MESA_htable_handle mrl_htable_init(void * fn_data_free_cb);
+
+void ht_nominee_free_cb(void * data);
+void ht_snat_candidate_free_cb(void * data);
+
+void ht_dnat_candidate_free_cb(void * data);
+
+void ht_dnat_policy_free_cb(void * data);
+void ht_vxlan_info_free_cb(void * data);
+void ht_mrl_ip_info_free_cb(void * data);
+void ht_link_identity_free_cb(void * data);
+long ht_nominee_search_cb(void *data, const uchar *key, uint size, void *user_arg);
+
+//long ht_dnat_policy_search_cb(void *data, const uchar *key, uint size, void *user_arg);
+
+
+int mrl_htable_add(MESA_htable_handle htable,const unsigned char* key,unsigned int key_len,const void* value);
+int mrl_htable_delete(MESA_htable_handle htable,const unsigned char* key,unsigned int key_len);
+
+void mrl_socket_init();
+void mrl_socket_close();
+
+bool mrl_snat_pkt_identify(struct streaminfo *mystream, struct mrl_tuple *tuple);
+
+bool mrl_dnat_pkt_identify(struct streaminfo *mystream, struct mrl_tuple *tuple);
+
+void mrl_send_to_gdev(int thread_seq, struct mrl_vxlan_info * vxlan_info, const char *payload, size_t payload_len);
+int mrl_send_to_mgw(void *raw_pkt, int thread_seq);
+void *mrl_recv_from_mgw(void *arg);
+
+void *mrl_detect_action(void *arg);
+
+#endif
+
+