globals: Allow global properties to be optional
[qemu/kevin.git] / slirp / libslirp.h
blob42e42e9a2a61ffe32739b6032d03308aa29b655f
1 #ifndef LIBSLIRP_H
2 #define LIBSLIRP_H
4 #include "qemu-common.h"
6 typedef struct Slirp Slirp;
8 int get_dns_addr(struct in_addr *pdns_addr);
9 int get_dns6_addr(struct in6_addr *pdns6_addr, uint32_t *scope_id);
11 Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
12 struct in_addr vnetmask, struct in_addr vhost,
13 bool in6_enabled,
14 struct in6_addr vprefix_addr6, uint8_t vprefix_len,
15 struct in6_addr vhost6, const char *vhostname,
16 const char *tftp_server_name,
17 const char *tftp_path, const char *bootfile,
18 struct in_addr vdhcp_start, struct in_addr vnameserver,
19 struct in6_addr vnameserver6, const char **vdnssearch,
20 const char *vdomainname, void *opaque);
21 void slirp_cleanup(Slirp *slirp);
23 void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout);
25 void slirp_pollfds_poll(GArray *pollfds, int select_error);
27 void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len);
29 /* you must provide the following functions: */
30 void slirp_output(void *opaque, const uint8_t *pkt, int pkt_len);
32 int slirp_add_hostfwd(Slirp *slirp, int is_udp,
33 struct in_addr host_addr, int host_port,
34 struct in_addr guest_addr, int guest_port);
35 int slirp_remove_hostfwd(Slirp *slirp, int is_udp,
36 struct in_addr host_addr, int host_port);
37 int slirp_add_exec(Slirp *slirp, int do_pty, const void *args,
38 struct in_addr *guest_addr, int guest_port);
40 void slirp_connection_info(Slirp *slirp, Monitor *mon);
42 void slirp_socket_recv(Slirp *slirp, struct in_addr guest_addr,
43 int guest_port, const uint8_t *buf, int size);
44 size_t slirp_socket_can_recv(Slirp *slirp, struct in_addr guest_addr,
45 int guest_port);
47 #endif