1 /*
2  * Copyright (c) 2001, 2003, 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 public abstract class SnmpScopedPduPacket extends SnmpPdu
51     implements Serializable {
52     /**
53      * Message max size the pdu sender can deal with.
54      */
55     public int msgMaxSize = 0;
56 
57     /**
58      * Message identifier.
59      */
60     public int msgId = 0;
61 
62     /**
63      * Message flags. Reportable flag  and security level.</P>
64      *<PRE>
65      * --  .... ...1   authFlag
66      * --  .... ..1.   privFlag
67      * --  .... .1..   reportableFlag
68      * --              Please observe:
69      * --  .... ..00   is OK, means noAuthNoPriv
70      * --  .... ..01   is OK, means authNoPriv
71      * --  .... ..10   reserved, must NOT be used.
72      * --  .... ..11   is OK, means authPriv
73      *</PRE>
74      */
75     public byte msgFlags = 0;
76 
77     /**
78      * The security model the security sub system MUST use in order to deal with this pdu (eg: User based Security Model Id = 3).
79      */
80     public int msgSecurityModel = 0;
81 
82     /**
83      * The context engine Id in which the pdu must be handled (Generaly the local engine Id).
84      */
85     public byte[] contextEngineId = null;
86 
87     /**
88      * The context name in which the OID have to be interpreted.
89      */
90     public byte[] contextName = null;
91 
92     /**
93      * The security parameters. This is an opaque member that is
94      * interpreted by the concerned security model.
95      */
96     public SnmpSecurityParameters securityParameters = null;
97 
98     /**
99      * Constructor. Is only called by a son. Set the version to <CODE>SnmpDefinitions.snmpVersionThree</CODE>.
100      */
SnmpScopedPduPacket()101     protected SnmpScopedPduPacket() {
102         version = SnmpDefinitions.snmpVersionThree;
103     }
104 }
105