Revision 22, 2.5 KB
(checked in by andreu, 16 years ago)
|
aggregation et timer
|
-
Property svn:eol-style set to
native
|
Rev | Line | |
---|
[2] | 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 | |
---|
[8] | 26 | #define _GNU_SOURCE |
---|
| 27 | |
---|
[2] | 28 | #include <unistd.h> |
---|
| 29 | #include <stdio.h> |
---|
| 30 | #include <string.h> |
---|
| 31 | #include <stdlib.h> |
---|
| 32 | #include <syslog.h> |
---|
| 33 | #include <sys/types.h> |
---|
| 34 | #include <sys/socket.h> |
---|
| 35 | #include <netinet/in.h> |
---|
| 36 | #include <time.h> |
---|
| 37 | #include <errno.h> |
---|
| 38 | #include <sys/ipc.h> |
---|
| 39 | #include <sys/shm.h> |
---|
| 40 | #include <sys/sem.h> |
---|
| 41 | #include <ctype.h> |
---|
| 42 | #include <netdb.h> |
---|
| 43 | #include <net/if.h> |
---|
| 44 | #include <sys/ioctl.h> |
---|
| 45 | #include <arpa/inet.h> |
---|
| 46 | #include <signal.h> |
---|
| 47 | #include <setjmp.h> |
---|
| 48 | |
---|
| 49 | #include "routers_mgmt.h" |
---|
| 50 | #include "fields_mgmt.h" |
---|
| 51 | #include "routers_mgmt.h" |
---|
| 52 | #include "tplflset_mgmt.h" |
---|
| 53 | #include "fields_mgmt.h" |
---|
| 54 | #include "headers_mgmt.h" |
---|
| 55 | #include "V9Header_mgmt.h" |
---|
| 56 | #include "template.h" |
---|
| 57 | #include "dataFlowSet.h" |
---|
| 58 | #include "get_conf.h" |
---|
| 59 | #include "rules_mgmt.h" |
---|
| 60 | #include "msg_mgmt.h" |
---|
[18] | 61 | |
---|
[2] | 62 | |
---|
| 63 | |
---|
| 64 | #define SOCKET_BUFFER_SIZE 1500 |
---|
| 65 | |
---|
| 66 | #define RECEPTION_ADDRESS "" |
---|
[8] | 67 | #define RECEPTION_PORT 9999 |
---|
[2] | 68 | |
---|
[18] | 69 | #define TIME_OUT 300 |
---|
[2] | 70 | |
---|
| 71 | #define ROUTER_INDEX_MAX 70 |
---|
| 72 | #define FIELD_TYPE_NUMBER 89 |
---|
| 73 | #define MAX_RULES_PER_FIELD 10 |
---|
| 74 | |
---|
[20] | 75 | #ifdef CRIHAN |
---|
[19] | 76 | #define OUTPUT_IP "/tmp/ipflow" |
---|
| 77 | #define EXTENSION ".txt" |
---|
| 78 | #define OUTPUT_MPLS "/tmp/mplsflow" |
---|
| 79 | #define MAX_IP_OUTPUT_FILES 3 |
---|
| 80 | #define MAX_MPLS_OUTPUT_FILES 3 |
---|
| 81 | #define IP_TIME_THRESHOLD 60 |
---|
| 82 | #define MPLS_TIME_THRESHOLD 60 |
---|
[20] | 83 | #endif |
---|
[22] | 84 | #define MAX_IP_FLOW 10000 |
---|
| 85 | #define MAX_MPLS_FLOW 200 |
---|
[18] | 86 | |
---|
[2] | 87 | void setCache(RulesPtr); |
---|
| 88 | void initCache(); |
---|
| 89 | void waitingRoom(); |
---|
[8] | 90 | void initRule(); |
---|
| 91 | void sigusr1Mgmt(int); |
---|
| 92 | void sendMyPid(int); |
---|
| 93 | void sendReadRulesSignal(int); |
---|
[2] | 94 | void initStream(); |
---|
| 95 | void catchAlarm(int); |
---|
| 96 | int socketLoop(); |
---|
| 97 | short initSocket(); |
---|
| 98 | short socketReading(); |
---|
| 99 | short getFlow(short); |
---|
| 100 | short checkFlow(short); |
---|
| 101 | void showAllTplFlSet(); |
---|