summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking/nfs/bootp_subr.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-09 03:43:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-09 03:43:47 +0000
commita0af97d2bfba67f952a59dfb549397d8e110dc2c (patch)
treef3e006050ad0e6bc787f775d891fb801b6ed54b7 /cpukit/libnetworking/nfs/bootp_subr.c
parentAdded #define to make this file exactly like its siblings in mpc821 (diff)
downloadrtems-a0af97d2bfba67f952a59dfb549397d8e110dc2c.tar.bz2
Patch from Eric Norum <eric@cls.usask.ca> to add NTP BOOTP support because
EPICS needs a synchronized time-of-day clock. This patch is the changes needed to get NTP server information from a BOOTP server. This patch also adds NTP server information to the network configuration structure, too.
Diffstat (limited to 'cpukit/libnetworking/nfs/bootp_subr.c')
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index b39c9e4714..36907cda1d 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -730,7 +730,12 @@ processOptions (unsigned char *optbuf, int optbufSize)
dhcp_gotnetmask = 1;
break;
- case 2: /* Time offset, unused */
+ case 2: /* Time offset */
+ /* Time offset */
+ if (len!=4)
+ panic("bootpc: time offset len is %d",len);
+ bcopy (p, &rtems_bsdnet_timeoffset, 4);
+ rtems_bsdnet_timeoffset = ntohl (rtems_bsdnet_timeoffset);
break;
case 3:
@@ -743,6 +748,32 @@ processOptions (unsigned char *optbuf, int optbufSize)
}
break;
+ /*
+ * Some old BOOTP daemons don't support the NTP server (42) tag,
+ * but do support the RFC 868 time server (4) tag. Cheat here
+ * and assume they mean the same thing.
+ */
+ case 4:
+ case 42:
+ /* Time servers */
+ if (len % 4)
+ panic ("bootpc: time server Len is %d", len);
+ {
+ int tlen = 0;
+ while ((tlen < len) &&
+ (rtems_bsdnet_ntpserver_count < sizeof rtems_bsdnet_config.ntp_server /
+ sizeof rtems_bsdnet_config.ntp_server[0])) {
+ bcopy (p+tlen,
+ &rtems_bsdnet_ntpserver[rtems_bsdnet_ntpserver_count],
+ 4);
+ printip("Time Server",
+ rtems_bsdnet_ntpserver[rtems_bsdnet_ntpserver_count]);
+ rtems_bsdnet_ntpserver_count++;
+ tlen += 4;
+ }
+ }
+ break;
+
case 6:
/* Domain Name servers */
if (len % 4)