VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/libslirp.h@ 1050

Last change on this file since 1050 was 1039, checked in by vboxsync, 18 years ago

Attempt to fix slirp build for 64 bit (also eliminated global variables)

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1#ifndef _LIBSLIRP_H
2#define _LIBSLIRP_H
3
4#ifdef _WIN32
5#include <winsock2.h>
6#if defined(VBOX) && defined(__cplusplus)
7extern "C" {
8#endif
9int inet_aton(const char *cp, struct in_addr *ia);
10#if defined(VBOX) && defined(__cplusplus)
11}
12#endif
13#else
14#if defined(VBOX) && defined(__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#ifdef VBOX
22#include <VBox/types.h>
23
24typedef struct NATState *PNATState;
25#endif /* VBOX */
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#ifndef VBOX
32void slirp_init(void);
33#else /* VBOX */
34int slirp_init(PNATState *, const char *, void *);
35void slirp_term(PNATState);
36void slirp_link_up(PNATState);
37void slirp_link_down(PNATState);
38#endif /* VBOX */
39
40#ifdef VBOX
41void slirp_select_fill(PNATState pData, int *pnfds,
42 fd_set *readfds, fd_set *writefds, fd_set *xfds);
43
44void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds);
45
46void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len);
47#else /* !VBOX */
48void slirp_select_fill(int *pnfds,
49 fd_set *readfds, fd_set *writefds, fd_set *xfds);
50
51void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds);
52
53void slirp_input(const uint8_t *pkt, int pkt_len);
54#endif /* !VBOX */
55
56#ifdef VBOX
57/* you must provide the following functions: */
58int slirp_can_output(void * pvUser);
59void slirp_output(void * pvUser, const uint8_t *pkt, int pkt_len);
60
61int slirp_redir(PNATState pData, int is_udp, int host_port,
62 struct in_addr guest_addr, int guest_port);
63int slirp_add_exec(PNATState pData, int do_pty, const char *args, int addr_low_byte,
64 int guest_port);
65#else /* !VBOX */
66/* you must provide the following functions: */
67int slirp_can_output(void);
68void slirp_output(const uint8_t *pkt, int pkt_len);
69
70int slirp_redir(int is_udp, int host_port,
71 struct in_addr guest_addr, int guest_port);
72int slirp_add_exec(int do_pty, const char *args, int addr_low_byte,
73 int guest_port);
74#endif /* !VBOX */
75
76#ifndef VBOX
77extern const char *tftp_prefix;
78extern char slirp_hostname[33];
79#endif /* !VBOX */
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette