summaryrefslogtreecommitdiffstats
path: root/sys/netinet/vinet.h
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2008-11-28 23:30:51 +0000
committerzec <zec@FreeBSD.org>2008-11-28 23:30:51 +0000
commit7ecd715d484a68ba07dae8dcb30670d691129c07 (patch)
treebb923196c85b9e71d363a7650c292edddfbc6beb /sys/netinet/vinet.h
parentd8aff71262b6224530a865344e20823189bd5cb1 (diff)
downloadFreeBSD-src-7ecd715d484a68ba07dae8dcb30670d691129c07.zip
FreeBSD-src-7ecd715d484a68ba07dae8dcb30670d691129c07.tar.gz
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
Diffstat (limited to 'sys/netinet/vinet.h')
-rw-r--r--sys/netinet/vinet.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/netinet/vinet.h b/sys/netinet/vinet.h
index 005a46b..5fdb1c0 100644
--- a/sys/netinet/vinet.h
+++ b/sys/netinet/vinet.h
@@ -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_ */
OpenPOWER on IntegriCloud