nic.c File Reference

Network interface controller abstraction layer. More...

#include "core/net.h"
#include "core/nic.h"
#include "core/socket.h"
#include "core/raw_socket.h"
#include "core/tcp_misc.h"
#include "core/udp.h"
#include "ipv4/ipv4.h"
#include "ipv6/ipv6.h"
#include "dns/dns_cache.h"
#include "dns/dns_client.h"
#include "mdns/mdns_client.h"
#include "mdns/mdns_responder.h"
#include "dns_sd/dns_sd.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   NIC_TRACE_LEVEL
 

Functions

NetInterfacenicGetLogicalInterface (NetInterface *interface)
 Retrieve logical interface. More...
 
NetInterfacenicGetPhysicalInterface (NetInterface *interface)
 Retrieve physical interface. More...
 
void nicTick (NetInterface *interface)
 Network controller timer handler. More...
 
error_t nicSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet to the network controller. More...
 
error_t nicUpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void nicProcessPacket (NetInterface *interface, void *packet, size_t length)
 Handle a packet received by the network controller. More...
 
void nicNotifyLinkChange (NetInterface *interface)
 Process link state change event. More...
 

Variables

systime_t nicTickCounter
 

Detailed Description

Network interface controller abstraction layer.

License

Copyright (C) 2010-2018 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file nic.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 30 of file nic.c.

Function Documentation

◆ nicGetLogicalInterface()

NetInterface* nicGetLogicalInterface ( NetInterface interface)

Retrieve logical interface.

Parameters
[in]interfacePointer to the network interface
Returns
Pointer to the physical interface

Definition at line 60 of file nic.c.

◆ nicGetPhysicalInterface()

NetInterface* nicGetPhysicalInterface ( NetInterface interface)

Retrieve physical interface.

Parameters
[in]interfacePointer to the network interface
Returns
Pointer to the physical interface

Definition at line 85 of file nic.c.

◆ nicNotifyLinkChange()

void nicNotifyLinkChange ( NetInterface interface)

Process link state change event.

Parameters
[in]interfaceUnderlying network interface

Definition at line 298 of file nic.c.

◆ nicProcessPacket()

void nicProcessPacket ( NetInterface interface,
void *  packet,
size_t  length 
)

Handle a packet received by the network controller.

Parameters
[in]interfaceUnderlying network interface
[in]packetIncoming packet to process
[in]lengthTotal packet length

Definition at line 239 of file nic.c.

◆ nicSendPacket()

error_t nicSendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset 
)

Send a packet to the network controller.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
Returns
Error code

Definition at line 148 of file nic.c.

◆ nicTick()

void nicTick ( NetInterface interface)

Network controller timer handler.

This routine is periodically called by the TCP/IP stack to handle periodic operations such as polling the link state

Parameters
[in]interfaceUnderlying network interface

Definition at line 122 of file nic.c.

◆ nicUpdateMacAddrFilter()

error_t nicUpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 204 of file nic.c.

Variable Documentation

◆ nicTickCounter

systime_t nicTickCounter

Definition at line 51 of file nic.c.