1 11 package com.sun.jmx.snmp; 12 13 14 import java.io.Serializable ; 15 import java.net.InetAddress ; 16 34 public abstract class SnmpPdu implements SnmpDefinitions, Serializable { 35 36 41 public int type=0 ; 42 43 48 public int version=0 ; 49 50 54 public SnmpVarBind[] varBindList ; 55 56 57 62 public int requestId=0 ; 63 64 70 public InetAddress address ; 71 72 78 public int port=0 ; 79 80 87 public static String pduTypeToString(int cmd) { 88 switch (cmd) { 89 case pduGetRequestPdu : 90 return "SnmpGet" ; 91 case pduGetNextRequestPdu : 92 return "SnmpGetNext" ; 93 case pduWalkRequest : 94 return "SnmpWalk(*)" ; 95 case pduSetRequestPdu : 96 return "SnmpSet" ; 97 case pduGetResponsePdu : 98 return "SnmpResponse" ; 99 case pduV1TrapPdu : 100 return "SnmpV1Trap" ; 101 case pduV2TrapPdu : 102 return "SnmpV2Trap" ; 103 case pduGetBulkRequestPdu : 104 return "SnmpGetBulk" ; 105 case pduInformRequestPdu : 106 return "SnmpInform" ; 107 } 108 return "Unknown Command = " + cmd ; 109 } 110 } 111 | Popular Tags |