2
|
1 /* udp.h
|
|
2 *
|
|
3 * Copyright (C) DFS Deutsche Flugsicherung (2004, 2005).
|
|
4 * All Rights Reserved.
|
|
5 *
|
|
6 * UDP functions for IPv4
|
|
7 *
|
|
8 * Version 0.2
|
|
9 */
|
|
10
|
|
11 class UDP {
|
|
12 int local_fd;
|
|
13 struct sockaddr_in foreign_sock;
|
|
14 public:
|
|
15 void send_init(char *foreign_name, int foreign_port, int local_fd_);
|
|
16 void send(char *buf, int bytes);
|
|
17 void send_close();
|
|
18 };
|
|
19
|
|
20 int UDP_recv_init(int port);
|
|
21
|
|
22 // IP to ASCII
|
|
23 char *iptoa(char *buf, in_addr_t ip);
|
|
24
|
|
25 // ASCII to IP
|
|
26 in_addr_t atoip(char *buf);
|