How do I create RAW TCP/IP packets in C++?

后端 未结 11 1397
有刺的猬
有刺的猬 2020-12-24 06:59

I\'m a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated

11条回答
  •  执念已碎
    2020-12-24 07:44

    easy:

    #include 
    #include 
    
    int socket(int protocolFamily, int Type, int Protocol)
    // returns a socket descriptor
    
    int bind(int socketDescriptor, struct sockaddr* localAddress, unsigned int addressLength)
    // returns 0 
    

    ...etc.

    it's all in sys/socket.h

提交回复
热议问题