summaryrefslogtreecommitdiffstats
path: root/sys/net/vnet.h
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2009-05-23 21:43:44 +0000
committerzec <zec@FreeBSD.org>2009-05-23 21:43:44 +0000
commit48f748dc297cbf46f02ec8b61d47436d66d0d8b9 (patch)
tree488633605f2f07bbba417ff74314596b3bb04cf2 /sys/net/vnet.h
parent40574d258ab1aec7b8c5ad9d5d9ee09d5e3f5296 (diff)
downloadFreeBSD-src-48f748dc297cbf46f02ec8b61d47436d66d0d8b9.zip
FreeBSD-src-48f748dc297cbf46f02ec8b61d47436d66d0d8b9.tar.gz
V_irtualize the if_clone framework, thus allowing for clonable ifnets
to optionally have overlapping unit numbers if attached in different vnets. At this stage if_loop is the only clonable ifnet class that has been extended to allow for such overlapping allocation of unit numbers, i.e. in each vnet it is possible to have a lo0 interface. Other clonable ifnet classes remain to operate with traditional semantics, i.e. each instance of a clonable ifnet will be assigned a globally unique unit number, regardless in which vnet such an ifnet becomes instantiated. While here, garbage collect unused _lo_list field in struct vnet_net, as well as improve indentation for #defines in sys/net/vnet.h. The layout of struct vnet_net has changed, therefore bump __FreeBSD_version. This change has no functional impact on nooptions VIMAGE kernel builds. Reviewed by: bz, brooks Approved by: julian (mentor)
Diffstat (limited to 'sys/net/vnet.h')
-rw-r--r--sys/net/vnet.h37
1 files changed, 21 insertions, 16 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index 662586a..bdc466b 100644
--- a/sys/net/vnet.h
+++ b/sys/net/vnet.h
@@ -31,7 +31,7 @@
*/
#ifndef _NET_VNET_H_
-#define _NET_VNET_H_
+#define _NET_VNET_H_
#include <net/if_var.h>
@@ -50,10 +50,13 @@ struct vnet_net {
uma_zone_t _rtzone;
struct ifnet * _loif;
- LIST_HEAD(, lo_softc) _lo_list;
+ struct if_clone * _lo_cloner;
LIST_HEAD(, rawcb) _rawcb_list;
+ LIST_HEAD(, if_clone) _if_cloners;
+ int _if_cloners_count;
+
int _ether_ipfw;
};
@@ -74,19 +77,21 @@ extern struct vnet_net vnet_net_0;
#define VNET_NET(sym) VSYM(vnet_net, sym)
-#define V_ether_ipfw VNET_NET(ether_ipfw)
-#define V_if_index VNET_NET(if_index)
-#define V_if_indexlim VNET_NET(if_indexlim)
-#define V_ifg_head VNET_NET(ifg_head)
-#define V_ifindex_table VNET_NET(ifindex_table)
-#define V_ifklist VNET_NET(ifklist)
-#define V_ifnet VNET_NET(ifnet)
-#define V_lo_list VNET_NET(lo_list)
-#define V_loif VNET_NET(loif)
-#define V_rawcb_list VNET_NET(rawcb_list)
-#define V_rt_tables VNET_NET(rt_tables)
-#define V_rtstat VNET_NET(rtstat)
-#define V_rttrash VNET_NET(rttrash)
-#define V_rtzone VNET_NET(rtzone)
+#define V_ether_ipfw VNET_NET(ether_ipfw)
+#define V_if_index VNET_NET(if_index)
+#define V_if_indexlim VNET_NET(if_indexlim)
+#define V_if_cloners VNET_NET(if_cloners)
+#define V_if_cloners_count VNET_NET(if_cloners_count)
+#define V_ifg_head VNET_NET(ifg_head)
+#define V_ifindex_table VNET_NET(ifindex_table)
+#define V_ifklist VNET_NET(ifklist)
+#define V_ifnet VNET_NET(ifnet)
+#define V_lo_cloner VNET_NET(lo_cloner)
+#define V_loif VNET_NET(loif)
+#define V_rawcb_list VNET_NET(rawcb_list)
+#define V_rt_tables VNET_NET(rt_tables)
+#define V_rtstat VNET_NET(rtstat)
+#define V_rttrash VNET_NET(rttrash)
+#define V_rtzone VNET_NET(rtzone)
#endif /* !_NET_VNET_H_ */
OpenPOWER on IntegriCloud