307
314
int tcp_ctl (PNATState, struct socket *);
308
315
struct tcpcb *tcp_drop(PNATState, struct tcpcb *tp, int err);
310
uint16_t slirp_get_service(int proto, uint16_t dport, uint16_t sport);
313
318
void slirp_arp_who_has(PNATState pData, uint32_t dst);
314
int slirp_update_arp_cache(PNATState pData, uint32_t dst, const uint8_t *mac);
319
int slirp_arp_cache_update(PNATState pData, uint32_t dst, const uint8_t *mac);
320
void slirp_arp_cache_add(PNATState pData, uint32_t ip, const uint8_t *ether);
321
int slirp_arp_cache_update_or_add(PNATState pData, uint32_t dst, const uint8_t *mac);
315
322
#define MIN_MRU 128
316
323
#define MAX_MRU 16384
344
350
unsigned short h_proto; /* packet type ID field */
346
352
AssertCompileSize(struct ethhdr, 14);
348
#if defined(VBOX_WITH_SLIRP_ALIAS) && defined(VBOX_SLIRP_ALIAS)
355
* (vvl) externing of sscanf.
357
int sscanf(const char *s, const char *format, ...);
359
#if defined(VBOX_SLIRP_ALIAS) || defined(VBOX_SLIRP_BSD)
350
361
# define ip_next(ip) (void *)((uint8_t *)(ip) + ((ip)->ip_hl << 2))
351
362
# define udp_next(udp) (void *)((uint8_t *)&((struct udphdr *)(udp))[1] )
371
386
# define strncasecmp RTStrNICmp
374
# define LIBALIAS_DEBUG
384
#define fflush(x) do{}while(0)
385
# define fprintf vbox_slirp_fprintf
386
# define printf vbox_slirp_printf
387
static void vbox_slirp_printV(char *format, va_list args)
390
memset(buffer, 0, 1024);
391
RTStrPrintfV(buffer, 1024, format, args);
393
Log2(("NAT:ALIAS: %s\n", buffer));
395
static void vbox_slirp_printf(char *format, ...)
398
va_start(args, format);
399
vbox_slirp_printV(format, args);
402
static void vbox_slirp_fprintf(void *ignored, char *format, ...)
405
va_start(args, format);
406
vbox_slirp_printV(format, args);
410
#endif /*VBOX_WITH_SLIRP_ALIAS && VBOX_SLIRP_ALIAS*/
412
#ifdef VBOX_WITH_SLIRP_ALIAS
391
# define LIBALIAS_DEBUG
394
# define fflush(x) do{} while(0)
396
#endif /*VBOX_SLIRP_ALIAS*/
398
#ifdef VBOX_WITH_SLIRP_BSD_MBUF
399
/* @todo might be useful to make it configurable,
400
* especially in terms of Intnet behind NAT
403
# define max_protohdr 0
404
/* @todo (r=vvl) for now ignore value,
405
* latter here should be fetching of tuning parameters entered
407
# define TUNABLE_INT_FETCH(name, pval) do { } while (0)
408
# define SYSCTL_PROC(a0, a1, a2, a3, a4, a5, a6, a7, a8)
409
# define SYSCTL_STRUCT(a0, a1, a2, a3, a4, a5, a6)
410
# define SYSINIT(a0, a1, a2, a3, a4)
411
# define sysctl_handle_int(a0, a1, a2, a3) 0
412
# define EVENTHANDLER_INVOKE(a) do{}while(0)
413
# define EVENTHANDLER_REGISTER(a0, a1, a2, a3) do{}while(0)
414
# define KASSERT AssertMsg
421
#define SYSCTL_HANDLER_ARGS PNATState pData, void *oidp, struct dummy_req *req
423
void mbuf_init(void *);
424
# define cksum(m, len) in_cksum_skip((m), (len), 0)
413
427
int ftp_alias_load(PNATState);
414
428
int ftp_alias_unload(PNATState);
415
429
int nbt_alias_load(PNATState);
416
430
int nbt_alias_unload(PNATState);
417
#endif /*VBOX_WITH_SLIRP_ALIAS*/
431
int dns_alias_load(PNATState);
432
int dns_alias_unload(PNATState);
433
int slirp_arp_lookup_ip_by_ether(PNATState, const uint8_t *, uint32_t *);
434
int slirp_arp_lookup_ether_by_ip(PNATState, uint32_t, uint8_t *);