static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#endif
static const char rcsid[] =
- "$Id: ifconfig.c,v 1.6 2003/12/16 23:16:58 lindak Exp $";
+ "$Id: ifconfig.c,v 1.8 2004/08/26 23:55:21 lindak Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <string.h>
#include <unistd.h>
-struct ether_addr *ether_aton __P((const char *));
#include "ifconfig.h"
struct afswtch;
+int bond_details = 0;
int supmedia = 0;
int listcloners = 0;
{ "vlandev", NEXTARG, setvlandev },
{ "-vlandev", NEXTARG, unsetvlandev },
#endif
+#ifdef USE_BONDS
+ { "bonddev", NEXTARG, setbonddev },
+ { "-bonddev", NEXTARG, unsetbonddev },
+#endif
#if 0
/* XXX `create' special-cased below */
{"create", 0, clone_create },
#ifdef USE_VLANS
{ "vlan", AF_UNSPEC, vlan_status, NULL, NULL, }, /* XXX not real!! */
#endif
+#ifdef USE_BONDS
+ { "bond", AF_UNSPEC, bond_status, NULL, NULL, }, /* XXX not real!! */
+#endif
#ifdef USE_IEEE80211
{ "ieee80211", AF_UNSPEC, ieee80211_status, NULL, NULL, }, /* XXX not real!! */
#endif
/* Parse leading line options */
all = downonly = uponly = namesonly = 0;
- while ((c = getopt(argc, argv, "adlmu"
+ while ((c = getopt(argc, argv, "abdlmu"
#ifdef INET6
"L"
#endif
case 'a': /* scan all interfaces */
all++;
break;
+ case 'b': /* bond detailed output */
+ bond_details++;
+ break;
case 'd': /* restrict scan to "down" interfaces */
downonly++;
break;
argc -= optind;
argv += optind;
- /* -l cannot be used with -a or -m */
- if (namesonly && (all || supmedia))
+ /* -l cannot be used with -a or -m or -b */
+ if (namesonly && (all || supmedia || bond_details))
usage();
/* nonsense.. */
if (afp->af_ridreq == NULL || afp->af_difaddr == 0) {
warnx("interface %s cannot change %s addresses!",
name, afp->af_name);
- clearaddr = NULL;
+ clearaddr = 0;
}
}
if (clearaddr) {
if (afp->af_addreq == NULL || afp->af_aifaddr == 0) {
warnx("interface %s cannot change %s addresses!",
name, afp->af_name);
- newaddr = NULL;
+ newaddr = 0;
}
}
if (newaddr && (setaddr || setmask)) {
if (allfamilies || afp->af_status == vlan_status)
vlan_status(s, NULL);
#endif
+#ifdef USE_BONDS
+ if (allfamilies || afp->af_status == bond_status)
+ bond_status(s, NULL);
+#endif
#ifdef USE_IEEE80211
if (allfamilies || afp->af_status == ieee80211_status)
ieee80211_status(s, NULL);