Annotation of mstools/samples/snmp/testdll/testmib.h, revision 1.1

1.1     ! root        1: /*++ BUILD Version: 0001    // Increment this if a change has global effects
        !             2: 
        !             3: Copyright (c) 1991  Microsoft Corporation
        !             4: 
        !             5: Module Name:
        !             6: 
        !             7:     testmib.h
        !             8: 
        !             9: Abstract:
        !            10: 
        !            11:     Sample SNMP Extension Agent for Windows NT.
        !            12: 
        !            13:     These files (testdll.c, testmib.c, and testmib.h) provide an example of 
        !            14:     how to structure an Extension Agent DLL which works in conjunction with 
        !            15:     the SNMP Extendible Agent for Windows NT.
        !            16: 
        !            17:     Extensive comments have been included to describe its structure and
        !            18:     operation.  See also "Microsoft Windows/NT SNMP Programmer's Reference".
        !            19: 
        !            20: Created:
        !            21: 
        !            22:     13-Jun-1991
        !            23: 
        !            24: Revision History:
        !            25: 
        !            26: --*/
        !            27: 
        !            28: #ifndef testmib_h
        !            29: #define testmib_h
        !            30: 
        !            31: static char *testmib__h = "@(#) $Logfile:   N:/xtest/vcs/testmib.h_v  $ $Revision:   1.2  $";
        !            32: 
        !            33: 
        !            34: // Necessary includes.
        !            35: 
        !            36: #include <snmp.h>
        !            37: 
        !            38: 
        !            39: // MIB Specifics.
        !            40: 
        !            41: #define MIB_PREFIX_LEN            MIB_OidPrefix.idLength
        !            42: #define MAX_STRING_LEN            255
        !            43: 
        !            44: 
        !            45: // Ranges and limits for specific MIB variables.
        !            46: 
        !            47: #define MIB_TOASTER_UP            1
        !            48: #define MIB_TOASTER_DOWN          2
        !            49: 
        !            50: #define MIB_TOASTER_LIGHTLYWARM   1
        !            51: #define MIB_TOASTER_BURNT         10
        !            52: 
        !            53: #define MIB_TOASTER_WHITEBREAD    1
        !            54: #define MIB_TOASTER_OTHERBREAD    7
        !            55: 
        !            56: 
        !            57: // MIB function actions.
        !            58: 
        !            59: #define MIB_ACTION_GET         ASN_RFC1157_GETREQUEST
        !            60: #define MIB_ACTION_SET         ASN_RFC1157_SETREQUEST
        !            61: #define MIB_ACTION_GETNEXT     ASN_RFC1157_GETNEXTREQUEST
        !            62: 
        !            63: 
        !            64: // MIB Variable access privileges.
        !            65: 
        !            66: #define MIB_ACCESS_READ        0
        !            67: #define MIB_ACCESS_WRITE       1
        !            68: #define MIB_ACCESS_READWRITE   2
        !            69: 
        !            70: 
        !            71: // Macro to determine number of sub-oid's in array.
        !            72: 
        !            73: #define OID_SIZEOF( Oid )      ( sizeof Oid / sizeof(UINT) )
        !            74: 
        !            75: 
        !            76: // MIB variable ENTRY definition.  This structure defines the format for
        !            77: // each entry in the MIB.
        !            78: 
        !            79: typedef struct mib_entry
        !            80:            {
        !            81:           AsnObjectIdentifier Oid;
        !            82:           void *              Storage;
        !            83:           BYTE                Type;
        !            84:           UINT                Access;
        !            85:           UINT                (*MibFunc)( UINT, struct mib_entry *,
        !            86:                                           RFC1157VarBind * );
        !            87:           struct mib_entry *  MibNext;
        !            88:           } MIB_ENTRY;
        !            89: 
        !            90: 
        !            91: // Internal MIB structure.
        !            92: 
        !            93: extern MIB_ENTRY Mib[];
        !            94: extern UINT      MIB_num_variables;
        !            95: 
        !            96: 
        !            97: // Prefix to every variable in the MIB.
        !            98: 
        !            99: extern AsnObjectIdentifier MIB_OidPrefix;
        !           100: 
        !           101: 
        !           102: // Function Prototypes.
        !           103: 
        !           104: UINT ResolveVarBind(
        !           105:         IN OUT RFC1157VarBind *VarBind, // Variable Binding to resolve
        !           106:        IN UINT PduAction               // Action specified in PDU
        !           107:        );
        !           108: 
        !           109: UINT MIB_leaf_func(
        !           110:         IN UINT Action,
        !           111:        IN MIB_ENTRY *MibPtr,
        !           112:        IN RFC1157VarBind *VarBind
        !           113:        );
        !           114: 
        !           115: UINT MIB_control_func(
        !           116:         IN UINT Action,
        !           117:        IN MIB_ENTRY *MibPtr,
        !           118:        IN RFC1157VarBind *VarBind
        !           119:        );
        !           120: 
        !           121: UINT MIB_doneness_func(
        !           122:         IN UINT Action,
        !           123:        IN MIB_ENTRY *MibPtr,
        !           124:        IN RFC1157VarBind *VarBind
        !           125:        );
        !           126: 
        !           127: UINT MIB_toasttype_func(
        !           128:         IN UINT Action,
        !           129:        IN MIB_ENTRY *MibPtr,
        !           130:        IN RFC1157VarBind *VarBind
        !           131:        );
        !           132: 
        !           133: 
        !           134: #endif /* testmib_h */
        !           135: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.