2 * HP specific stuff that OpenView recognizes
5 #include <net-snmp/net-snmp-config.h>
8 #if HAVE_MACHINE_PARAM_H
9 #include <machine/param.h>
11 #if HAVE_SYS_VMMETER_H
12 #include <sys/vmmeter.h>
18 #include <net-snmp/net-snmp-includes.h>
19 #include <net-snmp/agent/net-snmp-agent-includes.h>
29 * define the structure we're going to ask the agent to register our
32 struct variable2 hp_variables[] = {
33 {HPCONF, ASN_INTEGER, RWRITE, var_hp, 1, {HPCONF}},
34 {HPRECONFIG, ASN_INTEGER, RWRITE, var_hp, 1, {HPRECONFIG}},
35 {HPFLAG, ASN_INTEGER, RWRITE, var_hp, 1, {HPFLAG}},
36 {HPLOGMASK, ASN_INTEGER, RWRITE, var_hp, 1, {ERRORFLAG}},
37 {HPSTATUS, ASN_INTEGER, RWRITE, var_hp, 1, {ERRORMSG}}
40 struct variable2 hptrap_variables[] = {
41 {HPTRAP, ASN_IPADDRESS, RWRITE, var_hp, 1, {HPTRAP}},
45 * Define the OID pointer to the top of the mib tree that we're
46 * registering underneath
48 oid hp_variables_oid[] =
49 { 1, 3, 6, 1, 4, 1, 11, 2, 13, 1, 2, 1 };
50 oid hptrap_variables_oid[] =
51 { 1, 3, 6, 1, 4, 1, 11, 2, 13, 2 };
54 * register ourselves with the agent to handle our mib tree
56 REGISTER_MIB("ucd-snmp/hpux:hp", hp_variables, variable2,
58 REGISTER_MIB("ucd-snmp/hpux:hptrap", hptrap_variables, variable2,
59 hptrap_variables_oid);
64 #ifdef RESERVED_FOR_FUTURE_USE
69 int var_val_len, u_char * statP, oid * name, int name_len)
71 DODEBUG("Gotto: writeHP\n");
72 return SNMP_ERR_NOERROR;
77 var_hp(struct variable *vp,
80 int exact, size_t * var_len, WriteMethod ** write_method)
83 oid newname[MAX_OID_LEN];
87 memcpy((char *) newname, (char *) vp->name,
88 (int) vp->namelen * sizeof(oid));
91 snmp_oid_compare(name, *length, newname, (int) vp->namelen + 1);
92 if ((exact && (result != 0)) || (!exact && (result >= 0)))
94 memcpy((char *) name, (char *) newname,
95 ((int) vp->namelen + 1) * sizeof(oid));
96 *length = *length + 1;
97 *var_len = sizeof(long); /* default length */
104 return (u_char *) & long_ret; /* remove trap */
107 return (u_char *) & long_ret;
109 newname[*length - 1] = 128;
110 newname[*length] = 120;
111 newname[*length + 1] = 57;
112 newname[*length + 2] = 92;
113 *length = *length + 3;
114 memcpy((char *) name, (char *) newname, *length * sizeof(oid));
115 long_ret = ((((((128 << 8) + 120) << 8) + 57) << 8) + 92);
116 return (u_char *) & long_ret;