WinSock2.h + IP_TTL



  • Hi,

    warum wurde das Makro IP_TTL (7) nicht in die WinSock2.h übernommen? WinSock.h hat das Makro noch drin, und das MSDN sagt auch wenig dazu, bzw. es schreibt sogar man soll WinSock2.h includen. ( http://msdn.microsoft.com/en-us/library/ms738586(v=vs.85).aspx )

    Bug oder Feature? Denn es sollte doch irgendwem mal aufgefallen sein 😃



  • in ws2ipdef.h isses drin, aber dort mit dem Wert 4



  • k schrieb:

    in ws2ipdef.h isses drin, aber dort mit dem Wert 4

    Ok, aber so wie ich das MSDN verstehe, sollte es doch reichen die WinSock2.h zu includen?



  • In den Remarks steht drin, dass man

    #include <Ws2tcpip.h>
    

    includieren soll...



  • auch wenn ich die includiere läuft bie mir die TTL einstellung net.

    Brauche unbedingt eine Lösung.

    Zuvor habe ich einach mit der winsock.h gearbeitet aber ich brauch die winsock2.h unbedingt wegen der inet_pton(). Wenn ich die winsock2.h nehme hab ich allerdings das Prob das ich die TLLs net mehr einstellen kann -.-



  • Warte mal, ich versteh nicht ganz, woran es scheitert: weil IP_TTL gar nicht bekannt ist (und es kommt eine Fehlermeldung wie undeclared identifier oder so) oder weil die TTL-Einstellung nicht funktioniert?



  • Jochen Kalmbach schrieb:

    In den Remarks steht drin, dass man

    #include <Ws2tcpip.h>
    

    includieren soll...

    Omg, stimmt ja! Hatte mal wieder nur die Requirements gelesen, und "Ws2def.h (include Winsock2.h);" würde für mich irgendwie heißen, dass man nur die Winsock2.h braucht. Nun gut, damit wär das ja geklärt 😉



  • Homie schrieb:

    auch wenn ich die includiere läuft bie mir die TTL einstellung net.

    Bei mir geht das Problemlos.... zeig doch mal den Code... hier ist meiner:

    #include <WinSock2.h>
    #include <Ws2tcpip.h>
    #include <stdio.h>
    void main()
    {
      printf("%d\n", IP_TTL);
    }
    


  • Zur Info. Hier das Feedback von MS:

    We appreciate your feedback on the IPPROTO_IP Socket Options topic in the Winsock docs. Based on your feedback, we revised this topic.

    The Remarks section was changed as follows:

    In the Microsoft Windows Software Development Kit (SDK) for Windows Vista and later, , the organization of header files has changed and IPPROTO_IP level is defined in the Ws2def.h header file which is automatically included in the Winsock2.h header file. Some of the IPPROTO_IP socket options are defined in the Ws2ipdef.h header file which is automatically included by the Ws2tcpip.h header file. The remaining IPPROTO_IP socket options are defined in the Wsipv6ok.h header file which is automatically included by the Winsock2.h header file. The Ws2def.h, Ws2ipdef.h, and Wsipv6ok.h header files should never be used directly

    On the Platform Software Development Kit (SDK) released for Windows Server 2003 and Windows XP, the IPPROTO_IP level is defined in the Winsock2.h header file. Some of the IPPROTO_IP socket options are defined in the Ws2tcpip.h header file. The remaining IPPROTO_IP socket options are defined in the Wsipv6ok.h header file which is automatically included by the Winsock2.h header file. The Wsipv6ok.h header file should never be used directly.

    The Requirements section was changed as follows:

    Header:
    Ws2def.h (include Winsock2.h)
    Ws2ipdef.h (include Ws2tcpip.h)
    Ws2ipv6ok.h (include Winsock2.h)

    This updated documentation will be included in future Windows SDK updates and will be made available on the MSDN web site.

    We apologize for the delay in responding to your message. Thank you for your interest in MSDN, and let us know if we can assist you further.

    Microsoft Windows Networking SDK Feedback Team


Anmelden zum Antworten