Choco OS  V.0.16.9.0
Join to the chocolate world
oc_udp.h File Reference

Stores UDP interface. More...

#include <oc_net.h>
#include <oc_netif.h>
#include <limits.h>
#include <oc_process.h>

Go to the source code of this file.

Data Structures

struct  PACKED
 stores IPv6 address More...
 
struct  PACKED
 stores IPv6 address More...
 
struct  PACKED
 stores IPv6 address More...
 
union  oC_Udp_Packet_t
 stores UDP packet More...
 

Typedefs

typedef struct PACKED oC_Udp_Header_t
 stores UDP header
 
typedef union PACKED oC_Udp_PseudoHeader_t
 pseudo UDP header required only for checksum calculation
 
typedef struct PACKED oC_Udp_Datagram_t
 stores UDP datagram
 
typedef struct Udp_t * oC_Udp_t
 stores information about UDP state More...
 

Enumerations

Functions

oC_ErrorCode_t oC_Udp_TurnOn (void)
 turns on UDP module More...
 
oC_ErrorCode_t oC_Udp_TurnOff (void)
 turns off UDP module More...
 
bool oC_Udp_IsPortReserved (oC_Udp_Port_t Port, oC_Process_t Process)
 checks if the given UDP port is reserved More...
 
oC_ErrorCode_t oC_Udp_ReservePort (oC_Udp_Port_t *Port, oC_Time_t Timeout)
 reserves a UDP port More...
 
oC_ErrorCode_t oC_Udp_ReleasePort (oC_Udp_Port_t Port, oC_Time_t Timeout)
 releases a port More...
 
oC_ErrorCode_t oC_Udp_ReleaseAllPortsReservedBy (oC_Process_t Process, oC_Time_t Timeout)
 releases all ports reserved by the process More...
 
uint16_t oC_Udp_Packet_GetMaximumDataSize (oC_Net_PacketType_t Type)
 returns maximum size of the data for UDP packet
 
oC_Udp_Packet_toC_Udp_Packet_New (Allocator_t PacketAllocator, oC_Net_PacketType_t Type, const void *Data, uint16_t Size)
 allocates memory for a UDP packet More...
 
bool oC_Udp_Packet_Delete (oC_Udp_Packet_t **Packet)
 release memory allocated for a UDP packet
 
uint16_t oC_Udp_Packet_GetDataSize (const oC_Udp_Packet_t *Packet)
 returns size of the data inside UDP packet
 
bool oC_Udp_Packet_SetData (oC_Udp_Packet_t *Packet, const void *Data, uint16_t Size)
 sets data inside UDP packet
 
oC_ErrorCode_t oC_Udp_Packet_ReadData (const oC_Udp_Packet_t *Packet, void *outData, uint16_t Size)
 reads data of the UDP packet
 
void * oC_Udp_Packet_GetDataReference (oC_Udp_Packet_t *Packet)
 returns reference to the data inside UDP packet
 
oC_ErrorCode_t oC_Udp_Send (oC_Netif_t Netif, oC_Udp_Port_t LocalPort, const oC_Net_Address_t *Destination, oC_Udp_Packet_t *Packet, oC_Time_t Timeout)
 sends UDP packet More...
 
oC_ErrorCode_t oC_Udp_Receive (oC_Netif_t Netif, oC_Udp_Port_t LocalPort, oC_Udp_Packet_t *Packet, oC_Time_t Timeout)
 receives UDP packet More...
 
oC_ErrorCode_t oC_Udp_CalculateChecksum (oC_Udp_Packet_t *Packet, bool *outChecksumCorrect, uint16_t *outExpectedChecksum)
 Calculates checksum for UDP packet. More...
 

Detailed Description


Author
Patryk Kubiak
Note
Copyright (C) 2016 Patryk Kubiak patry.nosp@m.k.ku.nosp@m.biak9.nosp@m.0@gm.nosp@m.ail.c.nosp@m.om

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 St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file oc_udp.h.