Choco OS  V.0.16.9.0
Join to the chocolate world
Netif - Network Interface object

stores informations about the network interface More...

Typedefs

typedef struct Netif_toC_Netif_t
 Netif main object. More...
 
typedef oC_Net_FriendlyInterfaceName_t oC_Netif_FriendlyName_t
 type for storing friendly name string More...
 

Functions

oC_Netif_t oC_Netif_New (oC_Netif_FriendlyName_t FriendlyName, const char *AddressString, const char *NetMaskAddressString, oC_Driver_t Driver, const void *Config)
 Creates Netif object. More...
 
bool oC_Netif_Delete (oC_Netif_t *outNetif)
 deletes netif object More...
 
bool oC_Netif_IsCorrect (oC_Netif_t Netif)
 checks if the Netif object is correct More...
 
bool oC_Netif_IsConfigured (oC_Netif_t Netif)
 checks if the driver is configured More...
 
const char * oC_Netif_GetFriendlyName (oC_Netif_t Netif)
 returns friendly name of the network interface More...
 
oC_Driver_t oC_Netif_GetDriver (oC_Netif_t Netif)
 returns driver related with the Netif More...
 
oC_ErrorCode_t oC_Netif_Configure (oC_Netif_t Netif)
 configures network driver to work with netif More...
 
oC_ErrorCode_t oC_Netif_Unconfigure (oC_Netif_t Netif)
 unconfigures network driver related with the Netif More...
 
oC_ErrorCode_t oC_Netif_ReadNetInfo (oC_Netif_t Netif, oC_Net_Info_t *outInfo)
 reads informations about network interface More...
 
oC_ErrorCode_t oC_Netif_SendPacket (oC_Netif_t Netif, oC_Net_Packet_t *Packet, oC_Time_t Timeout)
 sends packet by using the network interface More...
 
oC_ErrorCode_t oC_Netif_ReceivePacket (oC_Netif_t Netif, oC_Net_Packet_t *Packet, oC_MemorySize_t PacketSize, oC_Time_t Timeout)
 receives packet by using the interface More...
 
oC_ErrorCode_t oC_Netif_SetWakeOnLanEvent (oC_Netif_t Netif, oC_Event_t WolEvent)
 sets wake on LAN event More...
 
oC_ErrorCode_t oC_Netif_Flush (oC_Netif_t Netif)
 flushes Network interface More...
 
oC_ErrorCode_t oC_Netif_SetLoopback (oC_Netif_t Netif, oC_Net_Layer_t Layer, bool Enabled)
 enables or disables loopback More...
 
oC_ErrorCode_t oC_Netif_PerformDiagnostics (oC_Netif_t Netif, oC_Diag_t *outDiags, uint32_t *NumberOfDiags)
 performs diagnostics of the network interface More...
 
oC_Net_LinkStatus_t oC_Netif_GetLinkStatus (oC_Netif_t Netif)
 returns last known link status of the network interface More...
 
oC_BaudRate_t oC_Netif_GetBaudRate (oC_Netif_t Netif)
 returns baud rate of the network interface More...
 
oC_Net_HardwareType_t oC_Netif_GetHardwareType (oC_Netif_t Netif)
 returns hardware type of the network interface More...
 
oC_ErrorCode_t oC_Netif_ReadHardwareAddress (oC_Netif_t Netif, oC_Net_HardwareAddress_t *outHardwareAddress)
 reads hardware address of the interface More...
 
oC_ErrorCode_t oC_Netif_ReadHardwareAddressOf (oC_Netif_t Netif, oC_Net_HardwareAddress_t *outHardwareAddress, const oC_Net_Address_t *Address, oC_Time_t Timeout)
 reads hardware address of the given IP address in LAN More...
 
oC_ErrorCode_t oC_Netif_SetIpv4Info (oC_Netif_t Netif, const oC_Net_Ipv4Info_t *Info)
 sets informations about IPv4 More...
 
oC_ErrorCode_t oC_Netif_ReadIpv4Info (oC_Netif_t Netif, oC_Net_Ipv4Info_t *outInfo)
 reads IPv4 informations More...
 
oC_ErrorCode_t oC_Netif_SetIpv6Info (oC_Netif_t Netif, const oC_Net_Ipv6Info_t *Info)
 sets informations about IPv6 More...
 
oC_ErrorCode_t oC_Netif_ReadIpv6Info (oC_Netif_t Netif, oC_Net_Ipv6Info_t *outInfo)
 reads IPv6 informations More...
 
bool oC_Netif_IsAddressInSubnet (oC_Netif_t Netif, const oC_Net_Address_t *Address)
 checks if the given address belongs to the given subnet More...
 
oC_Net_Ipv4_t oC_Netif_GetIpv4Address (oC_Netif_t Netif)
 returns address of the network interface
 
bool oC_Netif_ReadIpv6Address (oC_Netif_t Netif, oC_Net_Ipv6_t *outAddress)
 reads IPv6 address of the network interface
 
oC_ErrorCode_t oC_Netif_UpdateLinkStatus (oC_Netif_t Netif)
 updates link status in the network interface object More...
 
bool oC_Netif_IsIpAssigned (oC_Netif_t Netif)
 returns true if IP is assigned
 
oC_ErrorCode_t oC_Netif_WaitOnLink (oC_Netif_t Netif, oC_Time_t Timeout)
 waits for the link and updates IP More...
 
oC_ErrorCode_t oC_Netif_UpdateIp (oC_Netif_t Netif, oC_Time_t Timeout)
 updates IP in the given network interface More...
 
oC_ErrorCode_t oC_Netif_SetReceiveThread (oC_Netif_t Netif, oC_Thread_t Thread)
 sets thread for receiving packets More...
 
oC_ErrorCode_t oC_Netif_SetListenMode (oC_Netif_t Netif, bool Enabled)
 enables listen mode More...
 
bool oC_Netif_GetListenMode (oC_Netif_t Netif)
 returns true if listen mode is enabled
 
oC_ErrorCode_t oC_Netif_ReadReceiveThread (oC_Netif_t Netif, oC_Thread_t *outThread)
 sets thread for receiving packets More...
 
oC_ErrorCode_t oC_Netif_SendAddressProbe (oC_Netif_t Netif, oC_Time_t Timeout)
 sends frame that probes the address More...
 

Detailed Description

Typedef Documentation

The type is for storing friendly name string of the network interface (the string that is easy to understand and remember for human).

Definition at line 68 of file oc_netif.h.

typedef struct Netif_t* oC_Netif_t

The type is for storing Netif object. All data inside are private, you can only use it for identify the instance for Netif functions. The object cannot be copied.

Please use oC_Netif_New function to create the object and oC_Netif_Delete to destroy it.

Definition at line 59 of file oc_netif.h.

Function Documentation

oC_ErrorCode_t oC_Netif_Configure ( oC_Netif_t  Netif)

The function is for configuration of the network driver related with the network interface by using configuration structure given to the oC_Netif_New function.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_AlreadyConfigured Network interface was configured before

Definition at line 438 of file oc_netif.c.

bool oC_Netif_Delete ( oC_Netif_t outNetif)

The function is for deleting the Netif object. It release all memory and unconfigures the related driver if it is possible.

Parameters
outNetifNetif object from the oC_Netif_New function
Returns
true if success (check system errors stack for more info)

Definition at line 284 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_Flush ( oC_Netif_t  Netif)

When this function is called, the transmit FIFO controller logic is reset to its default values and thus all data in the Tx FIFO are lost/flushed.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif or WolEvent is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 836 of file oc_netif.c.

oC_BaudRate_t oC_Netif_GetBaudRate ( oC_Netif_t  Netif)

The function returns baud rate of the network interface.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
Baud rate of the network interface or 0 in case of error

Definition at line 1049 of file oc_netif.c.

oC_Driver_t oC_Netif_GetDriver ( oC_Netif_t  Netif)

The function returns the network driver related with the Netif object or NULL in case of error.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
driver related with the Netif or NULL in case of error

Definition at line 407 of file oc_netif.c.

const char* oC_Netif_GetFriendlyName ( oC_Netif_t  Netif)

The function is to read friendly name of the network interface

Parameters
NetifNetif object from the oC_Netif_New function
Returns
string with the name of the network interface

Definition at line 383 of file oc_netif.c.

oC_Net_HardwareType_t oC_Netif_GetHardwareType ( oC_Netif_t  Netif)

The function returns hardware type of the network interface

Parameters
NetifNetif object from the oC_Netif_New function
Returns
hardware type of the interface

Definition at line 1072 of file oc_netif.c.

oC_Net_LinkStatus_t oC_Netif_GetLinkStatus ( oC_Netif_t  Netif)

The function returns link status of the network interface.

Warning
The function does not check the current link status - it only returns last KNOWN link status. It is updated periodically by the system. To update the link status, call oC_Netif_UpdateLinkStatus function. If you want to be sure, that your link status is up-to-date, you should call oC_Netif_ReadNetInfo function.
Note
If the netif loopback mode is enabled, the function will always return oC_Net_LinkStatus_Down
Parameters
NetifNetif object from the oC_Netif_New function
Returns
last known link status or oC_Net_LinkStatus_Down in case of error

Definition at line 1026 of file oc_netif.c.

bool oC_Netif_IsAddressInSubnet ( oC_Netif_t  Netif,
const oC_Net_Address_t Address 
)

The function checks if the given address belongs to the network interface subnet.

Parameters
NetifNetif object from the oC_Netif_New function
AddressPointer to the network address to check (IPv4 or IPv6)
Returns
true if the address is correct, and it belongs to the network

Definition at line 1393 of file oc_netif.c.

bool oC_Netif_IsConfigured ( oC_Netif_t  Netif)

The function is for checking if a driver related with the object was configured before by function oC_Netif_Configure

Parameters
NetifNetif object from the oC_Netif_New function
Returns
true if object is correct and configured

Definition at line 367 of file oc_netif.c.

bool oC_Netif_IsCorrect ( oC_Netif_t  Netif)

The function is for checking if the #Netif object is correct

Parameters
NetifNetif object from the oC_Netif_New function
Returns
true if object is correct

Definition at line 351 of file oc_netif.c.

oC_Netif_t oC_Netif_New ( oC_Netif_FriendlyName_t  FriendlyName,
const char *  AddressString,
const char *  NetMaskAddressString,
oC_Driver_t  Driver,
const void *  Config 
)

The function is for creating new #Netif object. It allocates memory and initializes variables to work. The function does not configure the related network driver, to do it, you have to call oC_Netif_Configure function.

Parameters
FriendlyNameString with friendly name
AddressString with IPv4 or IPv6 address of the network interface or NULL if DHCP should be used
NetMaskAddressString with IPv4 or IPv6 address of the network mask or NULL if DHCP should be used
DriverNetwork driver to use for the #Netif object
ConfigPointer to the configuration of the network driver
Returns
Netif object or NULL in case of failure (check system errors stack for more info)

Definition at line 189 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_PerformDiagnostics ( oC_Netif_t  Netif,
oC_Diag_t outDiags,
uint32_t *  NumberOfDiags 
)

The function is for performing diagnostics on the selected network interface. The feature has to be handled by the related network driver.

Note
You can set the outDiags field to NULL and NumberOfDiags to 0, if you want to know count of diagnostics supported by the driver.
Parameters
NetifNetif object from the oC_Netif_New function
outDiagsPointer to the allocated array for diagnostics, or NULL if only number of diagnostics is required
NumberOfDiagsAs input - size of the outDiags array. As output - number of performed diagnostics or diagnostics, that can be performed (if the outDiags is NULL)

Example:

oC_Diag_t * diags = NULL;
uint32_t numberOfDiags = 0;
// Reading number of supported diags
oC_Netif_PerformDiagnostics( netif, NULL, &numberOfDiags );
diags = malloc( sizeof(oC_Diag_t) * numberOfDiags , 0 );
oC_Netif_PerformDiagnostics( netif, diags, &numberOfDiags );
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_OutputAddressNotInRAM NumberOfDiags address does not point to the RAM section
oC_ErrorCode_NotHandledByDriver The associated network driver does not handle diagnostics

Definition at line 986 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadHardwareAddress ( oC_Netif_t  Netif,
oC_Net_HardwareAddress_t outHardwareAddress 
)

The function reads hardware address of the network interface

Parameters
NetifNetif object from the oC_Netif_New function
outHardwareAddressDestination for the hardware address
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_OutputAddressNotInRAM outHardwareAddress address does not point to the RAM section

Definition at line 1105 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadHardwareAddressOf ( oC_Netif_t  Netif,
oC_Net_HardwareAddress_t outHardwareAddress,
const oC_Net_Address_t Address,
oC_Time_t  Timeout 
)

The function is for reading hardware address of the machine with the given IP address. It uses ARP protocol to receive it from the Local Area Network (LAN).

Warning
When the given IP address is not in the LAN, the function will return only hardware address of the local router.
Parameters
NetifNetif object from the oC_Netif_New function
outHardwareAddressDestination for the hardware address
AddressIP address to find
TimeoutMaximum time for operation
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_OutputAddressNotInRAM outHardwareAddress address does not point to the RAM section

Definition at line 1147 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadIpv4Info ( oC_Netif_t  Netif,
oC_Net_Ipv4Info_t outInfo 
)

The function reads IPv4 informations from the given network interface.

Parameters
NetifNetif object from the oC_Netif_New function
outInfoDestination for the IPv4 informations
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_OutputAddressNotInRAM The outInfo pointer is not storred in the RAM section

Definition at line 1288 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadIpv6Info ( oC_Netif_t  Netif,
oC_Net_Ipv6Info_t outInfo 
)

The function reads IPv6 informations from the given network interface.

Parameters
NetifNetif object from the oC_Netif_New function
outInfoDestination for the IPv4 informations
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_OutputAddressNotInRAM The outInfo pointer is not storred in the RAM section

Definition at line 1364 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadNetInfo ( oC_Netif_t  Netif,
oC_Net_Info_t outInfo 
)

The function is for read informations about the network interface. The network driver related with this object has to be configured before by using the function oC_Netif_Configure.

Note
The function also updates the link status for future use
Parameters
NetifNetif object from the oC_Netif_New function
outInfoDestination address for the network interface informations
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_OutputAddressNotInRAM outInfo pointer is not valid RAM pointer

Definition at line 519 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReadReceiveThread ( oC_Netif_t  Netif,
oC_Thread_t outThread 
)

The function reads the thread for receiving packet of the Netif.

Parameters
NetifNetif object from the oC_Netif_New function
ThreadThread object to set
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_ThreadNotSet Receive thread has not been set yet
oC_ErrorCode_OutputAddressNotInRAM outThread does not point to the RAM section

Definition at line 1723 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_ReceivePacket ( oC_Netif_t  Netif,
oC_Net_Packet_t Packet,
oC_MemorySize_t  PacketSize,
oC_Time_t  Timeout 
)

The function receives packet from the network by using the network interface. The interface has to be configured by the function oC_Netif_Configure before.

Parameters
NetifNetif object from the oC_Netif_New function
outPacketDestination pointer for the packet to receive. It will points to the memory allocated by using the PacketAllocator and it should be released by #kfree when it is not needed anymore
PacketSizeSize of the packet buffer
TimeoutMaximum time to wait for the packet
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_OutputAddressNotInRAM Packet address does not point to the RAM section
oC_ErrorCode_SizeNotCorrect PacketSize is too small

Definition at line 697 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SendAddressProbe ( oC_Netif_t  Netif,
oC_Time_t  Timeout 
)

The function sends address probe packet - the special packet that confirms the selected IP address and that prevents address conflicts

Parameters
NetifNetif object from the oC_Netif_New function
TimeoutMaximum time to wait for the packet sending
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_TimeNotCorrect Time is lower than 0

Definition at line 1761 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SendPacket ( oC_Netif_t  Netif,
oC_Net_Packet_t Packet,
oC_Time_t  Timeout 
)

Allows for sending a packet to the network location by using the interface. The interface has to be configured by calling the function oC_Netif_Configure before.

Parameters
NetifNetif object from the oC_Netif_New function
PacketPacket to send
TimeoutMaximum time to wait for the packet sending
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_WrongAddress Packet address is not correct

Definition at line 572 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetIpv4Info ( oC_Netif_t  Netif,
const oC_Net_Ipv4Info_t Info 
)

The function sets informations about the IPv4.

Warning
It does not check if the data is correct - only pointer is validated.
Parameters
NetifNetif object from the oC_Netif_New function
InfoPointer to the IPv4 info structure
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_WrongAddress The Info pointer is not correct

Definition at line 1252 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetIpv6Info ( oC_Netif_t  Netif,
const oC_Net_Ipv6Info_t Info 
)

The function sets informations about the IPv6.

Warning
It does not check if the data is correct - only pointer is validated.
Parameters
NetifNetif object from the oC_Netif_New function
InfoPointer to the IPv4 info structure
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_WrongAddress The Info pointer is not correct

Definition at line 1328 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetListenMode ( oC_Netif_t  Netif,
bool  Enabled 
)

In listen mode packets are not followed to the upper layer. Thanks to that it is possible to listen all packets send to the netif. Only root user can call this function.

Parameters
NetifNetif object from the oC_Netif_New function
Enabledtrue if enabled, false if disabled
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_PermissionDenied You are not root user

Definition at line 1674 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetLoopback ( oC_Netif_t  Netif,
oC_Net_Layer_t  Layer,
bool  Enabled 
)

The function enables or disables loopback mode at the given network layer.

If the Layer is set to the oC_Net_Layer_Netif, the loopback will be set in this object. Note, that this will be only software loopback, and the performance of it can be very low.

Parameters
NetifNetif object from the oC_Netif_New function
LayerTarget layer for the loopback
Enabledtrue if loopback should be enabled
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif or WolEvent is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 879 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetReceiveThread ( oC_Netif_t  Netif,
oC_Thread_t  Thread 
)

The function sets the thread for receiving packet of the Netif.

Parameters
NetifNetif object from the oC_Netif_New function
ThreadThread object to set
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_ThreadNotCorrect Thread is not correct

Definition at line 1634 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_SetWakeOnLanEvent ( oC_Netif_t  Netif,
oC_Event_t  WolEvent 
)

The function sets the "Wake on LAN" event. This the event, that should be activated when some packet will be available to receive during sleep mode.

Parameters
NetifNetif object from the oC_Netif_New function
WolEventWake on LAN event
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif or WolEvent is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 796 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_Unconfigure ( oC_Netif_t  Netif)

The function unconfigures the network driver related with the network interface.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 477 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_UpdateIp ( oC_Netif_t  Netif,
oC_Time_t  Timeout 
)

The function is for updating IP of the given network interface.

Warning
The network interface has to be connected to the network!
Parameters
NetifNetif object from the oC_Netif_New function
TimeoutMaximum time for the operation
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before
oC_ErrorCode_LinkNotDetected The given network interface has not link up status

Definition at line 1583 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_UpdateLinkStatus ( oC_Netif_t  Netif)

The function is for updating link status of the network interface for the function oC_Netif_GetLinkStatus. It reads current link status from the driver and saves it for later.

Parameters
NetifNetif object from the oC_Netif_New function
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 1477 of file oc_netif.c.

oC_ErrorCode_t oC_Netif_WaitOnLink ( oC_Netif_t  Netif,
oC_Time_t  Timeout 
)

The function waits for the link (oC_Net_LinkStatus_Up), and updates IP address if it is needed

Parameters
NetifNetif object from the oC_Netif_New function
TimeoutMaximum time to wait on the link
Returns
code of error or oC_ErrorCode_None if success

List of standard error codes, that can be returned by the function:

Code of error Description
oC_ErrorCode_ObjectNotCorrect Netif is not correct (address is not correct or not valid anymore)
oC_ErrorCode_NotConfiguredYet The configuration function was not called before

Definition at line 1524 of file oc_netif.c.