diff options
Diffstat (limited to 'lib/ns.c')
| -rw-r--r-- | lib/ns.c | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -14,10 +14,9 @@ * 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> @@ -304,22 +303,24 @@ ns_netns_pathname (struct vty *vty, const char *name) return pathname; } -DEFUN (ns_netns, +DEFUN_NOSH (ns_netns, ns_netns_cmd, - "logical-router <1-65535> ns NAME", + "logical-router (1-65535) ns NAME", "Enable a logical-router\n" "Specify the logical-router indentifier\n" "The Name Space\n" "The file name in " NS_RUN_DIR ", or a full pathname\n") { + int idx_number = 1; + int idx_name = 3; ns_id_t ns_id = NS_DEFAULT; struct ns *ns = NULL; - char *pathname = ns_netns_pathname (vty, argv[1]); + char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg); if (!pathname) return CMD_WARNING; - VTY_GET_INTEGER ("NS ID", ns_id, argv[0]); + VTY_GET_INTEGER ("NS ID", ns_id, argv[idx_number]->arg); ns = ns_get (ns_id); if (ns->name && strcmp (ns->name, pathname) != 0) @@ -344,21 +345,23 @@ DEFUN (ns_netns, DEFUN (no_ns_netns, no_ns_netns_cmd, - "no logical-router <1-65535> ns NAME", + "no logical-router (1-65535) ns NAME", NO_STR "Enable a Logical-Router\n" "Specify the Logical-Router identifier\n" "The Name Space\n" "The file name in " NS_RUN_DIR ", or a full pathname\n") { + int idx_number = 2; + int idx_name = 4; ns_id_t ns_id = NS_DEFAULT; struct ns *ns = NULL; - char *pathname = ns_netns_pathname (vty, argv[1]); + char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg); if (!pathname) return CMD_WARNING; - VTY_GET_INTEGER ("NS ID", ns_id, argv[0]); + VTY_GET_INTEGER ("NS ID", ns_id, argv[idx_number]->arg); ns = ns_lookup (ns_id); if (!ns) |
