CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    2

    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?

  2. #2
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured