#ifdef OPENSSL
#include "ntp_crypto.h"
#endif /* OPENSSL */
+#include <ntp_random.h>
#include <isc/boolean.h>
--- /dev/null
+
+#include <ntp_types.h>
+
+long ntp_random P((void));
+void ntp_srandom P((unsigned long));
+void ntp_srandomdev P((void));
+char * ntp_initstate P((unsigned long, /* seed for R.N.G. */
+ char *, /* pointer to state array */
+ long /* # bytes of state info */
+ ));
+char * ntp_setstate P((char *)); /* pointer to state array */
+
+
+
#ifdef SYS_WINNT
#define exit ntservice_exit
extern void ntservice_exit (int);
-/* declare the service threads */
-void service_main (DWORD, LPTSTR *);
-void service_ctrl (DWORD);
-void worker_thread (void *);
#define sleep(x) Sleep((DWORD) x * 1000 /* milliseconds */ );
#endif /* SYS_WINNT */
-extern void ntp_srandom P((unsigned long));
-extern int ntp_random P((void));
-
/* ntp_config.c */
extern void getconfig P((int, char **));
lib_strbuf.c machines.c md5c.c memmove.c mfptoa.c \
mfptoms.c mktime.c modetoa.c mstolfp.c msutotsf.c msyslog.c netof.c \
ntp_rfc2553.c numtoa.c numtohost.c octtoint.c prettydate.c \
- random.c recvbuff.c refnumtoa.c snprintf.c socktoa.c socktohost.c \
+ ntp_random.c recvbuff.c refnumtoa.c snprintf.c socktoa.c socktohost.c \
statestr.c strdup.c strerror.c strstr.c \
syssignal.c tsftomsu.c tstotv.c tvtoa.c tvtots.c \
uglydate.c uinttoa.c utvtoa.c ymd2yd.c \
#include <stdio.h>
#include <ntp_types.h>
+#include <ntp_random.h>
+#include <ntp_unixtime.h>
/*
* random.c:
static long *end_ptr = &randtbl[DEG_3 + 1];
static inline long good_rand P((long));
-long ntp_random P((void));
static inline long
good_rand (
* state buffer are no longer derived from the LC algorithm applied to
* a fixed seed.
*/
+#ifdef NEED_SRANDOMDEV
void
ntp_srandomdev( void )
{
struct timeval tv;
unsigned long junk; /* Purposely used uninitialized */
- gettimeofday(&tv, NULL);
+ GETTIMEOFDAY(&tv, NULL);
ntp_srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk);
return;
}
+#endif
/*
* initstate:
#include "ntp_stdlib.h"
#include "ntp_config.h"
#include "ntp_cmdargs.h"
+#include <ntp_random.h>
#include <isc/net.h>
#include <isc/result.h>
#include "ntp_stdlib.h"
#include "ntp_unixtime.h"
#include "ntp_string.h"
+#include <ntp_random.h>
#include "openssl/asn1_mac.h"
#include "openssl/bn.h"
#include "ntp_io.h"
#include "ntp_if.h"
#include "ntp_stdlib.h"
+#include <ntp_random.h>
#include <stdio.h>
#include <signal.h>
#include "ntpd.h"
#include "ntp_stdlib.h"
+#include <ntp_random.h>
#ifdef OPENSSL
#include "openssl/rand.h"
#endif /* OPENSSL */
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_stdlib.h"
+#include <ntp_random.h>
#ifdef SIM
#include "ntpsim.h"
* Miscellaneous functions that Microsoft maps
* to other names
*/
+#define inline __inline
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define stricmp _stricmp
# End Source File
# Begin Source File
-SOURCE=..\..\..\libntp\binio.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\libntp\buftvtots.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=..\..\..\libntp\gpstolfp.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\libntp\hextoint.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=..\..\..\libntp\ieee754io.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\libisc\inet_aton.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=..\..\..\libntp\mfp_mul.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\libntp\mfptoa.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\..\libntp\ntp_random.c
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\libntp\ntp_rfc2553.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=..\..\..\libntp\ranny.c
-# End Source File
-# Begin Source File
-
SOURCE=..\..\..\libntp\recvbuff.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\..\include\ntp_random.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\include\ntp_refclock.h
# End Source File
# Begin Source File
# End Source File
# Begin Source File
+SOURCE=..\..\..\libntp\ntp_random.c
+# End Source File
+# Begin Source File
+
SOURCE=..\libntp\randfile.c
# End Source File
# Begin Source File
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "\openssl-0.9.7d\inc32" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /YX"windows.h" /FD /c
+# ADD CPP /nologo /MD /W4 /GX /O2 /I "." /I "..\include" /I "..\..\..\include" /I "\openssl-0.9.7d\inc32" /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__STDC__" /D "SYS_WINNT" /D "HAVE_CONFIG_H" /D _WIN32_WINNT=0x400 /FR /YX"windows.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# End Source File
# Begin Source File
+SOURCE=..\..\..\include\ntp_random.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\include\ntp_refclock.h
# End Source File
# Begin Source File