-
Saif Hasan authored
Summary: To set `Type Of Service` for IP layer packets ZMQ provides `ZMQ_TOS` socket option. However this only works for v4 sockets. Considering things are moving to IPv6 heavily (especially within enterprise networks), ZMQ should support setting `traffic class` for v6 based on `ZMQ_TOS`. There is a subtle difference between v4 and v6 in terms of the positioning of field but TOS has same meaning in both v4 and v6. Linux provides following APIs for v4/v6 to set TOS field value. ``` // For v4 setsockopt(fd, IPPROTO_IP, IP_TOS, tos, sizeof(tos)); // For v6 setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, tos, sizeof(tos)); ``` Test Plan: Make sure Cmake works fine and all tests passes. Imported this change to `OpenR` project and tested on our local testbed. Captured some packets exchanged between PUB/SUB and ROUTER/ROUTER sockets pairs. Verify that `TCLASS` value is set as per expectation. Tasks: #2208
fc8007e8