001 /** 002 * ISnmpConstants.java, ABr, 2001 003 * 004 * Copyright (c) 2001-2005 softwareAB Co. 005 * All rights reserved. 006 * 007 * SOFTWAREAB MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE 008 * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING 009 * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 010 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOFTWAREAB 011 * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A 012 * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS 013 * DERIVATIVES. 014 * 015 * Developed by softwareAB Co. 016 * 6806 Silver Ann Drive 017 * Lorton, VA 22079 018 * andy@softwareab.net 019 * http://softwareab.net/ 020 */ 021 package com.abr.snmp ; 022 023 import com.abr.common.* ; 024 025 /** 026 * Defines all important constants for the SNMP package. 027 */ 028 public interface ISnmpConstants { 029 // ASN field types 030 public static final int ASN_BOOLEAN = 0x01 ; 031 public static final int ASN_INTEGER = 0x02 ; 032 public static final int ASN_BIT_STR = 0x03 ; 033 public static final int ASN_OCTET_STR = 0x04 ; 034 public static final int ASN_NULL = 0x05 ; 035 public static final int ASN_OID = 0x06 ; 036 public static final int ASN_SEQUENCE = 0x10 ; 037 public static final int ASN_SET = 0x11 ; 038 public static final int ASN_UNIVERSAL = 0x00 ; 039 public static final int ASN_APPLICATION = 0x40 ; 040 public static final int ASN_CONTEXT = 0x80 ; 041 public static final int ASN_PRIVATE = 0xC0 ; 042 public static final int ASN_PRIMITIVE = 0x00 ; 043 public static final int ASN_CONSTRUCTOR = 0x20 ; 044 public static final int ASN_LONG_LEN = 0x80 ; 045 public static final int ASN_EXTENSION_ID = 0x1F ; 046 public static final int ASN_BIT8 = 0x80 ; 047 048 // SNMP version 049 public static final int SNMP_VERSION_1 = 0 ; 050 public static final int ASN_VERSION_2C = 1 ; 051 052 053 // defined types (from the SMI, RFC 1065) 054 public static final int SMI_IPADDRESS = ASN_APPLICATION | 0 ; 055 public static final int SMI_COUNTER = ASN_APPLICATION | 1 ; 056 public static final int SMI_GUAGE = ASN_APPLICATION | 2 ; 057 public static final int SMI_TIMETICKS = ASN_APPLICATION | 3 ; 058 public static final int SMI_OPAQUE = ASN_APPLICATION | 4 ; 059 public static final int SMI_NSAP = ASN_APPLICATION | 5 ; 060 public static final int SMI_COUNTER64 = ASN_APPLICATION | 6 ; 061 public static final int SMI_UINTEGER = ASN_APPLICATION | 7 ; 062 063 // types of queries 064 public static final int GET_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x00 ; 065 public static final int GETNEXT_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x01 ; 066 public static final int GET_RSP_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x02 ; 067 public static final int SET_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x03 ; 068 public static final int TRP_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x04 ; 069 public static final int GETBULK_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x05 ; 070 public static final int INFORM_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x06 ; 071 public static final int TRP2_REQ_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x07 ; 072 public static final int REPORT_MSG = ASN_CONTEXT | ASN_CONSTRUCTOR | 0x08 ; 073 074 // i think these are easier to remember than "trp" 075 public static final int TRAP_REQ_MSG = TRP_REQ_MSG ; 076 public static final int TRAP2_REQ_MSG = TRP2_REQ_MSG ; 077 078 // SNMP values 079 public static final int SNMP_NOSUCHOBJECT = ASN_CONTEXT | ASN_PRIMITIVE | 0x00 ; 080 public static final int SNMP_NOSUCHINSTANCE = ASN_CONTEXT | ASN_PRIMITIVE | 0x01 ; 081 public static final int SNMP_EMDOFMIBVIEW = ASN_CONTEXT | ASN_PRIMITIVE | 0x02 ; 082 } //ISnmpConstants 083