Lines Matching refs:rule

362 static int routing_policy_rule_build_json(RoutingPolicyRule *rule, JsonVariant **ret) {  in routing_policy_rule_build_json()  argument
367 assert(rule); in routing_policy_rule_build_json()
368 assert(rule->manager); in routing_policy_rule_build_json()
371 r = manager_get_route_table_to_string(rule->manager, rule->table, &table); in routing_policy_rule_build_json()
375 r = route_protocol_to_string_alloc(rule->protocol, &protocol); in routing_policy_rule_build_json()
379 r = network_config_state_to_string_alloc(rule->state, &state); in routing_policy_rule_build_json()
384 JSON_BUILD_PAIR_INTEGER("Family", rule->family), in routing_policy_rule_build_json()
385 … JSON_BUILD_PAIR_IN_ADDR_NON_NULL("FromPrefix", &rule->from, rule->family), in routing_policy_rule_build_json()
386 JSON_BUILD_PAIR_CONDITION(in_addr_is_set(rule->family, &rule->from), in routing_policy_rule_build_json()
387 … "FromPrefixLength", JSON_BUILD_UNSIGNED(rule->from_prefixlen)), in routing_policy_rule_build_json()
388 … JSON_BUILD_PAIR_IN_ADDR_NON_NULL("ToPrefix", &rule->to, rule->family), in routing_policy_rule_build_json()
389 JSON_BUILD_PAIR_CONDITION(in_addr_is_set(rule->family, &rule->to), in routing_policy_rule_build_json()
390 … "ToPrefixLength", JSON_BUILD_UNSIGNED(rule->to_prefixlen)), in routing_policy_rule_build_json()
391 JSON_BUILD_PAIR_UNSIGNED("Protocol", rule->protocol), in routing_policy_rule_build_json()
393 JSON_BUILD_PAIR_UNSIGNED("TOS", rule->tos), in routing_policy_rule_build_json()
394 JSON_BUILD_PAIR_UNSIGNED("Type", rule->type), in routing_policy_rule_build_json()
395 … JSON_BUILD_PAIR_STRING("TypeString", fr_act_type_full_to_string(rule->type)), in routing_policy_rule_build_json()
396 JSON_BUILD_PAIR_UNSIGNED("IPProtocol", rule->ipproto), in routing_policy_rule_build_json()
397 … JSON_BUILD_PAIR_STRING("IPProtocolString", ip_protocol_to_name(rule->ipproto)), in routing_policy_rule_build_json()
398 JSON_BUILD_PAIR_UNSIGNED("Priority", rule->priority), in routing_policy_rule_build_json()
399 JSON_BUILD_PAIR_UNSIGNED("FirewallMark", rule->fwmark), in routing_policy_rule_build_json()
400 JSON_BUILD_PAIR_UNSIGNED("FirewallMask", rule->fwmask), in routing_policy_rule_build_json()
401 JSON_BUILD_PAIR_UNSIGNED_NON_ZERO("Table", rule->table), in routing_policy_rule_build_json()
403 JSON_BUILD_PAIR_BOOLEAN("Invert", rule->invert_rule), in routing_policy_rule_build_json()
404 JSON_BUILD_PAIR_CONDITION(rule->suppress_prefixlen >= 0, in routing_policy_rule_build_json()
405 … "SuppressPrefixLength", JSON_BUILD_UNSIGNED(rule->suppress_prefixlen)), in routing_policy_rule_build_json()
406 JSON_BUILD_PAIR_CONDITION(rule->suppress_ifgroup >= 0, in routing_policy_rule_build_json()
407 … "SuppressInterfaceGroup", JSON_BUILD_UNSIGNED(rule->suppress_ifgroup)), in routing_policy_rule_build_json()
408 … JSON_BUILD_PAIR_CONDITION(rule->sport.start != 0 || rule->sport.end != 0, "SourcePort", in routing_policy_rule_build_json()
409 … JSON_BUILD_ARRAY(JSON_BUILD_UNSIGNED(rule->sport.start), JSON_BUILD_UNSIGNED(rule->sport.end))), in routing_policy_rule_build_json()
410 … JSON_BUILD_PAIR_CONDITION(rule->dport.start != 0 || rule->dport.end != 0, "DestinationPort", in routing_policy_rule_build_json()
411 … JSON_BUILD_ARRAY(JSON_BUILD_UNSIGNED(rule->dport.start), JSON_BUILD_UNSIGNED(rule->dport.end))), in routing_policy_rule_build_json()
412 …JSON_BUILD_PAIR_CONDITION(rule->uid_range.start != UID_INVALID && rule->uid_range.end != UID_INVAL… in routing_policy_rule_build_json()
413 …JSON_BUILD_ARRAY(JSON_BUILD_UNSIGNED(rule->uid_range.start), JSON_BUILD_UNSIGNED(rule->uid_range.e… in routing_policy_rule_build_json()
414 JSON_BUILD_PAIR_STRING_NON_EMPTY("IncomingInterface", rule->iif), in routing_policy_rule_build_json()
415 JSON_BUILD_PAIR_STRING_NON_EMPTY("OutgoingInterface", rule->oif), in routing_policy_rule_build_json()
416 … JSON_BUILD_PAIR_STRING("ConfigSource", network_config_source_to_string(rule->source)), in routing_policy_rule_build_json()
427 RoutingPolicyRule *rule; in routing_policy_rules_build_json() local
442 SET_FOREACH(rule, rules) { in routing_policy_rules_build_json()
443 r = routing_policy_rule_build_json(rule, elements + n); in routing_policy_rules_build_json()