pxe_cmd.c
Go to the documentation of this file.00001 #include <gpxe/netdevice.h>
00002 #include <gpxe/command.h>
00003 #include <hci/ifmgmt_cmd.h>
00004 #include <pxe_call.h>
00005
00006 FILE_LICENCE ( GPL2_OR_LATER );
00007
00008 static int startpxe_payload ( struct net_device *netdev ) {
00009 if ( netdev_is_open ( netdev ) )
00010 pxe_activate ( netdev );
00011 return 0;
00012 }
00013
00014 static int startpxe_exec ( int argc, char **argv ) {
00015 return ifcommon_exec ( argc, argv, startpxe_payload,
00016 "Activate PXE on" );
00017 }
00018
00019 static int stoppxe_exec ( int argc __unused, char **argv __unused ) {
00020 pxe_deactivate();
00021 return 0;
00022 }
00023
00024 struct command pxe_commands[] __command = {
00025 {
00026 .name = "startpxe",
00027 .exec = startpxe_exec,
00028 },
00029 {
00030 .name = "stoppxe",
00031 .exec = stoppxe_exec,
00032 },
00033 };