From 894ec2ddcd9965f60c4bc7a0b48edf41bfc167d8 Mon Sep 17 00:00:00 2001 From: wenxian li Date: Thu, 1 Oct 2015 22:29:46 -0400 Subject: Code change according to code review comments after Tuple Generator phase 2 commit. --- src/tuple_gen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/tuple_gen.cpp') diff --git a/src/tuple_gen.cpp b/src/tuple_gen.cpp index e408f275..d725de44 100755 --- a/src/tuple_gen.cpp +++ b/src/tuple_gen.cpp @@ -57,7 +57,7 @@ void CClientPool::Create(IP_DIST_t dist_value, uint32_t max_ip, double l_flow, double t_cps, - CFlowGenList* fl_list, + CFlowGenListMac* mac_info, bool has_mac_map, uint16_t tcp_aging, uint16_t udp_aging) { @@ -65,10 +65,10 @@ void CClientPool::Create(IP_DIST_t dist_value, set_dist(dist_value); uint32_t total_ip = max_ip - min_ip +1; uint32_t avail_ip = total_ip; - if (has_mac_map && (fl_list!=NULL)) { + if (has_mac_map && (mac_info!=NULL)) { for(int idx=0;idxget_mac_addr_by_ip(min_ip+idx); if (mac_adr == NULL) { avail_ip--; } @@ -86,7 +86,7 @@ void CClientPool::Create(IP_DIST_t dist_value, if (has_mac_map) { for(int idx=0;idxget_mac_addr_by_ip( min_ip+idx); if (mac_adr != NULL) { m_ip_info[idx] = new CClientInfoL(has_mac_map); m_ip_info[idx]->set_ip(min_ip+idx); @@ -103,7 +103,7 @@ void CClientPool::Create(IP_DIST_t dist_value, if (has_mac_map) { for(int idx=0;idxget_mac_addr_by_ip(min_ip+idx); if (mac_adr != NULL) { m_ip_info[idx] = new CClientInfo(has_mac_map); m_ip_info[idx]->set_ip(min_ip+idx); @@ -130,13 +130,13 @@ bool CTupleGeneratorSmart::add_client_pool(IP_DIST_t client_dist, uint32_t max_client, double l_flow, double t_cps, - CFlowGenList* fl_list, + CFlowGenListMac* mac_info, uint16_t tcp_aging, uint16_t udp_aging){ assert(max_client>=min_client); CClientPool* pool = new CClientPool(); pool->Create(client_dist, min_client, max_client, - l_flow, t_cps, fl_list, has_mac_mapping, + l_flow, t_cps, mac_info, has_mac_mapping, tcp_aging, udp_aging); m_client_pool.push_back(pool); -- cgit From e2b63ecc0544c82590c9aeb9a44a8a4bcb869cb6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Oct 2015 22:58:16 -0400 Subject: minor change --- src/tuple_gen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/tuple_gen.cpp') diff --git a/src/tuple_gen.cpp b/src/tuple_gen.cpp index d725de44..3a477338 100755 --- a/src/tuple_gen.cpp +++ b/src/tuple_gen.cpp @@ -123,7 +123,6 @@ void CClientPool::Create(IP_DIST_t dist_value, CreateBase(); } -void delay(int msec); bool CTupleGeneratorSmart::add_client_pool(IP_DIST_t client_dist, uint32_t min_client, @@ -136,7 +135,7 @@ bool CTupleGeneratorSmart::add_client_pool(IP_DIST_t client_dist, assert(max_client>=min_client); CClientPool* pool = new CClientPool(); pool->Create(client_dist, min_client, max_client, - l_flow, t_cps, mac_info, has_mac_mapping, + l_flow, t_cps, mac_info, m_has_mac_mapping, tcp_aging, udp_aging); m_client_pool.push_back(pool); @@ -171,13 +170,13 @@ bool CTupleGeneratorSmart::Create(uint32_t _id, m_thread_id = thread_id; m_id = _id; m_was_init=true; - has_mac_mapping = has_mac; + m_has_mac_mapping = has_mac; return(true); } void CTupleGeneratorSmart::Delete(){ m_was_init=false; - has_mac_mapping = false; + m_has_mac_mapping = false; for (int idx=0;idxDelete(); -- cgit From cf5dc18ecbeca6b4be9a171d996bba1cba9c3679 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Sun, 18 Oct 2015 16:16:39 +0300 Subject: another small fix for trex-130 --- src/tuple_gen.cpp | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'src/tuple_gen.cpp') diff --git a/src/tuple_gen.cpp b/src/tuple_gen.cpp index 3a477338..3c05cf05 100755 --- a/src/tuple_gen.cpp +++ b/src/tuple_gen.cpp @@ -245,30 +245,12 @@ void operator >> (const YAML::Node& node, CTupleGenPoolYaml & fi) { fi.m_tcp_aging_sec = 0; fi.m_udp_aging_sec = 0; fi.m_dual_interface_mask = 0; - try { - utl_yaml_read_uint32(node,"clients_per_gb",fi.m_number_of_clients_per_gb); - } catch ( const std::exception& e ) { - ;} - try { - utl_yaml_read_uint32(node,"min_clients",fi.m_min_clients); - } catch ( const std::exception& e ) { - ;} - try { - utl_yaml_read_ip_addr(node,"dual_port_mask",fi.m_dual_interface_mask); - } catch ( const std::exception& e ) { - ;} - try { - utl_yaml_read_uint16(node,"tcp_aging",fi.m_tcp_aging_sec); - } catch ( const std::exception& e ) { - ;} - try { - utl_yaml_read_uint16(node,"udp_aging",fi.m_udp_aging_sec); - } catch ( const std::exception& e ) { - ;} - try { - node["track_ports"] >> fi.m_is_bundling; - } catch ( const std::exception& e ) { - ;} + utl_yaml_read_uint32(node,"clients_per_gb",fi.m_number_of_clients_per_gb); + utl_yaml_read_uint32(node,"min_clients",fi.m_min_clients); + utl_yaml_read_ip_addr(node,"dual_port_mask",fi.m_dual_interface_mask); + utl_yaml_read_uint16(node,"tcp_aging",fi.m_tcp_aging_sec); + utl_yaml_read_uint16(node,"udp_aging",fi.m_udp_aging_sec); + utl_yaml_read_bool(node,"track_ports",fi.m_is_bundling); } void copy_global_pool_para(CTupleGenPoolYaml & src, CTupleGenPoolYaml & dst) { if (src.m_number_of_clients_per_gb == 0) -- cgit