Choco OS  V.0.16.9.0
Join to the chocolate world
oc_netif.h
Go to the documentation of this file.
1 
31 #ifndef SYSTEM_CORE_INC_NET_OC_NETIF_H_
32 #define SYSTEM_CORE_INC_NET_OC_NETIF_H_
33 
34 #include <oc_net.h>
35 #include <oc_driver.h>
36 #include <oc_thread.h>
37 
43 #define _________________________________________TYPES_SECTION______________________________________________________________________________
44 
49 //==========================================================================================================================================
58 //==========================================================================================================================================
59 typedef struct Netif_t * oC_Netif_t;
60 
61 //==========================================================================================================================================
67 //==========================================================================================================================================
69 
70 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
71 
78 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
79 
80 extern oC_Netif_t oC_Netif_New ( oC_Netif_FriendlyName_t FriendlyName, const char * Address, const char * NetMaskAddress , oC_Driver_t Driver , const void * Config );
81 extern bool oC_Netif_Delete ( oC_Netif_t * outNetif );
82 extern bool oC_Netif_IsCorrect ( oC_Netif_t Netif );
83 extern bool oC_Netif_IsConfigured ( oC_Netif_t Netif );
84 extern const char * oC_Netif_GetFriendlyName ( oC_Netif_t Netif );
85 extern oC_Driver_t oC_Netif_GetDriver ( oC_Netif_t Netif );
86 extern oC_ErrorCode_t oC_Netif_Configure ( oC_Netif_t Netif );
87 extern oC_ErrorCode_t oC_Netif_Unconfigure ( oC_Netif_t Netif );
88 extern oC_ErrorCode_t oC_Netif_ReadNetInfo ( oC_Netif_t Netif , oC_Net_Info_t * outInfo );
89 extern oC_ErrorCode_t oC_Netif_SendPacket ( oC_Netif_t Netif , oC_Net_Packet_t * Packet , oC_Time_t Timeout );
90 extern oC_ErrorCode_t oC_Netif_ReceivePacket ( oC_Netif_t Netif , oC_Net_Packet_t * Packet , oC_MemorySize_t PacketSize , oC_Time_t Timeout );
91 extern oC_ErrorCode_t oC_Netif_SetWakeOnLanEvent ( oC_Netif_t Netif , oC_Event_t WolEvent );
92 extern oC_ErrorCode_t oC_Netif_Flush ( oC_Netif_t Netif );
93 extern oC_ErrorCode_t oC_Netif_SetLoopback ( oC_Netif_t Netif , oC_Net_Layer_t Layer , bool Enabled );
94 extern oC_ErrorCode_t oC_Netif_PerformDiagnostics ( oC_Netif_t Netif , oC_Diag_t * outDiags , uint32_t * NumberOfDiags );
95 extern oC_Net_LinkStatus_t oC_Netif_GetLinkStatus ( oC_Netif_t Netif );
96 extern oC_BaudRate_t oC_Netif_GetBaudRate ( oC_Netif_t Netif );
97 extern oC_Net_HardwareType_t oC_Netif_GetHardwareType ( oC_Netif_t Netif );
98 extern oC_ErrorCode_t oC_Netif_ReadHardwareAddress ( oC_Netif_t Netif , oC_Net_HardwareAddress_t * outHardwareAddress );
99 extern 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 );
100 extern oC_ErrorCode_t oC_Netif_SetIpv4Info ( oC_Netif_t Netif , const oC_Net_Ipv4Info_t * Info );
101 extern oC_ErrorCode_t oC_Netif_ReadIpv4Info ( oC_Netif_t Netif , oC_Net_Ipv4Info_t * outInfo );
102 extern oC_ErrorCode_t oC_Netif_SetIpv6Info ( oC_Netif_t Netif , const oC_Net_Ipv6Info_t * Info );
103 extern oC_ErrorCode_t oC_Netif_ReadIpv6Info ( oC_Netif_t Netif , oC_Net_Ipv6Info_t * outInfo );
104 extern bool oC_Netif_IsAddressInSubnet ( oC_Netif_t Netif , const oC_Net_Address_t * Address );
105 extern oC_Net_Ipv4_t oC_Netif_GetIpv4Address ( oC_Netif_t Netif );
106 extern bool oC_Netif_ReadIpv6Address ( oC_Netif_t Netif , oC_Net_Ipv6_t * outAddress );
107 extern oC_ErrorCode_t oC_Netif_UpdateLinkStatus ( oC_Netif_t Netif );
108 extern bool oC_Netif_IsIpAssigned ( oC_Netif_t Netif );
109 extern oC_ErrorCode_t oC_Netif_WaitOnLink ( oC_Netif_t Netif , oC_Time_t Timeout );
110 extern oC_ErrorCode_t oC_Netif_UpdateIp ( oC_Netif_t Netif , oC_Time_t Timeout );
111 extern oC_ErrorCode_t oC_Netif_SetReceiveThread ( oC_Netif_t Netif , oC_Thread_t Thread );
112 extern oC_ErrorCode_t oC_Netif_SetListenMode ( oC_Netif_t Netif , bool Enabled );
113 extern bool oC_Netif_GetListenMode ( oC_Netif_t Netif );
114 extern oC_ErrorCode_t oC_Netif_ReadReceiveThread ( oC_Netif_t Netif , oC_Thread_t * outThread );
115 extern oC_ErrorCode_t oC_Netif_SendAddressProbe ( oC_Netif_t Netif , oC_Time_t Timeout );
116 
117 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
118 
119 
120 #endif /* SYSTEM_CORE_INC_NET_OC_NETIF_H_ */
oC_ErrorCode_t oC_Netif_ReadHardwareAddress(oC_Netif_t Netif, oC_Net_HardwareAddress_t *outHardwareAddress)
reads hardware address of the interface
Definition: oc_netif.c:1105
bool oC_Netif_GetListenMode(oC_Netif_t Netif)
returns true if listen mode is enabled
Definition: oc_netif.c:1696
oC_Driver_t oC_Netif_GetDriver(oC_Netif_t Netif)
returns driver related with the Netif
Definition: oc_netif.c:407
const char * oC_Netif_GetFriendlyName(oC_Netif_t Netif)
returns friendly name of the network interface
Definition: oc_netif.c:383
The file with interface for thread managing.
oC_ErrorCode_t oC_Netif_SendAddressProbe(oC_Netif_t Netif, oC_Time_t Timeout)
sends frame that probes the address
Definition: oc_netif.c:1761
oC_ErrorCode_t oC_Netif_ReadReceiveThread(oC_Netif_t Netif, oC_Thread_t *outThread)
sets thread for receiving packets
Definition: oc_netif.c:1723
stores network interface informations
Definition: oc_net.h:508
oC_ErrorCode_t oC_Netif_PerformDiagnostics(oC_Netif_t Netif, oC_Diag_t *outDiags, uint32_t *NumberOfDiags)
performs diagnostics of the network interface
Definition: oc_netif.c:986
oC_ErrorCode_t oC_Netif_Unconfigure(oC_Netif_t Netif)
unconfigures network driver related with the Netif
Definition: oc_netif.c:477
stores network address
Definition: oc_net.h:441
char oC_Net_FriendlyInterfaceName_t[MAXIMUM_FRIENDLY_INTERFACE_NAME]
type for storing friendly name string
Definition: oc_net.h:393
oC_ErrorCode_t oC_Netif_Flush(oC_Netif_t Netif)
flushes Network interface
Definition: oc_netif.c:836
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
Definition: oc_netif.c:1147
uint32_t oC_Net_Ipv4_t
stores IPv4 address
Definition: oc_net.h:132
bool oC_Netif_IsCorrect(oC_Netif_t Netif)
checks if the Netif object is correct
Definition: oc_netif.c:351
oC_Net_HardwareType_t
stores hardware type of the network interface
Definition: oc_net.h:202
oC_BaudRate_t oC_Netif_GetBaudRate(oC_Netif_t Netif)
returns baud rate of the network interface
Definition: oc_netif.c:1049
The file with interface for driver creating.
oC_ErrorCode_t oC_Netif_UpdateLinkStatus(oC_Netif_t Netif)
updates link status in the network interface object
Definition: oc_netif.c:1477
struct Netif_t * oC_Netif_t
Netif main object.
Definition: oc_netif.h:59
oC_ErrorCode_t oC_Netif_SetLoopback(oC_Netif_t Netif, oC_Net_Layer_t Layer, bool Enabled)
enables or disables loopback
Definition: oc_netif.c:879
oC_Netif_t oC_Netif_New(oC_Netif_FriendlyName_t FriendlyName, const char *Address, const char *NetMaskAddress, oC_Driver_t Driver, const void *Config)
Creates Netif object.
Definition: oc_netif.c:189
oC_ErrorCode_t oC_Netif_SetIpv6Info(oC_Netif_t Netif, const oC_Net_Ipv6Info_t *Info)
sets informations about IPv6
Definition: oc_netif.c:1328
oC_ErrorCode_t oC_Netif_ReadIpv6Info(oC_Netif_t Netif, oC_Net_Ipv6Info_t *outInfo)
reads IPv6 informations
Definition: oc_netif.c:1364
oC_Net_Ipv4_t oC_Netif_GetIpv4Address(oC_Netif_t Netif)
returns address of the network interface
Definition: oc_netif.c:1427
oC_ErrorCode_t oC_Netif_Configure(oC_Netif_t Netif)
configures network driver to work with netif
Definition: oc_netif.c:438
stores network packet
Definition: oc_net.h:302
oC_ErrorCode_t oC_Netif_SetReceiveThread(oC_Netif_t Netif, oC_Thread_t Thread)
sets thread for receiving packets
Definition: oc_netif.c:1634
oC_ErrorCode_t oC_Netif_SetWakeOnLanEvent(oC_Netif_t Netif, oC_Event_t WolEvent)
sets wake on LAN event
Definition: oc_netif.c:796
oC_ErrorCode_t oC_Netif_SetIpv4Info(oC_Netif_t Netif, const oC_Net_Ipv4Info_t *Info)
sets informations about IPv4
Definition: oc_netif.c:1252
bool oC_Netif_Delete(oC_Netif_t *outNetif)
deletes netif object
Definition: oc_netif.c:284
stores hardware address
Definition: oc_net.h:114
oC_ErrorCode_t oC_Netif_ReadNetInfo(oC_Netif_t Netif, oC_Net_Info_t *outInfo)
reads informations about network interface
Definition: oc_netif.c:519
oC_ErrorCode_t oC_Netif_SetListenMode(oC_Netif_t Netif, bool Enabled)
enables listen mode
Definition: oc_netif.c:1674
oC_ErrorCode_t oC_Netif_WaitOnLink(oC_Netif_t Netif, oC_Time_t Timeout)
waits for the link and updates IP
Definition: oc_netif.c:1524
bool oC_Netif_IsAddressInSubnet(oC_Netif_t Netif, const oC_Net_Address_t *Address)
checks if the given address belongs to the given subnet
Definition: oc_netif.c:1393
bool oC_Netif_IsIpAssigned(oC_Netif_t Netif)
returns true if IP is assigned
Definition: oc_netif.c:1491
bool oC_Netif_IsConfigured(oC_Netif_t Netif)
checks if the driver is configured
Definition: oc_netif.c:367
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
Definition: oc_netif.c:697
oC_Net_FriendlyInterfaceName_t oC_Netif_FriendlyName_t
type for storing friendly name string
Definition: oc_netif.h:68
oC_Net_HardwareType_t oC_Netif_GetHardwareType(oC_Netif_t Netif)
returns hardware type of the network interface
Definition: oc_netif.c:1072
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
Definition: oc_netif.c:572
oC_ErrorCode_t oC_Netif_ReadIpv4Info(oC_Netif_t Netif, oC_Net_Ipv4Info_t *outInfo)
reads IPv4 informations
Definition: oc_netif.c:1288
File with interface for the NET module.
oC_Net_LinkStatus_t oC_Netif_GetLinkStatus(oC_Netif_t Netif)
returns last known link status of the network interface
Definition: oc_netif.c:1026
bool oC_Netif_ReadIpv6Address(oC_Netif_t Netif, oC_Net_Ipv6_t *outAddress)
reads IPv6 address of the network interface
Definition: oc_netif.c:1445
stores network interface IPv4 informations
Definition: oc_net.h:469
stores network interface IPv6 informations
Definition: oc_net.h:495
oC_Net_LinkStatus_t
stores network interface link status
Definition: oc_net.h:360
oC_ErrorCode_t oC_Netif_UpdateIp(oC_Netif_t Netif, oC_Time_t Timeout)
updates IP in the given network interface
Definition: oc_netif.c:1583
stores IPv6 address
Definition: oc_net.h:142
oC_Net_Layer_t
stores layer of the OSI model
Definition: oc_net.h:333