From c740f7d3678a8ea2c70a062c1207157e999bd6e8 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 12 Jun 2017 11:39:12 -0300 Subject: ldpd: convert cli and get rid of the xml interface The xml2cli.pl script was useful years ago when the vty code was very rudimentary. This is not the case anymore, so convert all ldpd CLI commands to use DEFUNs directly and get rid of the XML interface. The benefits are: * Consistency with the other daemons; * One less build dependency (the LibXML perl module); * Easier to add new commands. Signed-off-by: Renato Westphal --- ldpd/ldp_debug.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'ldpd/ldp_debug.c') diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index 4419f853b4..4fc4a3cce0 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -39,16 +39,10 @@ struct cmd_node ldp_debug_node = }; int -ldp_vty_debug(struct vty *vty, struct vty_arg *args[]) +ldp_vty_debug(struct vty *vty, int disable, const char *type_str, + const char *dir_str, int all) { - const char *type_str, *dir_str; - int disable, all; - - disable = (vty_get_arg_value(args, "no")) ? 1 : 0; - type_str = vty_get_arg_value(args, "type"); - if (strcmp(type_str, "discovery") == 0) { - dir_str = vty_get_arg_value(args, "dir"); if (dir_str == NULL) return (CMD_WARNING); @@ -74,8 +68,6 @@ ldp_vty_debug(struct vty *vty, struct vty_arg *args[]) else DEBUG_ON(event, EVENT); } else if (strcmp(type_str, "messages") == 0) { - all = (vty_get_arg_value(args, "all")) ? 1 : 0; - dir_str = vty_get_arg_value(args, "dir"); if (dir_str == NULL) return (CMD_WARNING); @@ -112,7 +104,7 @@ ldp_vty_debug(struct vty *vty, struct vty_arg *args[]) } int -ldp_vty_show_debugging(struct vty *vty, struct vty_arg *args[]) +ldp_vty_show_debugging(struct vty *vty) { vty_out(vty, "LDP debugging status:%s", VTY_NEWLINE); -- cgit v1.2.3 From 180fc2cd704708442d3a7fcf555dcbc1a5f1831f Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 12 Jun 2017 16:30:54 -0300 Subject: ldpd: update copyright information Signed-off-by: Renato Westphal --- ldpd/ldp_debug.c | 19 +++++++++---------- ldpd/ldp_debug.h | 19 +++++++++---------- ldpd/ldp_vty.h | 19 +++++++++---------- ldpd/ldp_vty_cmds.c | 19 +++++++++---------- ldpd/ldp_vty_conf.c | 19 +++++++++---------- ldpd/ldp_vty_exec.c | 19 +++++++++---------- ldpd/ldp_zebra.c | 19 +++++++++---------- 7 files changed, 63 insertions(+), 70 deletions(-) (limited to 'ldpd/ldp_debug.c') diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index 4fc4a3cce0..7915fb709d 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 diff --git a/ldpd/ldp_debug.h b/ldpd/ldp_debug.h index 6366d3f6ac..4b91656851 100644 --- a/ldpd/ldp_debug.h +++ b/ldpd/ldp_debug.h @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 */ #ifndef _LDP_DEBUG_H_ diff --git a/ldpd/ldp_vty.h b/ldpd/ldp_vty.h index 1375c3c798..93713166f4 100644 --- a/ldpd/ldp_vty.h +++ b/ldpd/ldp_vty.h @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 */ #ifndef _LDP_VTY_H_ diff --git a/ldpd/ldp_vty_cmds.c b/ldpd/ldp_vty_cmds.c index 9f737fa1b2..d28424cbb7 100644 --- a/ldpd/ldp_vty_cmds.c +++ b/ldpd/ldp_vty_cmds.c @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 5154371f43..c96e69a6c5 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 diff --git a/ldpd/ldp_vty_exec.c b/ldpd/ldp_vty_exec.c index 5ea3ec6452..252abd17fd 100644 --- a/ldpd/ldp_vty_exec.c +++ b/ldpd/ldp_vty_exec.c @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 1a93f5a86f..79fff01c4c 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -1,21 +1,20 @@ /* * Copyright (C) 2016 by Open Source Routing. * - * This file is part of GNU Zebra. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * GNU Zebra is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * GNU Zebra is distributed in the hope that it will be useful, but + * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * 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 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 + * 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 -- cgit v1.2.3