TCP/IP raw sockets. More...
#include "core/net.h"
#include "core/socket.h"
#include "core/socket_misc.h"
#include "core/raw_socket.h"
#include "core/ethernet_misc.h"
#include "ipv4/ipv4.h"
#include "ipv4/ipv4_misc.h"
#include "ipv6/ipv6.h"
#include "ipv6/ipv6_misc.h"
#include "mibs/mib2_module.h"
#include "mibs/if_mib_module.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL RAW_SOCKET_TRACE_LEVEL |
Functions | |
error_t | rawSocketProcessIpPacket (NetInterface *interface, const IpPseudoHeader *pseudoHeader, const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary) |
Process incoming IP packet. More... | |
void | rawSocketProcessEthPacket (NetInterface *interface, const uint8_t *data, size_t length, const NetRxAncillary *ancillary) |
Process incoming Ethernet packet. More... | |
error_t | rawSocketSendIpPacket (Socket *socket, const SocketMsg *message, uint_t flags) |
Send a raw IP packet. More... | |
error_t | rawSocketSendEthPacket (Socket *socket, const SocketMsg *message, uint_t flags) |
Send a raw Ethernet packet. More... | |
error_t | rawSocketReceiveIpPacket (Socket *socket, SocketMsg *message, uint_t flags) |
Receive an IP packet from a raw socket. More... | |
error_t | rawSocketReceiveEthPacket (Socket *socket, SocketMsg *message, uint_t flags) |
Receive an Ethernet packet from a raw socket. More... | |
void | rawSocketUpdateEvents (Socket *socket) |
Update event state for raw sockets. More... | |
Detailed Description
TCP/IP raw sockets.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Description
A raw socket is a type of socket that allows access to the underlying transport provider
- Version
- 2.4.4
Definition in file raw_socket.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL RAW_SOCKET_TRACE_LEVEL |
Definition at line 37 of file raw_socket.c.
Function Documentation
◆ rawSocketProcessEthPacket()
void rawSocketProcessEthPacket | ( | NetInterface * | interface, |
const uint8_t * | data, | ||
size_t | length, | ||
const NetRxAncillary * | ancillary | ||
) |
Process incoming Ethernet packet.
- Parameters
-
[in] interface Underlying network interface [in] data Pointer to the payload data [in] length Length of the payload data, in bytes [in] ancillary Additional options passed to the stack along with the packet
Definition at line 385 of file raw_socket.c.
◆ rawSocketProcessIpPacket()
error_t rawSocketProcessIpPacket | ( | NetInterface * | interface, |
const IpPseudoHeader * | pseudoHeader, | ||
const NetBuffer * | buffer, | ||
size_t | offset, | ||
const NetRxAncillary * | ancillary | ||
) |
Process incoming IP packet.
- Parameters
-
[in] interface Underlying network interface [in] pseudoHeader IPv4 or IPv6 pseudo header [in] buffer Multi-part buffer containing the IP packet [in] offset Offset to the first byte of the IP packet [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 68 of file raw_socket.c.
◆ rawSocketReceiveEthPacket()
Receive an Ethernet packet from a raw socket.
- Parameters
-
[in] socket Handle referencing the socket [out] message Received Ethernet packet and ancillary data [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 930 of file raw_socket.c.
◆ rawSocketReceiveIpPacket()
Receive an IP packet from a raw socket.
- Parameters
-
[in] socket Handle referencing the socket [out] message Received IP packet and ancillary data [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 824 of file raw_socket.c.
◆ rawSocketSendEthPacket()
Send a raw Ethernet packet.
- Parameters
-
[in] socket Handle referencing the socket [in] message Pointer to the structure describing the raw packet [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 732 of file raw_socket.c.
◆ rawSocketSendIpPacket()
Send a raw IP packet.
- Parameters
-
[in] socket Handle referencing the socket [in] message Pointer to the structure describing the raw packet [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
Definition at line 538 of file raw_socket.c.
◆ rawSocketUpdateEvents()
void rawSocketUpdateEvents | ( | Socket * | socket | ) |
Update event state for raw sockets.
- Parameters
-
[in] socket Handle referencing the socket
Definition at line 1025 of file raw_socket.c.