package uk.co.wingpath.mib;

import java.util.*;
import java.io.*;

/**
*	Provides the symbols required in the MIB file. 
*	@since 2.01.
*/
public class MIBSym
{
	/**
	*	 Symbols that are to be imported in the MIB from SNMPv2-SMI
	*	 These exclude the following, which should not be imported:
	* 			Basetypes:	OBJECT IDENTIFIER, INTEGER, OCTET STRING, 
	* 			Constructs: SEQUENCE, SEQUENCE OF type
	*/
	static final HashMap<String,String> v2smi = new HashMap<String,String>();

	/**
	*	 Symbols that are to be imported in the MIB from SNMPv2-TC
	*/
	static final HashMap<String,String> v2tc = new HashMap<String,String>();
	/**
	*	 Symbols that are to be imported in the MIB  
	*	 (SnmpAdminString) from SNMP-FRAMEWORK-MIB 
	*/
	static final HashMap<String,String> snmpf = new HashMap<String,String>();
	
	/**
	*	 Symbols that are to be imported in the MIB from Wingpath-MIB
	*/
	static final HashMap<String,String> wmib = new HashMap<String,String>();
	/**
	*	 Symbols that are valid values for MAX-ACCESS clause in OBJECT-TYPE
	*/
	static final HashMap<String,String> maxacc = new HashMap<String,String>();

	/** Source of set of imports */
	static final String SNMPV2SM1 = "FROM SNMPv2-SMI";
	/** Source of set of imports */
	static final String SNMPV2TC = "FROM SNMPv2-TC";
	/** Source of set of imports */
	static final String SNMPF = "FROM SNMP-FRAMEWORK-MIB";
	/** Source of set of imports */
	static final String WINGPATHMIB = "FROM Wingpath-MIB";


	/** Starts the DEFINITIONS in the MIB file*/	
	static final String DEFSTART = "DEFINITIONS ::= BEGIN";

	/** Ends the DEFINITIONS in the MIB file*/	
	static final String DEFEND = "END";
	static final String IMPORTS = "IMPORTS";

	/** Name of OID for the root of the <code>wingpath</code> subtree.*/
	static final String ENTERPRISES = "enterprises";

	// From Wingpath-MIB
	// construct to be imported
	static final String MODSNMP = "modsnmp";

	// From SNMPv2-SMI
	//constructs to be imprted
	static final String MODULEID = "MODULE-IDENTITY";
	static final String OBJTYPE = "OBJECT-TYPE";
	static final String OBJIDENTITY = "OBJECT-IDENTITY";
	static final String NOTIFYTYPE = "NOTIFICATION-TYPE";

	// these should not be imported;
	static final String SEQ = "SEQUENCE";
	static final String SEQOF = "SEQUENCE OF ";


	/** Specifies the SYNTAX base type <code>Integer32</code> with a
	 positive range starting from 1 */

	public static final String INT32P = "Integer32 (1..2147483647)"; 
	/** Specifies the SYNTAX base type <code>INTEGER</code> with a
	 positive range starting from 1 */
	public static final String INTP = "INTEGER (1..2147483647)"; 

	//Base data types (also INTEGER, OCTET STRING, BITS that should not be imported)
	
	/** Specifies the SYNTAX base type <code>OBJECT IDENTIFIER</code>*/	
	public static final String OBJIDF = "OBJECT IDENTIFIER";
	/** Specifies the SYNTAX base type <code>OCTET STRING</code>*/	
	public static final String OCTSTR = "OCTET STRING";
	/** Specifies the SYNTAX type <code>BITS</code>*/
	public static final String BITS = "BITS";
	/** Specifies the SYNTAX base type <code>INTEGER</code>*/	
//	public static final String INT = "INTEGER";


	/** Specifies the SYNTAX base type <code>Unsigned32</code>*/
	public static final String UINT32 = "Unsigned32";
	/** Specifies the SYNTAX base type <code>Integer32</code>*/
	public static final String INT32 = "Integer32"; 
	/** Specifies the SYNTAX base type <code>Counter32</code>*/	
	public static final String CNT32 = "Counter32";
	/** Specifies the SYNTAX base type <code>Counter64</code>*/	
	public static final String CNT64 = "Counter64";
	/** Specifies the SYNTAX base type <code>Gauge32</code>	*/
	public static final String GAUGE32 = "Gauge32";
	/** Specifies the SYNTAX base type <code>TimeTicks</code>*/	
	public static final String TMTKS = "TimeTicks";
	/** Specifies the SYNTAX base type <code>IpAddress</code>*/
	public static final String IPADDR = "IpAddress";
	/** Specifies the SYNTAX base type <code>Opaque</code>*/
	public static final String OPAQUE = "Opaque";


	/**
	*	 Symbols that are to be imported from SNMPv2-SMI
	*	 These exclude the following, which should not be imported:
	* 			Basetypes:	OBJECT IDENTIFIER, INTEGER, OCTET STRING, 
	* 			Constructs: SEQUENCE, SEQUENCE OF type
	*/
	static 
	{
		v2smi.put ("MODULEID", MODULEID);
//V2	v2smi.put ("ENTERPRISES", ENTERPRISES); // not sure whereshould be
 		v2smi.put ("OBJTYPE", OBJTYPE);
//V2	v2smi.put ("OBJIDENTITY", OBJIDENTITY);
//V2	v2smi.put ("NOTIFYTYPE", NOTIFYTYPE );
		v2smi.put ("UINT32", UINT32);
		v2smi.put ("INT32",INT32 );
		v2smi.put ("CNT32", CNT32);
		v2smi.put ("CNT64",CNT64 );
		v2smi.put ("GAUGE32", GAUGE32);
		v2smi.put ("TMTKS",TMTKS );
//V2	v2smi.put ("IPADDR", IPADDR);
//V2	v2smi.put ("OPAQUE", OPAQUE);
	}

	
	// From SNMOV2-TC
	/**TEXTUAL CONVENTION */

	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String PHYSADDR  = "PhysAddress";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String MACADDR  = "MacAddress";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String TRUTHVAL  = "TruthValue";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String TESTANDINCR = "TestAndIncr";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String AUTOTYPE  = "AutonomousType";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String INSTPTR = "InstancePointer";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String VARPTR = "VariablePointer";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String RWPTR = "RowPointer";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String RWSTATUS = "RowStatus";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String TMINTERV = "TimeInterval";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String DATEANDTM = "DateAndTime";
	/** Defines a Textual Convention type (a value for SYNTAX) */
	public static final String STRTYPE = "StorageType";
	/** Defines a Textual Convention type for the value of SYNTAX*/
	public static final String TDOM = "TDomain";
	/** Defines a Textual Convention type for the value of SYNTAX*/
	public static final String TADDR = "TAddress";
	
	/** Specifies the SYNTAX Textual Convention type <code>DisplayString</code>*/
	public static final String DISPSTR = "DisplayString";

	/**
	*	 Symbols that are to be imported from SNMPv2-TC
	*/
	static 
	{
		v2tc.put ("DISPSTR", DISPSTR );

//V2		v2tc.put ("PHYSADDR", PHYSADDR );
//V2		v2tc.put ("MACADDR", MACADDR );
//V2		v2tc.put ("TRUTHVAL", TRUTHVAL  );
//V2		v2tc.put ("TESTANDINCR",TESTANDINCR  );
//V2		v2tc.put ("AUTOTYPE", AUTOTYPE );
//V2		v2tc.put ("INSTPTR", INSTPTR );
//V2		v2tc.put ("VARPTR", VARPTR  );
//V2		v2tc.put ("RWPTR", RWPTR );
//V2		v2tc.put ("RWSTATUS", RWSTATUS );
//V2		v2tc.put ("TMINTERV",  TMINTERV );
//V2		v2tc.put ("DATEANDTM", DATEANDTM );
//V2		v2tc.put ("STRTYPE",  STRTYPE);
//V2		v2tc.put ("TDOM",  TDOM);
//V2		v2tc.put ("TADDR", TADDR );
	}
	/**
	*	 Symbols that are to be imported  SnmpAdminString from SNMP-FRAMEWORK-MIB 
	*/
	static 
	{
		snmpf.put ("SNMPADMINSTR", "SnmpAdminString"  );
	}

	/**
	*	 Symbols that are to be imported from Wingpath-MIBC
	*/
	static 
	{
		wmib.put ("MODSNMP", MODSNMP );
	}

	//MAX-ACCESS types

	//not-accessible, acccessible-for-notify, read-only,read-write, read-create
	/** Specifies the  MAX-ACCESS type <code>not-accessible</current>*/
	public static final String NOACC = "not-accessible";
	/** Specifies the  MAX-ACCESS type <code>accessible-for-notify</current>*/
	public static final String ACCNTFY = "accessible-for-notify";
	/** Specifies the  MAX-ACCESS type <code>read-only</current>*/
	public static final String RO = "read-only";
	/** Specifies the  MAX-ACCESS type <code>read-write</current>*/
	public static final String RW = "read-write";
	/** Specifies the  MAX-ACCESS type <code>read-create</current>*/
	public static final String RC = "read-create";

	// STATUS types 

	/** Specifies the  STATUS type <code>current</current>*/
	public static final String CUR = "current";
	/** Specifies the  STATUS type <code>deprecated</code>*/
	public static final String DEPREC = "deprecated";
	/** Specifies the  STATUS type <code>obsolete</code>*/
	public static final String OBSOL = "obsolete";


	static 
	{
		maxacc.put ("NOACC", NOACC );
		maxacc.put ("ACCNFTY", ACCNTFY );
		maxacc.put ("RO", RO );
		maxacc.put ("RW", RW );
		maxacc.put ("RC", RC );
	}



	/** Defines in the MODULE-IDENTITY the last time of updating the MIB*/
	static String LASTUPDATED = "\"201302070000Z\"";
	
	/** Defines the MODULE-IDENTITY descriptor <code>wingpath</code> */
	static final String WINGPATH = "wingpath";


	/** Defines the MODULE-IDENTITY description of first version */
	static final String REVDESC = "Initial version";

	/** Defines a double-quote */
	static final String QUOTE = "\"";
	/** Defines a semi-colon */
	static final String SC = ";";
	/** Defines a comma */
	static final String COMMA= ",";
	
	/** Defines start of positive numbering for sub-typing of syntax 
		value for an index*/
	static final String SPSTYPE = "(1..";
	/** Defines close bracket for end sub-typing of syntax value */
	static final String ESTYPE= ")";

	/** Defines  open curly bracket  */
	static final String SBITS = "{";
	/** Defines close curly bracket  */
	static final String EBITS= "}";

	/** Defines a single tab indent */
	static final String INDENT= "\t";
	// Newline  
	static final String NL= "\n";
	 
	/** Defines syntax for start of comment in MIB file  */
	static final String CMT = "-- ";
	
	/** Defines syntax for 'defined as' with open curly bracket  */
	static final String INAMEDS =  "::= { ";


	/** Defines syntax for 'defined as' */
	static final String INAMED =  "::= ";

	// Instance Id Name End
	/** Defines syntax for end 'defined as oid' */
	static final String INAMEDE = "}";

	/** Indents the libe by the number of tabs specified
	*	@param out the file stream to which the chars should be written
	(	@param i the number of indents.
	*/	
	static void indent (PrintWriter out, int i)
	{
		for (int n = 0 ; n < i ; n++)
			out.print (INDENT);
	}	
}
