So, I am trying to make a toy (bash?) implementation of TCP on top of raw sockets, to better understand the protocol.
I understand that /dev/raw is deprecated in favor of O_DIRECT (why?) and is not enabled in my kernel.
$ zgrep -i raw /proc/config.gz
CONFIG_IP_NF_RAW=m
CONFIG_IP6_NF_RAW=m
CONFIG_SERIO_RAW=m
# CONFIG_RAW_DRIVER is not set
CONFIG_SND_RAWMIDI=m
CONFIG_SND_RAWMIDI_SEQ=m
CONFIG_HIDRAW=y
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
CONFIG_USB_GADGET_VBUS_DRAW=2
# CONFIG_LINE6_USB_RAW is not set
CONFIG_ATH6KL_HTC_RAW_INTERFACE=y
I cannot find information on how to send data without linux’s TCP implementation using O_DIRECT which is what I guess I should use.
Here’s an informative paper on raw sockets in FreeBSD 7.0 and Linux 2.6.
If you do not have
/dev/tcpin Bash, you may want to look at Richard Stevens’ sock program (http://www.icir.org/christian/sock.html).