Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
net_split.h
Go to the documentation of this file.
1 
11 #ifndef NET_SPLIT_H
12 #define NET_SPLIT_H
13 
14 #include "ev_mgr.h"
15 
16 #define MAX_DATA_LEN 448
17 #define MAX_PACKET_LEN (5*1024*1024)
18 #define LAST_PACKET_FLAG 0x8000
19 
23 typedef struct ksnSplitClass {
24 
26  PblMap* map;
27  uint16_t packet_number;
28  double last_added;
29  void *data_save;
30 
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
40 
41 void **ksnSplitPacket(ksnSplitClass *ks, uint8_t cmd, void *packet, size_t packet_len, int *num_subpackets);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* NET_SPLIT_H */
KSNet split class data.
Definition: net_split.h:23
void * data_save
Allocated data pointer.
Definition: net_split.h:29
KSNet core received data structure.
Definition: net_com.h:107
ksnCommandClass * kco
Definition: net_split.h:25
struct ksnSplitClass ksnSplitClass
KSNet split class data.
#define kc
Definition: hotkeys.c:72
ksnSplitClass * ksnSplitInit(ksnCommandClass *kc)
Initialize split module.
Definition: net_split.c:27
#define rd
KSNet command class data.
Definition: net_com.h:95
void ** ksnSplitPacket(ksnSplitClass *ks, uint8_t cmd, void *packet, size_t packet_len, int *num_subpackets)
Split large packet to array of small.
Definition: net_split.c:61
void ksnSplitDestroy(ksnSplitClass *ks)
Destroy split module.
Definition: net_split.c:42
ksnCorePacketData * ksnSplitCombine(ksnSplitClass *ks, ksnCorePacketData *rd)
Combine packets to one large packet.
Definition: net_split.c:111
uint16_t packet_number
Large packet number.
Definition: net_split.h:27
void ksnSplitFreeRds(ksnSplitClass *ks, ksnCorePacketData *rd)
Free ksnCorePacketData created in ksnSplitCombine function.
Definition: net_split.c:232
double last_added
Last time when record added to map.
Definition: net_split.h:28
PblMap * map
Hash Map to store splitted packets.
Definition: net_split.h:26