I'm trying to code a simple UDP client that can be used for voice testing and it needs to set the ToS byte in the IP header. On Linux, I would simply:
Alas, on Windows XP, this would also work if I hack a registry setting:Code:... setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&ipTOS, sizeof(ipTOS)) ...
On Windows 7, this is not an option. Google searching has lead to QoS2 API and qWAVE. It seems terribly overcomplicated and woefully underpowered for custom DSCP assignment to IP_TOS. Nonetheless, I found a guide at:Code:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TcpIp\Parameters DisableUserTOSSetting: REG_DWORD = 0
Adding QOS2 calls in a sample Winsock application: Part 1 - Windows Core Networking - Site Home - MSDN Blogs
Trying that out, it compiles in my code, but when run, I get an error 1068 at the QosCreateHandle() call - which means "Dependency service or group failed to start." Under Windows Services, the qWAVE service is set to 'Manual' and is not started. When I try to start it, I get an error 1075: "The dependency service does not exist or has been marked for deletion".
My original UDP client (without the QoS piece) compiles and works fine - of course *not* setting the ToS byte. That's the only piece I'm stuck on. This is becoming *WAY* more work than I expected. Does anyone have any experience with the QoS2 API or (without using the WinPcap library) know how to code ToS onto a Windows socket?