summaryrefslogtreecommitdiffstats
path: root/sbin/etherswitchcfg
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/etherswitchcfg')
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.88
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c13
2 files changed, 11 insertions, 10 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.8 b/sbin/etherswitchcfg/etherswitchcfg.8
index 4f3bc92..88e06f7 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.8
+++ b/sbin/etherswitchcfg/etherswitchcfg.8
@@ -62,9 +62,9 @@ To set the register value, use the form instance.register=value.
.Ss port
The port command selects one of the ports of the switch.
It supports the following commands:
-.Bl -tag -width ".Ar vlangroup number" -compact
-.It Ar vlangroup number
-Sets the VLAN group number that is used to process incoming frames that are not tagged.
+.Bl -tag -width ".Ar pvid number" -compact
+.It Ar pvid number
+Sets the default port VID that is used to process incoming frames that are not tagged.
.It Ar media mediaspec
Specifies the physical media configuration to be configured for a port.
.It Ar mediaopt mediaoption
@@ -104,7 +104,7 @@ Configure VLAN group 1 with a VID of 2 and makes ports 0 and 5 members,
while excluding all other ports.
Port 5 will send and receive tagged frames, while port 0 will be untagged.
Incoming untagged frames on port 0 are assigned to vlangroup1.
-.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 vlangroup 1
+.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2
.Sh SEE ALSO
.Xr etherswitch 4
.Sh HISTORY
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c
index a3f286e..3e0b451 100644
--- a/sbin/etherswitchcfg/etherswitchcfg.c
+++ b/sbin/etherswitchcfg/etherswitchcfg.c
@@ -131,19 +131,20 @@ write_phyregister(struct cfg *cfg, int phy, int reg, int val)
}
static void
-set_port_vlangroup(struct cfg *cfg, char *argv[])
+set_port_vid(struct cfg *cfg, char *argv[])
{
int v;
etherswitch_port_t p;
v = strtol(argv[1], NULL, 0);
- if (v < 0 || v >= cfg->info.es_nvlangroups)
- errx(EX_USAGE, "vlangroup must be between 0 and %d", cfg->info.es_nvlangroups-1);
+ if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
+ errx(EX_USAGE, "pvid must be between 0 and %d",
+ IEEE802DOT1Q_VID_MAX);
bzero(&p, sizeof(p));
p.es_port = cfg->unit;
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)");
- p.es_vlangroup = v;
+ p.es_pvid = v;
if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHSETPORT)");
}
@@ -302,7 +303,7 @@ print_port(struct cfg *cfg, int port)
if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0)
err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)");
printf("port%d:\n", port);
- printf("\tvlangroup: %d\n", p.es_vlangroup);
+ printf("\tpvid: %d\n", p.es_pvid);
printf("\tmedia: ");
print_media_word(p.es_ifmr.ifm_current, 1);
if (p.es_ifmr.ifm_active != p.es_ifmr.ifm_current) {
@@ -506,7 +507,7 @@ main(int argc, char *argv[])
}
static struct cmds cmds[] = {
- { MODE_PORT, "vlangroup", 1, set_port_vlangroup },
+ { MODE_PORT, "pvid", 1, set_port_vid },
{ MODE_PORT, "media", 1, set_port_media },
{ MODE_PORT, "mediaopt", 1, set_port_mediaopt },
{ MODE_VLANGROUP, "vlan", 1, set_vlangroup_vid },
OpenPOWER on IntegriCloud