public class TrapPduv1 extends Pdu
Note that the SNMPv1 Trap PDU is the only PDU with a different PDU
format. It has additional fields like enterprise
,
ipAddress
, genericTrap
,
specificTrap
and timeTicks
.
TrapPduv2
added, answered, context, encodedPacket, errind, errstat, msg_type, reqVarbinds, respVarbinds, snmpv3MsgId
Constructor and Description |
---|
TrapPduv1(SnmpContext con)
Constructor.
|
TrapPduv1(SnmpContextPool con)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEnterprise()
Returns the type of object generating the trap.
|
int |
getGenericTrap()
Returns the generic trap type.
|
java.lang.String |
getGenericTrapString()
Returns the string representation of the generic trap.
|
byte[] |
getIpAddress()
Returns the IP Address of the object generating the trap.
|
int |
getSpecificTrap()
Returns the specific trap code.
|
long |
getTimeTicks()
Returns the sysUpTime of the agent.
|
protected boolean |
isExpectingResponse()
Returns that this type of PDU is not expecting a response.
|
protected void |
new_value(int n,
varbind res)
Has no meaning, since there is not response.
|
boolean |
send()
Sends the TrapPduv1.
|
void |
setEnterprise(java.lang.String var)
Sets the type of object generating the trap.
|
void |
setGenericTrap(int var)
Sets the generic trap type.
|
void |
setIpAddress(byte[] var)
Sets the IP Address of the object generating the trap.
|
void |
setSpecificTrap(int var)
Sets the specific trap code.
|
void |
setTimeTicks(long var)
Sets the sysUpTime of the agent.
|
protected void |
tell_them()
Has no meaning, since there is not response.
|
java.lang.String |
toString()
Returns the string representation of this object.
|
addOid, addOid, addOid, addOid, addOid, addToTrans, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, getRetryIntervals, isTimedOut, notifyObservers, printVars, send, send, sendme, setErrorIndex, setErrorStatus, setErrorStatus, setMsgType, setRetryIntervals, toString, waitForSelf
public TrapPduv1(SnmpContext con)
con
- The context (v1) of the TrapPduv1SnmpContext
public TrapPduv1(SnmpContextPool con)
con
- The context pool (v1) of the TrapPduv1SnmpContext
public void setEnterprise(java.lang.String var)
public java.lang.String getEnterprise()
public void setIpAddress(byte[] var)
public byte[] getIpAddress()
public void setGenericTrap(int var)
public int getGenericTrap()
public java.lang.String getGenericTrapString()
getGenericTrap()
public void setSpecificTrap(int var)
public int getSpecificTrap()
public void setTimeTicks(long var)
RFC1155-SMI: TimeTicks:
This application-wide type represents a non-negative integer which
counts the time in hundredths of a second since some epoch. When
object types are defined in the MIB which use this ASN.1 type, the
description of the object type identifies the reference epoch.
public long getTimeTicks()
setTimeTicks(long)
public boolean send() throws java.io.IOException, PduException
send
in class Pdu
java.io.IOException
PduException
public java.lang.String toString()
protected void new_value(int n, varbind res)
protected void tell_them()
protected boolean isExpectingResponse()
isExpectingResponse
in class Pdu