home *** CD-ROM | disk | FTP | other *** search
/ ftp.umcs.maine.edu / 2015-02-07.ftp.umcs.maine.edu.tar / ftp.umcs.maine.edu / pub / thesis / zhongy / snmp / snmprint.c < prev    next >
C/C++ Source or Header  |  1994-05-11  |  883b  |  55 lines

  1. /*
  2.  
  3.   This package includes routines to print the snmp MIB object values
  4.  
  5.   according to their different type
  6.  
  7.  
  8.   programmer: Zhong Yunxiang
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #include <sys/types.h>
  15. #include <sys/socket.h>
  16. #include <netinet/in.h>
  17. #include <netdb.h>
  18.  
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <sys/time.h>
  23. #include <sys/types.h>
  24.  
  25. #include "asn1.h"
  26. #include "snmp.h"
  27.  
  28. /*
  29.   print the value according to the type of test
  30. */
  31.  
  32. void print_value(struct snbentry sn)
  33. {
  34.  
  35. printf("\n in the print function");
  36.   switch (sn.sb_val.sv_type) {
  37.     case ASN1_INT:
  38.     case ASN1_COUNTER:
  39.     case ASN1_GAUGE:
  40.     case ASN1_TIMETICKS:
  41.          printf("\n %s = %d\n",sn.name,sn.sb_val.sv_val.sv_int);
  42.     case ASN1_OCTSTR:
  43.          break;
  44.     case ASN1_NULL:
  45.          break;
  46.     case ASN1_OBJID:
  47.          break;
  48.     case ASN1_IPADDR:
  49.          break;
  50.     default:
  51.          break;
  52.     }
  53. }
  54.  
  55.