I write a simple program to set my NIC in promiscuous mode and capture
all tcp or udp datagrams.
The following is taken from linux man page raw(7):
An IPPROTO_RAW socket is send only. If you really want to
receive all IP packets use a packet(7) socket with the ETH_P_IP
protocol. Note that packet sockets don't reassemble IP fragments,
unlike raw sockets.
Does it mean that I need to write codes myself to reassemble ip packet
if it's fragmented? And if I want to receive all TCP segments or UDP
datagrams, is it feasible to use raw socket instead of packet socket
and set the protocol to IPPROTO_TCP or IPPROTO_UDP?
Thanks in advance for any help.