diff --git a/inc/tsg_label.h b/inc/tsg_label.h index a0c9469..47fc406 100644 --- a/inc/tsg_label.h +++ b/inc/tsg_label.h @@ -50,10 +50,6 @@ struct location_info { int ref_cnt; int full_location_len; - char *country_full; - char *province_full; - char *city_full; - char *subdivision_addr; char *full_location; }; diff --git a/src/tsg_proxy.cpp b/src/tsg_proxy.cpp index e3545df..93ef39b 100644 --- a/src/tsg_proxy.cpp +++ b/src/tsg_proxy.cpp @@ -410,31 +410,13 @@ static void tsg_proxy_cmsg_ip_location_fill(struct session_runtime_attribute *se const struct location_info *client_location = srt_attribute_get_client_ip_location(session_attr); const struct location_info *server_location = srt_attribute_get_server_ip_location(session_attr); if (client_location) { - if (client_location->country_full) { - cmsg->src_ip_location_country = client_location->country_full; - } - if (client_location->province_full) { - cmsg->src_ip_location_provine = client_location->province_full; - } - if (client_location->city_full) { - cmsg->src_ip_location_city = client_location->city_full; - } - if (client_location->subdivision_addr) { - cmsg->src_ip_location_subdivision = client_location->subdivision_addr; + if (client_location->full_location && client_location->full_location_len) { + cmsg->src_ip_full_location = client_location->full_location; } } if (server_location) { - if (server_location->country_full) { - cmsg->dst_ip_location_country = server_location->country_full; - } - if (server_location->province_full) { - cmsg->dst_ip_location_provine = server_location->province_full; - } - if (server_location->city_full) { - cmsg->dst_ip_location_city = server_location->city_full; - } - if (server_location->subdivision_addr) { - cmsg->dst_ip_location_subdivision = server_location->subdivision_addr; + if (server_location->full_location && server_location->full_location_len) { + cmsg->dst_ip_full_location = server_location->full_location; } } return; @@ -543,14 +525,8 @@ static void tsg_proxy_tcp_attribute_dump(tsg_proxy_tcp_attribute *tcp_attr, stru "server asn: %s\n"\ "client orgnization: %s\n"\ "server orgnization: %s\n"\ - "client ip country: %s\n"\ - "server ip country: %s\n"\ - "client ip province: %s\n"\ - "server ip province: %s\n"\ - "client ip city: %s\n"\ - "server ip city: %s\n"\ - "client ip subdevision: %s\n"\ - "server ip subdevision: %s\n"\ + "client ip full_location: %s\n"\ + "server ip full_location: %s\n"\ "ssl ja3 fingerprint:%s\n"\ "tcp_seq_route_ctx len: %d\n"\ "tcp_ack_route_ctx len: %d\n"\ @@ -562,14 +538,8 @@ static void tsg_proxy_tcp_attribute_dump(tsg_proxy_tcp_attribute *tcp_attr, stru cmsg->dst_asn, cmsg->src_organization, cmsg->dst_organization, - cmsg->src_ip_location_country, - cmsg->dst_ip_location_country, - cmsg->src_ip_location_provine, - cmsg->dst_ip_location_provine, - cmsg->src_ip_location_city, - cmsg->dst_ip_location_city, - cmsg->src_ip_location_subdivision, - cmsg->dst_ip_location_subdivision, + cmsg->src_ip_full_location, + cmsg->dst_ip_full_location, cmsg->ssl_client_ja3_fingerprint, cmsg->tcp_seq_route_ctx.len, cmsg->tcp_ack_route_ctx.len, diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 5225544..f451c25 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -556,23 +556,22 @@ void ex_data_location_new(const char *table_name, int table_id, const char* key, char full_address[1024]={0}; struct location_info *location=(struct location_info *)calloc(1, sizeof(struct location_info)); - location->country_full=column_string_get_value(table_line, 13); // country_full - location->province_full=column_string_get_value(table_line, 15); // province_full - location->city_full=column_string_get_value(table_line, 16); // city_full - tsg_str_unescape(location->country_full); - tsg_str_unescape(location->province_full); - tsg_str_unescape(location->city_full); - - location->subdivision_addr=column_string_get_value(table_line, 17); // subdivision_addr - tsg_str_unescape(location->subdivision_addr); + char *country_full=column_string_get_value(table_line, 13); // country_full + char *province_full=column_string_get_value(table_line, 15); // province_full + char *city_full=column_string_get_value(table_line, 16); // city_full + char *subdivision_addr=column_string_get_value(table_line, 17); // subdivision_addr + tsg_str_unescape(country_full); + tsg_str_unescape(province_full); + tsg_str_unescape(city_full); + tsg_str_unescape(subdivision_addr); location->full_location_len=snprintf(full_address, sizeof(full_address), "%s.%s.%s.%s.", - location->country_full, - location->province_full, - location->city_full, - location->subdivision_addr==NULL ? "" : location->subdivision_addr); + country_full, + province_full, + city_full, + subdivision_addr==NULL ? "" : subdivision_addr); if(location->full_location_len>0) @@ -586,6 +585,11 @@ void ex_data_location_new(const char *table_name, int table_id, const char* key, *ad=(void *)location; tsg_stat_sync_exdata_add_update(SYNC_EXDATA_LOCATION, 1); + tsg_free_field(country_full); + tsg_free_field(province_full); + tsg_free_field(city_full); + tsg_free_field(subdivision_addr); + return; } @@ -596,10 +600,6 @@ void ex_data_location_free(int table_id, void **ad, long argl, void* argp) struct location_info *location=(struct location_info *)(*ad); if((__sync_sub_and_fetch(&location->ref_cnt, 1) == 0)) { - tsg_free_field(location->country_full); - tsg_free_field(location->province_full); - tsg_free_field(location->city_full); - tsg_free_field(location->subdivision_addr); tsg_free_field(location->full_location); tsg_free_field((char *)(*ad)); diff --git a/src/tsg_sync_state.cpp b/src/tsg_sync_state.cpp index 29d9df7..0016743 100644 --- a/src/tsg_sync_state.cpp +++ b/src/tsg_sync_state.cpp @@ -204,14 +204,8 @@ static void mpack_append_cmsg_value(mpack_writer_t *writer, struct proxy_cmsg *c mpack_append_string(writer, cmsg->dst_asn); mpack_append_string(writer, cmsg->src_organization); mpack_append_string(writer, cmsg->dst_organization); - mpack_append_string(writer, cmsg->src_ip_location_country); - mpack_append_string(writer, cmsg->dst_ip_location_country); - mpack_append_string(writer, cmsg->src_ip_location_provine); - mpack_append_string(writer, cmsg->dst_ip_location_provine); - mpack_append_string(writer, cmsg->src_ip_location_city); - mpack_append_string(writer, cmsg->dst_ip_location_city); - mpack_append_string(writer, cmsg->src_ip_location_subdivision); - mpack_append_string(writer, cmsg->dst_ip_location_subdivision); + mpack_append_string(writer, cmsg->src_ip_full_location); + mpack_append_string(writer, cmsg->dst_ip_full_location); mpack_append_string(writer, cmsg->ssl_client_ja3_fingerprint); // fqdn_cat_id_val diff --git a/src/tsg_sync_state.h b/src/tsg_sync_state.h index 3eb4a1a..4b391e5 100644 --- a/src/tsg_sync_state.h +++ b/src/tsg_sync_state.h @@ -68,7 +68,7 @@ struct proxy_cmsg uint32_t tcp_ts_client_val; uint32_t tcp_ts_server_val; uint32_t tcp_seq; - uint32_t tcp_ack; + uint32_t tcp_ack; char *src_sub_id; char *dst_sub_id; @@ -76,14 +76,8 @@ struct proxy_cmsg char *dst_asn; char *src_organization; char *dst_organization; - char *src_ip_location_country; - char *dst_ip_location_country; - char *src_ip_location_provine; - char *dst_ip_location_provine; - char *src_ip_location_city; - char *dst_ip_location_city; - char *src_ip_location_subdivision; - char *dst_ip_location_subdivision; + char *src_ip_full_location; + char *dst_ip_full_location; char *ssl_client_ja3_fingerprint; struct fqdn_cat_id_val fqdn_cat_ids; struct tcp_sids tcp_seq_sids; diff --git a/test/src/gtest_bridge.cpp b/test/src/gtest_bridge.cpp index 209ff3c..a62a961 100644 --- a/test/src/gtest_bridge.cpp +++ b/test/src/gtest_bridge.cpp @@ -703,18 +703,10 @@ TEST(TSGBridge, SessionSessionRuntimeAttributeTSG15457) srt_attribute->client_location=(struct location_info *)dictator_malloc(0, sizeof(struct location_info)); srt_attribute->client_location->ref_cnt=1; - srt_attribute->client_location->country_full=(char *)"china"; - srt_attribute->client_location->province_full=(char *)"beijing"; - srt_attribute->client_location->city_full=(char *)"west"; - srt_attribute->client_location->subdivision_addr=(char *)"yuming road"; srt_attribute->client_location->full_location=(char *)"china.beijing.west.yuming road."; srt_attribute->server_location=(struct location_info *)dictator_malloc(0, sizeof(struct location_info)); srt_attribute->server_location->ref_cnt=1; - srt_attribute->server_location->country_full=(char *)"china"; - srt_attribute->server_location->province_full=(char *)"shanghai"; - srt_attribute->server_location->city_full=(char *)"east"; - srt_attribute->server_location->subdivision_addr=(char *)"zhongshan road"; srt_attribute->server_location->full_location=(char *)"china.shanghai.east.zhongshan road."; srt_attribute->client_subscribe_id=(struct subscribe_id_info *)dictator_malloc(0, sizeof(struct subscribe_id_info)); @@ -805,36 +797,20 @@ TEST(TSGBridge, SessionSessionRuntimeAttributeTSG15457) EXPECT_NE(nullptr, srt_attribute_out->client_location); EXPECT_EQ(1, srt_attribute_out->client_location->ref_cnt); - EXPECT_STREQ("china", srt_attribute_out->client_location->country_full); - EXPECT_STREQ("beijing", srt_attribute_out->client_location->province_full); - EXPECT_STREQ("west", srt_attribute_out->client_location->city_full); - EXPECT_STREQ("yuming road", srt_attribute_out->client_location->subdivision_addr); EXPECT_STREQ("china.beijing.west.yuming road.", srt_attribute_out->client_location->full_location); const struct location_info *c_location=srt_attribute_get_client_ip_location((const struct session_runtime_attribute *)srt_attribute_out); EXPECT_NE(nullptr, c_location); EXPECT_EQ(1, c_location->ref_cnt); - EXPECT_STREQ("china", c_location->country_full); - EXPECT_STREQ("beijing", c_location->province_full); - EXPECT_STREQ("west", c_location->city_full); - EXPECT_STREQ("yuming road", c_location->subdivision_addr); EXPECT_STREQ("china.beijing.west.yuming road.", c_location->full_location); EXPECT_NE(nullptr, srt_attribute_out->server_location); EXPECT_EQ(1, srt_attribute_out->server_location->ref_cnt); - EXPECT_STREQ("china", srt_attribute_out->server_location->country_full); - EXPECT_STREQ("shanghai", srt_attribute_out->server_location->province_full); - EXPECT_STREQ("east", srt_attribute_out->server_location->city_full); - EXPECT_STREQ("zhongshan road", srt_attribute_out->server_location->subdivision_addr); EXPECT_STREQ("china.shanghai.east.zhongshan road.", srt_attribute_out->server_location->full_location); const struct location_info *s_location=srt_attribute_get_server_ip_location((const struct session_runtime_attribute *)srt_attribute_out); EXPECT_NE(nullptr, s_location); EXPECT_EQ(1, s_location->ref_cnt); - EXPECT_STREQ("china", s_location->country_full); - EXPECT_STREQ("shanghai", s_location->province_full); - EXPECT_STREQ("east", s_location->city_full); - EXPECT_STREQ("zhongshan road", s_location->subdivision_addr); EXPECT_STREQ("china.shanghai.east.zhongshan road.", s_location->full_location); EXPECT_NE(nullptr, srt_attribute_out->client_subscribe_id); diff --git a/test/src/gtest_rule.cpp b/test/src/gtest_rule.cpp index 012f0ea..751da0f 100644 --- a/test/src/gtest_rule.cpp +++ b/test/src/gtest_rule.cpp @@ -203,20 +203,12 @@ TEST(TM, ExDataLocationBuiltIn) struct location_info *location = NULL; maat_ip_plugin_table_get_ex_data(g_tsg_maat_feather, g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_LOCATION_BUILT_IN].id, &temp_addr, (void **)&location, 1); - EXPECT_STREQ("Other", location->city_full); - EXPECT_STREQ("Hong Kong", location->country_full); - EXPECT_STREQ("Other", location->province_full); - EXPECT_STREQ("Road1", location->subdivision_addr); EXPECT_STREQ("Hong Kong.Other.Other.Road1.", location->full_location); EXPECT_EQ(2, location->ref_cnt); temp_addr.ipv4 = inet_addr("192.168.50.2"); maat_ip_plugin_table_get_ex_data(g_tsg_maat_feather, g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_LOCATION_BUILT_IN].id, &temp_addr, (void **)&location, 1); - EXPECT_STREQ("Xin Xi Gang", location->city_full); - EXPECT_STREQ("China", location->country_full); - EXPECT_STREQ("Beijing", location->province_full); - EXPECT_STREQ("Road1", location->subdivision_addr); EXPECT_STREQ("China.Beijing.Xin Xi Gang.Road1.", location->full_location); EXPECT_EQ(2, location->ref_cnt); @@ -239,10 +231,6 @@ TEST(TM, ExDataLocationUserDefine) struct location_info *location = NULL; maat_ip_plugin_table_get_ex_data(g_tsg_maat_feather, g_tsg_maat_rt_para.plugin_tb[MAAT_PLUGIN_LOCATION_USER_DEFINED].id, &temp_addr, (void **)&location, 1); - EXPECT_STREQ("Hua Yan Bei Li", location->city_full); - EXPECT_STREQ("China", location->country_full); - EXPECT_STREQ("Beijing", location->province_full); - EXPECT_STREQ("Road1", location->subdivision_addr); EXPECT_STREQ("China.Beijing.Hua Yan Bei Li.Road1.", location->full_location); EXPECT_EQ(2, location->ref_cnt); diff --git a/test/src/gtest_sync_state.cpp b/test/src/gtest_sync_state.cpp index 17c50cf..cb9fd1e 100644 --- a/test/src/gtest_sync_state.cpp +++ b/test/src/gtest_sync_state.cpp @@ -419,32 +419,14 @@ static void gtest_cmsg_init(struct proxy_cmsg *cmsg) cmsg->dst_organization = (char *)calloc(1, 256); snprintf(cmsg->dst_organization, 256, "thisistest=%d", 6); - cmsg->src_ip_location_country = (char *)calloc(1, 256); - snprintf(cmsg->src_ip_location_country, 256, "thisistest=%d", 7); + cmsg->src_ip_full_location = (char *)calloc(1, 256); + snprintf(cmsg->src_ip_full_location, 256, "thisistest=%d", 7); - cmsg->dst_ip_location_country = (char *)calloc(1, 256); - snprintf(cmsg->dst_ip_location_country, 256, "thisistest=%d", 8); - - cmsg->src_ip_location_provine = (char *)calloc(1, 256); - snprintf(cmsg->src_ip_location_provine, 256, "thisistest=%d", 9); - - cmsg->dst_ip_location_provine = (char *)calloc(1, 256); - snprintf(cmsg->dst_ip_location_provine, 256, "thisistest=%d", 10); - - cmsg->src_ip_location_city = (char *)calloc(1, 256); - snprintf(cmsg->src_ip_location_city, 256, "thisistest=%d", 11); - - cmsg->dst_ip_location_city = (char *)calloc(1, 256); - snprintf(cmsg->dst_ip_location_city, 256, "thisistest=%d", 12); - - cmsg->src_ip_location_subdivision = (char *)calloc(1, 256); - snprintf(cmsg->src_ip_location_subdivision, 256, "thisistest=%d", 13); - - cmsg->dst_ip_location_subdivision = (char *)calloc(1, 256); - snprintf(cmsg->dst_ip_location_subdivision, 256, "thisistest=%d", 14); + cmsg->dst_ip_full_location = (char *)calloc(1, 256); + snprintf(cmsg->dst_ip_full_location, 256, "thisistest=%d", 8); cmsg->ssl_client_ja3_fingerprint = (char *)calloc(1, 256); - snprintf(cmsg->ssl_client_ja3_fingerprint, 256, "thisistest=%d", 15); + snprintf(cmsg->ssl_client_ja3_fingerprint, 256, "thisistest=%d", 9); cmsg->fqdn_cat_ids.num = 4; for (size_t i = 0; i < 4; i++) @@ -491,14 +473,8 @@ static void gtest_cmsg_destroy(struct proxy_cmsg *cmsg) free(cmsg->dst_asn); free(cmsg->src_organization); free(cmsg->dst_organization); - free(cmsg->src_ip_location_country); - free(cmsg->dst_ip_location_country); - free(cmsg->src_ip_location_provine); - free(cmsg->dst_ip_location_provine); - free(cmsg->src_ip_location_city); - free(cmsg->dst_ip_location_city); - free(cmsg->src_ip_location_subdivision); - free(cmsg->dst_ip_location_subdivision); + free(cmsg->src_ip_full_location); + free(cmsg->dst_ip_full_location); free(cmsg->ssl_client_ja3_fingerprint); if (cmsg->tcp_seq_route_ctx.buff) @@ -570,36 +546,36 @@ TEST(POLICY_UPDATE, Proxy) EXPECT_STREQ("thisistest=2", test_str); memset(test_str, 0, sizeof(test_str)); - memcpy(test_str, mpack_node_str(mpack_node_array_at(tcp_handshake, 30)), mpack_node_strlen(mpack_node_array_at(tcp_handshake, 30))); - EXPECT_STREQ("thisistest=15", test_str); + memcpy(test_str, mpack_node_str(mpack_node_array_at(tcp_handshake, 22)), mpack_node_strlen(mpack_node_array_at(tcp_handshake, 22))); + EXPECT_STREQ("thisistest=7", test_str); memset(test_str, 0, sizeof(test_str)); - mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 31); + mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 25); EXPECT_EQ(4, mpack_node_array_length(fqdn_cat_id_vals)); for (int i = 0; i < 4; i++) { EXPECT_EQ(i + 1, mpack_node_u32(mpack_node_array_at(fqdn_cat_id_vals, i))); } - mpack_node_t tcp_ack_route_ctxs = mpack_node_array_at(tcp_handshake, 35); + mpack_node_t tcp_ack_route_ctxs = mpack_node_array_at(tcp_handshake, 29); EXPECT_EQ(mpack_type_bin, mpack_node_type(tcp_ack_route_ctxs)); memcpy(test_str, mpack_node_bin_data(tcp_ack_route_ctxs), mpack_node_bin_size(tcp_ack_route_ctxs)); EXPECT_STREQ("test: tcp_ack_route_ctx", test_str); memset(test_str, 0, sizeof(test_str)); - mpack_node_t tcp_seq_pkg_header = mpack_node_array_at(tcp_handshake, 36); + mpack_node_t tcp_seq_pkg_header = mpack_node_array_at(tcp_handshake, 30); EXPECT_EQ(mpack_type_bin, mpack_node_type(tcp_seq_pkg_header)); memcpy(test_str, mpack_node_bin_data(tcp_seq_pkg_header), mpack_node_bin_size(tcp_seq_pkg_header)); EXPECT_STREQ("test: c2s_rawpkt_header", test_str); memset(test_str, 0, sizeof(test_str)); - mpack_node_t tcp_ack_pkg_header = mpack_node_array_at(tcp_handshake, 37); + mpack_node_t tcp_ack_pkg_header = mpack_node_array_at(tcp_handshake, 31); EXPECT_EQ(mpack_type_bin, mpack_node_type(tcp_ack_pkg_header)); memcpy(test_str, mpack_node_bin_data(tcp_ack_pkg_header), mpack_node_bin_size(tcp_ack_pkg_header)); EXPECT_STREQ("test: s2c_rawpkt_header", test_str); memset(test_str, 0, sizeof(test_str)); - mpack_node_t tcp_is_intercept = mpack_node_array_at(tcp_handshake, 38); + mpack_node_t tcp_is_intercept = mpack_node_array_at(tcp_handshake, 32); EXPECT_EQ(0, mpack_node_u8(tcp_is_intercept)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); gtest_cmsg_destroy(&cmsg); @@ -638,7 +614,7 @@ TEST(POLICY_UPDATE, ProxyTcpIsIntercept) mpack_node_t proxy_map = mpack_node_map_cstr(params, "proxy"); mpack_node_t tcp_handshake = mpack_node_map_cstr(proxy_map, "tcp_handshake"); - mpack_node_t tcp_is_intercept = mpack_node_array_at(tcp_handshake, 38); + mpack_node_t tcp_is_intercept = mpack_node_array_at(tcp_handshake, 32); EXPECT_EQ(3, mpack_node_u8(tcp_is_intercept)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); @@ -682,10 +658,10 @@ TEST(POLICY_UPDATE, ProxyPkgHeader0) EXPECT_EQ(1, mpack_node_u32(mpack_node_array_at(tcp_handshake, 0))); EXPECT_EQ(0, mpack_node_u32(mpack_node_array_at(tcp_handshake, 4))); EXPECT_EQ(0, mpack_node_u32(mpack_node_array_at(tcp_handshake, 5))); - EXPECT_EQ(0, mpack_node_bin_size(mpack_node_array_at(tcp_handshake, 36))); - EXPECT_NE(nullptr, mpack_node_bin_data(mpack_node_array_at(tcp_handshake, 36))); - EXPECT_EQ(0, mpack_node_bin_size(mpack_node_array_at(tcp_handshake, 37))); - EXPECT_NE(nullptr, mpack_node_bin_data(mpack_node_array_at(tcp_handshake, 37))); + EXPECT_EQ(0, mpack_node_bin_size(mpack_node_array_at(tcp_handshake, 30))); + EXPECT_NE(nullptr, mpack_node_bin_data(mpack_node_array_at(tcp_handshake, 31))); + EXPECT_EQ(0, mpack_node_bin_size(mpack_node_array_at(tcp_handshake, 30))); + EXPECT_NE(nullptr, mpack_node_bin_data(mpack_node_array_at(tcp_handshake, 31))); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); gtest_cmsg_destroy(&cmsg); @@ -765,7 +741,7 @@ TEST(POLICY_UPDATE, ProxyFqdnCatIds0) mpack_node_t proxy_map = mpack_node_map_cstr(params, "proxy"); mpack_node_t tcp_handshake = mpack_node_map_cstr(proxy_map, "tcp_handshake"); - mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 31); + mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 25); EXPECT_EQ(0, mpack_node_array_length(fqdn_cat_id_vals)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); @@ -805,7 +781,7 @@ TEST(POLICY_UPDATE, ProxyTcpAckRouteCtxs0) mpack_node_t proxy_map = mpack_node_map_cstr(params, "proxy"); mpack_node_t tcp_handshake = mpack_node_map_cstr(proxy_map, "tcp_handshake"); - mpack_node_t tcp_ack_route_ctxs = mpack_node_array_at(tcp_handshake, 35); + mpack_node_t tcp_ack_route_ctxs = mpack_node_array_at(tcp_handshake, 29); EXPECT_EQ(0, mpack_node_bin_size(tcp_ack_route_ctxs)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); @@ -845,7 +821,7 @@ TEST(POLICY_UPDATE, ProxyTcpSeqSids0) mpack_node_t proxy_map = mpack_node_map_cstr(params, "proxy"); mpack_node_t tcp_handshake = mpack_node_map_cstr(proxy_map, "tcp_handshake"); - mpack_node_t tcp_seq_sids = mpack_node_array_at(tcp_handshake, 32); + mpack_node_t tcp_seq_sids = mpack_node_array_at(tcp_handshake, 26); EXPECT_EQ(0, mpack_node_array_length(tcp_seq_sids)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); @@ -886,13 +862,13 @@ TEST(POLICY_UPDATE, ProxyOverLimit) mpack_node_t tcp_handshake = mpack_node_map_cstr(proxy_map, "tcp_handshake"); - mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 31); + mpack_node_t fqdn_cat_id_vals = mpack_node_array_at(tcp_handshake, 25); EXPECT_EQ(FQDN_CAT_ID_VALS, mpack_node_array_length(fqdn_cat_id_vals)); - mpack_node_t tcp_seq_sids = mpack_node_array_at(tcp_handshake, 32); + mpack_node_t tcp_seq_sids = mpack_node_array_at(tcp_handshake, 26); EXPECT_EQ(TCP_XXX_SIDS, mpack_node_array_length(tcp_seq_sids)); - mpack_node_t tcp_ack_sids = mpack_node_array_at(tcp_handshake, 33); + mpack_node_t tcp_ack_sids = mpack_node_array_at(tcp_handshake, 27); EXPECT_EQ(TCP_XXX_SIDS, mpack_node_array_length(tcp_ack_sids)); EXPECT_EQ(mpack_tree_destroy(&tree), mpack_ok); diff --git a/test/src/gtest_tableinfo.cpp b/test/src/gtest_tableinfo.cpp index 1492536..5e92ed1 100644 --- a/test/src/gtest_tableinfo.cpp +++ b/test/src/gtest_tableinfo.cpp @@ -755,8 +755,6 @@ TEST(TSG_Table, TSG_SECURITY_SOURCE_LOCATION) { struct streaminfo a_stream = {0}; struct location_info location = {0}; - location.country_full = (char *)"country_full_test"; - location.city_full = (char *)"city_full_test"; location.full_location=(char *)"country_full_test..city_full_test.."; location.full_location_len=strlen(location.full_location); struct maat_state *mid = maat_state_new(g_tsg_maat_feather, a_stream.threadnum); @@ -772,8 +770,6 @@ TEST(TSG_Table, TSG_SECURITY_DESTINATION_LOCATION) { struct streaminfo a_stream = {0}; struct location_info location = {0}; - location.country_full = (char *)"country_full_test"; - location.city_full = (char *)"city_full_test"; location.full_location=(char *)"country_full_test..city_full_test.."; location.full_location_len=strlen(location.full_location); struct maat_state *mid = maat_state_new(g_tsg_maat_feather, a_stream.threadnum);