net.h
Go to the documentation of this file.
1 /**
2  * @file net.h
3  * @brief TCP/IP stack core
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _NET_H
32 #define _NET_H
33 
34 //Forward declaration of NetInterface structure
35 struct _NetInterface;
36 #define NetInterface struct _NetInterface
37 
38 //Dependencies
39 #include "os_port.h"
40 #include "net_config.h"
41 #include "core/net_legacy.h"
42 #include "core/net_mem.h"
43 #include "core/net_misc.h"
44 #include "core/nic.h"
45 #include "core/ethernet.h"
46 #include "ipv4/ipv4.h"
47 #include "ipv4/ipv4_frag.h"
48 #include "ipv4/auto_ip.h"
49 #include "ipv6/ipv6.h"
50 #include "ipv4/arp.h"
51 #include "igmp/igmp_host.h"
52 #include "igmp/igmp_router.h"
53 #include "igmp/igmp_snooping.h"
54 #include "ipv6/ndp.h"
55 #include "ipv6/ndp_router_adv.h"
56 #include "ipv6/slaac.h"
57 #include "ppp/ppp.h"
58 #include "dhcp/dhcp_client.h"
59 #include "dhcp/dhcp_server.h"
60 #include "dhcpv6/dhcpv6_client.h"
61 #include "dns/dns_client.h"
62 #include "mdns/mdns_responder.h"
63 #include "mdns/mdns_common.h"
64 #include "dns_sd/dns_sd.h"
65 #include "cpu_endian.h"
66 #include "error.h"
67 
68 
69 /*
70  * CycloneTCP Open is licensed under GPL version 2. In particular:
71  *
72  * - If you link your program to CycloneTCP Open, the result is a derivative
73  * work that can only be distributed under the same GPL license terms.
74  *
75  * - If additions or changes to CycloneTCP Open are made, the result is a
76  * derivative work that can only be distributed under the same license terms.
77  *
78  * - The GPL license requires that you make the source code available to
79  * whoever you make the binary available to.
80  *
81  * - If you sell or distribute a hardware product that runs CycloneTCP Open,
82  * the GPL license requires you to provide public and full access to all
83  * source code on a nondiscriminatory basis.
84  *
85  * If you fully understand and accept the terms of the GPL license, then edit
86  * the os_port_config.h header and add the following directive:
87  *
88  * #define GPL_LICENSE_TERMS_ACCEPTED
89  */
90 
91 #ifndef GPL_LICENSE_TERMS_ACCEPTED
92  #error Before compiling CycloneTCP Open, you must accept the terms of the GPL license
93 #endif
94 
95 //Version string
96 #define CYCLONE_TCP_VERSION_STRING "2.4.0"
97 //Major version
98 #define CYCLONE_TCP_MAJOR_VERSION 2
99 //Minor version
100 #define CYCLONE_TCP_MINOR_VERSION 4
101 //Revision number
102 #define CYCLONE_TCP_REV_NUMBER 0
103 
104 //RTOS support
105 #ifndef NET_RTOS_SUPPORT
106  #define NET_RTOS_SUPPORT ENABLED
107 #elif (NET_RTOS_SUPPORT != ENABLED && NET_RTOS_SUPPORT != DISABLED)
108  #error NET_RTOS_SUPPORT parameter is not valid
109 #endif
110 
111 //Number of network adapters
112 #ifndef NET_INTERFACE_COUNT
113  #define NET_INTERFACE_COUNT 1
114 #elif (NET_INTERFACE_COUNT < 1)
115  #error NET_INTERFACE_COUNT parameter is not valid
116 #endif
117 
118 //Loopback interface support
119 #ifndef NET_LOOPBACK_IF_SUPPORT
120  #define NET_LOOPBACK_IF_SUPPORT DISABLED
121 #elif (NET_LOOPBACK_IF_SUPPORT != ENABLED && NET_LOOPBACK_IF_SUPPORT != DISABLED)
122  #error NET_LOOPBACK_IF_SUPPORT parameter is not valid
123 #endif
124 
125 //Maximum number of link change callback functions that can be registered
126 #ifndef NET_MAX_LINK_CHANGE_CALLBACKS
127  #define NET_MAX_LINK_CHANGE_CALLBACKS (6 * NET_INTERFACE_COUNT)
128 #elif (NET_MAX_LINK_CHANGE_CALLBACKS < 1)
129  #error NET_MAX_LINK_CHANGE_CALLBACKS parameter is not valid
130 #endif
131 
132 //Maximum number of timer callback functions that can be registered
133 #ifndef NET_MAX_TIMER_CALLBACKS
134  #define NET_MAX_TIMER_CALLBACKS (6 * NET_INTERFACE_COUNT)
135 #elif (NET_MAX_TIMER_CALLBACKS < 1)
136  #error NET_MAX_TIMER_CALLBACKS parameter is not valid
137 #endif
138 
139 //Maximum length of interface name
140 #ifndef NET_MAX_IF_NAME_LEN
141  #define NET_MAX_IF_NAME_LEN 8
142 #elif (NET_MAX_IF_NAME_LEN < 1)
143  #error NET_MAX_IF_NAME_LEN parameter is not valid
144 #endif
145 
146 //Maximum length of host name
147 #ifndef NET_MAX_HOSTNAME_LEN
148  #define NET_MAX_HOSTNAME_LEN 24
149 #elif (NET_MAX_HOSTNAME_LEN < 1)
150  #error NET_MAX_HOSTNAME_LEN parameter is not valid
151 #endif
152 
153 //Size of the seed
154 #ifndef NET_RAND_SEED_SIZE
155  #define NET_RAND_SEED_SIZE 16
156 #elif (NET_RAND_SEED_SIZE < 10)
157  #error NET_RAND_SEED_SIZE parameter is not valid
158 #endif
159 
160 //Stack size required to run the TCP/IP task
161 #ifndef NET_TASK_STACK_SIZE
162  #define NET_TASK_STACK_SIZE 650
163 #elif (NET_TASK_STACK_SIZE < 1)
164  #error NET_TASK_STACK_SIZE parameter is not valid
165 #endif
166 
167 //Priority at which the TCP/IP task should run
168 #ifndef NET_TASK_PRIORITY
169  #define NET_TASK_PRIORITY OS_TASK_PRIORITY_HIGH
170 #endif
171 
172 //TCP/IP stack tick interval
173 #ifndef NET_TICK_INTERVAL
174  #define NET_TICK_INTERVAL 100
175 #elif (NET_TICK_INTERVAL < 10)
176  #error NET_TICK_INTERVAL parameter is not valid
177 #endif
178 
179 //Get system tick count
180 #ifndef netGetSystemTickCount
181  #define netGetSystemTickCount() osGetSystemTime()
182 #endif
183 
184 //C++ guard
185 #ifdef __cplusplus
186 extern "C" {
187 #endif
188 
189 
190 /**
191  * @brief Structure describing a network interface
192  **/
193 
195 {
196  uint_t index; ///<Zero-based index
197  uint32_t id; ///<A unique number identifying the interface
198  Eui64 eui64; ///<EUI-64 interface identifier
199  char_t name[NET_MAX_IF_NAME_LEN + 1]; ///<A unique name identifying the interface
201  const NicDriver *nicDriver; ///<NIC driver
202  const SpiDriver *spiDriver; ///<Underlying SPI driver
203  const UartDriver *uartDriver; ///<Underlying UART driver
204  const ExtIntDriver *extIntDriver; ///<External interrupt line driver
205  uint8_t nicContext[NIC_CONTEXT_SIZE]; ///<Driver specific context
206  OsEvent nicTxEvent; ///<Network controller TX event
207  bool_t nicEvent; ///<A NIC event is pending
208  NicLinkState adminLinkState; ///<Administrative link state
209  bool_t linkState; ///<Link state
210  uint32_t linkSpeed; ///<Link speed
211  NicDuplexMode duplexMode; ///<Duplex mode
212  bool_t configured; ///<Configuration done
213  systime_t initialRto; ///<TCP initial retransmission timeout
214 
215 #if (ETH_SUPPORT == ENABLED)
216  const PhyDriver *phyDriver; ///<Ethernet PHY driver
217  uint8_t phyAddr; ///<PHY address
218  bool_t phyEvent; ///<A PHY event is pending
219  const SwitchDriver *switchDriver; ///<Ethernet switch driver
220  const SmiDriver *smiDriver; ///<SMI driver
221  MacAddr macAddr; ///<Link-layer address
223  bool_t promiscuous; ///<Promiscuous mode
224  bool_t acceptAllMulticast; ///<Accept all frames with a multicast destination address
225 #endif
226 #if (ETH_VLAN_SUPPORT == ENABLED)
227  uint16_t vlanId; ///<VLAN identifier (802.1Q)
228 #endif
229 #if (ETH_VMAN_SUPPORT == ENABLED)
230  uint16_t vmanId; ///<VMAN identifier (802.1ad)
231 #endif
232 #if (ETH_LLC_SUPPORT == ENABLED)
233  LlcRxCallback llcRxCallback; ///<LLC frame received callback (802.2)
234  void *llcRxParam; ///<Callback parameter
235 #endif
236 #if (ETH_PORT_TAGGING_SUPPORT == ENABLED)
237  uint8_t port; ///<Switch port identifier
238 #endif
239 #if (ETH_VIRTUAL_IF_SUPPORT == ENABLED || ETH_VLAN_SUPPORT == ENABLED || \
240  ETH_PORT_TAGGING_SUPPORT == ENABLED)
241  NetInterface *parent; ///<Interface on top of which the virtual interface runs
242 #endif
243 
244 #if (IPV4_SUPPORT == ENABLED)
245  Ipv4Context ipv4Context; ///<IPv4 context
246 #if (ETH_SUPPORT == ENABLED)
247  bool_t enableArp; ///<Enable address resolution using ARP
249 #endif
250 #if (IGMP_HOST_SUPPORT == ENABLED)
251  IgmpHostContext igmpHostContext; ///<IGMP host context
252 #endif
253 #if (IGMP_ROUTER_SUPPORT == ENABLED)
254  IgmpRouterContext *igmpRouterContext; ///<IGMP router context
255 #endif
256 #if (IGMP_SNOOPING_SUPPORT == ENABLED)
257  IgmpSnoopingContext *igmpSnoopingContext; ///<IGMP snooping switch context
258 #endif
259 #if (AUTO_IP_SUPPORT == ENABLED)
260  AutoIpContext *autoIpContext; ///<Auto-IP context
261 #endif
262 #if (DHCP_CLIENT_SUPPORT == ENABLED)
263  DhcpClientContext *dhcpClientContext; ///<DHCP client context
264 #endif
265 #if (DHCP_SERVER_SUPPORT == ENABLED)
266  DhcpServerContext *dhcpServerContext; ///<DHCP server context
267 #endif
268 #endif
269 
270 #if (IPV6_SUPPORT == ENABLED)
271  Ipv6Context ipv6Context; ///<IPv6 context
272 #if (NDP_SUPPORT == ENABLED)
273  NdpContext ndpContext; ///<NDP context
274 #endif
275 #if (NDP_ROUTER_ADV_SUPPORT == ENABLED)
276  NdpRouterAdvContext *ndpRouterAdvContext; ///<RA service context
277 #endif
278 #if (SLAAC_SUPPORT == ENABLED)
279  SlaacContext *slaacContext; ///<SLAAC context
280 #endif
281 #if (DHCPV6_CLIENT_SUPPORT == ENABLED)
282  Dhcpv6ClientContext *dhcpv6ClientContext; ///<DHCPv6 client context
283 #endif
284 #endif
285 
286 #if (MDNS_RESPONDER_SUPPORT == ENABLED)
287  MdnsResponderContext *mdnsResponderContext; ///<mDNS responder context
288 #endif
289 
290 #if (DNS_SD_SUPPORT == ENABLED)
291  DnsSdContext *dnsSdContext; ///DNS-SD context
292 #endif
293 
294 #if (PPP_SUPPORT == ENABLED)
295  PppContext *pppContext; ///<PPP context
296 #endif
297 };
298 
299 
300 /**
301  * @brief TCP/IP stack settings
302  **/
303 
304 typedef struct
305 {
306  OsTaskParameters task; ///<Task parameters
307 } NetSettings;
308 
309 
310 /**
311  * @brief TCP/IP stack context
312  **/
313 
314 typedef struct
315 {
316  OsMutex mutex; ///<Mutex preventing simultaneous access to the TCP/IP stack
317  OsEvent event; ///<Event object to receive notifications from drivers
318  bool_t running; ///<The TCP/IP stack is currently running
319  OsTaskParameters taskParams; ///<Task parameters
320  OsTaskId taskId; ///<Task identifier
321  uint32_t entropy;
323  uint8_t randSeed[NET_RAND_SEED_SIZE]; ///<Random seed
324  NetRandState randState; ///<Pseudo-random number generator state
325  NetInterface interfaces[NET_INTERFACE_COUNT]; ///<Network interfaces
328 #if (IPV4_IPSEC_SUPPORT == ENABLED)
329  void *ipsecContext; ///<IPsec context
330  void *ikeContext; ///<IKE context
331 #endif
332 } NetContext;
333 
334 
335 //Global variables
336 extern NetContext netContext;
337 
338 //TCP/IP stack related functions
339 void netGetDefaultSettings(NetSettings *settings);
340 error_t netInit(void);
341 error_t netInitEx(NetContext *context, const NetSettings *settings);
342 
343 error_t netStart(NetContext *context);
344 
345 error_t netSeedRand(const uint8_t *seed, size_t length);
346 uint32_t netGetRand(void);
347 uint32_t netGetRandRange(uint32_t min, uint32_t max);
348 void netGetRandData(uint8_t *data, size_t length);
349 
351 
352 error_t netSetMacAddr(NetInterface *interface, const MacAddr *macAddr);
353 error_t netGetMacAddr(NetInterface *interface, MacAddr *macAddr);
354 
355 error_t netSetEui64(NetInterface *interface, const Eui64 *eui64);
356 error_t netGetEui64(NetInterface *interface, Eui64 *eui64);
357 
358 error_t netSetInterfaceId(NetInterface *interface, uint32_t id);
360 error_t netSetHostname(NetInterface *interface, const char_t *name);
361 
362 error_t netSetVlanId(NetInterface *interface, uint16_t vlanId);
363 error_t netSetVmanId(NetInterface *interface, uint16_t vmanId);
364 
366  NetInterface *physicalInterface);
367 
368 error_t netSetDriver(NetInterface *interface, const NicDriver *driver);
369 
370 error_t netSetPhyDriver(NetInterface *interface, const PhyDriver *driver);
371 error_t netSetPhyAddr(NetInterface *interface, uint8_t phyAddr);
372 
373 error_t netSetSwitchDriver(NetInterface *interface, const SwitchDriver *driver);
374 error_t netSetSwitchPort(NetInterface *interface, uint8_t port);
375 
376 error_t netSetSmiDriver(NetInterface *interface, const SmiDriver *driver);
377 error_t netSetSpiDriver(NetInterface *interface, const SpiDriver *driver);
378 error_t netSetUartDriver(NetInterface *interface, const UartDriver *driver);
379 error_t netSetExtIntDriver(NetInterface *interface, const ExtIntDriver *driver);
380 
381 error_t netSetLinkState(NetInterface *interface, NicLinkState linkState);
383 
386 
388 
392 
393 void netTask(void);
394 void netTaskEx(NetContext *context);
395 
396 //C++ guard
397 #ifdef __cplusplus
398 }
399 #endif
400 
401 #endif
ARP (Address Resolution Protocol)
#define ARP_CACHE_SIZE
Definition: arp.h:46
Auto-IP (Dynamic Configuration of IPv4 Link-Local Addresses)
#define AutoIpContext
Definition: auto_ip.h:139
unsigned int uint_t
Definition: compiler_port.h:50
char char_t
Definition: compiler_port.h:48
int bool_t
Definition: compiler_port.h:53
Byte order conversion.
DHCP client (Dynamic Host Configuration Protocol)
#define DhcpClientContext
Definition: dhcp_client.h:145
DHCP server (Dynamic Host Configuration Protocol)
#define DhcpServerContext
Definition: dhcp_server.h:79
DHCPv6 client (Dynamic Host Configuration Protocol for IPv6)
#define Dhcpv6ClientContext
DNS client (Domain Name System)
uint16_t port
Definition: dns_common.h:267
DNS-SD (DNS-Based Service Discovery)
#define DnsSdContext
Definition: dns_sd.h:90
Error codes description.
error_t
Error codes.
Definition: error.h:43
Ethernet.
Eui64
Definition: ethernet.h:210
uint8_t data[]
Definition: ethernet.h:222
MacAddr
Definition: ethernet.h:195
#define MAC_ADDR_FILTER_SIZE
Definition: ethernet.h:95
void(* LlcRxCallback)(NetInterface *interface, EthHeader *header, const uint8_t *data, size_t length, NetRxAncillary *ancillary, void *param)
LLC frame received callback.
Definition: ethernet.h:274
IGMP host.
IGMP router.
#define IgmpRouterContext
Definition: igmp_router.h:47
IGMP snooping switch.
IPv4 (Internet Protocol Version 4)
IPv4 fragmentation and reassembly.
IPv6 (Internet Protocol Version 6)
Definitions common to mDNS client and mDNS responder.
mDNS responder (Multicast DNS)
#define MdnsResponderContext
NDP (Neighbor Discovery Protocol)
Router advertisement service.
#define NdpRouterAdvContext
bool_t netGetLinkState(NetInterface *interface)
Get link state.
Definition: net.c:1083
void netGetDefaultSettings(NetSettings *settings)
Initialize settings with default values.
Definition: net.c:83
void netTaskEx(NetContext *context)
TCP/IP events handling.
Definition: net.c:1538
#define NET_RAND_SEED_SIZE
Definition: net.h:155
error_t netSetParentInterface(NetInterface *interface, NetInterface *physicalInterface)
Attach a virtual interface to a given physical interface.
Definition: net.c:765
#define NET_MAX_TIMER_CALLBACKS
Definition: net.h:134
NetContext netContext
Definition: net.c:75
#define NET_INTERFACE_COUNT
Definition: net.h:113
error_t netSetDriver(NetInterface *interface, const NicDriver *driver)
Set Ethernet MAC driver.
Definition: net.c:797
error_t netSetSmiDriver(NetInterface *interface, const SmiDriver *driver)
Set SMI driver.
Definition: net.c:946
error_t netSeedRand(const uint8_t *seed, size_t length)
Seed the pseudo-random number generator.
Definition: net.c:338
#define NET_MAX_IF_NAME_LEN
Definition: net.h:141
#define NetInterface
Definition: net.h:36
error_t netInitEx(NetContext *context, const NetSettings *settings)
Initialize TCP/IP stack.
Definition: net.c:129
#define NET_MAX_LINK_CHANGE_CALLBACKS
Definition: net.h:127
error_t netEnablePromiscuousMode(NetInterface *interface, bool_t enable)
Enable promiscuous mode.
Definition: net.c:1177
void netGetRandData(uint8_t *data, size_t length)
Get a string of random data.
Definition: net.c:446
error_t netSetInterfaceName(NetInterface *interface, const char_t *name)
Set interface name.
Definition: net.c:638
error_t netSetExtIntDriver(NetInterface *interface, const ExtIntDriver *driver)
Set external interrupt line driver.
Definition: net.c:1026
#define NET_MAX_HOSTNAME_LEN
Definition: net.h:148
error_t netSetVlanId(NetInterface *interface, uint16_t vlanId)
Specify VLAN identifier (802.1Q)
Definition: net.c:696
error_t netSetSpiDriver(NetInterface *interface, const SpiDriver *driver)
Set SPI driver.
Definition: net.c:976
NicDuplexMode netGetDuplexMode(NetInterface *interface)
Get duplex mode.
Definition: net.c:1145
error_t netGetEui64(NetInterface *interface, Eui64 *eui64)
Retrieve EUI-64 interface identifier.
Definition: net.c:581
error_t netSetSwitchDriver(NetInterface *interface, const SwitchDriver *driver)
Set Ethernet switch driver.
Definition: net.c:886
error_t netSetPhyDriver(NetInterface *interface, const PhyDriver *driver)
Set Ethernet PHY driver.
Definition: net.c:822
error_t netConfigInterface(NetInterface *interface)
Configure network interface.
Definition: net.c:1203
error_t netSetMacAddr(NetInterface *interface, const MacAddr *macAddr)
Set MAC address.
Definition: net.c:484
error_t netSetHostname(NetInterface *interface, const char_t *name)
Set host name.
Definition: net.c:667
error_t netSetPhyAddr(NetInterface *interface, uint8_t phyAddr)
Specify Ethernet PHY address.
Definition: net.c:852
uint32_t netGetRand(void)
Generate a random 32-bit value.
Definition: net.c:385
error_t netSetUartDriver(NetInterface *interface, const UartDriver *driver)
Set UART driver.
Definition: net.c:1001
error_t netSetSwitchPort(NetInterface *interface, uint8_t port)
Specify switch port.
Definition: net.c:916
uint_t netGetLinkSpeed(NetInterface *interface)
Get link speed.
Definition: net.c:1114
void netTask(void)
TCP/IP events handling (deprecated)
Definition: net.c:1527
NetInterface * netGetDefaultInterface(void)
Get default network interface.
Definition: net.c:470
error_t netSetLinkState(NetInterface *interface, NicLinkState linkState)
Set administrative link state.
Definition: net.c:1051
error_t netStopInterface(NetInterface *interface)
Stop network interface.
Definition: net.c:1471
error_t netInit(void)
Initialize TCP/IP stack (deprecated)
Definition: net.c:99
error_t netSetEui64(NetInterface *interface, const Eui64 *eui64)
Set EUI-64 interface identifier.
Definition: net.c:556
error_t netSetVmanId(NetInterface *interface, uint16_t vmanId)
Specify VMAN identifier (802.1ad)
Definition: net.c:730
error_t netGetMacAddr(NetInterface *interface, MacAddr *macAddr)
Retrieve MAC address.
Definition: net.c:519
error_t netSetInterfaceId(NetInterface *interface, uint32_t id)
Set interface identifier.
Definition: net.c:613
uint32_t netGetRandRange(uint32_t min, uint32_t max)
Generate a random value in the specified range.
Definition: net.c:416
error_t netStartInterface(NetInterface *interface)
Start network interface.
Definition: net.c:1391
error_t netStart(NetContext *context)
Start TCP/IP stack.
Definition: net.c:311
Legacy definitions.
Memory management.
Helper functions for TCP/IP stack.
Network interface controller abstraction layer.
NicLinkState
Link state.
Definition: nic.h:97
#define NIC_CONTEXT_SIZE
Definition: nic.h:53
NicDuplexMode
Duplex mode.
Definition: nic.h:122
RTOS abstraction layer.
uint32_t systime_t
System time.
thread_t * OsTaskId
Task identifier.
PPP (Point-to-Point Protocol)
#define PppContext
Definition: ppp.h:38
char_t name[]
IPv6 Stateless Address Autoconfiguration.
#define SlaacContext
Definition: slaac.h:50
Structure describing a network interface.
Definition: net.h:195
DhcpClientContext * dhcpClientContext
DHCP client context.
Definition: net.h:263
IgmpHostContext igmpHostContext
IGMP host context.
Definition: net.h:251
LlcRxCallback llcRxCallback
LLC frame received callback (802.2)
Definition: net.h:233
bool_t nicEvent
A NIC event is pending.
Definition: net.h:207
const SmiDriver * smiDriver
SMI driver.
Definition: net.h:220
void * llcRxParam
Callback parameter.
Definition: net.h:234
SlaacContext * slaacContext
SLAAC context.
Definition: net.h:279
DnsSdContext * dnsSdContext
Definition: net.h:291
uint8_t port
Switch port identifier.
Definition: net.h:237
const SpiDriver * spiDriver
Underlying SPI driver.
Definition: net.h:202
bool_t acceptAllMulticast
Accept all frames with a multicast destination address.
Definition: net.h:224
MacFilterEntry macAddrFilter[MAC_ADDR_FILTER_SIZE]
MAC filter table.
Definition: net.h:222
const NicDriver * nicDriver
NIC driver.
Definition: net.h:201
uint8_t phyAddr
PHY address.
Definition: net.h:217
systime_t initialRto
TCP initial retransmission timeout.
Definition: net.h:213
bool_t promiscuous
Promiscuous mode.
Definition: net.h:223
DhcpServerContext * dhcpServerContext
DHCP server context.
Definition: net.h:266
const PhyDriver * phyDriver
Ethernet PHY driver.
Definition: net.h:216
MacAddr macAddr
Link-layer address.
Definition: net.h:221
AutoIpContext * autoIpContext
Auto-IP context.
Definition: net.h:260
NdpRouterAdvContext * ndpRouterAdvContext
RA service context.
Definition: net.h:276
const UartDriver * uartDriver
Underlying UART driver.
Definition: net.h:203
NetInterface * parent
Interface on top of which the virtual interface runs.
Definition: net.h:241
PppContext * pppContext
DNS-SD context.
Definition: net.h:295
MdnsResponderContext * mdnsResponderContext
mDNS responder context
Definition: net.h:287
bool_t configured
Configuration done.
Definition: net.h:212
Eui64 eui64
EUI-64 interface identifier.
Definition: net.h:198
Ipv4Context ipv4Context
IPv4 context.
Definition: net.h:245
const ExtIntDriver * extIntDriver
External interrupt line driver.
Definition: net.h:204
Dhcpv6ClientContext * dhcpv6ClientContext
DHCPv6 client context.
Definition: net.h:282
uint16_t vlanId
VLAN identifier (802.1Q)
Definition: net.h:227
uint8_t nicContext[NIC_CONTEXT_SIZE]
Driver specific context.
Definition: net.h:205
bool_t phyEvent
A PHY event is pending.
Definition: net.h:218
uint32_t linkSpeed
Link speed.
Definition: net.h:210
uint32_t id
A unique number identifying the interface.
Definition: net.h:197
IgmpSnoopingContext * igmpSnoopingContext
IGMP snooping switch context.
Definition: net.h:257
IgmpRouterContext * igmpRouterContext
IGMP router context.
Definition: net.h:254
Ipv6Context ipv6Context
IPv6 context.
Definition: net.h:271
char_t hostname[NET_MAX_HOSTNAME_LEN+1]
Host name.
Definition: net.h:200
bool_t linkState
Link state.
Definition: net.h:209
NicLinkState adminLinkState
Administrative link state.
Definition: net.h:208
const SwitchDriver * switchDriver
Ethernet switch driver.
Definition: net.h:219
NdpContext ndpContext
NDP context.
Definition: net.h:273
uint16_t vmanId
VMAN identifier (802.1ad)
Definition: net.h:230
OsEvent nicTxEvent
Network controller TX event.
Definition: net.h:206
bool_t enableArp
Enable address resolution using ARP.
Definition: net.h:247
NicDuplexMode duplexMode
Duplex mode.
Definition: net.h:211
ArpCacheEntry arpCache[ARP_CACHE_SIZE]
ARP cache.
Definition: net.h:248
uint_t index
Zero-based index.
Definition: net.h:196
char_t name[NET_MAX_IF_NAME_LEN+1]
A unique name identifying the interface.
Definition: net.h:199
ARP cache entry.
Definition: arp.h:189
External interrupt line driver.
Definition: nic.h:394
IGMP host context.
Definition: igmp_host.h:68
IGMP snooping switch context.
IPv4 context.
Definition: ipv4.h:371
IPv6 context.
Definition: ipv6.h:462
MAC filter table entry.
Definition: ethernet.h:262
NDP context.
Definition: ndp.h:580
TCP/IP stack context.
Definition: net.h:315
systime_t timestamp
Definition: net.h:322
void * ipsecContext
IPsec context.
Definition: net.h:329
OsTaskId taskId
Task identifier.
Definition: net.h:320
bool_t running
The TCP/IP stack is currently running.
Definition: net.h:318
void * ikeContext
IKE context.
Definition: net.h:330
OsTaskParameters taskParams
Task parameters.
Definition: net.h:319
OsEvent event
Event object to receive notifications from drivers.
Definition: net.h:317
uint32_t entropy
Definition: net.h:321
NetRandState randState
Pseudo-random number generator state.
Definition: net.h:324
OsMutex mutex
Mutex preventing simultaneous access to the TCP/IP stack.
Definition: net.h:316
Link change callback entry.
Definition: net_misc.h:73
Pseudo-random number generator state.
Definition: net_misc.h:184
TCP/IP stack settings.
Definition: net.h:305
OsTaskParameters task
Task parameters.
Definition: net.h:306
Timer callback entry.
Definition: net_misc.h:92
NIC driver.
Definition: nic.h:283
Event object.
Mutex object.
Task parameters.
Ethernet PHY driver.
Definition: nic.h:308
SMI driver.
Definition: nic.h:354
SPI driver.
Definition: nic.h:366
Ethernet switch driver.
Definition: nic.h:322
UART driver.
Definition: nic.h:381
uint8_t length
Definition: tcp.h:368