Unhide declarations of network stack virtualization structs from
underneath #ifdef VIMAGE blocks. This change introduces some churn in #include ordering and nesting throughout the network stack and drivers but is not expected to cause any additional issues. In the next step this will allow us to instantiate the virtualization container structures and switch from using global variables to their "containerized" counterparts. Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
This commit is contained in:
parent
39a7471508
commit
f02493cbbd
@ -121,7 +121,7 @@ static const char rcsid[] = "@(#)$Id: ip_fil_freebsd.c,v 2.53.2.50 2007/09/20 12
|
||||
#endif
|
||||
extern int ip_optcopy __P((struct ip *, struct ip *));
|
||||
|
||||
#if (__FreeBSD_version > 460000)
|
||||
#if (__FreeBSD_version > 460000) && (__FreeBSD_version < 800055)
|
||||
extern int path_mtu_discovery;
|
||||
#endif
|
||||
|
||||
|
@ -43,7 +43,9 @@ static int sysctl_ipf_int ( SYSCTL_HANDLER_ARGS );
|
||||
static int ipf_modload(void);
|
||||
static int ipf_modunload(void);
|
||||
|
||||
#if __FreeBSD_version < 800055
|
||||
SYSCTL_DECL(_net_inet);
|
||||
#endif
|
||||
#define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \
|
||||
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
|
||||
ptr, val, sysctl_ipf_int, "I", descr);
|
||||
|
@ -33,9 +33,10 @@
|
||||
#ifndef _NET_VNET_H_
|
||||
#define _NET_VNET_H_
|
||||
|
||||
#ifdef VIMAGE
|
||||
#include "opt_route.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/socket.h>
|
||||
@ -66,8 +67,6 @@ struct vnet_net {
|
||||
int _ether_ipfw;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Symbol translation macros
|
||||
*/
|
||||
|
@ -1186,6 +1186,7 @@ typedef void *meta_p;
|
||||
|
||||
/* Hash related definitions */
|
||||
#define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */
|
||||
#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */
|
||||
|
||||
/* Virtualization macros */
|
||||
#define INIT_VNET_NETGRAPH(vnet) \
|
||||
@ -1194,6 +1195,16 @@ typedef void *meta_p;
|
||||
|
||||
#define VNET_NETGRAPH(sym) VSYM(vnet_netgraph, sym)
|
||||
|
||||
struct vnet_netgraph {
|
||||
LIST_HEAD(, ng_node) _ng_ID_hash[NG_ID_HASH_SIZE];
|
||||
LIST_HEAD(, ng_node) _ng_name_hash[NG_NAME_HASH_SIZE];
|
||||
LIST_HEAD(, ng_node) _ng_nodelist;
|
||||
ng_ID_t _nextID;
|
||||
struct unrhdr *_ng_iface_unit;
|
||||
struct unrhdr *_ng_eiface_unit;
|
||||
struct unrhdr *_ng_wormhole_unit;
|
||||
};
|
||||
|
||||
/* Symbol translation macros */
|
||||
#define V_nextID VNET_NETGRAPH(nextID)
|
||||
#define V_ng_ID_hash VNET_NETGRAPH(ng_ID_hash)
|
||||
|
@ -183,7 +183,6 @@ static struct mtx ng_idhash_mtx;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */
|
||||
static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE];
|
||||
static struct mtx ng_namehash_mtx;
|
||||
#define NG_NAMEHASH(NAME, HASH) \
|
||||
|
@ -447,8 +447,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
||||
caddr_t ptr;
|
||||
int buflen;
|
||||
|
||||
#define SA_SIZE(s) ((s)->sa_len<sizeof(*(s))? sizeof(*(s)):(s)->sa_len)
|
||||
|
||||
/* Determine size of response and allocate it */
|
||||
buflen = 0;
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
|
||||
@ -474,7 +472,6 @@ ng_eiface_rcvmsg(node_p node, item_p item, hook_p lasthook)
|
||||
buflen -= len;
|
||||
}
|
||||
break;
|
||||
#undef SA_SIZE
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -70,7 +70,6 @@ static void in_purgemaddrs(struct ifnet *);
|
||||
static int subnetsarelocal;
|
||||
static int sameprefixcarponly;
|
||||
extern struct inpcbinfo ripcbinfo;
|
||||
extern struct inpcbinfo udbinfo;
|
||||
#endif
|
||||
|
||||
SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_ip, OID_AUTO, subnets_are_local,
|
||||
|
@ -104,7 +104,6 @@ static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
MTX_SYSINIT(ip_id_mtx, &ip_id_mtx, "ip_id_mtx", MTX_DEF);
|
||||
|
||||
SYSCTL_DECL(_net_inet_ip);
|
||||
SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&array_size, 0, sysctl_ip_id_change, "IU", "IP ID Array size");
|
||||
SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_collisions, CTLFLAG_RD,
|
||||
|
@ -104,7 +104,7 @@ struct ipstat ipstat;
|
||||
static int ip_rsvp_on;
|
||||
struct socket *ip_rsvpd;
|
||||
int rsvp_on;
|
||||
static TAILQ_HEAD(ipqhead, ipq) ipq[IPREASS_NHASH];
|
||||
static struct ipqhead ipq[IPREASS_NHASH];
|
||||
static int maxnipq; /* Administrative limit on # reass queues. */
|
||||
static int maxfragsperpacket;
|
||||
int ipstealth;
|
||||
|
@ -234,18 +234,6 @@ extern struct pfil_head inet_pfil_hook; /* packet filter hooks */
|
||||
|
||||
void in_delayed_cksum(struct mbuf *m);
|
||||
|
||||
static __inline uint16_t ip_newid(void);
|
||||
extern int ip_do_randomid;
|
||||
|
||||
static __inline uint16_t
|
||||
ip_newid(void)
|
||||
{
|
||||
if (V_ip_do_randomid)
|
||||
return ip_randomid();
|
||||
|
||||
return htons(V_ip_id++);
|
||||
}
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif /* !_NETINET_IP_VAR_H_ */
|
||||
|
@ -98,55 +98,12 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <vm/uma.h>
|
||||
|
||||
|
||||
TAILQ_HEAD(hc_qhead, hc_metrics);
|
||||
|
||||
struct hc_head {
|
||||
struct hc_qhead hch_bucket;
|
||||
u_int hch_length;
|
||||
struct mtx hch_mtx;
|
||||
};
|
||||
|
||||
struct hc_metrics {
|
||||
/* housekeeping */
|
||||
TAILQ_ENTRY(hc_metrics) rmx_q;
|
||||
struct hc_head *rmx_head; /* head of bucket tail queue */
|
||||
struct in_addr ip4; /* IP address */
|
||||
struct in6_addr ip6; /* IP6 address */
|
||||
/* endpoint specific values for TCP */
|
||||
u_long rmx_mtu; /* MTU for this path */
|
||||
u_long rmx_ssthresh; /* outbound gateway buffer limit */
|
||||
u_long rmx_rtt; /* estimated round trip time */
|
||||
u_long rmx_rttvar; /* estimated rtt variance */
|
||||
u_long rmx_bandwidth; /* estimated bandwidth */
|
||||
u_long rmx_cwnd; /* congestion window */
|
||||
u_long rmx_sendpipe; /* outbound delay-bandwidth product */
|
||||
u_long rmx_recvpipe; /* inbound delay-bandwidth product */
|
||||
/* TCP hostcache internal data */
|
||||
int rmx_expire; /* lifetime for object */
|
||||
u_long rmx_hits; /* number of hits */
|
||||
u_long rmx_updates; /* number of updates */
|
||||
};
|
||||
|
||||
/* Arbitrary values */
|
||||
#define TCP_HOSTCACHE_HASHSIZE 512
|
||||
#define TCP_HOSTCACHE_BUCKETLIMIT 30
|
||||
#define TCP_HOSTCACHE_EXPIRE 60*60 /* one hour */
|
||||
#define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */
|
||||
|
||||
struct tcp_hostcache {
|
||||
struct hc_head *hashbase;
|
||||
uma_zone_t zone;
|
||||
u_int hashsize;
|
||||
u_int hashmask;
|
||||
u_int bucket_limit;
|
||||
u_int cache_count;
|
||||
u_int cache_limit;
|
||||
int expire;
|
||||
int prune;
|
||||
int purgeall;
|
||||
};
|
||||
|
||||
#ifdef VIMAGE_GLOBALS
|
||||
static struct tcp_hostcache tcp_hostcache;
|
||||
static struct callout tcp_hc_callout;
|
||||
|
@ -33,11 +33,12 @@
|
||||
#ifndef _NETINET_VINET_H_
|
||||
#define _NETINET_VINET_H_
|
||||
|
||||
#ifdef VIMAGE
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/md5.h>
|
||||
|
||||
#include <net/vnet.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/in_var.h>
|
||||
@ -196,8 +197,6 @@ struct vnet_inet {
|
||||
int _icmp_quotelen;
|
||||
int _icmpbmcastecho;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Symbol translation macros
|
||||
@ -333,4 +332,16 @@ struct vnet_inet {
|
||||
#define V_udpstat VNET_INET(udpstat)
|
||||
#define V_useloopback VNET_INET(useloopback)
|
||||
|
||||
static __inline uint16_t ip_newid(void);
|
||||
extern int ip_do_randomid;
|
||||
|
||||
static __inline uint16_t
|
||||
ip_newid(void)
|
||||
{
|
||||
if (V_ip_do_randomid)
|
||||
return ip_randomid();
|
||||
|
||||
return htons(V_ip_id++);
|
||||
}
|
||||
|
||||
#endif /* !_NETINET_VINET_H_ */
|
||||
|
@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$");
|
||||
unsigned long in6_maxmtu;
|
||||
int ip6_auto_linklocal;
|
||||
struct callout in6_tmpaddrtimer_ch;
|
||||
extern struct inpcbinfo udbinfo;
|
||||
extern struct inpcbinfo ripcbinfo;
|
||||
#endif
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#ifndef _NETINET6_VINET6_H_
|
||||
#define _NETINET6_VINET6_H_
|
||||
|
||||
#ifdef VIMAGE
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/ip6.h>
|
||||
#include <net/if.h>
|
||||
@ -154,15 +153,12 @@ struct vnet_inet6 {
|
||||
|
||||
struct ip6_pktopts _ip6_opts;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#define INIT_VNET_INET6(vnet) \
|
||||
INIT_FROM_VNET(vnet, VNET_MOD_INET6, struct vnet_inet6, vnet_inet6)
|
||||
|
||||
#define VNET_INET6(sym) VSYM(vnet_inet6, sym)
|
||||
|
||||
|
||||
/*
|
||||
* Symbol translation macros
|
||||
*/
|
||||
|
@ -66,11 +66,6 @@
|
||||
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
struct key_cb {
|
||||
int key_count;
|
||||
int any_count;
|
||||
};
|
||||
|
||||
#ifdef VIMAGE_GLOBALS
|
||||
static struct key_cb key_cb;
|
||||
struct pfkeystat pfkeystat;
|
||||
|
@ -58,6 +58,11 @@ struct pfkeystat {
|
||||
u_quad_t sockerr; /* # of socket related errors */
|
||||
};
|
||||
|
||||
struct key_cb {
|
||||
int key_count;
|
||||
int any_count;
|
||||
};
|
||||
|
||||
#define KEY_SENDUP_ONE 0
|
||||
#define KEY_SENDUP_ALL 1
|
||||
#define KEY_SENDUP_REGISTERED 2
|
||||
|
@ -33,7 +33,6 @@
|
||||
#ifndef _NETIPSEC_VIPSEC_H_
|
||||
#define _NETIPSEC_VIPSEC_H_
|
||||
|
||||
#ifdef VIMAGE
|
||||
#include <sys/proc.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/socket.h>
|
||||
@ -112,7 +111,6 @@ struct vnet_ipsec {
|
||||
LIST_HEAD(, secacq) _acqtree;
|
||||
LIST_HEAD(, secspacq) _spacqtree;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Symbol translation macros
|
||||
|
@ -92,9 +92,13 @@
|
||||
#include <sys/priority.h>
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _KERNEL
|
||||
/* Signals. */
|
||||
|
Loading…
Reference in New Issue
Block a user