buftvtots.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1996 by Sun Microsystems, Inc.
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* buftvtots - pull a Unix-format (struct timeval) time stamp out of
* an octet stream and convert it to a l_fp time stamp.
* This is useful when using the clock line discipline.
*/
#include "ntp_fp.h"
#include "ntp_unixtime.h"
int
const char *bufp;
{
#ifdef XNTP_BIG_ENDIAN
sec <<= 8;
sec <<= 8;
sec <<= 8;
usec <<= 8;
usec <<= 8;
usec <<= 8;
#else
usec <<= 8;
usec <<= 8;
usec <<= 8;
sec <<= 8;
sec <<= 8;
sec <<= 8;
#endif
if (usec > 999999)
return 0;
return 1;
}