summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_os_bsd.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_os_bsd.h')
-rw-r--r--sys/netinet/sctp_os_bsd.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index d018790..f0cca72 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -78,9 +78,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
-#ifdef VIMAGE
-#error "SCTP is not yet compatible with VIMAGE."
-#endif
+#include <net/vnet.h>
#ifdef IPSEC
#include <netipsec/ipsec.h>
@@ -137,25 +135,21 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT);
#define SCTP_CTR6 CTR6
#endif
-#define SCTP_BASE_INFO(__m) system_base_info.sctppcbinfo.__m
-#define SCTP_BASE_STATS system_base_info.sctpstat
-#define SCTP_BASE_STAT(__m) system_base_info.sctpstat.__m
-#define SCTP_BASE_SYSCTL(__m) system_base_info.sctpsysctl.__m
-#define SCTP_BASE_VAR(__m) system_base_info.__m
-
/*
* Macros to expand out globals defined by various modules
* to either a real global or a virtualized instance of one,
* depending on whether VIMAGE is defined.
*/
-/* first define modules that supply us information */
-#define MOD_NET net
-#define MOD_INET inet
-#define MOD_INET6 inet6
-#define MOD_IPSEC ipsec
-
/* then define the macro(s) that hook into the vimage macros */
-#define MODULE_GLOBAL(__MODULE, __SYMBOL) V_ ## __SYMBOL
+#define MODULE_GLOBAL(__SYMBOL) V_##__SYMBOL
+
+#define V_system_base_info VNET(system_base_info)
+#define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m
+#define SCTP_BASE_STATS V_system_base_info.sctpstat
+#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat)
+#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m
+#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m)
+#define SCTP_BASE_VAR(__m) V_system_base_info.__m
/*
*
OpenPOWER on IntegriCloud