PERFORCE change 37579 for review
Sam Leffler
sam at FreeBSD.org
Fri Sep 5 09:54:15 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37579
Change 37579 by sam at sam_ebb on 2003/09/05 09:53:24
o add compatibility sysctl's under !BURN_BRIDGES
o change version string to use RCS keywords and to be
visible in the mib
o update comments to reflect revised mib naming
Affected files ...
.. //depot/projects/netperf/sys/net/bridge.c#5 edit
Differences ...
==== //depot/projects/netperf/sys/net/bridge.c#5 (text+ko) ====
@@ -35,16 +35,16 @@
* identified by a "cluster-id" which is a number in the range 1..2^16-1.
*
* Bridging is enabled by the sysctl variable
- * net.link.ether.bridge
+ * net.link.ether.bridge.enable
* the grouping of interfaces into clusters is done with
- * net.link.ether.bridge_cfg
+ * net.link.ether.bridge.config
* containing a list of interfaces each optionally followed by
* a colon and the cluster it belongs to (1 is the default).
* Separators can be * spaces, commas or tabs, e.g.
- * net.link.ether.bridge_cfg="fxp0:2 fxp1:2 dc0 dc1:1"
+ * net.link.ether.bridge.config="fxp0:2 fxp1:2 dc0 dc1:1"
* Optionally bridged packets can be passed through the firewall,
* this is controlled by the variable
- * net.link.ether.bridge_ipfw
+ * net.link.ether.bridge.ipfw
*
* For each cluster there is a descriptor (cluster_softc) storing
* the following data structures:
@@ -193,6 +193,9 @@
SYSCTL_DECL(_net_link_ether);
SYSCTL_NODE(_net_link_ether, OID_AUTO, bridge, CTLFLAG_RD, 0,
"Bridge parameters");
+static char bridge_version[] = "$Revision$ $Date$";
+SYSCTL_STRING(_net_link_ether_bridge, OID_AUTO, version, CTLFLAG_RD,
+ bridge_version, 0, "software version");
#define BRIDGE_DEBUG
#ifdef BRIDGE_DEBUG
@@ -279,8 +282,7 @@
* System initialization
*/
static struct bdg_stats bdg_stats ;
-/* NB: leave at net.link.ether so netstat continues to work */
-SYSCTL_STRUCT(_net_link_ether, PF_BDG, bdgstats, CTLFLAG_RD,
+SYSCTL_STRUCT(_net_link_ether_bridge, OID_AUTO, stats, CTLFLAG_RD,
&bdg_stats, bdg_stats, "bridge statistics");
static struct callout bdg_callout;
@@ -609,6 +611,38 @@
SYSCTL_PROC(_net_link_ether_bridge, OID_AUTO, refresh, CTLTYPE_INT|CTLFLAG_WR,
NULL, 0, &sysctl_refresh, "I", "iface refresh");
+#ifndef BURN_BRIDGES
+#define SYSCTL_OID_COMPAT(parent, nbr, name, kind, a1, a2, handler, fmt, descr)\
+ static struct sysctl_oid sysctl__##parent##_##name##_compat = { \
+ &sysctl_##parent##_children, { 0 }, \
+ nbr, kind, a1, a2, #name, handler, fmt, 0, descr }; \
+ DATA_SET(sysctl_set, sysctl__##parent##_##name##_compat)
+#define SYSCTL_INT_COMPAT(parent, nbr, name, access, ptr, val, descr) \
+ SYSCTL_OID_COMPAT(parent, nbr, name, CTLTYPE_INT|(access), \
+ ptr, val, sysctl_handle_int, "I", descr)
+#define SYSCTL_STRUCT_COMPAT(parent, nbr, name, access, ptr, type, descr)\
+ SYSCTL_OID_COMPAT(parent, nbr, name, CTLTYPE_OPAQUE|(access), \
+ ptr, sizeof(struct type), sysctl_handle_opaque, \
+ "S," #type, descr)
+#define SYSCTL_PROC_COMPAT(parent, nbr, name, access, ptr, arg, handler, fmt, descr) \
+ SYSCTL_OID_COMPAT(parent, nbr, name, (access), \
+ ptr, arg, handler, fmt, descr)
+
+SYSCTL_INT_COMPAT(_net_link_ether, OID_AUTO, bridge_ipf, CTLFLAG_RW,
+ &bdg_ipf, 0,"Pass bridged pkts through IPFilter");
+SYSCTL_INT_COMPAT(_net_link_ether, OID_AUTO, bridge_ipfw, CTLFLAG_RW,
+ &bdg_ipfw,0,"Pass bridged pkts through firewall");
+SYSCTL_STRUCT_COMPAT(_net_link_ether, PF_BDG, bdgstats, CTLFLAG_RD,
+ &bdg_stats, bdg_stats, "bridge statistics");
+SYSCTL_PROC_COMPAT(_net_link_ether, OID_AUTO, bridge_cfg,
+ CTLTYPE_STRING|CTLFLAG_RW,
+ &bridge_cfg, sizeof(bridge_cfg), &sysctl_bdg_cfg, "A",
+ "Bridge configuration");
+SYSCTL_PROC_COMPAT(_net_link_ether, OID_AUTO, bridge_refresh,
+ CTLTYPE_INT|CTLFLAG_WR,
+ NULL, 0, &sysctl_refresh, "I", "iface refresh");
+#endif
+
static int bdg_loops;
static int bdg_slowtimer = 0;
static int bdg_age_index = 0; /* index of table position to age */
@@ -1151,7 +1185,7 @@
bdginit(void)
{
if (bootverbose)
- printf("BRIDGE 020214 loaded\n");
+ printf("BRIDGE %s loaded\n", bridge_version);
ifp2sc = malloc(BDG_MAX_PORTS * sizeof(struct bdg_softc),
M_IFADDR, M_WAITOK | M_ZERO );
More information about the p4-projects
mailing list