Browse Source

zebra: use more help string macros

Denis Ovsienko 6 years ago
parent
commit
d7f7850e3d
2 changed files with 90 additions and 81 deletions
  1. 9 0
      lib/command.h
  2. 81 81
      zebra/rtadv.c

+ 9 - 0
lib/command.h

@@ -483,6 +483,15 @@ struct cmd_token
 #define IPV6_STR "IPv6 information\n"
 #define IF_IPV6_STR "Interface IPv6 config commands\n"
 #define ND_STR "Neighbor discovery\n"
+#define PFX_STR "Prefix information\n"
+#define IPV6_PFX_STR "IPv6 prefix\n"
+#define IPV6_PFX_NOAUTO_STR "Do not use prefix for autoconfiguration\n"
+#define IPV6_PFX_OFFLINK_STR "Do not use prefix for onlink determination\n"
+#define IPV6_PFX_VALID1_STR "Valid lifetime in seconds\n"
+#define IPV6_PFX_VALID2_STR "Infinite valid lifetime\n"
+#define IPV6_PFX_PREF1_STR "Preferred lifetime in seconds\n"
+#define IPV6_PFX_PREF2_STR "Infinite preferred lifetime\n"
+#define IPV6_PFX_RADDR_STR "Set Router Address flag\n"
 #define NO_STR "Negate a command or set its defaults\n"
 #define REDIST_STR "Redistribute information from another routing protocol\n"
 #define CLEAR_STR "Reset functions\n"

+ 81 - 81
zebra/rtadv.c

@@ -1323,15 +1323,15 @@ DEFUN (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (off-link|) (no-autoconfig|) (router-address|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Do not use prefix for onlink determination\n"
-       "Do not use prefix for autoconfiguration\n"
-       "Set Router Address flag\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_OFFLINK_STR
+       IPV6_PFX_NOAUTO_STR
+       IPV6_PFX_RADDR_STR)
 {
   int i;
   int ret;
@@ -1406,14 +1406,14 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (off-link|) (no-autoconfig|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Do not use prefix for onlink determination\n"
-       "Do not use prefix for autoconfiguration\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_OFFLINK_STR
+       IPV6_PFX_NOAUTO_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_val_rev_cmd,
@@ -1421,14 +1421,14 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (no-autoconfig|) (off-link|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Do not use prefix for autoconfiguration\n"
-       "Do not use prefix for onlink determination\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_NOAUTO_STR
+       IPV6_PFX_OFFLINK_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_val_rev_rtaddr_cmd,
@@ -1436,15 +1436,15 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (no-autoconfig|) (off-link|) (router-address|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Do not use prefix for autoconfiguration\n"
-       "Do not use prefix for onlink determination\n"
-       "Set Router Address flag\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_NOAUTO_STR
+       IPV6_PFX_OFFLINK_STR
+       IPV6_PFX_RADDR_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_val_noauto_cmd,
@@ -1452,12 +1452,12 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (no-autoconfig|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
        "Do not use prefix for autoconfiguration")
 
 ALIAS (ipv6_nd_prefix,
@@ -1466,13 +1466,13 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (off-link|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Do not use prefix for onlink determination\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_OFFLINK_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_val_rtaddr_cmd,
@@ -1480,13 +1480,13 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite) (router-address|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n"
-       "Set Router Address flag\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR
+       IPV6_PFX_RADDR_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_val_cmd,
@@ -1494,67 +1494,67 @@ ALIAS (ipv6_nd_prefix,
        "(<0-4294967295>|infinite)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Valid lifetime in seconds\n"
-       "Infinite valid lifetime\n"
-       "Preferred lifetime in seconds\n"
-       "Infinite preferred lifetime\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_VALID1_STR
+       IPV6_PFX_VALID2_STR
+       IPV6_PFX_PREF1_STR
+       IPV6_PFX_PREF2_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_noval_cmd,
        "ipv6 nd prefix X:X::X:X/M (no-autoconfig|) (off-link|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Do not use prefix for autoconfiguration\n"
-       "Do not use prefix for onlink determination\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_NOAUTO_STR
+       IPV6_PFX_OFFLINK_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_noval_rev_cmd,
        "ipv6 nd prefix X:X::X:X/M (off-link|) (no-autoconfig|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Do not use prefix for onlink determination\n"
-       "Do not use prefix for autoconfiguration\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_OFFLINK_STR
+       IPV6_PFX_NOAUTO_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_noval_noauto_cmd,
        "ipv6 nd prefix X:X::X:X/M (no-autoconfig|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Do not use prefix for autoconfiguration\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_NOAUTO_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_noval_offlink_cmd,
        "ipv6 nd prefix X:X::X:X/M (off-link|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Do not use prefix for onlink determination\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_OFFLINK_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_noval_rtaddr_cmd,
        "ipv6 nd prefix X:X::X:X/M (router-address|)",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n"
-       "Set Router Address flag\n")
+       PFX_STR
+       IPV6_PFX_STR
+       IPV6_PFX_RADDR_STR)
 
 ALIAS (ipv6_nd_prefix,
        ipv6_nd_prefix_prefix_cmd,
        "ipv6 nd prefix X:X::X:X/M",
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n")
+       PFX_STR
+       IPV6_PFX_STR)
 
 DEFUN (no_ipv6_nd_prefix,
        no_ipv6_nd_prefix_cmd,
@@ -1562,8 +1562,8 @@ DEFUN (no_ipv6_nd_prefix,
        NO_STR
        IF_IPV6_STR
        ND_STR
-       "Prefix information\n"
-       "IPv6 prefix\n")
+       PFX_STR
+       IPV6_PFX_STR)
 {
   int ret;
   struct interface *ifp;