From 1b1695316dab02fdbb626ca73ad61a92c31e417e Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 10 Feb 2016 08:03:32 -0500 Subject: Clean up gcc-5.2 warnings Change-Id: I7b0aa42a61607d4d30fe3627032d3837b2838982 Signed-off-by: Dave Barach --- vnet/vnet/vcgn/cnat_cli_handler.c | 32 ++++++---- vnet/vnet/vcgn/cnat_ipv4_icmp.h | 17 ++++-- vnet/vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c | 2 +- .../vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c | 2 +- vnet/vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c | 2 +- .../vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c | 2 +- vnet/vnet/vcgn/cnat_ipv4_udp.h | 4 +- vnet/vnet/vcgn/cnat_ipv4_udp_inside_input.c | 2 +- vnet/vnet/vcgn/cnat_ipv4_udp_outside_input.c | 4 +- vnet/vnet/vcgn/cnat_logging.c | 71 ++++------------------ vnet/vnet/vcgn/cnat_show.c | 15 +++-- vnet/vnet/vcgn/cnat_v4_functions.c | 2 +- vnet/vnet/vcgn/cnat_v4_functions.h | 2 +- vnet/vnet/vcgn/spp_platform_trace_log.c | 2 +- vnet/vnet/vcgn/spp_platform_trace_log.h | 7 ++- vnet/vnet/vcgn/vcgn_classify.c | 15 +---- 16 files changed, 74 insertions(+), 107 deletions(-) (limited to 'vnet') diff --git a/vnet/vnet/vcgn/cnat_cli_handler.c b/vnet/vnet/vcgn/cnat_cli_handler.c index d50f522a2e0..e0fb91bcc5d 100644 --- a/vnet/vnet/vcgn/cnat_cli_handler.c +++ b/vnet/vnet/vcgn/cnat_cli_handler.c @@ -276,15 +276,15 @@ void cnat_nat44_handle_show_stats(vlib_main_t *vm) vlib_cli_output(vm, "vCGN NAT44 Statistics :\n"); vlib_cli_output(vm, "\tActive Translations : %u\n", NAT44_COMMON_STATS.active_translations); - vlib_cli_output(vm, "\tTotal free address : %u\n", free); - vlib_cli_output(vm, "\tTotal used address : %u\n", used); + vlib_cli_output(vm, "\tTotal free translation entries : %u\n", free); + vlib_cli_output(vm, "\tTotal used translation entries : %u\n", used); vlib_cli_output(vm, "\ti2o drops due to port limit exceeded : %lu\n", in2out_drops_port_limit_exceeded); vlib_cli_output(vm, "\ti2o drops due to system limit reached : %lu\n", in2out_drops_system_limit_reached); vlib_cli_output(vm, "\ti2o drops due to resource depletion : %lu\n", in2out_drops_resource_depletion); - vlib_cli_output(vm, "\ti2o drops due to no translations : %lu\n", + vlib_cli_output(vm, "\to2i drops due to no translations : %lu\n", NAT44_COMMON_STATS.no_translation_entry_drops); vlib_cli_output(vm, "\tPool address usage:\n"); @@ -321,6 +321,10 @@ void cnat_nat44_handle_show_config(vlib_main_t *vm) u8 status_str[20]; cnat_nfv9_logging_info_t *my_nfv9_logging_info, *global_nfv9_logging_info = 0; + + vnet_hw_interface_t * hw; + dpdk_main_t * dm = &dpdk_main; + void cnat_nfv9_show_collector (vlib_main_t *vm, cnat_nfv9_logging_info_t *my_nfv9_logging_info); @@ -330,21 +334,23 @@ void cnat_nat44_handle_show_config(vlib_main_t *vm) vlib_cli_output(vm, "\tdynamic port start range : %u\n", cnat_static_port_range); pool_foreach(my_vrfmap, cnat_map_by_vrf, ({ - vlib_cli_output(vm, "\ti-intf-index : 0x%x\n", my_vrfmap->i_vrf); - vlib_cli_output(vm, "\to-intf-index : 0x%x\n", my_vrfmap->o_vrf); + hw = vnet_get_hw_interface (dm->vnet_main, my_vrfmap->i_vrf); + vlib_cli_output(vm, "\tInside Interface : %s\n", hw->name); + hw = vnet_get_hw_interface (dm->vnet_main, my_vrfmap->o_vrf); + vlib_cli_output(vm, "\tOutside Interface : %s\n", hw->name); memset(status_str, 0x00, sizeof(status_str)); switch(my_vrfmap->status) { case S_WAO: memcpy(status_str, "S_WAO", 5); break; case S_WA: memcpy(status_str, "S_WA", 4); break; case S_WO: memcpy(status_str, "S_WO", 4); break; - case S_RUN: memcpy(status_str, "S_RUN", 5); break; + case S_RUN: memcpy(status_str, "ONLINE", 6); break; case S_DEL: memcpy(status_str, "S_DEL", 5); break; default: memcpy(status_str, "Invalid state", 13); } vlib_cli_output(vm, - "\tvrf map table status : %s\n", status_str); + "\tAddress pool map table status : %s\n", status_str); pm = my_vrfmap->portmap_list; pm_len = vec_len(pm); @@ -493,13 +499,13 @@ void cnat_v4_show_inside_entry_req_t_handler cnat_v4_show_translation_entry entry[PLATFORM_MAX_TRANSLATION_ENTRIES]; u8 display_entry; u8 flag_str[11]; + vnet_hw_interface_t * hw; + dpdk_main_t * dm = &dpdk_main; ki.k.k.ipv4 = mp->ipv4_addr; ki.k.k.vrf = mp->vrf_id; start_port = mp->start_port; end_port = mp->end_port; - //memset(flag_str,0x00,11); - //strncpy(flag_str,"NA",2); #if DEBUG vlib_cli_output(vm, "## proto %d, inside-addr 0x%x, start_port %u, " "end_port %u, vrf 0x%x, flag 0x%x\n", @@ -714,11 +720,12 @@ next_entry: else strncpy((char *)transl_str, "Unknown", 7); /* currently we are not supporting static/alg entries */ ip.s_addr = clib_net_to_host_u32(u_ki.k.k.ipv4); + hw = vnet_get_hw_interface (dm->vnet_main, u_ki.k.k.vrf); vlib_cli_output (vm, "Inside-translation details\n"); vlib_cli_output (vm, "--------------------------\n"); - vlib_cli_output (vm, "Inside interface index : 0x%x\n", u_ki.k.k.vrf); + vlib_cli_output (vm, "Inside interface : %s\n", hw->name); vlib_cli_output (vm, "Inside address : %s\n", inet_ntoa(ip)); vlib_cli_output (vm, "Start port : %u\n", start_port); vlib_cli_output (vm, "End port : %u\n", end_port); @@ -779,6 +786,8 @@ void cnat_v4_show_outside_entry_req_t_handler u8 done = 0; u8 display_entry; u8 flag_str[11]; + vnet_hw_interface_t * hw; + dpdk_main_t * dm = &dpdk_main; ko.k.k.ipv4 = mp->ipv4_addr; ko.k.k.vrf = mp->vrf_id; @@ -899,11 +908,12 @@ void cnat_v4_show_outside_entry_req_t_handler else strncpy((char *)transl_str, "Unknown", 7); /* currently we are not supporting static/alg entries */ ip.s_addr = clib_net_to_host_u32(ko.k.k.ipv4); + hw = vnet_get_hw_interface (dm->vnet_main, (ko.k.k.vrf & CNAT_VRF_MASK)); vlib_cli_output (vm, "Outside-translation details\n"); vlib_cli_output (vm, "--------------------------\n"); - vlib_cli_output (vm, "Outside interface index : 0x%x\n", (ko.k.k.vrf & CNAT_VRF_MASK)); + vlib_cli_output (vm, "Outside interface : %s\n", hw->name); vlib_cli_output (vm, "Outside address : %s\n", inet_ntoa(ip)); vlib_cli_output (vm, "Start port : %u\n", start_port); vlib_cli_output (vm, "End port : %u\n", end_port); diff --git a/vnet/vnet/vcgn/cnat_ipv4_icmp.h b/vnet/vnet/vcgn/cnat_ipv4_icmp.h index 69505a0364f..664b62ac3dc 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_icmp.h +++ b/vnet/vnet/vcgn/cnat_ipv4_icmp.h @@ -38,14 +38,23 @@ typedef struct { u16 *em_l4_checksum; } icmp_em_ip_info; -inline void swap_ip_src_icmp_id(ipv4_header *ip, +extern void swap_ip_src_icmp_id(ipv4_header *ip, icmp_v4_t *icmp, cnat_main_db_entry_t *db, - u16 vrf); + u16 vrf); -inline void swap_ip_dst_icmp_id(ipv4_header *ip, +extern void swap_ip_dst_icmp_id(ipv4_header *ip, icmp_v4_t *icmp, cnat_main_db_entry_t *db, - u16 vrf); + u16 vrf); + +extern void swap_ip_src_emip_dst(ipv4_header *ip, + icmp_em_ip_info *icmp_info, + cnat_main_db_entry_t *db, u16 vrf); + +extern void swap_ip_dst_emip_src(ipv4_header *ip, + icmp_em_ip_info *icmp_info, + cnat_main_db_entry_t *db, u16 vrf); + #endif /* __CNAT_IPV4_ICMP_H__ */ diff --git a/vnet/vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c b/vnet/vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c index 998663d73cb..218d7e538fa 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c @@ -62,7 +62,7 @@ vlib_node_registration_t cnat_ipv4_icmp_e_inside_input_node; #define NSTAGES 5 -void swap_ip_src_emip_dst(ipv4_header *ip, +inline void swap_ip_src_emip_dst(ipv4_header *ip, icmp_em_ip_info *icmp_info, cnat_main_db_entry_t *db, u16 vrf) { diff --git a/vnet/vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c b/vnet/vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c index ae856da1a4e..f25f4d022c7 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c @@ -62,7 +62,7 @@ vlib_node_registration_t cnat_ipv4_icmp_e_outside_input_node; #define NSTAGES 5 -void swap_ip_dst_emip_src(ipv4_header *ip, +inline void swap_ip_dst_emip_src(ipv4_header *ip, icmp_em_ip_info *icmp_info, cnat_main_db_entry_t *db, u16 vrf) { diff --git a/vnet/vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c b/vnet/vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c index 0d261bf030b..1b9f0266d71 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c @@ -65,7 +65,7 @@ vlib_node_registration_t cnat_ipv4_icmp_q_inside_input_node; #define NSTAGES 5 -void swap_ip_src_icmp_id(ipv4_header *ip, +inline void swap_ip_src_icmp_id(ipv4_header *ip, icmp_v4_t *icmp, cnat_main_db_entry_t *db, u16 vrf) { diff --git a/vnet/vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c b/vnet/vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c index 62b95f7ccc0..2c05e0b400e 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c @@ -64,7 +64,7 @@ vlib_node_registration_t cnat_ipv4_icmp_q_outside_input_node; #define NSTAGES 5 -void swap_ip_dst_icmp_id(ipv4_header *ip, +inline void swap_ip_dst_icmp_id(ipv4_header *ip, icmp_v4_t *icmp, cnat_main_db_entry_t *db, u16 vrf) { diff --git a/vnet/vnet/vcgn/cnat_ipv4_udp.h b/vnet/vnet/vcgn/cnat_ipv4_udp.h index f6c5b5e0133..1ccf74a004e 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_udp.h +++ b/vnet/vnet/vcgn/cnat_ipv4_udp.h @@ -31,10 +31,10 @@ #include "cnat_global.h" #include "cnat_config.h" -inline void swap_ip_src_udp_port(ipv4_header *ip, +extern void swap_ip_src_udp_port(ipv4_header *ip, udp_hdr_type_t *udp, cnat_main_db_entry_t *db); -inline void swap_ip_dst_udp_port(ipv4_header *ip, +extern void swap_ip_dst_udp_port(ipv4_header *ip, udp_hdr_type_t *udp, cnat_main_db_entry_t *db, u16 vrf); diff --git a/vnet/vnet/vcgn/cnat_ipv4_udp_inside_input.c b/vnet/vnet/vcgn/cnat_ipv4_udp_inside_input.c index 246bec1d02f..657c5f1e64e 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_udp_inside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_udp_inside_input.c @@ -111,7 +111,7 @@ is_pcp_pkt(spp_ctx_t *ctx, u32 addr, u16 port) } #endif -void swap_ip_src_udp_port(ipv4_header *ip, +inline void swap_ip_src_udp_port(ipv4_header *ip, udp_hdr_type_t *udp, cnat_main_db_entry_t *db) { diff --git a/vnet/vnet/vcgn/cnat_ipv4_udp_outside_input.c b/vnet/vnet/vcgn/cnat_ipv4_udp_outside_input.c index 5783314a7ea..f6ffd4efa7e 100644 --- a/vnet/vnet/vcgn/cnat_ipv4_udp_outside_input.c +++ b/vnet/vnet/vcgn/cnat_ipv4_udp_outside_input.c @@ -137,7 +137,7 @@ is_static_dest_nat_enabled(u16 vrf) return CNAT_NO_CONFIG; }*/ -inline void swap_ip_dst(ipv4_header *ip, +static inline void swap_ip_dst(ipv4_header *ip, cnat_main_db_entry_t *db, u16 vrf) { @@ -177,7 +177,7 @@ inline void swap_ip_dst(ipv4_header *ip, #endif } -void swap_ip_dst_udp_port(ipv4_header *ip, +inline void swap_ip_dst_udp_port(ipv4_header *ip, udp_hdr_type_t *udp, cnat_main_db_entry_t *db, u16 vrf) { diff --git a/vnet/vnet/vcgn/cnat_logging.c b/vnet/vnet/vcgn/cnat_logging.c index f46dd0ac95a..45cfbe8ddfb 100644 --- a/vnet/vnet/vcgn/cnat_logging.c +++ b/vnet/vnet/vcgn/cnat_logging.c @@ -311,6 +311,7 @@ cnat_nfv9_dump_logging_context (u32 value1, * returns the difference */ +static inline int cnat_nfv9_pad_added_to_an_addr(u8 *new_addr, u8 *org_addr) { uword addr1 = (uword) new_addr; @@ -327,6 +328,7 @@ int cnat_nfv9_pad_added_to_an_addr(u8 *new_addr, u8 *org_addr) * pointer to the data pointer */ +static inline u8 *cnat_nfv9_add_end_of_record_padding (u8 *data_ptr) { uword tmp = (uword) data_ptr; @@ -346,6 +348,7 @@ u8 *cnat_nfv9_add_end_of_record_padding (u8 *data_ptr) * pointer to the data pointer */ +static inline u16 cnat_nfv9_pad_end_of_record_length (u16 record_length) { u16 pad_value = NFV9_PAD_VALUE; @@ -420,6 +423,7 @@ void fill_ip_n_udp_hdr (u32 ipv4_addr, u16 port, * structure that contains the packet context */ +static inline void cnat_nfv9_fill_nfv9_ip_header (cnat_nfv9_logging_info_t *nfv9_logging_info) { u16 new_record_length = 0; @@ -489,8 +493,10 @@ void cnat_nfv9_fill_nfv9_ip_header (cnat_nfv9_logging_info_t *nfv9_logging_info) * structure that contains the packet context */ +static inline void cnat_nfv9_send_queued_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) { + return; } /* @@ -504,6 +510,7 @@ void cnat_nfv9_send_queued_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) * structure that contains the packet context */ +static inline void cnat_nfv9_send_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) { cnat_nfv9_fill_nfv9_ip_header(nfv9_logging_info); @@ -548,64 +555,8 @@ void cnat_nfv9_send_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) /* * send_vpp3_nfv9_pkt: to send multiple b0 in a frame */ -#if 0 -inline void send_vpp3_nfv9_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) -{ - vlib_main_t *vm = vlib_get_main(); - vlib_frame_t *f; - vlib_buffer_t *b0; - u32 ip4_input_node_index; - //u32 * to_next, * from, bi0 =0; - u32 bi0 =0; - ipv4_header * h0, *ip; - static u32 * buffers; - u32 nalloc; - udp_header_t * udp; - u16 udp_length, ip_length; - - - ip4_input_node_index = nfv9_logging_info->ip4_input_node_index; - f = nfv9_logging_info->f; - if (f == NULL) { - nfv9_logging_info->f = vlib_get_frame_to_node(vm, ip4_input_node_index); - f = nfv9_logging_info->f; - f->n_vectors = 0; - nfv9_logging_info->to_next = vlib_frame_vector_args (f); - } - /* Build a pkt from whole cloth */ - b0 = nfv9_logging_info->current_logging_context; - //to_next = nfv9_logging_info->to_next; - ip = vlib_buffer_get_current (b0); - //if (PREDICT_TRUE(f->n_vectors < VLIB_FRAME_SIZE)) { - if (PREDICT_TRUE(f->n_vectors < 5)) { - - b0->current_length = clib_net_to_host_u16(ip->total_len_bytes); - bi0 = vlib_get_buffer_index (vm, b0); - nfv9_logging_info->to_next[0] = bi0; - printf("f->n_vec %d f %p to_next %p val %d b0 %p\n", - f->n_vectors, f, nfv9_logging_info->to_next, - nfv9_logging_info->to_next[0], b0); - //to_next++; - nfv9_logging_info->to_next++; // = to_next; - f->n_vectors++; - } - - //if (f->n_vectors == VLIB_FRAME_SIZE) - if (f->n_vectors == 5) { - printf("sending pkt on 256\n"); - printf("%s: total_len_bytes %d bi %d nfv9_logging_info->pkt_length %d index %d\n", - __func__, clib_net_to_host_u16(ip->total_len_bytes), - bi0, nfv9_logging_info->pkt_length, ip4_input_node_index); - vlib_put_frame_to_node(vm, ip4_input_node_index, f); - nfv9_logging_info->f = NULL; - nfv9_logging_info->to_next = NULL; - } - return; -} -#endif -/* - * send_vpp3_nfv9_pkt: to send one b0 in a frame - */ + +static inline void send_vpp3_nfv9_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) { vlib_node_t *output_node; @@ -648,6 +599,7 @@ void send_vpp3_nfv9_pkt (cnat_nfv9_logging_info_t *nfv9_logging_info) * vlib_node_t structure for rewrite_output node */ +static inline void cnat_nfv9_send_pkt_always_success ( cnat_nfv9_logging_info_t *nfv9_logging_info, vlib_node_t *output_node) @@ -723,6 +675,7 @@ void cnat_nfv9_send_pkt_always_success ( * the packet context as well. */ +static inline void cnat_nfv9_create_logging_context ( cnat_nfv9_logging_info_t *nfv9_logging_info, cnat_nfv9_template_add_flag_t template_flag) @@ -2715,7 +2668,7 @@ void cnat_nfv9_ds_lite_log_session_delete( */ -inline +static inline void handle_vrfid_name_mapping(void) { cnat_nfv9_logging_info_t *nfv9_logging_info = NULL; diff --git a/vnet/vnet/vcgn/cnat_show.c b/vnet/vnet/vcgn/cnat_show.c index 70476193797..68c52756d2a 100644 --- a/vnet/vnet/vcgn/cnat_show.c +++ b/vnet/vnet/vcgn/cnat_show.c @@ -496,21 +496,24 @@ static void print_server_ip_address (vlib_main_t *vm, u32 ip) bytes[1] = (ip >> 8) & 0xFF; bytes[2] = (ip >> 16) & 0xFF; bytes[3] = (ip >> 24) & 0xFF; - vlib_cli_output(vm, "\tIP Address %d.%d.%d.%d\n", bytes[0], bytes[1], bytes[2], bytes[3]); + vlib_cli_output(vm, "\tIP Address : %d.%d.%d.%d\n", bytes[0], bytes[1], bytes[2], bytes[3]); } void cnat_nfv9_show_collector (vlib_main_t *vm, cnat_nfv9_logging_info_t *my_nfv9_logging_info) { nfv9_server_info_t *server = nfv9_server_info_pool + my_nfv9_logging_info->server_index; - +#if 0 vlib_cli_output(vm,"\tVRF - 0x%x - %s\n", my_nfv9_logging_info->i_vrf, my_nfv9_logging_info->deleted?"DELETED":"ACTIVE"); +#endif print_server_ip_address(vm, clib_net_to_host_u32(server->ipv4_address)); - vlib_cli_output(vm,"\tIP port %d\n", server->port); - vlib_cli_output(vm,"\tTimeout %d\n", server->timeout_rate); - vlib_cli_output(vm,"\tRefresh %d\n", server->refresh_rate); - vlib_cli_output(vm,"\tMax PkSz %d\n", my_nfv9_logging_info->max_length_minus_max_record_size); + vlib_cli_output(vm,"\tPort : %d\n", server->port); + vlib_cli_output(vm,"\tTimeout : %d\n", server->timeout_rate); + vlib_cli_output(vm,"\tRefresh Rate : %d\n", server->refresh_rate); + vlib_cli_output(vm,"\tMax Pkt Size : %d\n", my_nfv9_logging_info->max_length_minus_max_record_size); + + return; } void cnat_db_dump_policy (int argc, unsigned long *argv) diff --git a/vnet/vnet/vcgn/cnat_v4_functions.c b/vnet/vnet/vcgn/cnat_v4_functions.c index bb25f5ef9bd..d3051fba5a7 100644 --- a/vnet/vnet/vcgn/cnat_v4_functions.c +++ b/vnet/vnet/vcgn/cnat_v4_functions.c @@ -264,7 +264,7 @@ print_tcp_pkt (ipv4_header *ip) * ip & tcp checksum update (incremental) */ -void tcp_in2out_nat_mss_n_checksum (ipv4_header * ip, +inline void tcp_in2out_nat_mss_n_checksum (ipv4_header * ip, tcp_hdr_type * tcp, u32 ipv4_addr, u16 port, diff --git a/vnet/vnet/vcgn/cnat_v4_functions.h b/vnet/vnet/vcgn/cnat_v4_functions.h index 047fe33cc4c..2429e5e1437 100644 --- a/vnet/vnet/vcgn/cnat_v4_functions.h +++ b/vnet/vnet/vcgn/cnat_v4_functions.h @@ -296,7 +296,7 @@ cnat_v4_recalculate_tcp_checksum (ipv4_header *ip, } -inline void tcp_in2out_nat_mss_n_checksum (ipv4_header *ip, +extern void tcp_in2out_nat_mss_n_checksum (ipv4_header *ip, tcp_hdr_type *tcp, u32 ipv4_addr, u16 port, diff --git a/vnet/vnet/vcgn/spp_platform_trace_log.c b/vnet/vnet/vcgn/spp_platform_trace_log.c index 8d1f49bf3ac..a96894f935d 100644 --- a/vnet/vnet/vcgn/spp_platform_trace_log.c +++ b/vnet/vnet/vcgn/spp_platform_trace_log.c @@ -977,7 +977,7 @@ void spp_printf(u16 error_code, u16 num_args, u32 *arg) /* To be filled */ } -u32 spp_trace_log_get_unix_time_in_seconds (void) +inline u32 spp_trace_log_get_unix_time_in_seconds (void) { vlib_main_t *vlib_main; diff --git a/vnet/vnet/vcgn/spp_platform_trace_log.h b/vnet/vnet/vcgn/spp_platform_trace_log.h index cffe5a09956..36da710f28c 100644 --- a/vnet/vnet/vcgn/spp_platform_trace_log.h +++ b/vnet/vnet/vcgn/spp_platform_trace_log.h @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. *------------------------------------------------------------------ - */ + */ #ifndef __SPP_PLATFORM_TRACE_LOG_H__ #define __SPP_PLATFORM_TRACE_LOG_H__ @@ -339,10 +339,11 @@ void spp_printf(u16 error_code, u16 num_args, u32 *arg); * The following 2 functions are temporary hacks until * we have RTC support from the PD nodes */ +#if 0 inline u32 spp_trace_log_get_sys_up_time_in_ms (void); - -inline +#endif +extern u32 spp_trace_log_get_unix_time_in_seconds (void); enum { diff --git a/vnet/vnet/vcgn/vcgn_classify.c b/vnet/vnet/vcgn/vcgn_classify.c index 5574f80287e..4a1d7466beb 100644 --- a/vnet/vnet/vcgn/vcgn_classify.c +++ b/vnet/vnet/vcgn/vcgn_classify.c @@ -799,11 +799,6 @@ static inline u16 nfv9_get_max_length_minus_max_record_size(u16 path_mtu) * requires max number of bytes. If you add more records, * this needs to be re-checked */ if (max_length_minus_max_record_size < CNAT_NFV9_MIN_RECORD_SIZE) { - printf( - "Resetting max_length_minus_max_record_size from %d to %ld\n", - max_length_minus_max_record_size, - CNAT_NFV9_MIN_RECORD_SIZE); - max_length_minus_max_record_size = CNAT_NFV9_MIN_RECORD_SIZE; } return max_length_minus_max_record_size; @@ -948,7 +943,6 @@ set_vcgn_nfv9_logging_cofig_command_fn (vlib_main_t * vm, u16 i_vrf; u32 i_vrf_id; u8 found; - u8 found_vrf; /* * Init NFv9 logging info as needed, this will be done only once */ @@ -983,6 +977,9 @@ set_vcgn_nfv9_logging_cofig_command_fn (vlib_main_t * vm, ip_addr, port, refresh_rate, timeout, pmtu, enable); #endif + if (refresh_rate == 0) refresh_rate = 500; /* num of pkts */ + if (timeout == 0) timeout = 30; /* in mins */ + nfv9_conf.enable = enable; nfv9_conf.ipv4_address = ip_addr; nfv9_conf.i_vrf_id = vcm->inside_sw_if_index; @@ -1009,16 +1006,11 @@ set_vcgn_nfv9_logging_cofig_command_fn (vlib_main_t * vm, /* Do we already have a map for this VRF? */ pool_foreach (my_nfv9_logging_info, cnat_nfv9_logging_info_pool, ({ if (my_nfv9_logging_info->i_vrf_id == i_vrf_id) { - found_vrf = 1; - printf("found_vrf %d\n", found_vrf); nfv9_server_info_t *server = nfv9_server_info_pool + my_nfv9_logging_info->server_index; - printf("server ip4 0x%x port %d\n", server->ipv4_address, server->port); - printf("nfv9_conf v4 0x%x port %d\n", nfv9_conf.ipv4_address, nfv9_conf.port); if((server->ipv4_address == (nfv9_conf.ipv4_address)) && (server->port == (nfv9_conf.port))) { found = 1; my_nfv9_logging_info_tmp = my_nfv9_logging_info; - printf("found %d\n", found); break; } } @@ -1280,7 +1272,6 @@ set_vcgn_nfv9_logging_cofig_command_fn (vlib_main_t * vm, } my_vrfmap->nf_logging_policy = nfv9_logging_policy; } - printf("After deleting the netflow server,Netflow logging policy = %d\n", my_vrfmap->nf_logging_policy); } done: -- cgit 1.2.3-korg