TCP handshake with SOCK_RAW socket

后端 未结 7 1309
灰色年华
灰色年华 2020-12-23 22:19

Ok, I realize this situation is somewhat unusual, but I need to establish a TCP connection (the 3-way handshake) using only raw sockets (in C, in linux) -- i.e. I need to co

7条回答
  •  抹茶落季
    2020-12-23 23:03

    Depending on what you're trying to do it may be easier to get existing software to handle the TCP handshaking for you.

    One open source IP stack is lwIP (http://savannah.nongnu.org/projects/lwip/) which provides a full tcp/ip stack. It is very possible to get it running in user mode using either SOCK_RAW or pcap.

提交回复
热议问题