]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: routing policy rule: introduce fr_act_type_full_to_string()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 14 Nov 2021 08:36:33 +0000 (17:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Nov 2021 13:35:35 +0000 (22:35 +0900)
src/network/networkd-routing-policy-rule.c
src/network/networkd-routing-policy-rule.h

index 72ef39f4579bce004120f6f373fba25efe836391..90086f35a750c6c60d809cd9c838a85591fbb6fc 100644 (file)
@@ -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)
index ac65fe8af48fb8ef068f7ea171468dab9c688a4b..f52943bd2e6d11434b7dfad113c953c32e3b2eee 100644 (file)
@@ -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);