l3.c (5609B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: l3.c 8 * Purpose: Tracks and manages l3 routing tables and interfaces. 9 */ 10 11 #ifdef INCLUDE_L3 12 13 #include <soc/drv.h> 14 #include <soc/mem.h> 15 16 #include <bcm/error.h> 17 #include <bcm/vlan.h> 18 #include <bcm/port.h> 19 20 #include <bcm_int/esw/mbcm.h> 21 #include <bcm_int/esw/l3.h> 22 23 int 24 bcm_hercules_l3_tables_init(int unit) 25 { 26 return BCM_E_NONE; 27 } 28 29 int 30 bcm_hercules_l3_tables_cleanup(int unit) 31 { 32 return BCM_E_NONE; 33 } 34 35 int 36 bcm_hercules_l3_enable(int unit, int enable) 37 { 38 return BCM_E_NONE; 39 } 40 41 int 42 bcm_hercules_l3_intf_get(int unit, _bcm_l3_intf_cfg_t *intf_info) 43 { 44 return (BCM_E_UNAVAIL); 45 } 46 47 int 48 bcm_hercules_l3_intf_get_by_vid(int unit, _bcm_l3_intf_cfg_t *intf_info) 49 { 50 return (BCM_E_UNAVAIL); 51 } 52 53 int 54 bcm_hercules_l3_intf_create(int unit, _bcm_l3_intf_cfg_t *intf_info) 55 { 56 return (BCM_E_UNAVAIL); 57 } 58 59 int 60 bcm_hercules_l3_intf_id_create(int unit, _bcm_l3_intf_cfg_t *intf_info) 61 { 62 return (BCM_E_UNAVAIL); 63 } 64 65 int 66 bcm_hercules_l3_intf_lookup(int unit, _bcm_l3_intf_cfg_t *l3i) 67 { 68 return (BCM_E_UNAVAIL); 69 } 70 71 int 72 bcm_hercules_l3_intf_del(int unit, _bcm_l3_intf_cfg_t *intf_info) 73 { 74 return (BCM_E_UNAVAIL); 75 } 76 77 int 78 bcm_hercules_l3_intf_del_all(int unit) 79 { 80 return (BCM_E_UNAVAIL); 81 } 82 83 int 84 bcm_hercules_l3_get(int unit, int flag, _bcm_l3_cfg_t *l3cfg) 85 { 86 return (BCM_E_UNAVAIL); 87 } 88 89 int 90 bcm_hercules_l3_add(int unit, _bcm_l3_cfg_t *l3cfg) 91 { 92 return (BCM_E_UNAVAIL); 93 } 94 95 int 96 bcm_hercules_l3_del(int unit, _bcm_l3_cfg_t *l3cfg) 97 { 98 return (BCM_E_UNAVAIL); 99 } 100 101 int 102 bcm_hercules_l3_del_prefix(int unit, _bcm_l3_cfg_t *l3cfg) 103 { 104 return (BCM_E_UNAVAIL); 105 } 106 107 int 108 bcm_hercules_l3_del_intf(int unit, _bcm_l3_cfg_t *l3cfg, int negate) 109 { 110 return (BCM_E_UNAVAIL); 111 } 112 113 int 114 bcm_hercules_l3_del_all(int unit) 115 { 116 return (BCM_E_UNAVAIL); 117 } 118 119 int 120 bcm_hercules_l3_replace(int unit, _bcm_l3_cfg_t *l3cfg) 121 { 122 return (BCM_E_UNAVAIL); 123 } 124 125 int 126 bcm_hercules_l3_conflict_get(int unit, bcm_l3_key_t *ipkey, 127 bcm_l3_key_t *cf_array, int cf_max, int *cf_count) 128 { 129 return (BCM_E_UNAVAIL); 130 } 131 132 int 133 bcm_hercules_defip_cfg_get(int unit, _bcm_defip_cfg_t *defip) 134 { 135 return (BCM_E_UNAVAIL); 136 } 137 138 int 139 bcm_hercules_defip_ecmp_get_all(int unit, _bcm_defip_cfg_t *defip, 140 bcm_l3_route_t *path_array, int max_path, int *path_count) 141 { 142 return (BCM_E_UNAVAIL); 143 } 144 145 int 146 bcm_hercules_defip_add(int unit, _bcm_defip_cfg_t *defip) 147 { 148 return (BCM_E_UNAVAIL); 149 } 150 151 int 152 bcm_hercules_defip_del(int unit, _bcm_defip_cfg_t *defip) 153 { 154 return (BCM_E_UNAVAIL); 155 } 156 157 int 158 bcm_hercules_defip_del_intf(int unit, _bcm_defip_cfg_t *defip, int negate) 159 { 160 return (BCM_E_UNAVAIL); 161 } 162 163 int 164 bcm_hercules_defip_del_all(int unit) 165 { 166 return (BCM_E_UNAVAIL); 167 } 168 169 int 170 bcm_hercules_l3_age(int unit, uint32 flags, bcm_l3_host_traverse_cb age_out, 171 void *user_data) 172 { 173 return (BCM_E_UNAVAIL); 174 } 175 176 int 177 bcm_hercules_l3_traverse(int unit, uint32 flags, uint32 start, 178 uint32 end, bcm_l3_host_traverse_cb cb, 179 void *user_data) 180 { 181 return (BCM_E_UNAVAIL); 182 } 183 184 int 185 bcm_hercules_l3_info(int unit, bcm_l3_info_t *l3info) 186 { 187 l3info->l3info_max_intf = 0; 188 l3info->l3info_max_host = 0; 189 l3info->l3info_max_route = 0; 190 l3info->l3info_occupied_intf = 0; 191 l3info->l3info_occupied_host = 0; 192 l3info->l3info_occupied_route = 0; 193 l3info->l3info_max_lpm_block = 0; 194 l3info->l3info_used_lpm_block = 0; 195 196 /* Superseded values for backward compatibility */ 197 198 l3info->l3info_max_l3 = l3info->l3info_max_host; 199 l3info->l3info_max_defip = l3info->l3info_max_route; 200 l3info->l3info_occupied_l3 = l3info->l3info_occupied_host; 201 l3info->l3info_occupied_defip = l3info->l3info_occupied_route; 202 203 return (BCM_E_NONE); 204 } 205 206 int 207 bcm_hercules_defip_age(int unit, bcm_l3_route_traverse_cb age_out, 208 void *user_data) 209 { 210 return (BCM_E_UNAVAIL); 211 } 212 213 int 214 bcm_hercules_defip_traverse(int unit, uint32 start, uint32 end, 215 bcm_l3_route_traverse_cb trav_fn, void *user_data) 216 { 217 return (BCM_E_UNAVAIL); 218 } 219 220 int 221 bcm_hercules_l3_ip6_get(int unit, _bcm_l3_cfg_t *l3cfg) 222 { 223 return BCM_E_UNAVAIL; 224 } 225 226 int 227 bcm_hercules_l3_ip6_add(int unit, _bcm_l3_cfg_t *l3cfg) 228 { 229 return BCM_E_UNAVAIL; 230 } 231 232 int 233 bcm_hercules_l3_ip6_del(int unit, _bcm_l3_cfg_t *l3cfg) 234 { 235 return BCM_E_UNAVAIL; 236 } 237 238 int 239 bcm_hercules_l3_ip6_del_prefix(int unit, _bcm_l3_cfg_t *l3cfg) 240 { 241 return BCM_E_UNAVAIL; 242 } 243 244 int 245 bcm_hercules_l3_ip6_replace(int unit, _bcm_l3_cfg_t *l3cfg) 246 { 247 return BCM_E_UNAVAIL; 248 } 249 250 int 251 bcm_hercules_l3_ip6_traverse(int unit, uint32 start, uint32 end, 252 bcm_l3_host_traverse_cb cb, void *user_data) 253 { 254 return (BCM_E_UNAVAIL); 255 } 256 257 int 258 bcm_hercules_ip6_defip_cfg_get(int unit, _bcm_defip_cfg_t *defip) 259 { 260 return BCM_E_UNAVAIL; 261 } 262 263 int 264 bcm_hercules_ip6_defip_ecmp_get_all(int unit, _bcm_defip_cfg_t *defip, 265 bcm_l3_route_t *path_array, int max_path, int *path_count) 266 { 267 return (BCM_E_UNAVAIL); 268 } 269 270 271 int 272 bcm_hercules_ip6_defip_traverse(int unit, uint32 start, uint32 end, 273 bcm_l3_route_traverse_cb trav_fn, void *user_data) 274 { 275 return (BCM_E_UNAVAIL); 276 } 277 278 int 279 bcm_hercules_ip6_defip_add(int unit, _bcm_defip_cfg_t *defip) 280 { 281 return BCM_E_UNAVAIL; 282 } 283 284 int 285 bcm_hercules_ip6_defip_del(int unit, _bcm_defip_cfg_t *defip) 286 { 287 return BCM_E_UNAVAIL; 288 } 289 290 #endif /* INCLUDE_L3 */ 291 292 int _bcm_esw_hercules_l3_not_empty;