]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/distribute.c
zebra, lib: Fix SA warning and formatting.
[mirror_frr.git] / lib / distribute.c
index 9f1272111bff3ac8c67c371cc0e935b6848322b0..25fcd92580e10a6c603a25d54fe379e717c7ff6a 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -344,8 +343,8 @@ DEFUN (no_distribute_list,
        int ret = distfn(ifname, type, argv[2 + prefix]->arg);
 
        if (!ret) {
-               vty_out(vty, "distribute list doesn't exist%s", VTY_NEWLINE);
-               return CMD_WARNING;
+               vty_out(vty, "distribute list doesn't exist\n");
+               return CMD_WARNING_CONFIG_FAILED;
        }
        return CMD_SUCCESS;
 }
@@ -383,9 +382,9 @@ int config_show_distribute(struct vty *vty)
                                             DISTRIBUTE_V6_OUT, has_print);
        }
        if (has_print)
-               vty_out(vty, "%s", VTY_NEWLINE);
+               vty_out(vty, "\n");
        else
-               vty_out(vty, " not set%s", VTY_NEWLINE);
+               vty_out(vty, " not set\n");
 
        for (i = 0; i < disthash->size; i++)
                for (mp = disthash->index[i]; mp; mp = mp->next) {
@@ -407,9 +406,9 @@ int config_show_distribute(struct vty *vty)
                                        vty, dist->prefix, 1, DISTRIBUTE_V6_OUT,
                                        has_print);
                                if (has_print)
-                                       vty_out(vty, "%s", VTY_NEWLINE);
+                                       vty_out(vty, "\n");
                                else
-                                       vty_out(vty, " nothing%s", VTY_NEWLINE);
+                                       vty_out(vty, " nothing\n");
                        }
                }
 
@@ -429,9 +428,9 @@ int config_show_distribute(struct vty *vty)
                                             DISTRIBUTE_V6_IN, has_print);
        }
        if (has_print)
-               vty_out(vty, "%s", VTY_NEWLINE);
+               vty_out(vty, "\n");
        else
-               vty_out(vty, " not set%s", VTY_NEWLINE);
+               vty_out(vty, " not set\n");
 
        for (i = 0; i < disthash->size; i++)
                for (mp = disthash->index[i]; mp; mp = mp->next) {
@@ -453,9 +452,9 @@ int config_show_distribute(struct vty *vty)
                                        vty, dist->prefix, 1, DISTRIBUTE_V6_IN,
                                        has_print);
                                if (has_print)
-                                       vty_out(vty, "%s", VTY_NEWLINE);
+                                       vty_out(vty, "\n");
                                else
-                                       vty_out(vty, " nothing%s", VTY_NEWLINE);
+                                       vty_out(vty, " nothing\n");
                        }
                }
        return 0;
@@ -483,13 +482,12 @@ int config_write_distribute(struct vty *vty)
                                        v6 = j == DISTRIBUTE_V6_IN
                                             || j == DISTRIBUTE_V6_OUT;
                                        vty_out(vty,
-                                               " %sdistribute-list %s %s %s%s",
+                                               " %sdistribute-list %s %s %s\n",
                                                v6 ? "ipv6 " : "",
                                                dist->list[j],
                                                output ? "out" : "in",
                                                dist->ifname ? dist->ifname
-                                                            : "",
-                                               VTY_NEWLINE);
+                                                            : "");
                                        write++;
                                }
 
@@ -500,13 +498,12 @@ int config_write_distribute(struct vty *vty)
                                        v6 = j == DISTRIBUTE_V6_IN
                                             || j == DISTRIBUTE_V6_OUT;
                                        vty_out(vty,
-                                               " %sdistribute-list prefix %s %s %s%s",
+                                               " %sdistribute-list prefix %s %s %s\n",
                                                v6 ? "ipv6 " : "",
                                                dist->prefix[j],
                                                output ? "out" : "in",
                                                dist->ifname ? dist->ifname
-                                                            : "",
-                                               VTY_NEWLINE);
+                                                            : "");
                                        write++;
                                }
                }
@@ -524,7 +521,7 @@ void distribute_list_init(int node)
 {
        disthash = hash_create(
                distribute_hash_make,
-               (int (*)(const void *, const void *))distribute_cmp);
+               (int (*)(const void *, const void *))distribute_cmp, NULL);
 
        /* vtysh command-extraction doesn't grok install_element(node, ) */
        if (node == RIP_NODE) {