-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLinkedListConnections.h
46 lines (35 loc) · 1.12 KB
/
LinkedListConnections.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __LINKEDLISTCONNECTIONS__
#define __LINKEDLISTCONNECTIONS__
/*
* Type declarations.
*
*/
typedef struct CONNODE
{
int first;
char ID[MAX_ID_LEN + 1];
time_t Created;
char SrcMAC[MAX_MAC_LEN+1];
char SrcIP[MAX_IP_LEN+1];
char DstIP[MAX_IP_LEN+1];
unsigned short SrcPort;
unsigned short DstPort;
int DataLen;
unsigned char *Data;
struct CONNODE *prev;
struct CONNODE *next;
} CONNODE, *PCONNODE, **PPCONNODE;
/*
* Function forward declarations.
*
*/
PCONNODE InitConnectionList();
void AddConnectionToList(PPCONNODE pConNodes, char *pSrcMAC, char *pSrcIP, unsigned short pSrcPort, char *pDstIP, unsigned short pDstPort);
PCONNODE ConnectionNodeExists(PCONNODE pConNodes, char *pID);
int CountConnectionNodes(PCONNODE pConNodes);
void ConnectionDeleteNode(PPCONNODE pConNodes, char *pID);
int ConnectionCountNodes(PCONNODE pConNodes);
void ConnectionAddData(PCONNODE pNode, char *pData, int pDataLen);
void RemoveOldConnections(PPCONNODE pConNodes);
void WriteHTTPDataToPipe(char *pData, int pDataLen, char *pSMAC, char *pSrcIP, unsigned short pSrcPort, char *pDstIP, unsigned short pDstPort);
#endif