From: Yu Watanabe Date: Sun, 14 Nov 2021 08:36:33 +0000 (+0900) Subject: network: routing policy rule: introduce fr_act_type_full_to_string() X-Git-Tag: v250-rc1~143^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=965153054a80def1d7df09151a474e870d404b7e;p=thirdparty%2Fsystemd.git network: routing policy rule: introduce fr_act_type_full_to_string() --- diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index 72ef39f4579..90086f35a75 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -29,8 +29,18 @@ static const char *const fr_act_type_table[__FR_ACT_MAX] = { [FR_ACT_PROHIBIT] = "prohibit", }; +static const char *const fr_act_type_full_table[__FR_ACT_MAX] = { + [FR_ACT_TO_TBL] = "table", + [FR_ACT_GOTO] = "goto", + [FR_ACT_NOP] = "nop", + [FR_ACT_BLACKHOLE] = "blackhole", + [FR_ACT_UNREACHABLE] = "unreachable", + [FR_ACT_PROHIBIT] = "prohibit", +}; + assert_cc(__FR_ACT_MAX <= UINT8_MAX); DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(fr_act_type, int); +DEFINE_STRING_TABLE_LOOKUP_TO_STRING(fr_act_type_full, int); RoutingPolicyRule *routing_policy_rule_free(RoutingPolicyRule *rule) { if (!rule) diff --git a/src/network/networkd-routing-policy-rule.h b/src/network/networkd-routing-policy-rule.h index ac65fe8af48..f52943bd2e6 100644 --- a/src/network/networkd-routing-policy-rule.h +++ b/src/network/networkd-routing-policy-rule.h @@ -54,6 +54,8 @@ typedef struct RoutingPolicyRule { int32_t suppress_ifgroup; } RoutingPolicyRule; +const char *fr_act_type_full_to_string(int t) _const_; + RoutingPolicyRule *routing_policy_rule_free(RoutingPolicyRule *rule); void routing_policy_rule_hash_func(const RoutingPolicyRule *rule, struct siphash *state);