RST problem ;\

This is a discussion on RST problem ;\ within the C++ Programming forums, part of the General Programming Boards category; Code: #include <windows.h> #include <stdio.h> #include <winsock.h> #pragma comment(lib, "WS2_32") int main() { int get; int get2; WSADATA wsadata; WSAStartup(MAKEWORD(2,2), ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    72

    RST problem ;\

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <winsock.h> 
    #pragma comment(lib, "WS2_32")
    
    int main() {
    int get;
    int get2; 
    
    WSADATA wsadata;
    WSAStartup(MAKEWORD(2,2), &wsadata);
    
    if ((get = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) {
    printf("no raw sockets - get\n");
    }
    
    if ((get2=socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == INVALID_SOCKET) {   
    printf("no raw sockets - get2\n");
    }
    system("pause");
    return 1;
    }
    ok so this is to test raw sockets but there is a problem.. you can initialize raw sockets on all win nt's without a problem, but when you try to send a packet through it, it will fail with permission denied... and if i want to make a true raw socket tester, then it also have to try send a packet... so anyone can give some ideas or whatever

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,702
    XP SP2 removed raw socket capabilities. You'll have have to use something like WinPCap to support raw sockets on any NT platform.

    http://technet.microsoft.com/en-us/l...7156.aspx#EHAA

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 09:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21