/** @file
* NAT - slirp state/configuration.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___slirp_state_h
#define ___slirp_state_h
#include <iprt/critsect.h>
#define COUNTERS_INIT
#include "counters.h"
#include "ip_icmp.h"
#include "dnsproxy/dnsproxy.h"
/** Where to start DHCP IP number allocation. */
/** DHCP Lease time. */
/*
* ARP cache this is naive implementaion of ARP
* cache of mapping 4 byte IPv4 address to 6 byte
* ethernet one.
*/
struct arp_cache_entry
{
};
/** TFTP session entry. */
struct dns_domain_entry
{
char *dd_pszDomain;
};
typedef struct DNSMAPPINGENTRY
{
/** host name to map.
* @note If pszCName isn't null pszPattern won't be used (see alias_dns.c for
* details).
*/
char *pszCName;
/** Pattern (simple) of hostnames to map to the specified IP. */
char *pszPattern;
/** The IP Address. */
/** List entry. */
#endif
struct dns_entry
{
};
struct port_forward_rule
{
int activated;
};
#ifdef RT_OS_WINDOWS
struct pong;
#endif
/* forward declaration */
struct proto_handler;
/** Main state/configuration structure for slirp NAT. */
typedef struct NATState
{
#include "counters.h"
/* Stuff from boot.c */
void *pbootp_clients;
const char *bootp_filename;
/* Stuff from if.c */
int if_comp;
int if_maxlinkhdr;
int if_queued;
int if_thresh;
/* Stuff from icmp.c */
/* Stuff from ip_input.c */
/* Stuff from mbuf.c */
/* Stuff from slirp.c */
void *pvUser;
bool do_slowtimo;
bool link_up;
int tcp_rcvspace;
int tcp_sndspace;
int socket_rcv;
int socket_snd;
int soMaxConn;
#ifdef RT_OS_WINDOWS
#endif
bool fPassDomain;
/* Stuff from tcp_input.c */
/* Stuff from tcp_timer.c */
int tcp_reass_qsize;
int tcp_reass_maxqlen;
int tcp_reass_maxseg;
int tcp_reass_overflows;
/* Stuff from tftp.c */
void *pvTftpSessions;
int cTftpSession;
const char *tftp_prefix;
/* Stuff from udp.c */
# ifndef RT_OS_WINDOWS
/* counter of sockets needed for allocation enough room to
*
* operation on socket queue (tcb, udb)
*/
int nsock;
# else
# define NSOCK_INC() do {} while (0)
# define NSOCK_DEC() do {} while (0)
# endif
# if !defined(RT_OS_WINDOWS)
int cIcmpCacheSize;
int iIcmpCacheLimit;
# else
# endif
#if defined(RT_OS_WINDOWS)
#endif
#ifdef zone_mbuf
#endif
#ifdef zone_clust
#endif
#ifdef zone_pack
#endif
#ifdef zone_jumbop
#endif
#ifdef zone_jumbo9
#endif
#ifdef zone_jumbo16
#endif
#ifdef zone_ext_refcnt
#endif
/**
* in (r89055) using of this behaviour has been changed and mean that Slirp
* can't parse hosts strucutures/files to provide to guest host name-resolving
* configuration, instead Slirp provides .{interface-number + 1}.3 as a nameserver
* and proxies DNS queiries to Host's Name Resolver API.
*/
bool fUseHostResolver;
/**
* Flag whether using the host resolver mode is permanent
* because the user configured it that way.
*/
/* from dnsproxy/dnsproxy.h*/
unsigned int authoritative_port;
unsigned int authoritative_timeout;
unsigned int recursive_port;
unsigned int recursive_timeout;
unsigned int stats_timeout;
unsigned int port;
unsigned long active_queries;
unsigned long all_queries;
unsigned long authoritative_queries;
unsigned long recursive_queries;
unsigned long removed_queries;
unsigned long dropped_queries;
unsigned long answered_queries;
unsigned long dropped_answers;
unsigned long late_answers;
unsigned long hash_collisions;
/*dnsproxy/dnsproxy.c*/
unsigned short queryid;
int sock_query;
int sock_answer;
/* this field control behaviour of DHCP server */
bool fUseDnsProxy;
int i32AliasMode;
/** Critical R/W section to protect the handler chain list. */
int cRedirectionsActive;
int cRedirectionsStored;
/* libalis modules' handlers*/
#ifdef VBOX_WITH_NAT_SEND2HOME
/* array of home addresses */
/* size of pInSockAddrHomeAddress in elements */
int cInHomeAddressSize;
#endif
#endif
} NATState;
/** Default IP time to live. */
/** Number of permanent buffers in mbuf. */
/** Use a fixed time before sending keepalive. */
/** Use a fixed interval between keepalive. */
/** Maximum idle time before timing out a connection. */
/** Default TCP socket options. */
/** Default TCP MSS value. */
/** Default TCP round trip time. */
/** Enable RFC1323 performance enhancements.
* @todo check if it really works, it was turned off before. */
/** TCP receive buffer size. */
/** TCP receive buffer size. */
/* TCP duplicate ACK retransmit threshold. */
#ifndef VBOX_SLIRP_ALIAS
#else
#endif
#define VBOX_X2(x) x
#if 1
{ \
do { \
} while(0)
do { \
} while(0)
do { \
} while (0)
#endif
/* dnsproxy/dnsproxy.c */
/* dnsproxy/dnsproxy.c */
#include "ext.h"
{
}
{
return pData->zone_jumbop;
}
{
return pData->zone_jumbo9;
}
{
return pData->zone_jumbo16;
}
{
return pData->zone_ext_refcnt;
}
{
}
{
return pData->zone_clust;
}
#ifndef VBOX_SLIRP_BSD
#endif
#endif /* !___slirp_state_h */