mikroSDK Reference Manual
raw_socket.h
Go to the documentation of this file.
1
31#ifndef _RAW_SOCKET_H
32#define _RAW_SOCKET_H
33
34//Dependencies
35#include "core/net.h"
36#include "core/ip.h"
37#include "core/socket.h"
38
39//Raw socket support
40#ifndef RAW_SOCKET_SUPPORT
41 #define RAW_SOCKET_SUPPORT DISABLED
42#elif (RAW_SOCKET_SUPPORT != ENABLED && RAW_SOCKET_SUPPORT != DISABLED)
43 #error RAW_SOCKET_SUPPORT parameter is not valid
44#endif
45
46//Receive queue depth for raw sockets
47#ifndef RAW_SOCKET_RX_QUEUE_SIZE
48 #define RAW_SOCKET_RX_QUEUE_SIZE 4
49#elif (RAW_SOCKET_RX_QUEUE_SIZE < 1)
50 #error RAW_SOCKET_RX_QUEUE_SIZE parameter is not valid
51#endif
52
53//C++ guard
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58//Raw socket related functions
59error_t rawSocketProcessIpPacket(NetInterface *interface,
60 const IpPseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset,
61 const NetRxAncillary *ancillary);
62
63void rawSocketProcessEthPacket(NetInterface *interface, const uint8_t *data,
64 size_t length, const NetRxAncillary *ancillary);
65
66error_t rawSocketSendIpPacket(Socket *socket, const SocketMsg *message,
67 uint_t flags);
68
69error_t rawSocketSendEthPacket(Socket *socket, const SocketMsg *message,
70 uint_t flags);
71
72error_t rawSocketReceiveIpPacket(Socket *socket, SocketMsg *message,
73 uint_t flags);
74
75error_t rawSocketReceiveEthPacket(Socket *socket, SocketMsg *message,
76 uint_t flags);
77
78void rawSocketUpdateEvents(Socket *socket);
79
80//C++ guard
81#ifdef __cplusplus
82}
83#endif
84
85#endif
error_t
Error codes.
Definition error.h:43
IPv4 and IPv6 common routines.
TCP/IP stack core.
Socket API.
IP pseudo header.
Definition ip.h:91
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
Message and ancillary data.
Definition socket.h:228