flowtracker.c (5416B)
1 /* 2 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 3 * 4 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 5 */ 6 7 #include <shared/bslenum.h> 8 #include <shared/bsl.h> 9 10 #include <soc/defs.h> 11 #include <soc/drv.h> 12 13 #include <bcm/error.h> 14 #include <bcm/flowtracker.h> 15 16 17 /* Initialize a flowtracker collector information structure. */ 18 void bcm_flowtracker_collector_info_t_init(bcm_flowtracker_collector_info_t *collector_info) 19 { 20 sal_memset(collector_info, 0, sizeof(bcm_flowtracker_collector_info_t)); 21 } 22 23 24 /* Initialize a flowtracker flow group information structure. */ 25 void bcm_flowtracker_group_info_t_init( 26 bcm_flowtracker_group_info_t *flow_group_info) 27 { 28 sal_memset(flow_group_info, 0, sizeof(bcm_flowtracker_group_info_t)); 29 } 30 31 /* Initialize flowtracker template transmit configuration. */ 32 void bcm_flowtracker_template_transmit_config_t_init( 33 bcm_flowtracker_template_transmit_config_t *config) 34 { 35 sal_memset(config, 0, sizeof(bcm_flowtracker_template_transmit_config_t)); 36 } 37 38 /* Initialize flow key. */ 39 void bcm_flowtracker_flow_key_t_init(bcm_flowtracker_flow_key_t *flow_key) 40 { 41 sal_memset(flow_key, 0, sizeof(bcm_flowtracker_flow_key_t)); 42 } 43 44 /* Initialize a flowtracker group action info structure. */ 45 void bcm_flowtracker_group_action_info_t_init( 46 bcm_flowtracker_group_action_info_t *action_info) 47 { 48 sal_memset(action_info, 0, sizeof(bcm_flowtracker_group_action_info_t)); 49 } 50 51 /* Initialize a flowtracker elephant profile info structure. */ 52 void bcm_flowtracker_elephant_profile_info_t_init( 53 bcm_flowtracker_elephant_profile_info_t *profile) 54 { 55 sal_memset(profile, 0, sizeof(bcm_flowtracker_elephant_profile_info_t)); 56 } 57 58 /* Initialize a flowtracker check information structure. */ 59 void bcm_flowtracker_check_info_t_init( 60 bcm_flowtracker_check_info_t *info) 61 { 62 sal_memset(info, 0, sizeof(bcm_flowtracker_check_info_t)); 63 } 64 65 /* Initialize a flowtracker collector copy information structure. */ 66 void bcm_flowtracker_collector_copy_info_t_init( 67 bcm_flowtracker_collector_copy_info_t *info) 68 { 69 sal_memset(info, 0, sizeof(bcm_flowtracker_collector_copy_info_t)); 70 } 71 72 /* Initialize a flowtracker meter information structure. */ 73 void bcm_flowtracker_meter_info_t_init( 74 bcm_flowtracker_meter_info_t *info) 75 { 76 sal_memset(info, 0, sizeof(bcm_flowtracker_meter_info_t)); 77 } 78 79 /* Initialize a flowtracker check action information structure. */ 80 void bcm_flowtracker_check_action_info_t_init( 81 bcm_flowtracker_check_action_info_t *info) 82 { 83 sal_memset(info, 0, sizeof(bcm_flowtracker_check_action_info_t)); 84 } 85 86 /* Initialize a flowtracker check export information structure. */ 87 void bcm_flowtracker_check_export_info_t_init( 88 bcm_flowtracker_check_export_info_t *info) 89 { 90 sal_memset(info, 0, sizeof(bcm_flowtracker_check_export_info_t)); 91 } 92 93 /* Initialize a flowtracker tracking parameter information structure. */ 94 void bcm_flowtracker_tracking_param_info_t_init( 95 bcm_flowtracker_tracking_param_info_t *info) 96 { 97 98 sal_memset(info, 0, sizeof(bcm_flowtracker_tracking_param_info_t)); 99 _shr_ip6_mask_create(info->mask, BCM_FLOWTRACKER_TRACKING_PARAM_MASK_LEN); 100 101 } 102 103 /* Initialize a flowtracker user entry information structure. */ 104 void bcm_flowtracker_user_entry_handle_t_init( 105 bcm_flowtracker_user_entry_handle_t *info) 106 { 107 sal_memset(info, 0, sizeof(bcm_flowtracker_user_entry_handle_t)); 108 } 109 110 /* Initialize a flowtracker group statistics structure. */ 111 void bcm_flowtracker_group_stat_t_init( 112 bcm_flowtracker_group_stat_t *group_stats) 113 { 114 sal_memset(group_stats, 0, sizeof(bcm_flowtracker_group_stat_t)); 115 } 116 117 /* Initialize a flowtracker CPU notification information structure. */ 118 void bcm_flowtracker_cpu_notification_info_t_init( 119 bcm_flowtracker_cpu_notification_info_t *info) 120 { 121 sal_memset(info, 0, sizeof(bcm_flowtracker_cpu_notification_info_t)); 122 } 123 124 /* Initialize a flowtracker callback options structure. */ 125 void bcm_flowtracker_collector_callback_options_t_init( 126 bcm_flowtracker_collector_callback_options_t *callback_options) 127 { 128 sal_memset(callback_options, 0, sizeof(bcm_flowtracker_collector_callback_options_t)); 129 } 130 131 /* Initialize a flowtracker export record structure. */ 132 void bcm_flowtracker_export_record_t_init( 133 bcm_flowtracker_export_record_t *record) 134 { 135 sal_memset(record, 0, sizeof(bcm_flowtracker_export_record_t)); 136 } 137 138 139 /* Initialize a flowtracker export trigger information structure, */ 140 void bcm_flowtracker_export_trigger_info_t_init( 141 bcm_flowtracker_export_trigger_info_t *info) 142 { 143 sal_memset(info, 0, sizeof(bcm_flowtracker_export_trigger_info_t)); 144 } 145 146 /* Initialize a flowtracker export trigger information structure, */ 147 void bcm_flowtracker_chip_debug_info_t_init( 148 bcm_flowtracker_chip_debug_info_t *info) 149 { 150 sal_memset(info, 0, sizeof(bcm_flowtracker_chip_debug_info_t)); 151 } 152 153 /* Initialize elephant match data. */ 154 void bcm_flowtracker_elephant_match_data_t_init( 155 bcm_flowtracker_elephant_match_data_t *match_data) 156 { 157 sal_memset(match_data, 0, sizeof(bcm_flowtracker_elephant_match_data_t)); 158 } 159 160 /* Initialize elephant stats */ 161 void bcm_flowtracker_elephant_stats_t_init(bcm_flowtracker_elephant_stats_t *stats) 162 { 163 sal_memset(stats, 0, sizeof(bcm_flowtracker_elephant_stats_t)); 164 }