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 | #ifndef ROUTERS_MGMT_H |
---|
26 | #define ROUTERS_MGMT_H |
---|
27 | |
---|
28 | #include <unistd.h> |
---|
29 | #include <stdio.h> |
---|
30 | #include <string.h> |
---|
31 | #include <stdlib.h> |
---|
32 | #include <errno.h> |
---|
33 | #include <sys/ioctl.h> |
---|
34 | #include <syslog.h> |
---|
35 | |
---|
36 | #include "renetcolParam.h" |
---|
37 | #include "tplflset_mgmt.h" |
---|
38 | #include "get_conf.h" |
---|
39 | #include "prefix_mgmt.h" |
---|
40 | #include "V9Header_mgmt.h" |
---|
41 | #include "headers_mgmt.h" |
---|
42 | #include "rules_mgmt.h" |
---|
43 | #include "renetcol_mib.h" |
---|
44 | #include "engine_mgmt.h" |
---|
45 | |
---|
46 | typedef struct Router * RouterPtr; |
---|
47 | typedef struct Router { |
---|
48 | unsigned long IpAddress; |
---|
49 | TplFlowSetPtr tplList; |
---|
50 | TplOptionPtr tplOptList; |
---|
51 | NDEEnginePtr engineList; |
---|
52 | unsigned long sampled; |
---|
53 | unsigned short ID; |
---|
54 | #ifdef IPV4AGGIDSNMP |
---|
55 | unsigned short snmpIndexList[MAX_SNMP_INDEX]; |
---|
56 | unsigned short snmpIndexType[MAX_INDEX_BY_ROUTER]; |
---|
57 | unsigned short snmpIndexID[MAX_INDEX_BY_ROUTER]; |
---|
58 | #endif |
---|
59 | RouterPtr next; |
---|
60 | RouterPtr prev; |
---|
61 | } RouterType; |
---|
62 | |
---|
63 | struct MyPtrs { |
---|
64 | RouterPtr currentRouterPtr; |
---|
65 | NetFlowV9HeaderPtr currentHeaderV9Ptr; |
---|
66 | unsigned short *offsetV9Ptr; |
---|
67 | unsigned char *ptr_buffer; |
---|
68 | short *currentFlowsetNumberPtr; |
---|
69 | short *currentFlowsetIdPtr; |
---|
70 | DatagramPtr pcktPtr; |
---|
71 | RuleDefPtr *rulesAddressPtr; |
---|
72 | RulesPtr rulesListPtr; |
---|
73 | #ifdef IPV4AGGIDR |
---|
74 | unsigned long *routersID; |
---|
75 | #endif |
---|
76 | struct RenetcolMIB *currentMIB; |
---|
77 | struct RenetcolMIB *secondMIB; |
---|
78 | struct PrefixV4 *currentV4Tab; |
---|
79 | struct PrefixV4 *secondV4Tab; |
---|
80 | struct PrefixV4 *currentV4SubnetTab; |
---|
81 | struct PrefixV4 *secondV4SubnetTab; |
---|
82 | #ifdef IPV6AGGIDSNMP |
---|
83 | struct PrefixV6 *currentV6Tab; |
---|
84 | struct PrefixV6 *secondV6Tab; |
---|
85 | #endif |
---|
86 | #ifdef IPV6LINKAGG |
---|
87 | struct IndexV6 *currentV6IndexTab; |
---|
88 | struct IndexV6 *secondV6IndexTab; |
---|
89 | #endif |
---|
90 | #ifdef ASACC |
---|
91 | unsigned short asNb; |
---|
92 | struct AS *currentASTab; |
---|
93 | struct AS *secondASTab; |
---|
94 | #endif |
---|
95 | #ifdef MATRIX |
---|
96 | struct POP *matrixPOP; |
---|
97 | #endif |
---|
98 | }; |
---|
99 | |
---|
100 | RouterPtr notExistRouter(RouterPtr, unsigned long); |
---|
101 | RouterPtr addRouter(RouterPtr, unsigned long, unsigned short); |
---|
102 | RouterPtr updateRouter(RouterPtr, unsigned long, unsigned long); |
---|
103 | TplFlowSetPtr newRouterTplList(); |
---|
104 | TplFlowSetPtr deleteTplFlSet(TplFlowSetPtr); |
---|
105 | NDEEnginePtr newRouterEngineList(); |
---|
106 | NDEEnginePtr existEngId(RouterPtr, unsigned long); |
---|
107 | TplOptionPtr newRouterTplOptList(); |
---|
108 | TplOptionPtr deleteTplOption(TplOptionPtr); |
---|
109 | int getSNMPIndexList(char *, RouterPtr); |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | #endif |
---|