MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vlan_status

Function vlan_status

tools/ifconfig/ifvlan.c:93–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static void
94vlan_status(int s)
95{
96 struct vlanreq vreq;
97
98 if (getvlan(s, &ifr, &vreq) == -1)
99 return;
100 printf("\tvlan: %d", vreq.vlr_tag);
101 printf(" vlanproto: ");
102 switch (vreq.vlr_proto) {
103 case ETHERTYPE_VLAN:
104 printf(proto_8021Q);
105 break;
106 case ETHERTYPE_QINQ:
107 printf(proto_8021ad);
108 break;
109 default:
110 printf("0x%04x", vreq.vlr_proto);
111 }
112 if (ioctl(s, SIOCGVLANPCP, (caddr_t)&ifr) != -1)
113 printf(" vlanpcp: %u", ifr.ifr_vlan_pcp);
114 printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ?
115 "<none>" : vreq.vlr_parent);
116 printf("\n");
117}
118
119static int
120vlan_match_ethervid(const char *name)

Callers

nothing calls this directly

Calls 3

getvlanFunction · 0.85
printfFunction · 0.50
ioctlFunction · 0.50

Tested by

no test coverage detected