Is there a possibility to intercept and modify the stream data between the socket layer and the transport layer (like the "Layered Service Provider" in winsock)

The iptables hook allow me to capture the IP packets, What I need is to change the application stream before the transform layer pack it to segments and send it to the IP mechanism.