main_demo.cpp 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Note: this file originally auto-generated by mib2c using
  3. * $
  4. */
  5. #include "pduMIB.h"
  6. #include <time.h>
  7. /** Initializes the pduMIB module */
  8. static int keep_running;
  9. RETSIGTYPE stop_server(int __attribute__((unused)) a) {
  10. keep_running = 0;
  11. }
  12. int main()
  13. {
  14. const char *app_name = "pduMIB";
  15. /* we are a subagent */
  16. netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
  17. /* initialize the agent library */
  18. init_agent(app_name);
  19. /* initialize your mib code here */
  20. init_pduMIB();
  21. /* pduMIB will be used to read pduMIB.conf files. */
  22. init_snmp("pduMIB");
  23. keep_running = 1;
  24. while(keep_running)
  25. {
  26. agent_check_and_process(1);/* block every 1 second */
  27. }
  28. /* at shutdown time */
  29. snmp_shutdown(app_name);
  30. /* deinitialize your mib code here */
  31. /* shutdown the agent library */
  32. shutdown_agent();
  33. return 0;
  34. }