TCP/IP stack core. More...
#include "os_port.h"
#include "net_config.h"
#include "core/net_legacy.h"
#include "core/net_mem.h"
#include "core/net_misc.h"
#include "core/nic.h"
#include "core/ethernet.h"
#include "ipv4/ipv4.h"
#include "ipv4/ipv4_frag.h"
#include "ipv4/auto_ip.h"
#include "ipv6/ipv6.h"
#include "ipv4/arp.h"
#include "igmp/igmp_host.h"
#include "igmp/igmp_router.h"
#include "igmp/igmp_snooping.h"
#include "ipv6/ndp.h"
#include "ipv6/ndp_router_adv.h"
#include "ipv6/slaac.h"
#include "mld/mld_node.h"
#include "ppp/ppp.h"
#include "dhcp/dhcp_client.h"
#include "dhcp/dhcp_server.h"
#include "dhcpv6/dhcpv6_client.h"
#include "dns/dns_client.h"
#include "mdns/mdns_responder.h"
#include "mdns/mdns_common.h"
#include "dns_sd/dns_sd_responder.h"
#include "cpu_endian.h"
#include "error.h"
Go to the source code of this file.
Data Structures | |
struct | _NetInterface |
Structure describing a network interface. More... | |
struct | NetSettings |
TCP/IP stack settings. More... | |
struct | NetContext |
TCP/IP stack context. More... | |
Macros | |
#define | NetInterface struct _NetInterface |
#define | CYCLONE_TCP_VERSION_STRING "2.4.4" |
#define | CYCLONE_TCP_MAJOR_VERSION 2 |
#define | CYCLONE_TCP_MINOR_VERSION 4 |
#define | CYCLONE_TCP_REV_NUMBER 4 |
#define | NET_RTOS_SUPPORT ENABLED |
#define | NET_INTERFACE_COUNT 1 |
#define | NET_LOOPBACK_IF_SUPPORT DISABLED |
#define | NET_MAX_LINK_CHANGE_CALLBACKS (6 * NET_INTERFACE_COUNT) |
#define | NET_MAX_TIMER_CALLBACKS (6 * NET_INTERFACE_COUNT) |
#define | NET_MAX_IF_NAME_LEN 8 |
#define | NET_MAX_HOSTNAME_LEN 24 |
#define | NET_RAND_SEED_SIZE 16 |
#define | NET_TASK_STACK_SIZE 650 |
#define | NET_TASK_PRIORITY OS_TASK_PRIORITY_HIGH |
#define | NET_TICK_INTERVAL 100 |
#define | netGetSystemTickCount() osGetSystemTime() |
Functions | |
void | netGetDefaultSettings (NetSettings *settings) |
Initialize settings with default values. More... | |
error_t | netInit (void) |
Initialize TCP/IP stack (deprecated) More... | |
error_t | netInitEx (NetContext *context, const NetSettings *settings) |
Initialize TCP/IP stack. More... | |
error_t | netStart (NetContext *context) |
Start TCP/IP stack. More... | |
error_t | netSeedRand (const uint8_t *seed, size_t length) |
Seed the pseudo-random number generator. More... | |
uint32_t | netGetRand (void) |
Generate a random 32-bit value. More... | |
uint32_t | netGetRandRange (uint32_t min, uint32_t max) |
Generate a random value in the specified range. More... | |
void | netGetRandData (uint8_t *data, size_t length) |
Get a string of random data. More... | |
NetInterface * | netGetDefaultInterface (void) |
Get default network interface. More... | |
error_t | netSetMacAddr (NetInterface *interface, const MacAddr *macAddr) |
Set MAC address. More... | |
error_t | netGetMacAddr (NetInterface *interface, MacAddr *macAddr) |
Retrieve MAC address. More... | |
error_t | netSetEui64 (NetInterface *interface, const Eui64 *eui64) |
Set EUI-64 interface identifier. More... | |
error_t | netGetEui64 (NetInterface *interface, Eui64 *eui64) |
Retrieve EUI-64 interface identifier. More... | |
error_t | netSetInterfaceId (NetInterface *interface, uint32_t id) |
Set interface identifier. More... | |
error_t | netSetInterfaceName (NetInterface *interface, const char_t *name) |
Set interface name. More... | |
error_t | netSetHostname (NetInterface *interface, const char_t *name) |
Set host name. More... | |
error_t | netSetVlanId (NetInterface *interface, uint16_t vlanId) |
Specify VLAN identifier (802.1Q) More... | |
error_t | netSetVmanId (NetInterface *interface, uint16_t vmanId) |
Specify VMAN identifier (802.1ad) More... | |
error_t | netSetParentInterface (NetInterface *interface, NetInterface *physicalInterface) |
Attach a virtual interface to a given physical interface. More... | |
error_t | netSetDriver (NetInterface *interface, const NicDriver *driver) |
Set Ethernet MAC driver. More... | |
error_t | netSetPhyDriver (NetInterface *interface, const PhyDriver *driver) |
Set Ethernet PHY driver. More... | |
error_t | netSetPhyAddr (NetInterface *interface, uint8_t phyAddr) |
Specify Ethernet PHY address. More... | |
error_t | netSetSwitchDriver (NetInterface *interface, const SwitchDriver *driver) |
Set Ethernet switch driver. More... | |
error_t | netSetSwitchPort (NetInterface *interface, uint8_t port) |
Specify switch port. More... | |
error_t | netSetSmiDriver (NetInterface *interface, const SmiDriver *driver) |
Set SMI driver. More... | |
error_t | netSetSpiDriver (NetInterface *interface, const SpiDriver *driver) |
Set SPI driver. More... | |
error_t | netSetUartDriver (NetInterface *interface, const UartDriver *driver) |
Set UART driver. More... | |
error_t | netSetExtIntDriver (NetInterface *interface, const ExtIntDriver *driver) |
Set external interrupt line driver. More... | |
error_t | netSetLinkState (NetInterface *interface, bool_t linkState) |
Set administrative link state. More... | |
bool_t | netGetLinkState (NetInterface *interface) |
Get link state. More... | |
uint_t | netGetLinkSpeed (NetInterface *interface) |
Get link speed. More... | |
NicDuplexMode | netGetDuplexMode (NetInterface *interface) |
Get duplex mode. More... | |
error_t | netEnablePromiscuousMode (NetInterface *interface, bool_t enable) |
Enable promiscuous mode. More... | |
error_t | netConfigInterface (NetInterface *interface) |
Configure network interface. More... | |
error_t | netStartInterface (NetInterface *interface) |
Start network interface. More... | |
error_t | netStopInterface (NetInterface *interface) |
Stop network interface. More... | |
void | netTask (void) |
TCP/IP events handling (deprecated) More... | |
void | netTaskEx (NetContext *context) |
TCP/IP events handling. More... | |
Variables | |
NetContext | netContext |
Detailed Description
TCP/IP stack core.
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.
- Version
- 2.4.4
Definition in file net.h.
Macro Definition Documentation
◆ CYCLONE_TCP_MAJOR_VERSION
◆ CYCLONE_TCP_MINOR_VERSION
◆ CYCLONE_TCP_REV_NUMBER
◆ CYCLONE_TCP_VERSION_STRING
◆ NET_INTERFACE_COUNT
◆ NET_LOOPBACK_IF_SUPPORT
◆ NET_MAX_HOSTNAME_LEN
◆ NET_MAX_IF_NAME_LEN
◆ NET_MAX_LINK_CHANGE_CALLBACKS
#define NET_MAX_LINK_CHANGE_CALLBACKS (6 * NET_INTERFACE_COUNT) |
◆ NET_MAX_TIMER_CALLBACKS
#define NET_MAX_TIMER_CALLBACKS (6 * NET_INTERFACE_COUNT) |
◆ NET_RAND_SEED_SIZE
◆ NET_RTOS_SUPPORT
◆ NET_TASK_PRIORITY
#define NET_TASK_PRIORITY OS_TASK_PRIORITY_HIGH |
◆ NET_TASK_STACK_SIZE
◆ NET_TICK_INTERVAL
◆ netGetSystemTickCount
#define netGetSystemTickCount | ( | ) | osGetSystemTime() |
◆ NetInterface
#define NetInterface struct _NetInterface |
Function Documentation
◆ netConfigInterface()
error_t netConfigInterface | ( | NetInterface * | interface | ) |
◆ netEnablePromiscuousMode()
error_t netEnablePromiscuousMode | ( | NetInterface * | interface, |
bool_t | enable | ||
) |
◆ netGetDefaultInterface()
NetInterface* netGetDefaultInterface | ( | void | ) |
◆ netGetDefaultSettings()
void netGetDefaultSettings | ( | NetSettings * | settings | ) |
◆ netGetDuplexMode()
NicDuplexMode netGetDuplexMode | ( | NetInterface * | interface | ) |
◆ netGetEui64()
error_t netGetEui64 | ( | NetInterface * | interface, |
Eui64 * | eui64 | ||
) |
◆ netGetLinkSpeed()
uint_t netGetLinkSpeed | ( | NetInterface * | interface | ) |
◆ netGetLinkState()
bool_t netGetLinkState | ( | NetInterface * | interface | ) |
◆ netGetMacAddr()
error_t netGetMacAddr | ( | NetInterface * | interface, |
MacAddr * | macAddr | ||
) |
◆ netGetRand()
uint32_t netGetRand | ( | void | ) |
◆ netGetRandData()
void netGetRandData | ( | uint8_t * | data, |
size_t | length | ||
) |
◆ netGetRandRange()
uint32_t netGetRandRange | ( | uint32_t | min, |
uint32_t | max | ||
) |
◆ netInit()
error_t netInit | ( | void | ) |
◆ netInitEx()
error_t netInitEx | ( | NetContext * | context, |
const NetSettings * | settings | ||
) |
◆ netSeedRand()
error_t netSeedRand | ( | const uint8_t * | seed, |
size_t | length | ||
) |
◆ netSetDriver()
error_t netSetDriver | ( | NetInterface * | interface, |
const NicDriver * | driver | ||
) |
◆ netSetEui64()
error_t netSetEui64 | ( | NetInterface * | interface, |
const Eui64 * | eui64 | ||
) |
◆ netSetExtIntDriver()
error_t netSetExtIntDriver | ( | NetInterface * | interface, |
const ExtIntDriver * | driver | ||
) |
◆ netSetHostname()
error_t netSetHostname | ( | NetInterface * | interface, |
const char_t * | name | ||
) |
◆ netSetInterfaceId()
error_t netSetInterfaceId | ( | NetInterface * | interface, |
uint32_t | id | ||
) |
◆ netSetInterfaceName()
error_t netSetInterfaceName | ( | NetInterface * | interface, |
const char_t * | name | ||
) |
◆ netSetLinkState()
error_t netSetLinkState | ( | NetInterface * | interface, |
bool_t | linkState | ||
) |
◆ netSetMacAddr()
error_t netSetMacAddr | ( | NetInterface * | interface, |
const MacAddr * | macAddr | ||
) |
◆ netSetParentInterface()
error_t netSetParentInterface | ( | NetInterface * | interface, |
NetInterface * | physicalInterface | ||
) |
◆ netSetPhyAddr()
error_t netSetPhyAddr | ( | NetInterface * | interface, |
uint8_t | phyAddr | ||
) |
◆ netSetPhyDriver()
error_t netSetPhyDriver | ( | NetInterface * | interface, |
const PhyDriver * | driver | ||
) |
◆ netSetSmiDriver()
error_t netSetSmiDriver | ( | NetInterface * | interface, |
const SmiDriver * | driver | ||
) |
◆ netSetSpiDriver()
error_t netSetSpiDriver | ( | NetInterface * | interface, |
const SpiDriver * | driver | ||
) |
◆ netSetSwitchDriver()
error_t netSetSwitchDriver | ( | NetInterface * | interface, |
const SwitchDriver * | driver | ||
) |
◆ netSetSwitchPort()
error_t netSetSwitchPort | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
◆ netSetUartDriver()
error_t netSetUartDriver | ( | NetInterface * | interface, |
const UartDriver * | driver | ||
) |
◆ netSetVlanId()
error_t netSetVlanId | ( | NetInterface * | interface, |
uint16_t | vlanId | ||
) |
◆ netSetVmanId()
error_t netSetVmanId | ( | NetInterface * | interface, |
uint16_t | vmanId | ||
) |
◆ netStart()
error_t netStart | ( | NetContext * | context | ) |
◆ netStartInterface()
error_t netStartInterface | ( | NetInterface * | interface | ) |
◆ netStopInterface()
error_t netStopInterface | ( | NetInterface * | interface | ) |
◆ netTask()
◆ netTaskEx()
void netTaskEx | ( | NetContext * | context | ) |
Variable Documentation
◆ netContext
|
extern |