/**************************************************************************
NETBOOT - BOOTP/TFTP Bootstrap Program
**************************************************************************/
int cmd_ip(), cmd_server(), cmd_bootfile(), cmd_help(), exit();
{"bootfile", cmd_bootfile
},
{"ip", cmd_ip
, "<addr> set my IP address"},
{"server", cmd_server
, "<addr> set server IP address"},
{"bootfile", cmd_bootfile
, "<file> set boot filename"},
{"help", cmd_help
, " this list"},
{"diskboot", exit
, " boot from disk"},
{"autoboot", NULL
, " continue"},
/**************************************************************************
CMD_HELP - Display help screen - NOT FOR SMALL ROMS
**************************************************************************/
struct bootcmds_t
*cmd
= bootcmds
;
printf("%s %s\n\r",cmd
->name
,cmd
->help
);
/**************************************************************************
CMD_IP - Set my IP address
**************************************************************************/
if (!setip(p
, &arptable
[ARP_CLIENT
].ipaddr
)) {
printf("IP address is %I\r\n",
arptable
[ARP_CLIENT
].ipaddr
);
/**************************************************************************
CMD_SERVER - Set server's IP address
**************************************************************************/
if (!setip(p
, &arptable
[ARP_SERVER
].ipaddr
)) {
printf("Server IP address is %I\r\n",
arptable
[ARP_SERVER
].ipaddr
);
} else /* Need to clear arp entry if we change IP address */
for (i
=0; i
<6; i
++) arptable
[ARP_SERVER
].node
[i
] = 0;
extern char bootname
[], *bootfile
;
/**************************************************************************
CMD_BOOTFILE - set boot filename
**************************************************************************/
char *q
= bootfile
= bootname
;
printf("Bootfile is %s\r\n", bootfile
);
/**************************************************************************
**************************************************************************/
struct bootcmds_t
*cmd
= bootcmds
;
while (*q
&& (*(q
++) == *(p
++))) ;
if ((!(*q
)) && ((*p
== ' ') || (!(*p
)))) {
if (!cmd
->func
) return(1);
printf("invalid command\n\r");
printf("bad command - type 'help' for list\n\r");
/**************************************************************************
BOOTMENU - Present boot options
**************************************************************************/