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

Function ether_set_pcp

freebsd/net/if_ethersubr.c:441–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441static bool
442ether_set_pcp(struct mbuf **mp, struct ifnet *ifp, uint8_t pcp)
443{
444 struct ether_8021q_tag qtag;
445 struct ether_header *eh;
446
447 eh = mtod(*mp, struct ether_header *);
448 if (ntohs(eh->ether_type) == ETHERTYPE_VLAN ||
449 ntohs(eh->ether_type) == ETHERTYPE_QINQ)
450 return (true);
451
452 qtag.vid = 0;
453 qtag.pcp = pcp;
454 qtag.proto = ETHERTYPE_VLAN;
455 if (ether_8021q_frame(mp, ifp, ifp, &qtag))
456 return (true);
457 if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
458 return (false);
459}
460
461/*
462 * Ethernet link layer output routine to send a raw frame to the device.

Callers 1

ether_output_frameFunction · 0.85

Calls 2

ether_8021q_frameFunction · 0.85
if_inc_counterFunction · 0.85

Tested by

no test coverage detected