summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-04-17 00:35:11 +0000
committerthompsa <thompsa@FreeBSD.org>2007-04-17 00:35:11 +0000
commit5fc175b7b49fb508d186e2eadee5104c2f774e24 (patch)
tree5ab1db16648abde2519f28c871592804af2cc1d6 /sbin
parentfc861d6ddfef1ad969b1beb206c79466f51bb0fb (diff)
downloadFreeBSD-src-5fc175b7b49fb508d186e2eadee5104c2f774e24.zip
FreeBSD-src-5fc175b7b49fb508d186e2eadee5104c2f774e24.tar.gz
Rename the trunk(4) driver to lagg(4) as it is too similar to vlan trunking.
The name trunk is misused as the networking term trunk means carrying multiple VLANs over a single connection. The IEEE standard for link aggregation (802.3 section 3) does not talk about 'trunk' at all while it is used throughout IEEE 802.1Q in describing vlans. The lagg(4) driver provides link aggregation, failover and fault tolerance. Discussed on: current@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/Makefile2
-rw-r--r--sbin/ifconfig/ifconfig.814
-rw-r--r--sbin/ifconfig/iflagg.c (renamed from sbin/ifconfig/iftrunk.c)82
3 files changed, 49 insertions, 49 deletions
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index 5520cf7..09592ad 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -30,7 +30,7 @@ SRCS+= ifgroup.c # ...
SRCS+= ifpfsync.c # pfsync(4) support
SRCS+= ifbridge.c # bridge support
-SRCS+= iftrunk.c # trunk support
+SRCS+= iflagg.c # lagg support
.if ${MK_IPX_SUPPORT} != "no" && !defined(RELEASE_CRUNCH)
SRCS+= af_ipx.c # IPX support
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index e915815..8c8f0aa 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -1367,18 +1367,18 @@ cost to 0.
The minimum is 1 and the maximum is 200000000.
.El
.Pp
-The following parameters are specific to trunk interfaces:
+The following parameters are specific to lagg interfaces:
.Bl -tag -width indent
-.It Cm trunkport Ar interface
+.It Cm laggport Ar interface
Add the interface named by
.Ar interface
-as a port of the trunk.
-.It Cm -trunkport Ar interface
+as a port of the aggregation interface.
+.It Cm -laggport Ar interface
Remove the interface named by
.Ar interface
-from the trunk.
-.It Cm trunkproto Ar proto
-Set the trunking protocol.
+from the aggregation interface.
+.It Cm laggproto Ar proto
+Set the aggregation protocol.
The default is failover.
The available options are failover, fec, lacp, loadbalance, roundrobin and
none.
diff --git a/sbin/ifconfig/iftrunk.c b/sbin/ifconfig/iflagg.c
index cd0c02d..33096bf 100644
--- a/sbin/ifconfig/iftrunk.c
+++ b/sbin/ifconfig/iflagg.c
@@ -16,7 +16,7 @@ static const char rcsid[] =
#include <net/ethernet.h>
#include <net/if.h>
-#include <net/if_trunk.h>
+#include <net/if_lagg.h>
#include <net/route.h>
#include <ctype.h>
@@ -30,40 +30,40 @@ static const char rcsid[] =
#include "ifconfig.h"
static void
-settrunkport(const char *val, int d, int s, const struct afswtch *afp)
+setlaggport(const char *val, int d, int s, const struct afswtch *afp)
{
- struct trunk_reqport rp;
+ struct lagg_reqport rp;
bzero(&rp, sizeof(rp));
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
- if (ioctl(s, SIOCSTRUNKPORT, &rp))
- err(1, "SIOCSTRUNKPORT");
+ if (ioctl(s, SIOCSLAGGPORT, &rp))
+ err(1, "SIOCSLAGGPORT");
}
static void
-unsettrunkport(const char *val, int d, int s, const struct afswtch *afp)
+unsetlaggport(const char *val, int d, int s, const struct afswtch *afp)
{
- struct trunk_reqport rp;
+ struct lagg_reqport rp;
bzero(&rp, sizeof(rp));
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
strlcpy(rp.rp_portname, val, sizeof(rp.rp_portname));
- if (ioctl(s, SIOCSTRUNKDELPORT, &rp))
- err(1, "SIOCSTRUNKDELPORT");
+ if (ioctl(s, SIOCSLAGGDELPORT, &rp))
+ err(1, "SIOCSLAGGDELPORT");
}
static void
-settrunkproto(const char *val, int d, int s, const struct afswtch *afp)
+setlaggproto(const char *val, int d, int s, const struct afswtch *afp)
{
- struct trunk_protos tpr[] = TRUNK_PROTOS;
- struct trunk_reqall ra;
+ struct lagg_protos tpr[] = LAGG_PROTOS;
+ struct lagg_reqall ra;
int i;
bzero(&ra, sizeof(ra));
- ra.ra_proto = TRUNK_PROTO_MAX;
+ ra.ra_proto = LAGG_PROTO_MAX;
for (i = 0; i < (sizeof(tpr) / sizeof(tpr[0])); i++) {
if (strcmp(val, tpr[i].tpr_name) == 0) {
@@ -71,20 +71,20 @@ settrunkproto(const char *val, int d, int s, const struct afswtch *afp)
break;
}
}
- if (ra.ra_proto == TRUNK_PROTO_MAX)
- errx(1, "Invalid trunk protocol: %s", val);
+ if (ra.ra_proto == LAGG_PROTO_MAX)
+ errx(1, "Invalid aggregation protocol: %s", val);
strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname));
- if (ioctl(s, SIOCSTRUNK, &ra) != 0)
- err(1, "SIOCSTRUNK");
+ if (ioctl(s, SIOCSLAGG, &ra) != 0)
+ err(1, "SIOCSLAGG");
}
static void
-trunk_status(int s)
+lagg_status(int s)
{
- struct trunk_protos tpr[] = TRUNK_PROTOS;
- struct trunk_reqport rp, rpbuf[TRUNK_MAX_PORTS];
- struct trunk_reqall ra;
+ struct lagg_protos tpr[] = LAGG_PROTOS;
+ struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS];
+ struct lagg_reqall ra;
const char *proto = "<unknown>";
int i, isport = 0;
@@ -94,14 +94,14 @@ trunk_status(int s)
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname));
strlcpy(rp.rp_portname, name, sizeof(rp.rp_portname));
- if (ioctl(s, SIOCGTRUNKPORT, &rp) == 0)
+ if (ioctl(s, SIOCGLAGGPORT, &rp) == 0)
isport = 1;
strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname));
ra.ra_size = sizeof(rpbuf);
ra.ra_port = rpbuf;
- if (ioctl(s, SIOCGTRUNK, &ra) == 0) {
+ if (ioctl(s, SIOCGLAGG, &ra) == 0) {
for (i = 0; i < (sizeof(tpr) / sizeof(tpr[0])); i++) {
if (ra.ra_proto == tpr[i].tpr_proto) {
proto = tpr[i].tpr_name;
@@ -109,45 +109,45 @@ trunk_status(int s)
}
}
- printf("\ttrunk: trunkproto %s", proto);
+ printf("\tlagg: laggproto %s", proto);
if (isport)
- printf(" trunkdev %s", rp.rp_ifname);
+ printf(" laggdev %s", rp.rp_ifname);
putchar('\n');
for (i = 0; i < ra.ra_ports; i++) {
- printf("\t\ttrunkport %s ", rpbuf[i].rp_portname);
- printb("", rpbuf[i].rp_flags, TRUNK_PORT_BITS);
+ printf("\t\tlaggport %s ", rpbuf[i].rp_portname);
+ printb("", rpbuf[i].rp_flags, LAGG_PORT_BITS);
putchar('\n');
}
if (0 /* XXX */) {
- printf("\tsupported trunk protocols:\n");
+ printf("\tsupported aggregation protocols:\n");
for (i = 0; i < (sizeof(tpr) / sizeof(tpr[0])); i++)
- printf("\t\ttrunkproto %s\n", tpr[i].tpr_name);
+ printf("\t\tlaggproto %s\n", tpr[i].tpr_name);
}
} else if (isport)
- printf("\ttrunk: trunkdev %s\n", rp.rp_ifname);
+ printf("\tlagg: laggdev %s\n", rp.rp_ifname);
}
-static struct cmd trunk_cmds[] = {
- DEF_CMD_ARG("trunkport", settrunkport),
- DEF_CMD_ARG("-trunkport", unsettrunkport),
- DEF_CMD_ARG("trunkproto", settrunkproto),
+static struct cmd lagg_cmds[] = {
+ DEF_CMD_ARG("laggport", setlaggport),
+ DEF_CMD_ARG("-laggport", unsetlaggport),
+ DEF_CMD_ARG("laggproto", setlaggproto),
};
-static struct afswtch af_trunk = {
- .af_name = "af_trunk",
+static struct afswtch af_lagg = {
+ .af_name = "af_lagg",
.af_af = AF_UNSPEC,
- .af_other_status = trunk_status,
+ .af_other_status = lagg_status,
};
static __constructor void
-trunk_ctor(void)
+lagg_ctor(void)
{
#define N(a) (sizeof(a) / sizeof(a[0]))
int i;
- for (i = 0; i < N(trunk_cmds); i++)
- cmd_register(&trunk_cmds[i]);
- af_register(&af_trunk);
+ for (i = 0; i < N(lagg_cmds); i++)
+ cmd_register(&lagg_cmds[i]);
+ af_register(&af_lagg);
#undef N
}
OpenPOWER on IntegriCloud