| 1 |
/* |
| 2 |
* This file was generated by mib2c and is intended for use as a mib module |
| 3 |
* for the ucd-snmp snmpd agent. |
| 4 |
*/ |
| 5 |
|
| 6 |
|
| 7 |
#ifndef _MIBGROUP_MTETRIGGERTABLE_H |
| 8 |
#define _MIBGROUP_MTETRIGGERTABLE_H |
| 9 |
|
| 10 |
|
| 11 |
/* |
| 12 |
* we may use header_complex from the header_complex module |
| 13 |
*/ |
| 14 |
|
| 15 |
|
| 16 |
config_require(header_complex); |
| 17 |
config_require(utilities/iquery); |
| 18 |
|
| 19 |
#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN |
| 20 |
config_error(disman/mteTriggerTable depends on the Callback transport); |
| 21 |
#endif |
| 22 |
|
| 23 |
/* |
| 24 |
* our storage structure(s) |
| 25 |
*/ |
| 26 |
struct mteTriggerTable_data { |
| 27 |
|
| 28 |
|
| 29 |
char *mteOwner; |
| 30 |
size_t mteOwnerLen; |
| 31 |
char *mteTriggerName; |
| 32 |
size_t mteTriggerNameLen; |
| 33 |
char *mteTriggerComment; |
| 34 |
size_t mteTriggerCommentLen; |
| 35 |
char *mteTriggerTest; |
| 36 |
size_t mteTriggerTestLen; |
| 37 |
long mteTriggerSampleType; |
| 38 |
oid *mteTriggerValueID; |
| 39 |
size_t mteTriggerValueIDLen; |
| 40 |
long mteTriggerValueIDWildcard; |
| 41 |
char *mteTriggerTargetTag; |
| 42 |
size_t mteTriggerTargetTagLen; |
| 43 |
char *mteTriggerContextName; |
| 44 |
size_t mteTriggerContextNameLen; |
| 45 |
long mteTriggerContextNameWildcard; |
| 46 |
unsigned long mteTriggerFrequency; |
| 47 |
char *mteTriggerObjectsOwner; |
| 48 |
size_t mteTriggerObjectsOwnerLen; |
| 49 |
char *mteTriggerObjects; |
| 50 |
size_t mteTriggerObjectsLen; |
| 51 |
long mteTriggerEnabled; |
| 52 |
long mteTriggerEntryStatus; |
| 53 |
|
| 54 |
/* |
| 55 |
* delta table |
| 56 |
*/ |
| 57 |
oid *mteTriggerDeltaDiscontinuityID; |
| 58 |
size_t mteTriggerDeltaDiscontinuityIDLen; |
| 59 |
long mteTriggerDeltaDiscontinuityIDWildcard; |
| 60 |
long mteTriggerDeltaDiscontinuityIDType; |
| 61 |
unsigned long prevDiscoTicks; |
| 62 |
unsigned long prevUptimeTicks; |
| 63 |
|
| 64 |
/* |
| 65 |
* existence table |
| 66 |
*/ |
| 67 |
char *mteTriggerExistenceTest; |
| 68 |
size_t mteTriggerExistenceTestLen; |
| 69 |
char *mteTriggerExistenceStartup; |
| 70 |
size_t mteTriggerExistenceStartupLen; |
| 71 |
char *mteTriggerExistenceObjectsOwner; |
| 72 |
size_t mteTriggerExistenceObjectsOwnerLen; |
| 73 |
char *mteTriggerExistenceObjects; |
| 74 |
size_t mteTriggerExistenceObjectsLen; |
| 75 |
char *mteTriggerExistenceEventOwner; |
| 76 |
size_t mteTriggerExistenceEventOwnerLen; |
| 77 |
char *mteTriggerExistenceEvent; |
| 78 |
size_t mteTriggerExistenceEventLen; |
| 79 |
|
| 80 |
/* |
| 81 |
* boolean table |
| 82 |
*/ |
| 83 |
long mteTriggerBooleanComparison; |
| 84 |
long mteTriggerBooleanValue; |
| 85 |
long mteTriggerBooleanStartup; |
| 86 |
char *mteTriggerBooleanObjectsOwner; |
| 87 |
size_t mteTriggerBooleanObjectsOwnerLen; |
| 88 |
char *mteTriggerBooleanObjects; |
| 89 |
size_t mteTriggerBooleanObjectsLen; |
| 90 |
char *mteTriggerBooleanEventOwner; |
| 91 |
size_t mteTriggerBooleanEventOwnerLen; |
| 92 |
char *mteTriggerBooleanEvent; |
| 93 |
size_t mteTriggerBooleanEventLen; |
| 94 |
|
| 95 |
/* |
| 96 |
* threshold table |
| 97 |
*/ |
| 98 |
long mteTriggerThresholdStartup; |
| 99 |
long mteTriggerThresholdRising; |
| 100 |
long mteTriggerThresholdFalling; |
| 101 |
long mteTriggerThresholdDeltaRising; |
| 102 |
long mteTriggerThresholdDeltaFalling; |
| 103 |
char *mteTriggerThresholdObjectsOwner; |
| 104 |
size_t mteTriggerThresholdObjectsOwnerLen; |
| 105 |
char *mteTriggerThresholdObjects; |
| 106 |
size_t mteTriggerThresholdObjectsLen; |
| 107 |
char *mteTriggerThresholdRisingEventOwner; |
| 108 |
size_t mteTriggerThresholdRisingEventOwnerLen; |
| 109 |
char *mteTriggerThresholdRisingEvent; |
| 110 |
size_t mteTriggerThresholdRisingEventLen; |
| 111 |
char *mteTriggerThresholdFallingEventOwner; |
| 112 |
size_t mteTriggerThresholdFallingEventOwnerLen; |
| 113 |
char *mteTriggerThresholdFallingEvent; |
| 114 |
size_t mteTriggerThresholdFallingEventLen; |
| 115 |
char *mteTriggerThresholdDeltaRisingEventOwner; |
| 116 |
size_t mteTriggerThresholdDeltaRisingEventOwnerLen; |
| 117 |
char *mteTriggerThresholdDeltaRisingEvent; |
| 118 |
size_t mteTriggerThresholdDeltaRisingEventLen; |
| 119 |
char *mteTriggerThresholdDeltaFallingEventOwner; |
| 120 |
size_t mteTriggerThresholdDeltaFallingEventOwnerLen; |
| 121 |
char *mteTriggerThresholdDeltaFallingEvent; |
| 122 |
size_t mteTriggerThresholdDeltaFallingEventLen; |
| 123 |
|
| 124 |
/* |
| 125 |
* internal variables |
| 126 |
*/ |
| 127 |
int storageType; |
| 128 |
unsigned int alarmreg; |
| 129 |
int lastboolresult; |
| 130 |
int started; |
| 131 |
long lastvalue; |
| 132 |
struct header_complex_index *hc_storage, *hc_storage_old; |
| 133 |
unsigned long threshold_state; |
| 134 |
|
| 135 |
/* |
| 136 |
* pdu auth contents |
| 137 |
*/ |
| 138 |
long have_copied_auth_info; |
| 139 |
long pdu_version; |
| 140 |
long pdu_securityModel; |
| 141 |
long pdu_securityLevel; |
| 142 |
void *pdu_transport; |
| 143 |
size_t pdu_transportLen; |
| 144 |
const oid *pdu_tDomain; |
| 145 |
size_t pdu_tDomainLen; |
| 146 |
u_char *pdu_community; |
| 147 |
size_t pdu_community_len; |
| 148 |
char *pdu_contextName; |
| 149 |
size_t pdu_contextNameLen; |
| 150 |
char *pdu_securityName; |
| 151 |
size_t pdu_securityNameLen; |
| 152 |
}; |
| 153 |
|
| 154 |
struct last_state { |
| 155 |
long *value; |
| 156 |
char lastbool; |
| 157 |
char lastthreshold; |
| 158 |
}; |
| 159 |
|
| 160 |
|
| 161 |
/* |
| 162 |
* enum definitions from the covered mib sections |
| 163 |
*/ |
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
#define MTETRIGGERTEST_EXISTENCE 0x80 |
| 172 |
#define MTETRIGGERTEST_BOOLEAN 0x40 |
| 173 |
#define MTETRIGGERTEST_THRESHOLD 0x20 |
| 174 |
|
| 175 |
#define MTETRIGGERSAMPLETYPE_ABSOLUTEVALUE 1 |
| 176 |
#define MTETRIGGERSAMPLETYPE_DELTAVALUE 2 |
| 177 |
|
| 178 |
|
| 179 |
/* |
| 180 |
* What's wrong with using the regular TruthValue definitions TV_TRUE |
| 181 |
* and TV_FALSE (snmp-tc.h) which are up to 77% shorter? |
| 182 |
*/ |
| 183 |
|
| 184 |
#define MTETRIGGERVALUEIDWILDCARD_TRUE 1 |
| 185 |
#define MTETRIGGERVALUEIDWILDCARD_FALSE 2 |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
#define MTETRIGGERCONTEXTNAMEWILDCARD_TRUE 1 |
| 190 |
#define MTETRIGGERCONTEXTNAMEWILDCARD_FALSE 2 |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
#define MTETRIGGERENABLED_TRUE 1 |
| 196 |
#define MTETRIGGERENABLED_FALSE 2 |
| 197 |
|
| 198 |
#define MTE_NOTSTARTED 0 |
| 199 |
#define MTE_STARTED 1 |
| 200 |
|
| 201 |
#define MTE_THRESHOLD_BEGIN 0 |
| 202 |
#define MTE_THRESHOLD_HIGH 1 |
| 203 |
#define MTE_THRESHOLD_LOW 2 |
| 204 |
|
| 205 |
/* |
| 206 |
* Just the first (MTE-specific) groups of errors defined here; |
| 207 |
* others are numerically equal to the regular SNMP errors. |
| 208 |
*/ |
| 209 |
|
| 210 |
#define MTE_FAILURE_LOCALRESOURCELACK -1 |
| 211 |
#define MTE_FAILURE_BADDESTINATION -2 |
| 212 |
#define MTE_FAILURE_DESTINATIONUNREACHABLE -3 |
| 213 |
#define MTE_FAILURE_NORESPONSE -4 |
| 214 |
#define MTE_FAILURE_BADTYPE -5 |
| 215 |
#define MTE_FAILURE_SAMPLEOVERRUN -6 |
| 216 |
|
| 217 |
|
| 218 |
extern struct header_complex_index *mteTriggerTableStorage; |
| 219 |
|
| 220 |
/* |
| 221 |
* function prototypes |
| 222 |
*/ |
| 223 |
|
| 224 |
|
| 225 |
void init_mteTriggerTable(void); |
| 226 |
FindVarMethod var_mteTriggerTable; |
| 227 |
void parse_mteTriggerTable(const char *, char *); |
| 228 |
void parse_simple_monitor(const char *, char *); |
| 229 |
void parse_default_monitors(const char *, char *); |
| 230 |
SNMPCallback store_mteTriggerTable; |
| 231 |
netsnmp_pdu *mte_get_response(struct mteTriggerTable_data *, |
| 232 |
netsnmp_pdu *); |
| 233 |
|
| 234 |
#ifndef NETSNMP_NO_WRITE_SUPPORT |
| 235 |
WriteMethod write_mteTriggerComment; |
| 236 |
WriteMethod write_mteTriggerTest; |
| 237 |
WriteMethod write_mteTriggerSampleType; |
| 238 |
WriteMethod write_mteTriggerValueID; |
| 239 |
WriteMethod write_mteTriggerValueIDWildcard; |
| 240 |
WriteMethod write_mteTriggerTargetTag; |
| 241 |
WriteMethod write_mteTriggerContextName; |
| 242 |
WriteMethod write_mteTriggerContextNameWildcard; |
| 243 |
WriteMethod write_mteTriggerFrequency; |
| 244 |
WriteMethod write_mteTriggerObjectsOwner; |
| 245 |
WriteMethod write_mteTriggerObjects; |
| 246 |
WriteMethod write_mteTriggerEnabled; |
| 247 |
WriteMethod write_mteTriggerEntryStatus; |
| 248 |
#endif /* !NETSNMP_NO_WRITE_SUPPORT */ |
| 249 |
|
| 250 |
void mte_enable_trigger(struct mteTriggerTable_data *item); |
| 251 |
void mte_disable_trigger(struct mteTriggerTable_data |
| 252 |
*item); |
| 253 |
SNMPAlarmCallback mte_run_trigger; |
| 254 |
|
| 255 |
#endif /* _MIBGROUP_MTETRIGGERTABLE_H */ |