tass-belgium / picotcp

PicoTCP is a free TCP/IP stack implementation
Other
1.18k stars 219 forks source link

Use picotcp without sockets? #512

Open tbarbette opened 4 years ago

tbarbette commented 4 years ago

Hi all,

Is it possible to use picotcp without sockets. That is, instead of calling picotcp_socket_open, I call a function to which I pass all incoming packets (received using eg. DPDK) and transmit packets by my own means.

Thanks, Tom

danielinux commented 4 years ago

Hello Tom,

in this GPL fork we have added two additional types of sockets for these purposes:

API for RAW IP sockets (compile with RAW=1): https://github.com/virtualsquare/picotcp/blob/master/modules/pico_ipv4.h#L160

API for PACKET SOCKETS (compile with PACKET_SOCKET=1): https://github.com/virtualsquare/picotcp/blob/master/modules/pico_socket_ll.h

HTH,

-- Danielinux

tbarbette commented 4 years ago

It seems great !

If I get it correctly, the idea is that my application implements the few headers, right?

Would an example be available somewhere?