Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
net_split.h File Reference
#include "ev_mgr.h"

Go to the source code of this file.

Data Structures

struct  ksnSplitClass
 KSNet split class data. More...
 

Macros

#define MAX_DATA_LEN   448
 File: net_split.h Author: Kirill Scherba kiril.nosp@m.l@sc.nosp@m.herba.nosp@m..ru More...
 
#define MAX_PACKET_LEN   (5*1024*1024)
 
#define LAST_PACKET_FLAG   0x8000
 

Typedefs

typedef struct ksnSplitClass ksnSplitClass
 KSNet split class data. More...
 

Functions

ksnSplitClassksnSplitInit (ksnCommandClass *kc)
 Initialize split module. More...
 
void ksnSplitDestroy (ksnSplitClass *ks)
 Destroy split module. More...
 
void ** ksnSplitPacket (ksnSplitClass *ks, uint8_t cmd, void *packet, size_t packet_len, int *num_subpackets)
 Split large packet to array of small. More...
 
ksnCorePacketDataksnSplitCombine (ksnSplitClass *ks, ksnCorePacketData *rd)
 Combine packets to one large packet. More...
 
void ksnSplitFreeRds (ksnSplitClass *ks, ksnCorePacketData *rd)
 Free ksnCorePacketData created in ksnSplitCombine function. More...
 

Macro Definition Documentation

#define LAST_PACKET_FLAG   0x8000

Referenced by ksnSplitCombine().

#define MAX_DATA_LEN   448

File: net_split.h Author: Kirill Scherba kiril.nosp@m.l@sc.nosp@m.herba.nosp@m..ru

Created on July 17, 2015, 10:20 AM

Module to split large packets when send and combine it when receive.

Referenced by ksnCoreSendto(), ksnSplitCombine(), and ksnSplitPacket().

#define MAX_PACKET_LEN   (5*1024*1024)

Referenced by ksnCoreSendto().

Typedef Documentation

typedef struct ksnSplitClass ksnSplitClass

KSNet split class data.

Function Documentation

void ksnSplitDestroy ( ksnSplitClass ks)

Destroy split module.

Parameters
ks

References free(), and ksnSplitClass::map.

Referenced by ksnCommandDestroy().

void ksnSplitFreeRds ( ksnSplitClass ks,
ksnCorePacketData rd 
)

Free ksnCorePacketData created in ksnSplitCombine function.

Parameters
ks
rd

References ksnSplitClass::data_save, and free().

ksnSplitClass* ksnSplitInit ( ksnCommandClass kco)

Initialize split module.

Parameters
kco
Returns

References ksnSplitClass::kco, ksnSplitClass::last_added, ksnSplitClass::map, ksnSplitClass::packet_number, and teo_malloc().

Referenced by ksnCommandInit().

void** ksnSplitPacket ( ksnSplitClass ks,
uint8_t  cmd,
void *  packet,
size_t  packet_len,
int *  num_subpackets 
)

Split large packet to array of small.

Parameters
ks
cmd
packet
packet_len
num_subpackets
Returns

References DEBUG_VV, kev, ksn_printf, malloc(), MAX_DATA_LEN, MODULE, and ksnSplitClass::packet_number.

Referenced by ksnCoreSendto().