|
|
1.1 ! root 1: /* ! 2: * Copyright (C) 2007 Michael Brown <[email protected]>. ! 3: * ! 4: * This program is free software; you can redistribute it and/or ! 5: * modify it under the terms of the GNU General Public License as ! 6: * published by the Free Software Foundation; either version 2 of the ! 7: * License, or any later version. ! 8: * ! 9: * This program is distributed in the hope that it will be useful, but ! 10: * WITHOUT ANY WARRANTY; without even the implied warranty of ! 11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! 12: * General Public License for more details. ! 13: * ! 14: * You should have received a copy of the GNU General Public License ! 15: * along with this program; if not, write to the Free Software ! 16: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ! 17: */ ! 18: ! 19: FILE_LICENCE ( GPL2_OR_LATER ); ! 20: ! 21: #include <stdio.h> ! 22: #include <getopt.h> ! 23: #include <ipxe/command.h> ! 24: #include <ipxe/parseopt.h> ! 25: #include <usr/route.h> ! 26: ! 27: /** @file ! 28: * ! 29: * Routing table management commands ! 30: * ! 31: */ ! 32: ! 33: /** "route" options */ ! 34: struct route_options {}; ! 35: ! 36: /** "route" option list */ ! 37: static struct option_descriptor route_opts[] = {}; ! 38: ! 39: /** "route" command descriptor */ ! 40: static struct command_descriptor route_cmd = ! 41: COMMAND_DESC ( struct route_options, route_opts, 0, 0, "" ); ! 42: ! 43: /** ! 44: * The "route" command ! 45: * ! 46: * @v argc Argument count ! 47: * @v argv Argument list ! 48: * @ret rc Return status code ! 49: */ ! 50: static int route_exec ( int argc, char **argv ) { ! 51: struct route_options opts; ! 52: int rc; ! 53: ! 54: /* Parse options */ ! 55: if ( ( rc = parse_options ( argc, argv, &route_cmd, &opts ) ) != 0 ) ! 56: return rc; ! 57: ! 58: route(); ! 59: ! 60: return 0; ! 61: } ! 62: ! 63: /** Routing table management commands */ ! 64: struct command route_commands[] __command = { ! 65: { ! 66: .name = "route", ! 67: .exec = route_exec, ! 68: }, ! 69: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.