From ea287debe1980182adbe8c63b71bb82193dad5b7 Mon Sep 17 00:00:00 2001 From: wdenk Date: Fri, 1 Apr 2005 00:25:43 +0000 Subject: * Patch by Masami Komiya, 30 Mar 2005: add SNTP support and expand time server and time offset fields of DHCP support. See doc/README.SNTP * Patch by Steven Scholz, 13 Dec 2004: Fix bug in at91rm920 ethernet driver --- net/bootp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'net/bootp.c') diff --git a/net/bootp.c b/net/bootp.c index 4bca50d75d..ee0982e60a 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -448,6 +448,10 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R *e++ = 1; /* Subnet Mask */ *cnt += 1; #endif +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) + *e++ = 2; + *cnt += 1; +#endif #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_GATEWAY) *e++ = 3; /* Router Option */ *cnt += 1; @@ -471,6 +475,10 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R #if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NISDOMAIN) *e++ = 40; /* NIS Domain name request */ *cnt += 1; +#endif +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) + *e++ = 42; + *cnt += 1; #endif *e++ = 255; /* End of the list */ @@ -718,6 +726,12 @@ static void DhcpOptionsProcess (uchar * popt) case 1: NetCopyIP (&NetOurSubnetMask, (popt + 2)); break; +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET) + case 2: /* Time offset */ + NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2)); + NetTimeOffset = ntohl (NetTimeOffset); + break; +#endif case 3: NetCopyIP (&NetOurGatewayIP, (popt + 2)); break; @@ -741,6 +755,11 @@ static void DhcpOptionsProcess (uchar * popt) memcpy (&NetOurRootPath, popt + 2, size); NetOurRootPath[size] = 0; break; +#if (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER) + case 42: /* NTP server IP */ + NetCopyIP (&NetNtpServerIP, (popt + 2)); + break; +#endif case 51: NetCopyLong (&dhcp_leasetime, (ulong *) (popt + 2)); break; -- cgit v1.2.1