char bootfile[128];
};
+int pxeinit(void);
int pxecall(int op, void *buf);
static void*
memmove(d, s, sizeof(d));
}
+void
+unload(void)
+{
+ struct {
+ uchar status[2];
+ uchar junk[10];
+ } buf;
+ static uchar shutdown[] = { 0x05, 0x070, 0x02, 0 };
+ uchar *o;
+
+ for(o = shutdown; *o; o++){
+ memset(&buf, 0, sizeof(buf));
+ if(pxecall(*o, &buf))
+ break;
+ }
+}
+
static int
getip(IP4 yip, IP4 sip, IP4 gip, char mac[16])
{
static int
udpclose(void)
{
- char status[2];
+ uchar status[2];
puts(status, 0);
return pxecall(0x31, status);
}
udpclose();
}
+
static int
tftpopen(Tftp *t, char *path, IP4 sip, IP4 dip, IP4 gip)
{
void *f;
Tftp t;
+ if(pxeinit()){
+ print("pxe init\r\n");
+ halt();
+ }
if(getip(yip, sip, gip, mac)){
print("bad dhcp\r\n");
halt();