Choco OS  V.0.16.9.0
Join to the chocolate world
oc_netifman.h
Go to the documentation of this file.
1 
31 #ifndef SYSTEM_CORE_INC_NET_OC_NETIFMAN_H_
32 #define SYSTEM_CORE_INC_NET_OC_NETIFMAN_H_
33 
34 #include <oc_netif.h>
35 
41 #define _________________________________________TYPES_SECTION______________________________________________________________________________
42 
43 //==========================================================================================================================================
55 //==========================================================================================================================================
56 typedef struct
57 {
63 
64 //==========================================================================================================================================
77 //==========================================================================================================================================
78 typedef bool (*oC_NetifMan_PacketFilterFunction_t)( oC_Net_Packet_t * ReceivedPacket , const void * Parameter , oC_Netif_t Netif );
79 
80 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
81 
87 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
88 
89 extern oC_ErrorCode_t oC_NetifMan_TurnOn ( void );
90 extern oC_ErrorCode_t oC_NetifMan_TurnOff ( void );
91 extern void oC_NetifMan_ConfigureAll ( void );
92 extern void oC_NetifMan_UnconfigureAll ( void );
94 extern oC_Netif_t oC_NetifMan_GetNetifForAddress ( const oC_Net_Address_t * Destination );
95 extern oC_ErrorCode_t oC_NetifMan_AddNetifToList ( oC_Netif_t Netif );
96 extern oC_ErrorCode_t oC_NetifMan_RemoveNetifFromList ( oC_Netif_t Netif );
97 extern oC_ErrorCode_t oC_NetifMan_AddRoutingTableEntry ( const oC_Net_Address_t * Destination, const oC_Net_Address_t * Netmask, oC_Net_Cost_t Cost , oC_Netif_t Netif );
98 extern oC_ErrorCode_t oC_NetifMan_RemoveRoutingTableEntry( const oC_Net_Address_t * Destination, const oC_Net_Address_t * Netmask, oC_Netif_t Netif );
99 extern oC_List(oC_Netif_t) oC_NetifMan_GetList ( void );
100 extern oC_ErrorCode_t oC_NetifMan_SendPacket ( const oC_Net_Address_t * Address , oC_Net_Packet_t * Packet , oC_Time_t Timeout , oC_Netif_t * outNetif );
101 extern oC_ErrorCode_t oC_NetifMan_ReceivePacket ( const oC_Net_Address_t * Address , oC_Net_Packet_t * outPacket , oC_Time_t Timeout , oC_Netif_t * outNetif , oC_NetifMan_PacketFilterFunction_t FilterFunction , const void * Parameter);
102 extern void oC_NetifMan_UpdateRoutingTable ( void );
103 extern oC_ErrorCode_t oC_NetifMan_StartDaemon ( void );
104 
105 
106 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
107 
108 
109 #endif /* SYSTEM_CORE_INC_NET_OC_NETIFMAN_H_ */
oC_ErrorCode_t oC_NetifMan_RemoveNetifFromList(oC_Netif_t Netif)
removes a Netif object from the list
Definition: oc_netifman.c:500
oC_Netif_t oC_NetifMan_GetNetif(oC_Netif_FriendlyName_t FriendlyName)
returns #Netif with the given name
Definition: oc_netifman.c:386
oC_Net_Address_t DestinationAddress
Destination address of the packet.
Definition: oc_netifman.h:58
oC_ErrorCode_t oC_NetifMan_StartDaemon(void)
starts the NetifMan daemon
Definition: oc_netifman.c:905
void oC_NetifMan_ConfigureAll(void)
configures all network interface
Definition: oc_netifman.c:335
oC_ErrorCode_t oC_NetifMan_ReceivePacket(const oC_Net_Address_t *Address, oC_Net_Packet_t *outPacket, oC_Time_t Timeout, oC_Netif_t *outNetif, oC_NetifMan_PacketFilterFunction_t FilterFunction, const void *Parameter)
receives packet from the network
Definition: oc_netifman.c:763
stores network address
Definition: oc_net.h:441
Contains interface for netif object.
oC_ErrorCode_t oC_NetifMan_RemoveRoutingTableEntry(const oC_Net_Address_t *Destination, const oC_Net_Address_t *Netmask, oC_Netif_t Netif)
removes entry from the Routing Table
Definition: oc_netifman.c:610
uint32_t oC_Net_Cost_t
stores cost of the network connection
Definition: oc_net.h:459
stores network packet
Definition: oc_net.h:302
oC_List(oC_Netif_t) oC_NetifMan_GetList(void)
returns list of network interfaces
Definition: oc_netifman.c:660
oC_Netif_t Netif
Netif interface to use.
Definition: oc_netifman.h:61
stores entry of the routing table
Definition: oc_netifman.h:56
bool(* oC_NetifMan_PacketFilterFunction_t)(oC_Net_Packet_t *ReceivedPacket, const void *Parameter, oC_Netif_t Netif)
stores pointer to the function to filter packets
Definition: oc_netifman.h:78
oC_Net_Address_t Netmask
Subnetwork mask.
Definition: oc_netifman.h:59
oC_ErrorCode_t oC_NetifMan_TurnOff(void)
releases module resources
Definition: oc_netifman.c:279
void oC_NetifMan_UnconfigureAll(void)
unconfigures all network interface
Definition: oc_netifman.c:358
oC_Netif_t oC_NetifMan_GetNetifForAddress(const oC_Net_Address_t *Destination)
returns network interface according to destination address
Definition: oc_netifman.c:415
oC_ErrorCode_t oC_NetifMan_AddNetifToList(oC_Netif_t Netif)
adds new netif to the list
Definition: oc_netifman.c:454
oC_ErrorCode_t oC_NetifMan_AddRoutingTableEntry(const oC_Net_Address_t *Destination, const oC_Net_Address_t *Netmask, oC_Net_Cost_t Cost, oC_Netif_t Netif)
adds an entry to the routing table
Definition: oc_netifman.c:547
void oC_NetifMan_UpdateRoutingTable(void)
updates active routing table
Definition: oc_netifman.c:834
oC_Net_FriendlyInterfaceName_t oC_Netif_FriendlyName_t
type for storing friendly name string
Definition: oc_netif.h:68
oC_ErrorCode_t oC_NetifMan_SendPacket(const oC_Net_Address_t *Address, oC_Net_Packet_t *Packet, oC_Time_t Timeout, oC_Netif_t *outNetif)
sends packet via active network interface
Definition: oc_netifman.c:689
oC_Net_Cost_t Cost
Cost of interface usage (it is to allow choosing one interface more frequently than another) ...
Definition: oc_netifman.h:60