Teonet library
0.4.7
|
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "net_split.h"
#include "utils/rlutil.h"
#include "utils/teo_memory.h"
Macros | |
#define | MODULE _ANSI_BLUE "net_split" _ANSI_NONE |
File: net_split.c Author: Kirill Scherba kiril l@sc herba .ruMore... | |
#define | kev ((ksnetEvMgrClass*)(((ksnCoreClass*)(ks->kco->kc))->ke)) |
#define | create_key(subpacket_num) |
Functions | |
ksnSplitClass * | ksnSplitInit (ksnCommandClass *kco) |
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 create_key | ( | subpacket_num | ) |
Referenced by ksnSplitCombine().
#define kev ((ksnetEvMgrClass*)(((ksnCoreClass*)(ks->kco->kc))->ke)) |
Referenced by ksnSplitCombine(), and ksnSplitPacket().
#define MODULE _ANSI_BLUE "net_split" _ANSI_NONE |
File: net_split.c Author: Kirill Scherba kiril l@sc herba .ru
Created on July 17, 2015, 10:20 AM
Referenced by ksnSplitCombine(), and ksnSplitPacket().
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().