summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-06-15 06:56:10 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2008-06-15 06:56:10 +0000
commit74c7f11fe6f9d45c4bff30198f3a7eb688b078b8 (patch)
tree416a4c0aaf59983030ba52a4ed8c8d11b0068789 /sbin
parentfd6388fffd794075b228479299e84d73c2bdb675 (diff)
Add 802.3ad LACP support for trunk(4).
Implementation from NetBSD. Ported via FreeBSD's version in trunk^Wlagg(4). This is still work in progress. Tested with a HP ProCurve 3500. OK reyk@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 35ff1961498..a78786d78c1 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.199 2008/06/14 21:46:22 reyk Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.200 2008/06/15 06:56:09 mpf Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -4013,6 +4013,7 @@ trunk_status(void)
struct trunk_protos tpr[] = TRUNK_PROTOS;
struct trunk_reqport rp, rpbuf[TRUNK_MAX_PORTS];
struct trunk_reqall ra;
+ struct lacp_opreq *lp;
const char *proto = "<unknown>";
int i, isport = 0;
@@ -4030,6 +4031,8 @@ trunk_status(void)
ra.ra_port = rpbuf;
if (ioctl(s, SIOCGTRUNK, &ra) == 0) {
+ lp = (struct lacp_opreq *)&ra.ra_lacpreq;
+
for (i = 0; i < (sizeof(tpr) / sizeof(tpr[0])); i++) {
if (ra.ra_proto == tpr[i].tpr_proto) {
proto = tpr[i].tpr_name;
@@ -4041,6 +4044,17 @@ trunk_status(void)
if (isport)
printf(" trunkdev %s", rp.rp_ifname);
putchar('\n');
+ if (ra.ra_proto == TRUNK_PROTO_LACP) {
+ printf("\ttrunk id: [(%04X,%s,%04X,%04X,%04X),\n"
+ "\t\t (%04X,%s,%04X,%04X,%04X)]\n",
+ lp->actor_prio,
+ ether_ntoa((struct ether_addr*)lp->actor_mac),
+ lp->actor_key, lp->actor_portprio, lp->actor_portno,
+ lp->partner_prio,
+ ether_ntoa((struct ether_addr*)lp->partner_mac),
+ lp->partner_key, lp->partner_portprio,
+ lp->partner_portno);
+ }
for (i = 0; i < ra.ra_ports; i++) {
printf("\t\ttrunkport %s ", rpbuf[i].rp_portname);