This commit is contained in:
wangyu-
2017-09-23 03:35:28 -05:00
parent d778be2bfc
commit 3960ca1b36
7 changed files with 1077 additions and 991 deletions

View File

@@ -14,6 +14,9 @@ extern int disable_anti_replay;
#include "common.h"
#include "log.h"
#include "network.h"
#include "misc.h"
struct anti_replay_t //its for anti replay attack,similar to openvpn/ipsec 's anti replay window
{
@@ -142,6 +145,10 @@ int clear_inactive0();
};
extern conn_manager_t conn_manager;
void server_clear_function(u64_t u64);
int send_bare(raw_info_t &raw_info,const char* data,int len);//send function with encryption but no anti replay,this is used when client and server verifys each other
//you have to design the protocol carefully, so that you wont be affect by relay attack
int reserved_parse_bare(const char *input,int input_len,char* & data,int & len); // a sub function used in recv_bare