1
0
mirror of https://frontier.innolan.net/rainlance/amiga-ntimed.git synced 2025-11-22 23:02:32 +00:00

Initial commit

This commit is contained in:
llsth
2015-03-07 23:29:12 +01:00
parent db0abbb4c8
commit a56b6e0b0f
20 changed files with 1565 additions and 374 deletions

View File

@ -35,6 +35,8 @@
#include "udp.h"
#include "ntp.h"
#include "agetaddrinfo.h"
struct ntp_peer *
NTP_Peer_New(const char *hostname, const void *sa, unsigned salen)
{
@ -78,9 +80,9 @@ NTP_Peer_NewLookup(struct ocx *ocx, const char *hostname)
memset(&hints, 0, sizeof hints);
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo(hostname, "ntp", &hints, &res0);
error = getaddrinfo(hostname, "123", &hints, &res0);
if (error)
Fail(ocx, 0, "hostname '%s', port 'ntp': %s\n",
Fail(ocx, 0, "hostname '%s', port '123': %s\n",
hostname, gai_strerror(error));
np = NTP_Peer_New(hostname, res0->ai_addr, res0->ai_addrlen);