1. /*
  2. * @(#)file SnmpScopedPduPacket.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.17
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. import java.io.Serializable;
  13. import com.sun.jmx.snmp.SnmpSecurityParameters;
  14. import com.sun.jmx.snmp.SnmpDefinitions;
  15. /**
  16. * Is the fully decoded representation of an SNMP V3 packet.
  17. * <P>
  18. *
  19. * Classes are derived from <CODE>SnmpPdu</CODE> to
  20. * represent the different forms of SNMP pdu
  21. * ({@link com.sun.jmx.snmp.SnmpScopedPduRequest SnmpScopedPduRequest},
  22. * {@link com.sun.jmx.snmp.SnmpScopedPduBulk SnmpScopedPduBulk}).
  23. * <BR>The <CODE>SnmpScopedPduPacket</CODE> class defines the attributes
  24. * common to every scoped SNMP packets.
  25. *
  26. * <p><b>This API is a Sun Microsystems internal API and is subject
  27. * to change without notice.</b></p>
  28. * @see SnmpV3Message
  29. *
  30. * @since 1.5
  31. */
  32. public abstract class SnmpScopedPduPacket extends SnmpPdu
  33. implements Serializable {
  34. /**
  35. * Message max size the pdu sender can deal with.
  36. */
  37. public int msgMaxSize = 0;
  38. /**
  39. * Message identifier.
  40. */
  41. public int msgId = 0;
  42. /**
  43. * Message flags. Reportable flag and security level.</P>
  44. *<PRE>
  45. * -- .... ...1 authFlag
  46. * -- .... ..1. privFlag
  47. * -- .... .1.. reportableFlag
  48. * -- Please observe:
  49. * -- .... ..00 is OK, means noAuthNoPriv
  50. * -- .... ..01 is OK, means authNoPriv
  51. * -- .... ..10 reserved, must NOT be used.
  52. * -- .... ..11 is OK, means authPriv
  53. *</PRE>
  54. */
  55. public byte msgFlags = 0;
  56. /**
  57. * The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3).
  58. */
  59. public int msgSecurityModel = 0;
  60. /**
  61. * The context engine Id in which the pdu must be handled (Generaly the local engine Id).
  62. */
  63. public byte[] contextEngineId = null;
  64. /**
  65. * The context name in which the OID have to be interpreted.
  66. */
  67. public byte[] contextName = null;
  68. /**
  69. * The security parameters. This is an opaque member that is
  70. * interpreted by the concerned security model.
  71. */
  72. public SnmpSecurityParameters securityParameters = null;
  73. /**
  74. * Constructor. Is only called by a son. Set the version to <CODE>SnmpDefinitions.snmpVersionThree</CODE>.
  75. */
  76. protected SnmpScopedPduPacket() {
  77. version = SnmpDefinitions.snmpVersionThree;
  78. }
  79. }