]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/rfapi/bgp_rfapi_cfg.c
Merge pull request #754 from qlyoung/fix-argv-arg
[mirror_frr.git] / bgpd / rfapi / bgp_rfapi_cfg.c
index c84109bc1a02797a6f976f34dac43e0ba0267141..41762080486354d67711fecdec323eb0f435b7e3 100644 (file)
@@ -479,7 +479,7 @@ DEFUN (vnc_defaults_l2rd,
   VTY_DECLVAR_CONTEXT(bgp, bgp);
   uint8_t value = 0;
 
-  if (!strcmp (argv[1]->arg, "auto-vn"))
+  if (strmatch(argv[1]->text, "auto-vn"))
     {
       value = 0;
     }
@@ -539,7 +539,7 @@ DEFUN (vnc_defaults_responselifetime,
   if (!h)
     return CMD_WARNING;
 
-  if (!strcmp (argv[1]->arg, "infinite"))
+  if (strmatch(argv[1]->text, "infinite"))
     {
       rspint = RFAPI_INFINITE_LIFETIME;
     }
@@ -1102,7 +1102,7 @@ DEFUN (vnc_redistribute_lifetime,
 
   vnc_redistribute_prechange (bgp);
 
-  if (!strcmp (argv[3]->arg, "infinite"))
+  if (strmatch(argv[3]->text, "infinite"))
     {
       bgp->rfapi_cfg->redist_lifetime = RFAPI_INFINITE_LIFETIME;
     }
@@ -1140,7 +1140,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "bgp-direct"))
+  if (strmatch(argv[3]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1149,7 +1149,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
       route_type = ZEBRA_ROUTE_BGP_DIRECT_EXT;
     }
 
-  if (!strcmp (argv[4]->arg, "ipv4"))
+  if (strmatch(argv[4]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1193,7 +1193,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "bgp-direct"))
+  if (strmatch(argv[2]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1202,7 +1202,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
       route_type = ZEBRA_ROUTE_BGP_DIRECT_EXT;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1243,7 +1243,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "bgp-direct"))
+  if (strmatch(argv[3]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1283,7 +1283,7 @@ DEFUN (vnc_redist_bgpdirect_routemap,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "bgp-direct"))
+  if (strmatch(argv[2]->text, "bgp-direct"))
     {
       route_type = ZEBRA_ROUTE_BGP_DIRECT;
     }
@@ -1336,7 +1336,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1385,7 +1385,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "ipv4"))
+  if (strmatch(argv[2]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1803,7 +1803,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1815,7 +1815,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
   if (argv[2]->arg[0] == 'b')
     {
       if (((argc > 5)
-           && !strcmp (argv[5]->arg, rfg->plist_export_bgp_name[afi]))
+           && strmatch(argv[5]->text, rfg->plist_export_bgp_name[afi]))
           || (argc <= 5))
         {
 
@@ -1830,7 +1830,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
   else
     {
       if (((argc > 5)
-           && !strcmp (argv[5]->arg, rfg->plist_export_zebra_name[afi]))
+           && strmatch(argv[5]->text, rfg->plist_export_zebra_name[afi]))
           || (argc <= 5))
         {
           if (rfg->plist_export_zebra_name[afi])
@@ -1872,7 +1872,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[2]->arg, "ipv4"))
+  if (strmatch(argv[2]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -1932,7 +1932,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
   if (argv[2]->arg[0] == 'b')
     {
       if (((argc > 4)
-           && !strcmp (argv[4]->arg, rfg->routemap_export_bgp_name))
+           && strmatch(argv[4]->text, rfg->routemap_export_bgp_name))
           || (argc <= 4))
         {
 
@@ -1948,7 +1948,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
   else
     {
       if (((argc > 4)
-           && !strcmp (argv[4]->arg, rfg->routemap_export_zebra_name))
+           && strmatch(argv[4]->text, rfg->routemap_export_zebra_name))
           || (argc <= 4))
         {
           if (rfg->routemap_export_zebra_name)
@@ -2031,7 +2031,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[4]->arg, "ipv4"))
+  if (strmatch(argv[4]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -2044,7 +2044,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
     {
       if (((argc > 6)
            && hc->plist_export_bgp_name[afi]
-           && !strcmp (argv[6]->arg, hc->plist_export_bgp_name[afi]))
+           && strmatch(argv[6]->text, hc->plist_export_bgp_name[afi]))
           || (argc <= 6))
         {
 
@@ -2058,7 +2058,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
     {
       if (((argc > 6)
            && hc->plist_export_zebra_name[afi]
-           && !strcmp (argv[6]->arg, hc->plist_export_zebra_name[afi]))
+           && strmatch(argv[6]->text, hc->plist_export_zebra_name[afi]))
           || (argc <= 6))
         {
 
@@ -2093,7 +2093,7 @@ DEFUN (vnc_nve_export_prefixlist,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[3]->arg, "ipv4"))
+  if (strmatch(argv[3]->text, "ipv4"))
     {
       afi = AFI_IP;
     }
@@ -2144,7 +2144,7 @@ DEFUN (vnc_nve_export_no_routemap,
     {
       if (((argc > 5)
            && hc->routemap_export_bgp_name
-           && !strcmp (argv[5]->arg, hc->routemap_export_bgp_name))
+           && strmatch(argv[5]->text, hc->routemap_export_bgp_name))
           || (argc <= 5))
         {
 
@@ -2159,7 +2159,7 @@ DEFUN (vnc_nve_export_no_routemap,
     {
       if (((argc > 5)
            && hc->routemap_export_zebra_name
-           && !strcmp (argv[5]->arg, hc->routemap_export_zebra_name))
+           && strmatch(argv[5]->text, hc->routemap_export_zebra_name))
           || (argc <= 5))
         {
 
@@ -3049,7 +3049,7 @@ DEFUN (vnc_nve_group_l2rd,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[1]->arg, "auto:vn"))
+  if (strmatch(argv[1]->text, "auto:vn"))
     {
       rfg->l2rd = 0;
     }
@@ -3198,7 +3198,7 @@ DEFUN (vnc_nve_group_responselifetime,
       return CMD_WARNING;
     }
 
-  if (!strcmp (argv[1]->arg, "infinite"))
+  if (strmatch(argv[1]->text, "infinite"))
     {
       rspint = RFAPI_INFINITE_LIFETIME;
     }