VirtualBox

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

Last change on this file since 13940 was 13940, checked in by vboxsync, 16 years ago

pseudo-timers moved to timers
polling select is notified via pipe (!!! on UNIX) about attaching new socket (to make it sleeping rather then polling)
writing part of slirp_select _fill/_poll are called on drvNATSend
pessimistic queue locking is in process to be tollerant to heavy model and to polling-less Slirp functioning

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1#ifndef _LIBSLIRP_H
2#define _LIBSLIRP_H
3
4#ifdef _WIN32
5#include <winsock2.h>
6#ifdef __cplusplus
7extern "C" {
8#endif
9int 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
23typedef struct NATState *PNATState;
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29int slirp_init(PNATState *, const char *, uint32_t, bool, const char *, const char *, void *);
30void slirp_term(PNATState);
31void slirp_link_up(PNATState);
32void slirp_link_down(PNATState);
33
34void slirp_select_fill(PNATState pData, int *pnfds,
35 fd_set *readfds, fd_set *writefds, fd_set *xfds);
36
37void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds);
38
39void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len);
40void slirp_set_ethaddr(PNATState pData, const uint8_t *ethaddr);
41
42/* you must provide the following functions: */
43int slirp_can_output(void * pvUser);
44void slirp_output(void * pvUser, const uint8_t *pkt, int pkt_len);
45
46int slirp_redir(PNATState pData, int is_udp, int host_port,
47 struct in_addr guest_addr, int guest_port);
48int slirp_add_exec(PNATState pData, int do_pty, const char *args, int addr_low_byte,
49 int guest_port);
50
51#ifdef VBOX_WITH_SYNC_SLIRP
52void slirp_fasttmr(PNATState pData);
53void slirp_slowtmr(PNATState pData);
54/*selects open and ready sockets for write*/
55void slirp_send_fill(PNATState pData, int *pnfds, fd_set *writeds);
56/*triggers socket output */
57void slirp_send_trigger(PNATState pData, int *pnfds, fd_set *writeds);
58/*should be implemented by client*/
59void slirp_socket_created(void* pvUser);
60#endif
61#ifdef __cplusplus
62}
63#endif
64
65#endif
Note: See TracBrowser for help on using the repository browser.

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