/* * Note: this file originally auto-generated by mib2c using * : mib2c.int_watch.conf,v 1.2 2002/07/17 14:41:53 dts12 Exp $ */ #include #include #include #include "timeMachineMIB.h" /* the variable we want to tie an OID to. The agent will handle all * GET and SET requests to this variable changing its value as needed. */ static int monthAgentObject = 12; /* default value */ static int dayAgentObject = 9; /* default value */ static int yearAgentObject = 2004; /* default value */ static int hourAgentObject = 19; /* default value */ static int minutesAgentObject = 11; /* default value */ /* * our initialization routine, automatically called by the agent * (to get called, the function name must match init_FILENAME()) */ void init_timeMachineMIB(void) { static oid monthAgentObject_oid[] = { 1,3,6,1,4,1,8072,2,4,1,1,1, 0 }; static oid dayAgentObject_oid[] = { 1,3,6,1,4,1,8072,2,4,1,1,2, 0 }; static oid yearAgentObject_oid[] = { 1,3,6,1,4,1,8072,2,4,1,1,3, 0 }; static oid hourAgentObject_oid[] = { 1,3,6,1,4,1,8072,2,4,2,2,1, 0 }; static oid minutesAgentObject_oid[] = { 1,3,6,1,4,1,8072,2,4,2,2,2, 0 }; /* * a debugging statement. Run the agent with -DtimeMachineMIB to see * the output of this debugging statement. */ DEBUGMSGTL(("timeMachineMIB", "Initializing the timeMachineMIB module\n")); /* * the line below registers our variables defined above as * accessible and makes them writable. A read only version of any * of these registrations would merely call * register_read_only_int_instance() instead. The functions * called below should be consistent with your MIB, however. * * If you wanted a callback when the value was retrieved or set * (even though the details of doing this are handled for you), * you could change the NULL pointer below to a valid handler * function. */ DEBUGMSGTL(("timeMachineMIB", "Initializing monthAgentObject scalar integer. Default value = %d\n", monthAgentObject)); netsnmp_register_int_instance("monthAgentObject", monthAgentObject_oid, OID_LENGTH(monthAgentObject_oid), &monthAgentObject, NULL); DEBUGMSGTL(("timeMachineMIB", "Initializing dayAgentObject scalar integer. Default value = %d\n", dayAgentObject)); netsnmp_register_int_instance("dayAgentObject", dayAgentObject_oid, OID_LENGTH(dayAgentObject_oid), &dayAgentObject, NULL); DEBUGMSGTL(("timeMachineMIB", "Initializing yearAgentObject scalar integer. Default value = %d\n", yearAgentObject)); netsnmp_register_int_instance("yearAgentObject", yearAgentObject_oid, OID_LENGTH(yearAgentObject_oid), &yearAgentObject, NULL); DEBUGMSGTL(("timeMachineMIB", "Initializing hourAgentObject scalar integer. Default value = %d\n", hourAgentObject)); netsnmp_register_int_instance("hourAgentObject", hourAgentObject_oid, OID_LENGTH(hourAgentObject_oid), &hourAgentObject, NULL); DEBUGMSGTL(("timeMachineMIB", "Initializing minutesAgentObject scalar integer. Default value = %d\n", minutesAgentObject)); netsnmp_register_int_instance("minutesAgentObject", minutesAgentObject_oid, OID_LENGTH(minutesAgentObject_oid), &minutesAgentObject, NULL); DEBUGMSGTL(("timeMachineMIB", "Done initalizing timeMachineMIB module\n")); }