Is there any way I can manipulate the value of Priority Code Point (PCP) field in the Ethernet frame from my application (e.g. using setsockopt()
)? I would like to avoid low level hacks with creating Ethernet frame from scratch.
I've searched in manual pages socket(7)
and ip(7)
but there is no option for controlling Ethernet frames fields.
If this is relevant I need it for TCP socket.
You can set the vlan priority field by using sockopt():
int priority = 7;
setsockopt(sfd, SOL_SOCKET, SO_PRIORITY, &priority, sizeof(priority));
In the file net/8021q/vlan_dev.c you can see, that the skb->priority field is used for the VLAN 802.1Q TCI...
There are ingress and egress mappings on each VLAN device. For example:
vconfig add eth0 333
vconfig set_egress_map eth0.333 2 4
vconfig set_egress_map eth0.333 3 5
cat /proc/net/vlan/eth0.333
You can see mappings on the last two lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With