1 /* 2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.jmx.snmp; 27 28 import java.io.Serializable; 29 30 import com.sun.jmx.snmp.SnmpSecurityParameters; 31 32 import com.sun.jmx.snmp.SnmpDefinitions; 33 /** 34 * Is the fully decoded representation of an SNMP V3 packet. 35 * <P> 36 * 37 * Classes are derived from <CODE>SnmpPdu</CODE> to 38 * represent the different forms of SNMP pdu 39 * ({@link com.sun.jmx.snmp.SnmpScopedPduRequest SnmpScopedPduRequest}, 40 * {@link com.sun.jmx.snmp.SnmpScopedPduBulk SnmpScopedPduBulk}). 41 * <BR>The <CODE>SnmpScopedPduPacket</CODE> class defines the attributes 42 * common to every scoped SNMP packets. 43 * 44 * <p><b>This API is a Sun Microsystems internal API and is subject 45 * to change without notice.</b></p> 46 * @see SnmpV3Message 47 * 48 * @since 1.5 49 */ 50 @SuppressWarnings("serial") // JDK implementation class 51 public abstract class SnmpScopedPduPacket extends SnmpPdu 52 implements Serializable { 53 /** 54 * Message max size the pdu sender can deal with. 55 */ 56 public int msgMaxSize = 0; 57 58 /** 59 * Message identifier. 60 */ 61 public int msgId = 0; 62 63 /** 64 * Message flags. Reportable flag and security level.</P> 65 *<PRE> 66 * -- .... ...1 authFlag 67 * -- .... ..1. privFlag 68 * -- .... .1.. reportableFlag 69 * -- Please observe: 70 * -- .... ..00 is OK, means noAuthNoPriv 71 * -- .... ..01 is OK, means authNoPriv 72 * -- .... ..10 reserved, must NOT be used. 73 * -- .... ..11 is OK, means authPriv 74 *</PRE> 75 */ 76 public byte msgFlags = 0; 77 78 /** 79 * The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3). 80 */ 81 public int msgSecurityModel = 0; 82 83 /** 84 * The context engine Id in which the pdu must be handled (Generaly the local engine Id). 85 */ 86 public byte[] contextEngineId = null; 87 88 /** 89 * The context name in which the OID have to be interpreted. 90 */ 91 public byte[] contextName = null; 92 93 /** 94 * The security parameters. This is an opaque member that is 95 * interpreted by the concerned security model. 96 */ 97 public SnmpSecurityParameters securityParameters = null; 98 99 /** 100 * Constructor. Is only called by a son. Set the version to <CODE>SnmpDefinitions.snmpVersionThree</CODE>. 101 */ 102 protected SnmpScopedPduPacket() { 103 version = SnmpDefinitions.snmpVersionThree; 104 } 105 }