246 int udp_ep = -1, tcp_ep = -1;
248 char ut[64], ipuaddr[64];
266 if (*uaddr ==
NULL) {
267 if ((srv !=
NULL) && (thost !=
NULL)) {
268 msg(
"both timehost and srv pointer used!");
272 srv =
get_server(netid, thost, &tsrv, teps, 32);
274 msg(
"unable to contruct server data.");
281 epl = srv->
ep.ep_len;
285 (
i < epl) && ((udp_ep == -1) || (tcp_ep == -1));
i++) {
295 useua = ep[tcp_ep].
uaddr;
297 }
else if (udp_ep > -1) {
299 useua = ep[udp_ep].
uaddr;
304 msg(
"no acceptable transport endpoints.");
324 msg(
"unable to translate uaddr to sockaddr.");
339 msg(
"unable to create client handle to rpcbind.");
378 msg(
"cannot convert timeservice uaddr to sockaddr.");
384 msg(
"unable to open fd to network.");
398 if (
sendto(
s, (
const char *)&thetime,
sizeof(thetime), 0,
400 msg(
"udp : sendto failed.");
415 msg(
"recvfrom failed on udp transport.");
431 msg(
"failed to connect to tcp endpoint.");
435 msg(
"alarm caught it, must be unreachable.");
439 res =
recv(
s, (
char *)&thetime,
sizeof(thetime), 0);
440 if (
res !=
sizeof(thetime)) {
442 msg(
"timed out TCP call.");
444 msg(
"wrong size of results returned");
456 thetime =
ntohl(thetime);
493 tv.tv_sec += (tv.tv_sec > 500000) ? 1 : 0;
494 delta = (thetime > tv.tv_sec) ? thetime - tv.tv_sec :
496 td->
tv_sec = (thetime < tv.tv_sec) ? - delta : delta;
499 msg(
"unable to get the server's time.");
INT WSAAPI recvfrom(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags, OUT LPSOCKADDR from, IN OUT INT FAR *fromlen)
static const struct update_accum a3
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
static int uaddr_to_sockaddr(char *uaddr, struct sockaddr_in *sin)
static const struct update_accum a4
INT WSAAPI connect(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
#define sprintf(buf, format,...)
#define gettimeofday(tv, tz)
bool_t(* xdrproc_t)(XDR *,...)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
INT WSAAPI WSAGetLastError(VOID)
static void alarm_hndler(int s)
static const struct update_accum a2
static void free_eps(eps, int num)
bool_t xdr_u_long(XDR *xdrs, u_long *ulp)
static nis_server * get_server(struct sockaddr_in *sin, char *host, nis_server *srv, eps, int maxep)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
struct nis_server::@199 ep
__BEGIN_DECLS CLIENT * clnttcp_create(struct sockaddr_in *, u_long, u_long, SOCKET *, u_int, u_int)
int _rpc_dtablesize(void)
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
static const struct update_accum a1
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
GLuint GLuint GLsizei GLenum type
static SERVICE_STATUS status
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)