zephyr/subsys/net/ip/packet_socket.h
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

38 lines
873 B
C

/** @file
* @brief Packet Socket related functions
*
* This is not to be included by the application.
*/
/*
* Copyright (c) 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __PACKET_SOCKET_H
#define __PACKET_SOCKET_H
#include <zephyr/types.h>
/**
* @brief Called by net_core.c when a network packet is received.
*
* @param pkt Network packet
*
* @return NET_OK if the packet was consumed, NET_DROP if
* the packet parsing failed and the caller should handle
* the received packet. If corresponding IP protocol support is
* disabled, the function will always return NET_DROP.
*/
#if defined(CONFIG_NET_SOCKETS_PACKET)
enum net_verdict net_packet_socket_input(struct net_pkt *pkt);
#else
static inline enum net_verdict net_packet_socket_input(struct net_pkt *pkt)
{
return NET_CONTINUE;
}
#endif
#endif /* __PACKET_SOCKET_H */