]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 258] sntp cleanup
authorHarlan Stenn <stenn@ntp.org>
Sun, 21 Dec 2003 01:18:51 +0000 (20:18 -0500)
committerHarlan Stenn <stenn@ntp.org>
Sun, 21 Dec 2003 01:18:51 +0000 (20:18 -0500)
bk: 3fe4f4fbh6w8tv-GvTJVSRLe6zMnzg

sntp/internet.c
sntp/main.c
sntp/socket.c
sntp/timing.c

index 2d23e501ff42f35e28fcd52c1ca98f84af6667a5..6c573febb739991ac72dd49215e8d83a37839e47 100644 (file)
@@ -71,8 +71,6 @@ number. */
     int family, rval;
     struct addrinfo hints;
     struct addrinfo *res;
-    struct sockaddr_in *sin;
-    struct sockaddr_in6 *sin6;
 
     res = NULL;
     memset(address, 0, sizeof(struct sockaddr_storage));
index 13e527ce65755b2c7b26e2c7612eac044440b01e..e6cee75f04f877c5923198a9ee578fd6f189831c 100644 (file)
@@ -241,7 +241,24 @@ typedef struct {
     double dispersion, weight, when, offset, error;
 } data_record;
 
-
+void syntax(int);
+void display_data(ntp_data *);
+void display_packet(unsigned char *, int);
+void pack_ntp(unsigned char *, int, ntp_data *);
+void unpack_ntp(ntp_data *, unsigned char *, int);
+void make_packet(ntp_data *, int);
+int read_packet(int, ntp_data *, double *, double *);
+void format_time(char *, int, double, double, double, double);
+double reset_clock(double, double, int);
+void run_server(void);
+double estimate_stats(int *, int *, data_record *, double, double *, double *,
+       double *, double *, double *, double *, int *, int);
+double correct_drift(double *, double *, double);
+void handle_saving(int, int *, int *, int *, data_record *, double *,
+       double *, double *);
+void query_savefile(void);
+void run_daemon(char **, int, int);
+void run_client(char **, int);
 
 void fatal (int syserr, const char *message, const char *insert) {
 
index 75fd4613de3bb44c1eab48cc1630ac65ee62d0a1..1e7254880dd59aa543d94456c86fc41cacc1864a 100644 (file)
@@ -30,6 +30,12 @@ static struct sockaddr_storage here[MAX_SOCKETS], there[MAX_SOCKETS];
 static struct sockaddr_in here[MAX_SOCKETS], there[MAX_SOCKETS];
 #endif
 
+void display_in_hex(const void *, int);
+#ifdef HAVE_IPV6
+void display_sock_in_hex(struct sockaddr_storage *);
+#else
+void display_sock_in_hex (struct sockaddr_in *);
+#endif
 
 /* There needs to be some disgusting grobble for handling timeouts, that is
 identical to the grobble in internet.c. */
@@ -63,7 +69,7 @@ void display_in_hex (const void *data, int length) {
 #ifdef HAVE_IPV6
 
 void display_sock_in_hex (struct sockaddr_storage *sock) {
-    int family, len;
+    int family;
     struct sockaddr_in *sin;
     struct sockaddr_in6 *sin6;
 
index 30a9159695574f82428c6aea92d7a1b298a21d30..019ecaafc377ff357f0e21149c4655c81e2d3e33 100644 (file)
@@ -94,6 +94,8 @@ negative, unsigned values. */
       /*  if (settimeofday(&new,NULL))
             fatal(1,"unable to reset current system time",NULL);*/
     } else {
+       previous.tv_sec  = 0;
+       previous.tv_usec = 0;
         errno = 0;
        /* if (adjtime(&adjust,&previous))
             fatal(1,"unable to adjust current system time",NULL);*/