-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.h
59 lines (53 loc) · 1.29 KB
/
log.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
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef LOG_H
#define LOG_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include "nids.h"
#include "include.h"
#include "get_data.h"
#define PROCESSORID 43
#define WEBSITE "renren"
#define LOGPORT 8888
#define LOGPORT2 8889
struct loginfo{
long configid;
char logtime[25]; //format: "yyyy-mm-dd hh:mm:ss"
int processorid; //id of worknode
char website[7]; //"renren" or "weibo"
//tuple4
unsigned short serverport;
unsigned int serverip;
unsigned short clientport;
unsigned int clientip;
/* char serverport[6];
char serverip[16];
char clientport[6];
char clientip[16];
*/
//social info
int actiontype;
char userID[20];
char resourceID[20];
char originUID[20];
char originRID[20];
char url[512];
char keywords[300];//format: "kw1&kw2&kw3"
int gk_type;
char fulltext[1000];
};
void printlog(struct loginfo*);
int sendlog(struct loginfo*);
void initlog(struct loginfo *, struct tcp_stream *);
void log_addsocialinfo(struct loginfo*, struct connection_info*);
void log_addkeywords(struct loginfo*, char*[], int);
#endif