| 1 |
/* |
| 2 |
* Template MIB group interface - example.h |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
/* |
| 7 |
* Don't include ourselves twice |
| 8 |
*/ |
| 9 |
#ifndef _MIBGROUP_EXAMPLE_H |
| 10 |
#define _MIBGROUP_EXAMPLE_H |
| 11 |
|
| 12 |
#ifdef __cplusplus |
| 13 |
extern "C" { |
| 14 |
#endif |
| 15 |
|
| 16 |
/* |
| 17 |
* We use 'header_generic' from the util_funcs/header_generic module, |
| 18 |
* so make sure this module is included in the agent. |
| 19 |
*/ |
| 20 |
config_require(util_funcs/header_generic); |
| 21 |
|
| 22 |
|
| 23 |
/* |
| 24 |
* Declare our publically-visible functions. |
| 25 |
* Typically, these will include the initialization and shutdown functions, |
| 26 |
* the main request callback routine and any writeable object methods. |
| 27 |
* |
| 28 |
* Function prototypes are provided for the callback routine ('FindVarMethod') |
| 29 |
* and writeable object methods ('WriteMethod'). |
| 30 |
*/ |
| 31 |
void init_example(void); |
| 32 |
FindVarMethod var_example; |
| 33 |
WriteMethod write_exampleint; |
| 34 |
WriteMethod write_exampletrap; |
| 35 |
WriteMethod write_exampletrap2; |
| 36 |
|
| 37 |
|
| 38 |
/* |
| 39 |
* Magic number definitions. |
| 40 |
* These must be unique for each object implemented within a |
| 41 |
* single mib module callback routine. |
| 42 |
* |
| 43 |
* Typically, these will be the last OID sub-component for |
| 44 |
* each entry, or integers incrementing from 1. |
| 45 |
* (which may well result in the same values anyway). |
| 46 |
* |
| 47 |
* Here, the second and third objects are form a 'sub-table' and |
| 48 |
* the magic numbers are chosen to match these OID sub-components. |
| 49 |
* This is purely for programmer convenience. |
| 50 |
* All that really matters is that the numbers are unique. |
| 51 |
*/ |
| 52 |
|
| 53 |
#define EXAMPLESTRING 1 |
| 54 |
#define EXAMPLEINTEGER 21 |
| 55 |
#define EXAMPLEOBJECTID 22 |
| 56 |
#define EXAMPLETIMETICKS 3 |
| 57 |
#define EXAMPLEIPADDRESS 4 |
| 58 |
#define EXAMPLECOUNTER 5 |
| 59 |
#define EXAMPLEGAUGE 6 |
| 60 |
#define EXAMPLETRIGGERTRAP 7 |
| 61 |
#define EXAMPLETRIGGERTRAP2 8 |
| 62 |
|
| 63 |
#ifdef __cplusplus |
| 64 |
} |
| 65 |
#endif |
| 66 |
|
| 67 |
#endif /* _MIBGROUP_EXAMPLE_H */ |