diff options
author | phk <phk@FreeBSD.org> | 1994-10-22 04:23:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-22 04:23:12 +0000 |
commit | 2d37cac963a1ef2f0494a24954de915b710e1d58 (patch) | |
tree | cec500d750243c59b0d1ad62d9cf30a22b24ea5f | |
parent | b77a63e6530bbce31999372e9e67d1b8fd83bf6c (diff) | |
download | FreeBSD-src-2d37cac963a1ef2f0494a24954de915b710e1d58.zip FreeBSD-src-2d37cac963a1ef2f0494a24954de915b710e1d58.tar.gz |
Some cosmetics in printfs mostly.
-rw-r--r-- | sys/i386/boot/netboot/main.c | 26 | ||||
-rw-r--r-- | sys/i386/boot/netboot/netboot.h | 1 |
2 files changed, 19 insertions, 8 deletions
diff --git a/sys/i386/boot/netboot/main.c b/sys/i386/boot/netboot/main.c index 0046208..e5d9871 100644 --- a/sys/i386/boot/netboot/main.c +++ b/sys/i386/boot/netboot/main.c @@ -88,9 +88,10 @@ load() longjmp(jmp_bootmenu,1); } } - printf("IP address %I, Server IP address %I\r\n", + printf("My IP %I, Server IP %I, GW IP %I\r\n", arptable[ARP_CLIENT].ipaddr, - arptable[ARP_SERVER].ipaddr); + arptable[ARP_SERVER].ipaddr, + arptable[ARP_GATEWAY].ipaddr); /* Now use TFTP to load configuration file */ sprintf(cfg,"cfg.%I",arptable[ARP_CLIENT].ipaddr); @@ -540,20 +541,29 @@ decode_rfc1048(p) unsigned char *p; { static char rfc1048_cookie[4] = RFC1048_COOKIE; - unsigned char *end = p + BOOTP_VENDOR_LEN; + unsigned char *end = p + BOOTP_VENDOR_LEN,*q; if (bcompare(p, rfc1048_cookie, 4)) { /* RFC 1048 header */ p += 4; while(p < end) { - if (*p == RFC1048_PAD) { + switch (*p) { + case RFC1048_PAD: p++; continue; - } - if (*p == RFC1048_END) break; - if (*p == RFC1048_NETMASK) + case RFC1048_END: + p = end; + continue; + case RFC1048_NETMASK: bcopy(p+2,&netmask,4); - if (*p == RFC1048_HOSTNAME) { + break; + case RFC1048_HOSTNAME: bcopy(p+2, &nfsdiskless.my_hostnam, TAG_LEN(p)); hostnamelen = (TAG_LEN(p) + 3) & ~3; + break; + default: + printf("Unknown RFC1048-tag "); + for(q=p;q<p+2+TAG_LEN(p);q++) + printf("%x ",*q); + printf("\n\r"); } p += TAG_LEN(p) + 2; } diff --git a/sys/i386/boot/netboot/netboot.h b/sys/i386/boot/netboot/netboot.h index e60c8f7..b54319d 100644 --- a/sys/i386/boot/netboot/netboot.h +++ b/sys/i386/boot/netboot/netboot.h @@ -83,6 +83,7 @@ Author: Martin Renters #define RFC1048_COOKIE { 99, 130, 83, 99 } #define RFC1048_PAD 0 #define RFC1048_NETMASK 1 +#define RFC1048_GATEWAY 3 #define RFC1048_HOSTNAME 12 #define RFC1048_END 255 #define BOOTP_VENDOR_LEN 64 |