[2] | 1 | |
---|
| 2 | |
---|
| 3 | |
---|
[28] | 4 | |
---|
[2] | 5 | |
---|
[127] | 6 | |
---|
[2] | 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> |
---|
[58] | 34 | #include <syslog.h> |
---|
[2] | 35 | |
---|
[58] | 36 | #include "renetcolParam.h" |
---|
[31] | 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" |
---|
[113] | 43 | #include "renetcol_mib.h" |
---|
| 44 | #include "engine_mgmt.h" |
---|
[2] | 45 | |
---|
| 46 | typedef struct Router * RouterPtr; |
---|
| 47 | typedef struct Router { |
---|
[58] | 48 | unsigned long IpAddress; |
---|
| 49 | TplFlowSetPtr tplList; |
---|
| 50 | TplOptionPtr tplOptList; |
---|
[113] | 51 | NDEEnginePtr engineList; |
---|
[96] | 52 | unsigned long sampled; |
---|
| 53 | unsigned short ID; |
---|
[59] | 54 | #ifdef IPV4AGGIDSNMP |
---|
[96] | 55 | unsigned short snmpIndexList[MAX_SNMP_INDEX]; |
---|
| 56 | unsigned short snmpIndexType[MAX_INDEX_BY_ROUTER]; |
---|
| 57 | unsigned short snmpIndexID[MAX_INDEX_BY_ROUTER]; |
---|
[59] | 58 | #endif |
---|
[2] | 59 | RouterPtr next; |
---|
| 60 | RouterPtr prev; |
---|
| 61 | } RouterType; |
---|
| 62 | |
---|
[31] | 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; |
---|
[59] | 73 | #ifdef IPV4AGGIDR |
---|
[31] | 74 | unsigned long *routersID; |
---|
[59] | 75 | #endif |
---|
[113] | 76 | struct RenetcolMIB *currentMIB; |
---|
| 77 | struct RenetcolMIB *secondMIB; |
---|
[31] | 78 | struct PrefixV4 *currentV4Tab; |
---|
| 79 | struct PrefixV4 *secondV4Tab; |
---|
[59] | 80 | struct PrefixV4 *currentV4SubnetTab; |
---|
| 81 | struct PrefixV4 *secondV4SubnetTab; |
---|
[95] | 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 |
---|
[60] | 90 | #ifdef ASACC |
---|
| 91 | unsigned short asNb; |
---|
| 92 | struct AS *currentASTab; |
---|
| 93 | struct AS *secondASTab; |
---|
| 94 | #endif |
---|
[59] | 95 | #ifdef MATRIX |
---|
[36] | 96 | struct POP *matrixPOP; |
---|
[59] | 97 | #endif |
---|
[31] | 98 | }; |
---|
| 99 | |
---|
[2] | 100 | RouterPtr notExistRouter(RouterPtr, unsigned long); |
---|
[95] | 101 | RouterPtr addRouter(RouterPtr, unsigned long, unsigned short); |
---|
[58] | 102 | RouterPtr updateRouter(RouterPtr, unsigned long, unsigned long); |
---|
[2] | 103 | TplFlowSetPtr newRouterTplList(); |
---|
| 104 | TplFlowSetPtr deleteTplFlSet(TplFlowSetPtr); |
---|
[113] | 105 | NDEEnginePtr newRouterEngineList(); |
---|
| 106 | NDEEnginePtr existEngId(RouterPtr, unsigned long); |
---|
[2] | 107 | TplOptionPtr newRouterTplOptList(); |
---|
| 108 | TplOptionPtr deleteTplOption(TplOptionPtr); |
---|
[58] | 109 | int getSNMPIndexList(char *, RouterPtr); |
---|
[2] | 110 | |
---|
| 111 | |
---|
[31] | 112 | |
---|
[2] | 113 | |
---|
| 114 | #endif |
---|