Commit graph

2 commits

Author SHA1 Message Date
Ravi kumar Veeramally a9a2b3ea91 net: sockets: Add socket api to support AF_PACKET
This commit adds packet socket support to socket api.
This version supports basic packet socket features.
Protocol family is AF_PACKET, type of socket is
SOCK_RAW and proto type is ETH_P_ALL. The user will
receive every packet (with L2 header) on the wire.
For TX, the subsystem expects that the user has set
all the protocol headers (L2 and L3) properly.

Networking subsystem doesn't verify or alter the headers while
sending or receiving the packets. This version supports packet
socket over Etherent only. Also combination of other family
and protocols doesn't work (i.e. Application can not open
packet-socket and non packet-socket together).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-07 14:43:30 +02:00
Ravi kumar Veeramally b458ebf755 net: core: Handle packets when packet sockets are enabled
If CONFIG_NET_SOCKETS_PACKET is enabled, then feed the packet
to net_packet_socket_input() for processing. It will search
for the net_contexts and if proper handler is found, pass
the packet to connection handler.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-07 14:43:30 +02:00