Lines Matching refs:route_rule

5212 …struct necp_route_rule *route_rule = necp_lookup_route_rule_locked(&necp_route_rules, result_param…  in __sized_by()  local
5213 if (route_rule != NULL) { in __sized_by()
5215 if (route_rule->exception_if_indices[index] != 0) { in __sized_by()
5216 ifnet_t interface = ifindex2ifnet[route_rule->exception_if_indices[index]]; in __sized_by()
5222 switch (route_rule->default_action) { in __sized_by()
5226 (route_rule->cellular_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Cell " : "", in __sized_by()
5227 (route_rule->wifi_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "WiFi " : "", in __sized_by()
5228 (route_rule->wired_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Wired " : "", in __sized_by()
5229 (route_rule->expensive_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Exp " : "", in __sized_by()
5230 (route_rule->constrained_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Constrained " : "", in __sized_by()
5231 …(route_rule->ultra_constrained_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Ultra-Constrained " :… in __sized_by()
5232 (route_rule->companion_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "Companion " : "", in __sized_by()
5233 (route_rule->vpn_action == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? "VPN " : "", in __sized_by()
5234 …(route_rule->exception_if_actions[0] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[0] : "", in __sized_by()
5235 (route_rule->exception_if_actions[0] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5236 …(route_rule->exception_if_actions[1] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[1] : "", in __sized_by()
5237 (route_rule->exception_if_actions[1] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5238 …(route_rule->exception_if_actions[2] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[2] : "", in __sized_by()
5239 (route_rule->exception_if_actions[2] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5240 …(route_rule->exception_if_actions[3] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[3] : "", in __sized_by()
5241 (route_rule->exception_if_actions[3] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5242 …(route_rule->exception_if_actions[4] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[4] : "", in __sized_by()
5243 (route_rule->exception_if_actions[4] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5244 …(route_rule->exception_if_actions[5] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[5] : "", in __sized_by()
5245 (route_rule->exception_if_actions[5] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5246 …(route_rule->exception_if_actions[6] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[6] : "", in __sized_by()
5247 (route_rule->exception_if_actions[6] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5248 …(route_rule->exception_if_actions[7] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[7] : "", in __sized_by()
5249 (route_rule->exception_if_actions[7] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5250 …(route_rule->exception_if_actions[8] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[8] : "", in __sized_by()
5251 (route_rule->exception_if_actions[8] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? " " : "", in __sized_by()
5252 …(route_rule->exception_if_actions[9] == NECP_ROUTE_RULE_ALLOW_INTERFACE) ? interface_names[9] : ""… in __sized_by()
5256 IS_NECP_ROUTE_RULE_DENY(route_rule->cellular_action) ? "!Cell " : "", in __sized_by()
5257 IS_NECP_ROUTE_RULE_DENY(route_rule->wifi_action) ? "!WiFi " : "", in __sized_by()
5258 IS_NECP_ROUTE_RULE_DENY(route_rule->wired_action) ? "!Wired " : "", in __sized_by()
5259 IS_NECP_ROUTE_RULE_DENY(route_rule->expensive_action) ? "!Exp " : "", in __sized_by()
5260 IS_NECP_ROUTE_RULE_DENY(route_rule->constrained_action) ? "!Constrained " : "", in __sized_by()
5261 IS_NECP_ROUTE_RULE_DENY(route_rule->ultra_constrained_action) ? "!Ultra-Constrained " : "", in __sized_by()
5262 IS_NECP_ROUTE_RULE_DENY(route_rule->companion_action) ? "!Companion " : "", in __sized_by()
5263 IS_NECP_ROUTE_RULE_DENY(route_rule->vpn_action) ? "!VPN " : "", in __sized_by()
5264 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[0]) ? "!" : "", in __sized_by()
5265 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[0]) ? interface_names[0] : "", in __sized_by()
5266 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[1]) ? "!" : "", in __sized_by()
5267 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[1]) ? interface_names[1] : "", in __sized_by()
5268 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[2]) ? "!" : "", in __sized_by()
5269 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[2]) ? interface_names[2] : "", in __sized_by()
5270 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[3]) ? "!" : "", in __sized_by()
5271 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[3]) ? interface_names[3] : "", in __sized_by()
5272 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[4]) ? "!" : "", in __sized_by()
5273 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[4]) ? interface_names[4] : "", in __sized_by()
5274 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[5]) ? "!" : "", in __sized_by()
5275 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[5]) ? interface_names[5] : "", in __sized_by()
5276 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[6]) ? "!" : "", in __sized_by()
5277 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[6]) ? interface_names[6] : "", in __sized_by()
5278 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[7]) ? "!" : "", in __sized_by()
5279 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[7]) ? interface_names[7] : "", in __sized_by()
5280 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[8]) ? "!" : "", in __sized_by()
5281 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[8]) ? interface_names[8] : "", in __sized_by()
5282 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[9]) ? "!" : "", in __sized_by()
5283 IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[9]) ? interface_names[9] : ""); in __sized_by()
5287 (route_rule->cellular_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Cell " : "", in __sized_by()
5288 (route_rule->wifi_action == NECP_ROUTE_RULE_QOS_MARKING) ? "WiFi " : "", in __sized_by()
5289 (route_rule->wired_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Wired " : "", in __sized_by()
5290 (route_rule->expensive_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Exp " : "", in __sized_by()
5291 (route_rule->constrained_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Constrained " : "", in __sized_by()
5292 … (route_rule->ultra_constrained_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Ultra-Constrained " : "", in __sized_by()
5293 (route_rule->companion_action == NECP_ROUTE_RULE_QOS_MARKING) ? "Companion " : "", in __sized_by()
5294 (route_rule->vpn_action == NECP_ROUTE_RULE_QOS_MARKING) ? "VPN " : "", in __sized_by()
5295 … (route_rule->exception_if_actions[0] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[0] : "", in __sized_by()
5296 (route_rule->exception_if_actions[0] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5297 … (route_rule->exception_if_actions[1] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[1] : "", in __sized_by()
5298 (route_rule->exception_if_actions[1] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5299 … (route_rule->exception_if_actions[2] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[2] : "", in __sized_by()
5300 (route_rule->exception_if_actions[2] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5301 … (route_rule->exception_if_actions[3] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[3] : "", in __sized_by()
5302 (route_rule->exception_if_actions[3] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5303 … (route_rule->exception_if_actions[4] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[4] : "", in __sized_by()
5304 (route_rule->exception_if_actions[4] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5305 … (route_rule->exception_if_actions[5] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[5] : "", in __sized_by()
5306 (route_rule->exception_if_actions[5] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5307 … (route_rule->exception_if_actions[6] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[6] : "", in __sized_by()
5308 (route_rule->exception_if_actions[6] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5309 … (route_rule->exception_if_actions[7] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[7] : "", in __sized_by()
5310 (route_rule->exception_if_actions[7] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5311 … (route_rule->exception_if_actions[8] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[8] : "", in __sized_by()
5312 (route_rule->exception_if_actions[8] == NECP_ROUTE_RULE_QOS_MARKING) ? " " : "", in __sized_by()
5313 … (route_rule->exception_if_actions[9] == NECP_ROUTE_RULE_QOS_MARKING) ? interface_names[9] : ""); in __sized_by()
11966 struct necp_route_rule *route_rule = NULL; in necp_update_qos_marking() local
11968 route_rule = necp_lookup_route_rule_locked(&necp_route_rules, route_rule_id); in necp_update_qos_marking()
11969 if (route_rule == NULL) { in necp_update_qos_marking()
11974 if (route_rule->match_netagent_id != 0) { in necp_update_qos_marking()
11981 if (route_rule->match_netagent_id == netagent_array[agent_index]) { in necp_update_qos_marking()
11992 qos_marking = (route_rule->default_action == NECP_ROUTE_RULE_QOS_MARKING) ? TRUE : FALSE; in necp_update_qos_marking()
11999 if (route_rule->exception_if_indices[exception_index] == 0) { in necp_update_qos_marking()
12002 if (route_rule->exception_if_actions[exception_index] != NECP_ROUTE_RULE_QOS_MARKING) { in necp_update_qos_marking()
12005 if (route_rule->exception_if_indices[exception_index] == ifp->if_index) { in necp_update_qos_marking()
12009 route_rule->exception_if_indices[exception_index], route_rule_id, qos_marking); in necp_update_qos_marking()
12015 if ((route_rule->cellular_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_CELLULAR(ifp)) || in necp_update_qos_marking()
12016 (route_rule->wifi_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_WIFI(ifp)) || in necp_update_qos_marking()
12017 (route_rule->wired_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_WIRED(ifp)) || in necp_update_qos_marking()
12018 (route_rule->expensive_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_EXPENSIVE(ifp)) || in necp_update_qos_marking()
12019 (route_rule->constrained_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_CONSTRAINED(ifp)) || in necp_update_qos_marking()
12020 …(route_rule->ultra_constrained_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_ULTRA_CONSTRAINED… in necp_update_qos_marking()
12021 … (route_rule->companion_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_COMPANION_LINK(ifp)) || in necp_update_qos_marking()
12022 (route_rule->vpn_action == NECP_ROUTE_RULE_QOS_MARKING && IFNET_IS_VPN(ifp))) { in necp_update_qos_marking()
12026 route_rule->cellular_action, route_rule->wifi_action, route_rule->wired_action, in necp_update_qos_marking()
12027route_rule->expensive_action, route_rule->constrained_action, route_rule->companion_action, route_… in necp_update_qos_marking()
12028 route_rule->ultra_constrained_action, route_rule_id, qos_marking); in necp_update_qos_marking()
12146 struct necp_route_rule *route_rule = NULL; in necp_route_is_allowed_inner() local
12148 route_rule = necp_lookup_route_rule_locked(&necp_route_rules, route_rule_id); in necp_route_is_allowed_inner()
12149 if (route_rule == NULL) { in necp_route_is_allowed_inner()
12153 if (route_rule->match_netagent_id != 0) { in necp_route_is_allowed_inner()
12160 if (route_rule->match_netagent_id == netagent_array[agent_index]) { in necp_route_is_allowed_inner()
12171 default_is_allowed = IS_NECP_ROUTE_RULE_DENY(route_rule->default_action) ? FALSE : TRUE; in necp_route_is_allowed_inner()
12184 if (route_rule->exception_if_indices[exception_index] == 0) { in necp_route_is_allowed_inner()
12187 if (route_rule->exception_if_indices[exception_index] == ifp->if_index || in necp_route_is_allowed_inner()
12188 …(delegated_ifp != NULL && route_rule->exception_if_indices[exception_index] == delegated_ifp->if_i… in necp_route_is_allowed_inner()
12189 if (route_rule->exception_if_actions[exception_index] == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12193 route_rule->exception_if_indices[exception_index], route_rule_id); in necp_route_is_allowed_inner()
12196 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->exception_if_actions[exception_index])) { in necp_route_is_allowed_inner()
12198 … for Rule %d Allowed %d", route_rule->exception_if_indices[exception_index], route_rule_id, (IS_NE… in necp_route_is_allowed_inner()
12200 …if (IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[exception_index]) && route_rule->effe… in necp_route_is_allowed_inner()
12201 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12203 … return IS_NECP_ROUTE_RULE_DENY(route_rule->exception_if_actions[exception_index]) ? FALSE : TRUE; in necp_route_is_allowed_inner()
12209 if (route_rule->cellular_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12213 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12214 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12220 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->cellular_action)) { in necp_route_is_allowed_inner()
12223 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12224 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12229 IS_NECP_ROUTE_RULE_DENY(route_rule->cellular_action))) { in necp_route_is_allowed_inner()
12231 type_aggregate_action = route_rule->cellular_action; in necp_route_is_allowed_inner()
12237 if (route_rule->wifi_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12241 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12242 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12248 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->wifi_action)) { in necp_route_is_allowed_inner()
12251 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12252 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12257 IS_NECP_ROUTE_RULE_DENY(route_rule->wifi_action))) { in necp_route_is_allowed_inner()
12259 type_aggregate_action = route_rule->wifi_action; in necp_route_is_allowed_inner()
12266 if (route_rule->companion_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12270 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12271 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12277 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->companion_action)) { in necp_route_is_allowed_inner()
12280 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12281 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12286 IS_NECP_ROUTE_RULE_DENY(route_rule->companion_action))) { in necp_route_is_allowed_inner()
12288 type_aggregate_action = route_rule->companion_action; in necp_route_is_allowed_inner()
12294 if (route_rule->wired_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12298 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12299 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12305 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->wired_action)) { in necp_route_is_allowed_inner()
12308 if (route_rule->effective_type != 0) { in necp_route_is_allowed_inner()
12309 *interface_type_denied = route_rule->effective_type; in necp_route_is_allowed_inner()
12314 IS_NECP_ROUTE_RULE_DENY(route_rule->wired_action))) { in necp_route_is_allowed_inner()
12316 type_aggregate_action = route_rule->wired_action; in necp_route_is_allowed_inner()
12322 if (route_rule->expensive_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12327 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->expensive_action)) { in necp_route_is_allowed_inner()
12330 IS_NECP_ROUTE_RULE_DENY(route_rule->expensive_action))) { in necp_route_is_allowed_inner()
12332 type_aggregate_action = route_rule->expensive_action; in necp_route_is_allowed_inner()
12338 if (route_rule->constrained_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12343 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->constrained_action)) { in necp_route_is_allowed_inner()
12346 IS_NECP_ROUTE_RULE_DENY(route_rule->constrained_action))) { in necp_route_is_allowed_inner()
12348 type_aggregate_action = route_rule->constrained_action; in necp_route_is_allowed_inner()
12354 if (route_rule->vpn_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12359 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->vpn_action)) { in necp_route_is_allowed_inner()
12362 IS_NECP_ROUTE_RULE_DENY(route_rule->vpn_action))) { in necp_route_is_allowed_inner()
12364 type_aggregate_action = route_rule->vpn_action; in necp_route_is_allowed_inner()
12370 if (route_rule->ultra_constrained_action == NECP_ROUTE_RULE_DENY_LQM_ABORT) { in necp_route_is_allowed_inner()
12375 } else if (IS_NECP_ROUTE_RULE_ALLOW_OR_DENY(route_rule->ultra_constrained_action)) { in necp_route_is_allowed_inner()
12376 …if (ultra_constrained_denied != NULL && IS_NECP_ROUTE_RULE_DENY(route_rule->ultra_constrained_acti… in necp_route_is_allowed_inner()
12381 IS_NECP_ROUTE_RULE_DENY(route_rule->ultra_constrained_action))) { in necp_route_is_allowed_inner()
12383 type_aggregate_action = route_rule->ultra_constrained_action; in necp_route_is_allowed_inner()
12390route_rule->cellular_action, route_rule->wifi_action, route_rule->wired_action, route_rule->expen… in necp_route_is_allowed_inner()
12510 …struct necp_route_rule *route_rule = necp_lookup_route_rule_locked(&necp_route_rules, route_rule_i… in necp_route_rule_matches_agents() local
12511 if (route_rule == NULL) { in necp_route_rule_matches_agents()
12515 return route_rule->match_netagent_id != 0; in necp_route_rule_matches_agents()
12525 …struct necp_route_rule *route_rule = necp_lookup_route_rule_locked(&necp_route_rules, route_rule_i… in necp_route_get_netagent() local
12526 if (route_rule == NULL) { in necp_route_get_netagent()
12531 if (route_rule->netagent_id == 0) { in necp_route_get_netagent()
12535 if (route_rule->match_netagent_id != 0) { in necp_route_get_netagent()
12542 if (route_rule->match_netagent_id == netagent_array[agent_index]) { in necp_route_get_netagent()
12556 if (route_rule->default_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12557 route_rule->default_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12558 *remove = (route_rule->default_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12559 return route_rule->netagent_id; in necp_route_get_netagent()
12565 if (route_rule->exception_if_indices[exception_index] == 0) { in necp_route_get_netagent()
12568 if (route_rule->exception_if_indices[exception_index] == ifp->if_index && in necp_route_get_netagent()
12569 route_rule->exception_if_actions[exception_index] != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12570 if (route_rule->exception_if_actions[exception_index] == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12571 route_rule->exception_if_actions[exception_index] == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12572 … *remove = (route_rule->exception_if_actions[exception_index] == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12573 return route_rule->netagent_id; in necp_route_get_netagent()
12580 route_rule->cellular_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12581 if (route_rule->cellular_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12582 route_rule->cellular_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12583 *remove = (route_rule->cellular_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12584 return route_rule->netagent_id; in necp_route_get_netagent()
12590 route_rule->wifi_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12591 if ((route_rule->wifi_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12592 route_rule->wifi_action == NECP_ROUTE_RULE_REMOVE_NETAGENT)) { in necp_route_get_netagent()
12593 *remove = (route_rule->wifi_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12594 return route_rule->netagent_id; in necp_route_get_netagent()
12600 route_rule->companion_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12601 if ((route_rule->companion_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12602 route_rule->companion_action == NECP_ROUTE_RULE_REMOVE_NETAGENT)) { in necp_route_get_netagent()
12603 *remove = (route_rule->companion_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12604 return route_rule->netagent_id; in necp_route_get_netagent()
12610 route_rule->wired_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12611 if ((route_rule->wired_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12612 route_rule->wired_action == NECP_ROUTE_RULE_REMOVE_NETAGENT)) { in necp_route_get_netagent()
12613 *remove = (route_rule->wired_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12614 return route_rule->netagent_id; in necp_route_get_netagent()
12620 route_rule->expensive_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12621 if (route_rule->expensive_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12622 route_rule->expensive_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12623 *remove = (route_rule->expensive_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12624 return route_rule->netagent_id; in necp_route_get_netagent()
12630 route_rule->constrained_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12631 if (route_rule->constrained_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12632 route_rule->constrained_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12633 *remove = (route_rule->constrained_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12634 return route_rule->netagent_id; in necp_route_get_netagent()
12640 route_rule->ultra_constrained_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12641 if (route_rule->ultra_constrained_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12642 route_rule->ultra_constrained_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12643 *remove = (route_rule->ultra_constrained_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12644 return route_rule->netagent_id; in necp_route_get_netagent()
12650 route_rule->vpn_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_netagent()
12651 if (route_rule->vpn_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12652 route_rule->vpn_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12653 *remove = (route_rule->vpn_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12654 return route_rule->netagent_id; in necp_route_get_netagent()
12660 if (route_rule->default_action == NECP_ROUTE_RULE_USE_NETAGENT || in necp_route_get_netagent()
12661 route_rule->default_action == NECP_ROUTE_RULE_REMOVE_NETAGENT) { in necp_route_get_netagent()
12662 *remove = (route_rule->default_action == NECP_ROUTE_RULE_REMOVE_NETAGENT); in necp_route_get_netagent()
12663 return route_rule->netagent_id; in necp_route_get_netagent()
12672 …struct necp_route_rule *route_rule = necp_lookup_route_rule_locked(&necp_route_rules, route_rule_i… in necp_route_get_flow_divert_inner() local
12673 if (route_rule == NULL) { in necp_route_get_flow_divert_inner()
12678 if (route_rule->control_unit == 0) { in necp_route_get_flow_divert_inner()
12682 if (route_rule->match_netagent_id != 0) { in necp_route_get_flow_divert_inner()
12689 if (route_rule->match_netagent_id == netagent_array[agent_index]) { in necp_route_get_flow_divert_inner()
12703 if (route_rule->default_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12704 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12710 if (route_rule->exception_if_indices[exception_index] == 0) { in necp_route_get_flow_divert_inner()
12713 if (route_rule->exception_if_indices[exception_index] == ifp->if_index && in necp_route_get_flow_divert_inner()
12714 route_rule->exception_if_actions[exception_index] != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12715 if (route_rule->exception_if_actions[exception_index] == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12716 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12723 route_rule->cellular_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12724 if (route_rule->cellular_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12725 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12731 route_rule->wifi_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12732 if (route_rule->wifi_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12733 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12739 route_rule->companion_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12740 if (route_rule->companion_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12741 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12747 route_rule->wired_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12748 if (route_rule->wired_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12749 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12755 route_rule->expensive_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12756 if (route_rule->expensive_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12757 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12763 route_rule->constrained_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12764 if (route_rule->constrained_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12765 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12771 route_rule->ultra_constrained_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12772 if (route_rule->ultra_constrained_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12773 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12779 route_rule->vpn_action != NECP_ROUTE_RULE_NONE) { in necp_route_get_flow_divert_inner()
12780 if (route_rule->vpn_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12781 return route_rule->control_unit; in necp_route_get_flow_divert_inner()
12787 if (route_rule->default_action == NECP_ROUTE_RULE_DIVERT_SOCKET) { in necp_route_get_flow_divert_inner()
12788 return route_rule->control_unit; in necp_route_get_flow_divert_inner()