|
|
@ -1,33 +1,9 @@
|
|
|
|
/* $Id: udp.c,v 1.17 2009/11/28 13:11:51 stpohle Exp $ */
|
|
|
|
/* $Id: udp.c,v 1.18 2009/12/18 11:05:37 stpohle Exp $ */
|
|
|
|
/* udp.c code for the network
|
|
|
|
/* udp.c code for the network
|
|
|
|
File Version 0.2
|
|
|
|
File Version 0.2
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define UDP_LEN_HOSTNAME 128
|
|
|
|
#include "udp.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#include <winsock.h>
|
|
|
|
|
|
|
|
#include <io.h>
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
|
|
|
#define _sockaddr sockaddr
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define _sockaddr sockaddr_in6
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern char *dns_net_getip (char *host);
|
|
|
|
extern char *dns_net_getip (char *host);
|
|
|
|
extern int dns_filladdr (char *host, int hostlen, char *port, int portlen, int ai_family,
|
|
|
|
extern int dns_filladdr (char *host, int hostlen, char *port, int portlen, int ai_family,
|
|
|
|