home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / snmp / cmu-snmp1.0 / snmplib / parse.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-19  |  2.5 KB  |  76 lines

  1. /***********************************************************
  2.     Copyright 1989 by Carnegie Mellon University
  3.  
  4.                       All Rights Reserved
  5.  
  6. Permission to use, copy, modify, and distribute this software and its 
  7. documentation for any purpose and without fee is hereby granted, 
  8. provided that the above copyright notice appear in all copies and that
  9. both that copyright notice and this permission notice appear in 
  10. supporting documentation, and that the name of CMU not be
  11. used in advertising or publicity pertaining to distribution of the
  12. software without specific, written prior permission.  
  13.  
  14. CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  15. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  16. CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  17. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  18. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  19. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  20. SOFTWARE.
  21. ******************************************************************/
  22. /*
  23.  * parse.h
  24.  */
  25.  
  26. /*
  27.  * A linked list of tag-value pairs for enumerated integers.
  28.  */
  29. struct enum_list {
  30.     struct enum_list *next;
  31.     int    value;
  32.     char *label;
  33. };
  34.  
  35. /*
  36.  * A linked list of nodes.
  37.  */
  38. struct node {
  39.     struct node *next;
  40.     char label[32]; /* This node's (unique) textual name */
  41.     int    subid;        /* This node's integer subidentifier */
  42.     char parent[32];/* The parent's textual name */
  43.     int type;        /* The type of object this represents */
  44.     struct enum_list *enums;    /* (optional) list of enumerated integers (otherwise NULL) */
  45. };
  46.  
  47. /*
  48.  * A tree in the format of the tree structure of the MIB.
  49.  */
  50. struct tree {
  51.     struct tree *child_list;    /* list of children of this node */
  52.     struct tree *next_peer;    /* Next node in list of peers */
  53.     struct tree *parent;
  54.     char label[32];        /* This node's textual name */
  55.     int subid;            /* This node's integer subidentifier */
  56.     int type;            /* This node's object type */
  57.     struct enum_list *enums;    /* (optional) list of enumerated integers (otherwise NULL) */
  58.     void (*printer)();     /* Value printing function */
  59. };
  60.  
  61. /* non-aggregate types for tree end nodes */
  62. #define TYPE_OTHER        0
  63. #define TYPE_OBJID        1
  64. #define TYPE_OCTETSTR        2
  65. #define TYPE_INTEGER        3
  66. #define TYPE_NETADDR        4
  67. #define    TYPE_IPADDR        5
  68. #define TYPE_COUNTER        6
  69. #define TYPE_GAUGE        7
  70. #define TYPE_TIMETICKS        8
  71. #define TYPE_OPAQUE        9
  72. #define TYPE_NULL        10
  73.  
  74. struct tree *read_mib();
  75.  
  76.