File: udp.h

package info (click to toggle)
bomberclone 0.11.5-1sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,608 kB
  • ctags: 1,437
  • sloc: ansic: 13,356; sh: 3,292; makefile: 183
file content (39 lines) | stat: -rw-r--r-- 974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* $Id: udp.h,v 1.1 2003/12/24 02:42:05 stpohle Exp $
 * UDP Network */

#ifndef _UDP_H
#define _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 int dns_filladdr (char *host, int hostlen, char *port, int portlen, int ai_family, struct _sockaddr *sAddr);
extern int udp_get (int sock, char *text, int len, struct _sockaddr *sAddr, int ai_family);
extern int udp_server (char *port, int ai_family);
extern void udp_send (int sock, char *text, int len, struct _sockaddr *sAddr, int ai_family);
extern void udp_close (int sock);

#endif