~ubuntu-branches/ubuntu/gutsy/virtualbox-ose/gutsy

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Network/slirp/libslirp.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-09-08 16:44:58 UTC
  • Revision ID: james.westby@ubuntu.com-20070908164458-wao29470vqtr8ksy
Tags: upstream-1.5.0-dfsg2
ImportĀ upstreamĀ versionĀ 1.5.0-dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _LIBSLIRP_H
 
2
#define _LIBSLIRP_H
 
3
 
 
4
#ifdef _WIN32
 
5
#include <winsock2.h>
 
6
#ifdef __cplusplus
 
7
extern "C" {
 
8
#endif
 
9
int inet_aton(const char *cp, struct in_addr *ia);
 
10
#ifdef __cplusplus
 
11
}
 
12
#endif
 
13
#else
 
14
#ifdef RT_OS_OS2 /* temporary workaround, see ticket #127 */
 
15
# include <sys/time.h>
 
16
#endif
 
17
#include <sys/select.h>
 
18
#include <arpa/inet.h>
 
19
#endif
 
20
 
 
21
#include <VBox/types.h>
 
22
 
 
23
typedef struct NATState *PNATState;
 
24
 
 
25
#ifdef __cplusplus
 
26
extern "C" {
 
27
#endif
 
28
 
 
29
int slirp_init(PNATState *, const char *, bool, void *);
 
30
void slirp_term(PNATState);
 
31
void slirp_link_up(PNATState);
 
32
void slirp_link_down(PNATState);
 
33
 
 
34
void slirp_select_fill(PNATState pData, int *pnfds,
 
35
                       fd_set *readfds, fd_set *writefds, fd_set *xfds);
 
36
 
 
37
void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds);
 
38
 
 
39
void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len);
 
40
 
 
41
/* you must provide the following functions: */
 
42
int slirp_can_output(void * pvUser);
 
43
void slirp_output(void * pvUser, const uint8_t *pkt, int pkt_len);
 
44
 
 
45
int slirp_redir(PNATState pData, int is_udp, int host_port,
 
46
                struct in_addr guest_addr, int guest_port);
 
47
int slirp_add_exec(PNATState pData, int do_pty, const char *args, int addr_low_byte,
 
48
                   int guest_port);
 
49
 
 
50
 
 
51
#ifdef __cplusplus
 
52
}
 
53
#endif
 
54
 
 
55
#endif