From: Johannes Maximilian Kuehn Date: Sat, 16 Aug 2008 20:57:54 +0000 (+0900) Subject: networking.h: X-Git-Tag: NTP_4_2_5P142~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a544b21ceb21c251e5f30b993faf4def39b6356a;p=thirdparty%2Fntp.git networking.h: Removed useless prototype filter_ntp main.c, utilities.c, networking.c, kod_management.c: Cleaning up bk: 48a73f52GWNMsDErcxi52vEU151EQw --- diff --git a/gsoc_sntp/kod_management.c b/gsoc_sntp/kod_management.c index 54b7525e7..685a4c75c 100644 --- a/gsoc_sntp/kod_management.c +++ b/gsoc_sntp/kod_management.c @@ -157,7 +157,6 @@ kod_init_kod_db ( /* Max. of 255 characters for hostname, 10 for timestamp, 4 for kisscode, 2 for format : and 1 for \n */ char fbuf[272]; - char *obuf = fbuf; char error = 0; @@ -179,7 +178,6 @@ kod_init_kod_db ( printf("Starting to read KOD file %s...\n", db_file); /* First let's see how many entries there are and check for right syntax */ - int scan_value = 0; while(!feof(db_s)) { fgets(fbuf, 272, db_s); @@ -223,8 +221,8 @@ kod_init_kod_db ( for(b=0; (!feof(db_s) || !ferror(db_s)) && borg)); + tv_xmt.tv_sec += JAN_1970; + TVTOTS(&tv_xmt, &xmt); + HTONL_FP(&xmt, &(x_pkt->xmt)); x_pkt->stratum = STRATUM_TO_PKT(STRATUM_UNSPEC); x_pkt->ppoll = 8; @@ -162,8 +162,8 @@ on_wire ( close_socket(sock); - if(rpktl == -1) - return -1; +/* if(rpktl == -1) + return -1; */ /* -2 would indicate that we should try to get a packet * from this server again @@ -199,6 +199,8 @@ on_wire ( #endif GETTIMEOFDAY(&tv_dst, (struct timezone *)NULL); + + tv_dst.tv_sec += JAN_1970; tmp = p_rec; L_SUB(&tmp, &p_org); @@ -220,7 +222,7 @@ on_wire ( printf("on_wire: t21: %.6f\t t34: %.6f\ndelta: %.6f\t offset: %.6f\n", t21, t34, delta, offset); - set_time(offset); +/* set_time(offset); */ return 0; } diff --git a/gsoc_sntp/networking.c b/gsoc_sntp/networking.c index 90b8aa499..e2f06f67e 100644 --- a/gsoc_sntp/networking.c +++ b/gsoc_sntp/networking.c @@ -1,4 +1,5 @@ #include +#include #include "sntp-opts.h" #include "networking.h" @@ -31,9 +32,8 @@ resolve_hosts ( printf("Starting host resolution for %s...\n", hosts[a]); #endif - struct addrinfo hints, *dres, *res0; + struct addrinfo hints, *dres; int error; - const char *cause = NULL; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; @@ -98,7 +98,7 @@ resolve_hosts ( for(a=0; aai_addr, result[a]->ai_addrlen, adr_buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); - printf("%x: IP %s\n", result[a], adr_buf); + printf("%x: IP %s\n", (unsigned int) result[a], adr_buf); #endif *res = (struct addrinfo *) malloc(sizeof(struct addrinfo *) * entryc); @@ -188,7 +188,6 @@ recvdata ( #endif #ifdef DEBUG - register int a; if(recvc > 0) { getnameinfo((struct sockaddr *)sender, sender->ss_len, adr_buf, INET6_ADDRSTRLEN, NULL, 0, NI_NUMERICHOST); @@ -226,11 +225,9 @@ recvpkt ( int has_mac; int is_authentic; - l_fp ts; - l_fp t10, t23, tmp; + l_fp tmp; l_fp org; l_fp rec; - l_fp ci; struct sockaddr_storage sender; @@ -419,12 +416,3 @@ filter_reachable ( return filter_elements; } - -/* Will be handled by recvpkt */ -int -filter_ntp ( - struct addrinfo **res, - int resc - ) -{ -} diff --git a/gsoc_sntp/networking.h b/gsoc_sntp/networking.h index fb5b26cc9..03d391887 100644 --- a/gsoc_sntp/networking.h +++ b/gsoc_sntp/networking.h @@ -1,16 +1,8 @@ #ifndef NETWORK_H #define NETWORK_H -#if 0 -#include /**/ -/* #include /**/ -/* #include /**/ -/* #include /**/ -#include /**/ -#include /**/ -#endif -#include /**/ -#include /**/ +#include +#include #include @@ -23,12 +15,6 @@ #define closesocket close #endif -/* Check if necessary or not */ -/* Maximum number of sockets... should be specified in sntp.h later */ -#define MAX_AF 2 - -int descriptors[MAX_AF]; - /* From ntpdate.c */ int is_reachable (struct addrinfo *dst); @@ -45,6 +31,4 @@ int recvdata (SOCKET rsock, struct sockaddr_storage *sender, char *rdata, size_t int recvpkt (SOCKET rsock, struct pkt *rpkt, struct pkt *spkt); -int filter_reachable (struct addrinfo **res, int resc); - #endif diff --git a/gsoc_sntp/utilities.c b/gsoc_sntp/utilities.c index 1d6de37af..f8a6d5c67 100644 --- a/gsoc_sntp/utilities.c +++ b/gsoc_sntp/utilities.c @@ -52,7 +52,7 @@ l_fp_output_bin ( FILE *output ) { - register int a, b, bexp; + register int a, b; fprintf(output, HLINE);