Changing TOS in IP Header in c++
Hi,
I am trying to write a program in c++ that can change the value of the TOS field in the IP header. Can this be done using any of the classes in winsock API?
The program I am building is a traffic generator for testing another program. This traffic generator has to send IP packets with different TOS for receiving different services. and testing the main program's working. Can anyuone help please?
Re: Changing TOS in IP Header in c++
you can use setsockopt() for this.
However, there are some restrictions:
- on W2K, look here http://support.microsoft.com/default...b;en-us;248611
- on WinXP, this does not work. You need to create a socket with WSASocket and provide a flowspec found with WSAEnumProtocols() that supports QoS (flag XP1_QOS_SUPPORTED).
HTH
Richard