Changeset a0af97d in rtems for cpukit/libnetworking/nfs


Ignore:
Timestamp:
Nov 9, 1999, 3:43:47 AM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
41d2eaca
Parents:
84bf329
Message:

Patch from Eric Norum <eric@…> 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/nfs/bootp_subr.c

    r84bf329 ra0af97d  
    731731      break;
    732732
    733     case 2:    /* Time offset, unused */
     733    case 2:    /* Time offset */
     734      /* Time offset */
     735      if (len!=4)
     736        panic("bootpc: time offset len is %d",len);
     737      bcopy (p, &rtems_bsdnet_timeoffset, 4);
     738      rtems_bsdnet_timeoffset = ntohl (rtems_bsdnet_timeoffset);
    734739      break;
    735740
     
    741746        bcopy(p, &dhcp_gw.sin_addr, 4);
    742747        dhcp_gotgw = 1;
     748      }
     749      break;
     750
     751    /*
     752     * Some old BOOTP daemons don't support the NTP server (42) tag,
     753     * but do support the RFC 868 time server (4) tag.  Cheat here
     754     * and assume they mean the same thing.
     755     */
     756    case 4:
     757    case 42:
     758      /* Time servers */
     759      if (len % 4)
     760        panic ("bootpc: time server Len is %d", len);
     761      {
     762      int tlen = 0;
     763      while ((tlen < len) &&
     764             (rtems_bsdnet_ntpserver_count < sizeof rtems_bsdnet_config.ntp_server /
     765             sizeof rtems_bsdnet_config.ntp_server[0])) {
     766        bcopy (p+tlen,
     767                &rtems_bsdnet_ntpserver[rtems_bsdnet_ntpserver_count],
     768                4);
     769        printip("Time Server",
     770          rtems_bsdnet_ntpserver[rtems_bsdnet_ntpserver_count]);
     771        rtems_bsdnet_ntpserver_count++;
     772        tlen += 4;
     773      }
    743774      }
    744775      break;
Note: See TracChangeset for help on using the changeset viewer.