summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2021-04-20 14:17:38 +0800
committerluwenpeng <[email protected]>2021-04-20 14:17:38 +0800
commitcd3d902a43755fc460fffa2b761df3571cc19f3f (patch)
tree1e50167166e28b5f9fef8265204ee3a595d15b1c
parent3cd503188036aedf55e2610e16c480656dd9b0d7 (diff)
增加 cmsg 字段, KNI 发送 timestamp val 给 TFE
-rw-r--r--common/include/kni_cmsg.h2
-rw-r--r--common/src/kni_cmsg.cpp2
-rw-r--r--entry/src/kni_entry.cpp6
3 files changed, 10 insertions, 0 deletions
diff --git a/common/include/kni_cmsg.h b/common/include/kni_cmsg.h
index 0e79b93..e39e81e 100644
--- a/common/include/kni_cmsg.h
+++ b/common/include/kni_cmsg.h
@@ -29,6 +29,8 @@ enum tfe_cmsg_tlv_type
TFE_CMSG_TCP_RESTORE_WINDOW_CLIENT = 0xb,
TFE_CMSG_TCP_RESTORE_WINDOW_SERVER = 0xc,
TFE_CMSG_TCP_RESTORE_INFO_PACKET_CUR_DIR = 0xd,
+ TFE_CMSG_TCP_RESTORE_TS_CLIENT_VAL = 0xe,
+ TFE_CMSG_TCP_RESTORE_TS_SERVER_VAL = 0xf,
TFE_CMSG_POLICY_ID = 0x10,
TFE_CMSG_STREAM_TRACE_ID = 0x11,
diff --git a/common/src/kni_cmsg.cpp b/common/src/kni_cmsg.cpp
index 3631745..3e834e9 100644
--- a/common/src/kni_cmsg.cpp
+++ b/common/src/kni_cmsg.cpp
@@ -207,6 +207,8 @@ void tfe_cmsg_enum_to_string()
tfe_cmsg_tlv_type_to_string[TFE_CMSG_TCP_RESTORE_WINDOW_CLIENT] = "TFE_CMSG_TCP_RESTORE_WINDOW_CLIENT";
tfe_cmsg_tlv_type_to_string[TFE_CMSG_TCP_RESTORE_WINDOW_SERVER] = "TFE_CMSG_TCP_RESTORE_WINDOW_SERVER";
tfe_cmsg_tlv_type_to_string[TFE_CMSG_TCP_RESTORE_INFO_PACKET_CUR_DIR] = "TFE_CMSG_TCP_RESTORE_INFO_PACKET_CUR_DIR";
+ tfe_cmsg_tlv_type_to_string[TFE_CMSG_TCP_RESTORE_TS_CLIENT_VAL] = "TFE_CMSG_TCP_RESTORE_TS_CLIENT_VAL";
+ tfe_cmsg_tlv_type_to_string[TFE_CMSG_TCP_RESTORE_TS_SERVER_VAL] = "TFE_CMSG_TCP_RESTORE_TS_SERVER_VAL";
tfe_cmsg_tlv_type_to_string[TFE_CMSG_POLICY_ID] = "TFE_CMSG_POLICY_ID";
tfe_cmsg_tlv_type_to_string[TFE_CMSG_STREAM_TRACE_ID] = "TFE_CMSG_STREAM_TRACE_ID";
tfe_cmsg_tlv_type_to_string[TFE_CMSG_SSL_INTERCEPT_STATE] = "TFE_CMSG_SSL_INTERCEPT_STATE";
diff --git a/entry/src/kni_entry.cpp b/entry/src/kni_entry.cpp
index 7ebc8bf..d413411 100644
--- a/entry/src/kni_entry.cpp
+++ b/entry/src/kni_entry.cpp
@@ -522,6 +522,12 @@ static unsigned char* kni_cmsg_serialize_header_new(struct pme_info *pmeinfo, st
//server timestamp
ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_TCP_RESTORE_TS_SERVER, (const unsigned char*)&(pmeinfo->server_tcpopt.ts_set), 1, pmeinfo);
if(ret < 0) goto error_out;
+ //client timestamp val
+ ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_TCP_RESTORE_TS_CLIENT_VAL, (const unsigned char*)&(pmeinfo->client_tcpopt.ts_value), 4, pmeinfo);
+ if(ret < 0) goto error_out;
+ //server timestamp val
+ ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_TCP_RESTORE_TS_SERVER_VAL, (const unsigned char*)&(pmeinfo->server_tcpopt.ts_value), 4, pmeinfo);
+ if(ret < 0) goto error_out;
//protocol
ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_TCP_RESTORE_PROTOCOL, (const unsigned char*)&protocol_type, 1, pmeinfo);
if(ret < 0) goto error_out;