Teonet library
0.4.7
|
#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 l@sc herba .ruMore... | |
#define | MAX_PACKET_LEN (5*1024*1024) |
#define | LAST_PACKET_FLAG 0x8000 |
Typedefs | |
typedef struct ksnSplitClass | ksnSplitClass |
KSNet split class data. More... | |
Functions | |
ksnSplitClass * | ksnSplitInit (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... | |
ksnCorePacketData * | ksnSplitCombine (ksnSplitClass *ks, ksnCorePacketData *rd) |
Combine packets to one large packet. More... | |
void | ksnSplitFreeRds (ksnSplitClass *ks, ksnCorePacketData *rd) |
Free ksnCorePacketData created in ksnSplitCombine function. More... | |
#define LAST_PACKET_FLAG 0x8000 |
Referenced by ksnSplitCombine().
#define MAX_DATA_LEN 448 |
File: net_split.h Author: Kirill Scherba kiril l@sc herba .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 struct ksnSplitClass ksnSplitClass |
KSNet split class data.
ksnCorePacketData* ksnSplitCombine | ( | ksnSplitClass * | ks, |
ksnCorePacketData * | rd | ||
) |
Combine packets to one large packet.
ks | Pointer to ksnSplitClass |
rd | Pointer to ksnCorePacketData |
References ksnCorePacketData::addr, ksnCorePacketData::arp, ksnCorePacketData::cmd, create_key, data, ksnCorePacketData::data, ksnCorePacketData::data_len, ksnSplitClass::data_save, DEBUG_VV, ERROR_M, free(), ksnCorePacketData::from, ksnCorePacketData::from_len, kev, ksn_printf, ksn_puts, ksnetEvMgrGetTime(), ksnSplitClass::last_added, LAST_PACKET_FLAG, malloc(), ksnSplitClass::map, MAX_DATA_LEN, MODULE, ksnCorePacketData::mtu, pblMapRemoveFree(), ksnCorePacketData::port, ksnCorePacketData::raw_data, ksnCorePacketData::raw_data_len, teo_calloc(), and teo_realloc().
void ksnSplitDestroy | ( | ksnSplitClass * | ks | ) |
Destroy split module.
ks |
References free(), and ksnSplitClass::map.
Referenced by ksnCommandDestroy().
void ksnSplitFreeRds | ( | ksnSplitClass * | ks, |
ksnCorePacketData * | rd | ||
) |
Free ksnCorePacketData created in ksnSplitCombine function.
ks | |
rd |
References ksnSplitClass::data_save, and free().
ksnSplitClass* ksnSplitInit | ( | ksnCommandClass * | kco | ) |
Initialize split module.
kco |
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.
ks | |
cmd | |
packet | |
packet_len | |
num_subpackets |
References DEBUG_VV, kev, ksn_printf, malloc(), MAX_DATA_LEN, MODULE, and ksnSplitClass::packet_number.
Referenced by ksnCoreSendto().