OpenJDK / jigsaw / jake / jdk
changeset 11249:07b10dda5f1c
8060692: Delete com/sun/jmx/snmp and sun/management/snmp from OpenJDK
Reviewed-by: alanb, dfuchs, erikj, mchung
author | sjiang |
---|---|
date | Wed, 22 Oct 2014 09:13:52 +0200 |
parents | 526d69b15ff5 |
children | 01349233c077 |
files | src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerDecoder.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerEncoder.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/EnumRowStatus.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/Enumerated.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.README src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclEntryImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/GroupImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Host.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAccess.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclItem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunities.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunity.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMEnterprise.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHost.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostInform.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostName.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformCommunity.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformInterestedHost.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformItem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpAddress.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpMask.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpV6Address.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMManagers.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMask.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMaskV6.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMSecurityDefs.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapCommunity.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapInterestedHost.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapItem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapNum.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JJTParserState.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Node.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/OwnerImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseError.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserConstants.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserTokenManager.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserTreeConstants.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/PermissionImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/PrincipalImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/README.update src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/SimpleNode.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/SnmpAcl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Token.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/TokenMgrError.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/InetAddressAcl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/ServiceName.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpAckPdu.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpBadSecurityLevelException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpCounter.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpCounter64.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngine.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineFactory.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineId.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpEngineParameters.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpGauge.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpInt.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpIpAddress.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpMessage.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpMsg.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpNull.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpOpaque.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpParams.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPdu.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduBulk.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduBulkType.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduFactory.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduFactoryBER.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduRequestType.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpPduTrap.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduBulk.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduPacket.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpScopedPduRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpSecurityException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpSecurityParameters.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpStatusException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpString.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpStringFixed.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpTooBigException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownAccContrModelException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownModelException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownModelLcdException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownMsgProcModelException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownSecModelException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnknownSubSystemException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUnsignedInt.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpUsmKeyHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpV3Message.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/SnmpValue.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/ThreadContext.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/UserAcl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/AcmChecker.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/LongList.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpEntryOid.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpGenericMetaServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpIndex.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMib.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgent.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibEntry.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibGroup.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibNode.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibOid.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpStandardMetaServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableCallbackHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableEntryFactory.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableEntryNotification.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpTableSupport.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/SnmpUserDataFactory.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/agent/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/ClientHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicationException.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/CommunicatorServerMBean.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpInformHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpMibTree.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/daemon/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/DefaultPaths.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/SnmpProperties.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/defaults/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpAccessControlModel.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpAccessControlSubSystem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpDecryptedPdu.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpEngineImpl.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpIncomingRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpIncomingResponse.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpLcd.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpModel.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpModelLcd.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpMsgProcessingModel.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpMsgProcessingSubSystem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpOutgoingRequest.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecurityCache.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecurityModel.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSecuritySubSystem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpSubSystem.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/SnmpTools.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/internal/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/mpm/SnmpMsgTranslator.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/mpm/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/package.html src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/Task.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/TaskServer.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/ThreadService.java src/jdk.snmp/share/classes/com/sun/jmx/snmp/tasks/package.html src/jdk.snmp/share/classes/sun/management/snmp/AdaptorBootstrap.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JVM_MANAGEMENT_MIB_IMPL.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmClassLoadingImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmCompilationImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemGCEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemGCTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemManagerEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemManagerTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemMgrPoolRelEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemMgrPoolRelTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemPoolTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemoryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmMemoryMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmOSImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTBootClassPathEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTBootClassPathTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTClassPathEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTClassPathTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTInputArgsEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTInputArgsTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTLibraryPathEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRTLibraryPathTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmRuntimeMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceEntryImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadInstanceTableMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadingImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/JvmThreadingMetaImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/NotificationTarget.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/NotificationTargetImpl.java src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/README src/jdk.snmp/share/classes/sun/management/snmp/jvminstr/package.html src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmClassesVerboseLevel.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmJITCompilerTimeMonitoring.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemManagerState.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolCollectThreshdSupport.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolState.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolThreshdSupport.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemPoolType.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemoryGCCall.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmMemoryGCVerboseLevel.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmRTBootClassPathSupport.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmThreadContentionMonitoring.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/EnumJvmThreadCpuTimeMonitoring.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JVM_MANAGEMENT_MIB.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JVM_MANAGEMENT_MIBOidTable.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmClassLoadingMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmClassLoadingMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmCompilationMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmCompilationMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemGCTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemManagerTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemMgrPoolRelTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemPoolTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemoryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmMemoryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmOSMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmOSMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTBootClassPathTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTClassPathTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTInputArgsTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRTLibraryPathTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRuntimeMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmRuntimeMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceEntryMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceEntryMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadInstanceTableMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadingMBean.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/JvmThreadingMeta.java src/jdk.snmp/share/classes/sun/management/snmp/jvmmib/package.html src/jdk.snmp/share/classes/sun/management/snmp/package.html src/jdk.snmp/share/classes/sun/management/snmp/util/JvmContextFactory.java src/jdk.snmp/share/classes/sun/management/snmp/util/MibLogger.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpCachedData.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpListTableCache.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpLoadedClassData.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpNamedListTableCache.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpTableCache.java src/jdk.snmp/share/classes/sun/management/snmp/util/SnmpTableHandler.java src/jdk.snmp/share/classes/sun/management/snmp/util/package.html test/com/sun/jmx/snmp/SnmpOidHashCode.java test/com/sun/jmx/snmp/TimeTicksWrapping.java |
diffstat | 272 files changed, 0 insertions(+), 60113 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerDecoder.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,757 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp; - - - - -/** - * The <CODE>BerDecoder</CODE> class is used for decoding - * BER-encoded data. - * - * A <CODE>BerDecoder</CODE> needs to be set up with the byte string containing - * the encoding. It maintains a current position in the byte string. - * - * Methods allows to fetch integer, string, OID, etc., from the current - * position. After a fetch the current position is moved forward. - * - * A fetch throws a <CODE>BerException</CODE> if the encoding is not of the - * expected type. - * - * <p><b>This API is a Sun Microsystems internal API and is subject - * to change without notice.</b></p> - * - * @since 1.5 - */ - -public class BerDecoder { - - /** - * Constructs a new decoder and attaches it to the specified byte string. - * - * @param b The byte string containing the encoded data. - */ - - public BerDecoder(byte b[]) { - bytes = b ; - reset() ; - } - - public void reset() { - next = 0 ; - stackTop = 0 ; - } - - /** - * Fetch an integer. - * - * @return The decoded integer. - * - * @exception BerException Current position does not point to an integer. - */ - - public int fetchInteger() throws BerException { - return fetchInteger(IntegerTag) ; - } - - - /** - * Fetch an integer with the specified tag. - * - * @param tag The expected tag. - * - * @return The decoded integer. - * - * @exception BerException Current position does not point to an integer - * or the tag is not the expected one. - */ - - public int fetchInteger(int tag) throws BerException { - int result = 0 ; - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - result = fetchIntegerValue() ; - } - catch(BerException e) { - next = backup ; - throw e ; - } - - return result ; - } - - - - /** - * Fetch an integer and return a long value. - * - * @return The decoded integer. - * - * @exception BerException Current position does not point to an integer. - */ - - public long fetchIntegerAsLong() throws BerException { - return fetchIntegerAsLong(IntegerTag) ; - } - - - /** - * Fetch an integer with the specified tag and return a long value. - * - * @param tag The expected tag. - * - * @return The decoded integer. - * - * @exception BerException Current position does not point to an integer - * or the tag is not the expected one. - */ - - public long fetchIntegerAsLong(int tag) throws BerException { - long result = 0 ; - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - result = fetchIntegerValueAsLong() ; - } - catch(BerException e) { - next = backup ; - throw e ; - } - - return result ; - } - - - - /** - * Fetch an octet string. - * - * @return The decoded string. - * - * @exception BerException Current position does not point to an octet string. - */ - - public byte[] fetchOctetString() throws BerException { - return fetchOctetString(OctetStringTag) ; - } - - - /** - * Fetch an octet string with a specified tag. - * - * @param tag The expected tag. - * - * @return The decoded string. - * - * @exception BerException Current position does not point to an octet string - * or the tag is not the expected one. - */ - - public byte[] fetchOctetString(int tag) throws BerException { - byte[] result = null ; - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - result = fetchStringValue() ; - } - catch(BerException e) { - next = backup ; - throw e ; - } - - return result ; - } - - - /** - * Fetch an object identifier. - * - * @return The decoded object identifier as an array of long. - */ - - public long[] fetchOid() throws BerException { - return fetchOid(OidTag) ; - } - - - /** - * Fetch an object identifier with a specified tag. - * - * @param tag The expected tag. - * - * @return The decoded object identifier as an array of long. - * - * @exception BerException Current position does not point to an oid - * or the tag is not the expected one. - */ - - public long[] fetchOid(int tag) throws BerException { - long[] result = null ; - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - result = fetchOidValue() ; - } - catch(BerException e) { - next = backup ; - throw e ; - } - - return result ; - } - - - /** - * Fetch a <CODE>NULL</CODE> value. - * - * @exception BerException Current position does not point to <CODE>NULL</CODE> value. - */ - - public void fetchNull() throws BerException { - fetchNull(NullTag) ; - } - - - /** - * Fetch a <CODE>NULL</CODE> value with a specified tag. - * - * @param tag The expected tag. - * - * @exception BerException Current position does not point to - * <CODE>NULL</CODE> value or the tag is not the expected one. - */ - - public void fetchNull(int tag) throws BerException { - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - final int length = fetchLength(); - if (length != 0) throw new BerException(); - } - catch(BerException e) { - next = backup ; - throw e ; - } - } - - - - /** - * Fetch an <CODE>ANY</CODE> value. In fact, this method does not decode anything - * it simply returns the next TLV as an array of bytes. - * - * @return The TLV as a byte array. - * - * @exception BerException The next TLV is really badly encoded... - */ - - public byte[] fetchAny() throws BerException { - byte[] result = null ; - final int backup = next ; - try { - final int tag = fetchTag() ; - final int contentLength = fetchLength() ; - if (contentLength < 0) throw new BerException() ; - final int tlvLength = next + contentLength - backup ; - if (contentLength > (bytes.length - next)) - throw new IndexOutOfBoundsException("Decoded length exceeds buffer"); - final byte[] data = new byte[tlvLength] ; - java.lang.System.arraycopy(bytes,backup,data,0,tlvLength); - // for (int i = 0 ; i < tlvLength ; i++) { - // data[i] = bytes[backup + i] ; - // } - next = next + contentLength ; - result = data; - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - // catch(Error e) { - // debug("fetchAny: Error decoding BER: " + e); - // throw e; - // } - - return result ; - } - - - /** - * Fetch an <CODE>ANY</CODE> value with a specific tag. - * - * @param tag The expected tag. - * - * @return The TLV as a byte array. - * - * @exception BerException The next TLV is really badly encoded... - */ - - public byte[] fetchAny(int tag) throws BerException { - if (getTag() != tag) { - throw new BerException() ; - } - return fetchAny() ; - } - - - - /** - * Fetch a sequence header. - * The decoder computes the end position of the sequence and push it - * on its stack. - * - * @exception BerException Current position does not point to a sequence header. - */ - - public void openSequence() throws BerException { - openSequence(SequenceTag) ; - } - - - /** - * Fetch a sequence header with a specific tag. - * - * @param tag The expected tag. - * - * @exception BerException Current position does not point to a sequence header - * or the tag is not the expected one. - */ - - public void openSequence(int tag) throws BerException { - final int backup = next ; - try { - if (fetchTag() != tag) { - throw new BerException() ; - } - final int l = fetchLength() ; - if (l < 0) throw new BerException(); - if (l > (bytes.length - next)) throw new BerException(); - stackBuf[stackTop++] = next + l ; - } - catch(BerException e) { - next = backup ; - throw e ; - } - } - - - /** - * Close a sequence. - * The decode pull the stack and verifies that the current position - * matches with the calculated end of the sequence. If not it throws - * an exception. - * - * @exception BerException The sequence is not expected to finish here. - */ - - public void closeSequence() throws BerException { - if (stackBuf[stackTop - 1] == next) { - stackTop-- ; - } - else { - throw new BerException() ; - } - } - - - /** - * Return <CODE>true</CODE> if the end of the current sequence is not reached. - * When this method returns <CODE>false</CODE>, <CODE>closeSequence</CODE> can (and must) be - * invoked. - * - * @return <CODE>true</CODE> if there is still some data in the sequence. - */ - - public boolean cannotCloseSequence() { - return (next < stackBuf[stackTop - 1]) ; - } - - - /** - * Get the tag of the data at the current position. - * Current position is unchanged. - * - * @return The next tag. - */ - - public int getTag() throws BerException { - int result = 0 ; - final int backup = next ; - try { - result = fetchTag() ; - } - finally { - next = backup ; - } - - return result ; - } - - - - public String toString() { - final StringBuffer result = new StringBuffer(bytes.length * 2) ; - for (int i = 0 ; i < bytes.length ; i++) { - final int b = (bytes[i] > 0) ? bytes[i] : bytes[i] + 256 ; - if (i == next) { - result.append("(") ; - } - result.append(Character.forDigit(b / 16, 16)) ; - result.append(Character.forDigit(b % 16, 16)) ; - if (i == next) { - result.append(")") ; - } - } - if (bytes.length == next) { - result.append("()") ; - } - - return new String(result) ; - } - - - // - // Some standard tags - // - public final static int BooleanTag = 1 ; - public final static int IntegerTag = 2 ; - public final static int OctetStringTag = 4 ; - public final static int NullTag = 5 ; - public final static int OidTag = 6 ; - public final static int SequenceTag = 0x30 ; - - - - - ////////////////////////// PRIVATE /////////////////////////////// - - - - /** - * Fetch a tag and move the current position forward. - * - * @return The tag - */ - - private final int fetchTag() throws BerException { - int result = 0 ; - final int backup = next ; - - try { - final byte b0 = bytes[next++] ; - result = (b0 >= 0) ? b0 : b0 + 256 ; - if ((result & 31) == 31) { - while ((bytes[next] & 128) != 0) { - result = result << 7 ; - result = result | (bytes[next++] & 127); - } - } - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - - return result ; - } - - - /** - * Fetch a length and move the current position forward. - * - * @return The length - */ - - private final int fetchLength() throws BerException { - int result = 0 ; - final int backup = next ; - - try { - final byte b0 = bytes[next++] ; - if (b0 >= 0) { - result = b0 ; - } - else { - for (int c = 128 + b0 ; c > 0 ; c--) { - final byte bX = bytes[next++] ; - result = result << 8 ; - result = result | ((bX >= 0) ? bX : bX+256) ; - } - } - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - - return result ; - } - - - /** - * Fetch an integer value and move the current position forward. - * - * @return The integer - */ - - private int fetchIntegerValue() throws BerException { - int result = 0 ; - final int backup = next ; - - try { - final int length = fetchLength() ; - if (length <= 0) throw new BerException() ; - if (length > (bytes.length - next)) throw - new IndexOutOfBoundsException("Decoded length exceeds buffer"); - final int end = next + length ; - result = bytes[next++] ; - while (next < end) { - final byte b = bytes[next++] ; - if (b < 0) { - result = (result << 8) | (256 + b) ; - } - else { - result = (result << 8) | b ; - } - } - } - catch(BerException e) { - next = backup ; - throw e ; - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - catch(ArithmeticException e) { - next = backup ; - throw new BerException() ; - } - return result ; - } - - - /** - * Fetch an integer value and return a long value. - * FIX ME: someday we could have only on fetchIntegerValue() which always - * returns a long value. - * - * @return The integer - */ - - private final long fetchIntegerValueAsLong() throws BerException { - long result = 0 ; - final int backup = next ; - - try { - final int length = fetchLength() ; - if (length <= 0) throw new BerException() ; - if (length > (bytes.length - next)) throw - new IndexOutOfBoundsException("Decoded length exceeds buffer"); - - final int end = next + length ; - result = bytes[next++] ; - while (next < end) { - final byte b = bytes[next++] ; - if (b < 0) { - result = (result << 8) | (256 + b) ; - } - else { - result = (result << 8) | b ; - } - } - } - catch(BerException e) { - next = backup ; - throw e ; - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - catch(ArithmeticException e) { - next = backup ; - throw new BerException() ; - } - return result ; - } - - - /** - * Fetch a byte string and move the current position forward. - * - * @return The byte string - */ - - private byte[] fetchStringValue() throws BerException { - byte[] result = null ; - final int backup = next ; - - try { - final int length = fetchLength() ; - if (length < 0) throw new BerException() ; - if (length > (bytes.length - next)) - throw new IndexOutOfBoundsException("Decoded length exceeds buffer"); - final byte data[] = new byte[length] ; - java.lang.System.arraycopy(bytes,next,data,0,length); - next += length; - // int i = 0 ; - // while (i < length) { - // result[i++] = bytes[next++] ; - // } - result = data; - } - catch(BerException e) { - next = backup ; - throw e ; - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - catch(ArithmeticException e) { - next = backup ; - throw new BerException() ; - } - // catch(Error e) { - // debug("fetchStringValue: Error decoding BER: " + e); - // throw e; - // } - - return result ; - } - - - - /** - * Fetch an oid and move the current position forward. - * - * @return The oid - */ - - private final long[] fetchOidValue() throws BerException { - long[] result = null ; - final int backup = next ; - - try { - final int length = fetchLength() ; - if (length <= 0) throw new BerException() ; - if (length > (bytes.length - next)) - throw new IndexOutOfBoundsException("Decoded length exceeds buffer"); - // Count how many bytes have their 8th bit to 0 - // -> this gives the number of components in the oid - int subidCount = 2 ; - for (int i = 1 ; i < length ; i++) { - if ((bytes[next + i] & 0x80) == 0) { - subidCount++ ; - } - } - final int datalen = subidCount; - final long[] data = new long[datalen]; - final byte b0 = bytes[next++] ; - - // bugId 4641746 - // The 8th bit of the first byte should always be set to 0 - if (b0 < 0) throw new BerException(); - - // bugId 4641746 - // The first sub Id cannot be greater than 2 - final long lb0 = b0 / 40 ; - if (lb0 > 2) throw new BerException(); - - final long lb1 = b0 % 40; - data[0] = lb0 ; - data[1] = lb1 ; - int i = 2 ; - while (i < datalen) { - long subid = 0 ; - byte b = bytes[next++] ; - while ((b & 0x80) != 0) { - subid = (subid << 7) | (b & 0x7f) ; - // bugId 4654674 - if (subid < 0) throw new BerException(); - b = bytes[next++] ; - } - subid = (subid << 7) | b ; - // bugId 4654674 - if (subid < 0) throw new BerException(); - data[i++] = subid ; - } - result = data; - } - catch(BerException e) { - next = backup ; - throw e ; - } - catch(IndexOutOfBoundsException e) { - next = backup ; - throw new BerException() ; - } - // catch(Error e) { - // debug("fetchOidValue: Error decoding BER: " + e); - // throw e; - // } - - return result ; - } - - // private static final void debug(String str) { - // System.out.println(str); - // } - - // - // This is the byte array containing the encoding. - // - private final byte bytes[]; - - // - // This is the current location. It is the next byte - // to be decoded. It's an index in bytes[]. - // - private int next = 0 ; - - // - // This is the stack where end of sequences are kept. - // A value is computed and pushed in it each time openSequence() - // is invoked. - // A value is pulled and checked each time closeSequence() is called. - // - private final int stackBuf[] = new int[200] ; - private int stackTop = 0 ; - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerEncoder.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,477 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp; - - -/** - * The <CODE>BerEncoder</CODE> class is used for encoding data using BER. - * - * A <CODE>BerEncoder</CODE> needs to be set up with a byte buffer. The encoded - * data are stored in this byte buffer. - * <P> - * NOTE : the buffer is filled from end to start. This means the caller - * needs to encode its data in the reverse order. - * - * - * <p><b>This API is a Sun Microsystems internal API and is subject - * to change without notice.</b></p> - * - * @since 1.5 - */ - -public class BerEncoder { - - /** - * Constructs a new encoder and attaches it to the specified byte string. - * - * @param b The byte string containing the encoded data. - */ - - public BerEncoder(byte b[]) { - bytes = b ; - start = b.length ; - stackTop = 0 ; - } - - - /** - * Trim the encoding data and returns the length of the encoding. - * - * The encoder does backward encoding : so the bytes buffer is - * filled from end to start. The encoded data must be shift before - * the buffer can be used. This is the purpose of the <CODE>trim</CODE> method. - * - * After a call to the <CODE>trim</CODE> method, the encoder is reinitialized and <CODE>putXXX</CODE> - * overwrite any existing encoded data. - * - * @return The length of the encoded data. - */ - - public int trim() { - final int result = bytes.length - start ; - - // for (int i = start ; i < bytes.length ; i++) { - // bytes[i-start] = bytes[i] ; - // } - if (result > 0) - java.lang.System.arraycopy(bytes,start,bytes,0,result); - - start = bytes.length ; - stackTop = 0 ; - - return result ; - } - - /** - * Put an integer. - * - * @param v The integer to encode. - */ - - public void putInteger(int v) { - putInteger(v, IntegerTag) ; - } - - - /** - * Put an integer with the specified tag. - * - * @param v The integer to encode. - * @param tag The tag to encode. - */ - - public void putInteger(int v, int tag) { - putIntegerValue(v) ; - putTag(tag) ; - } - - - - /** - * Put an integer expressed as a long. - * - * @param v The long to encode. - */ - - public void putInteger(long v) { - putInteger(v, IntegerTag) ; - } - - - /** - * Put an integer expressed as a long with the specified tag. - * - * @param v The long to encode - * @param tag The tag to encode. - */ - - public void putInteger(long v, int tag) { - putIntegerValue(v) ; - putTag(tag) ; - } - - - - /** - * Put an octet string. - * - * @param s The bytes to encode - */ - - public void putOctetString(byte[] s) { - putOctetString(s, OctetStringTag) ; - } - - - /** - * Put an octet string with a specified tag. - * - * @param s The bytes to encode - * @param tag The tag to encode. - */ - - public void putOctetString(byte[] s, int tag) { - putStringValue(s) ; - putTag(tag) ; - } - - - /** - * Put an object identifier. - * - * @param s The oid to encode. - */ - - public void putOid(long[] s) { - putOid(s, OidTag) ; - } - - - /** - * Put an object identifier with a specified tag. - * - * @param s The integer to encode. - * @param tag The tag to encode. - */ - - public void putOid(long[] s, int tag) { - putOidValue(s) ; - putTag(tag) ; - } - - - /** - * Put a <CODE>NULL</CODE> value. - */ - - public void putNull() { - putNull(NullTag) ; - } - - - /** - * Put a <CODE>NULL</CODE> value with a specified tag. - * - * @param tag The tag to encode. - */ - - public void putNull(int tag) { - putLength(0) ; - putTag(tag) ; - } - - - - /** - * Put an <CODE>ANY</CODE> value. In fact, this method does not encode anything. - * It simply copies the specified bytes into the encoding. - * - * @param s The encoding of the <CODE>ANY</CODE> value. - */ - - public void putAny(byte[] s) { - putAny(s, s.length) ; - } - - - /** - * Put an <CODE>ANY</CODE> value. Only the first <CODE>byteCount</CODE> are considered. - * - * @param s The encoding of the <CODE>ANY</CODE> value. - * @param byteCount The number of bytes of the encoding. - */ - - public void putAny(byte[] s, int byteCount) { - java.lang.System.arraycopy(s,0,bytes,start-byteCount,byteCount); - start -= byteCount; - // for (int i = byteCount - 1 ; i >= 0 ; i--) { - // bytes[--start] = s[i] ; - // } - } - - - /** - * Open a sequence. - * The encoder push the current position on its stack. - */ - - public void openSequence() { - stackBuf[stackTop++] = start ; - } - - - /** - * Close a sequence. - * The decode pull the stack to know the end of the current sequence. - */ - - public void closeSequence() { - closeSequence(SequenceTag) ; - } - - - /** - * Close a sequence with the specified tag. - */ - - public void closeSequence(int tag) { - final int end = stackBuf[--stackTop] ; - putLength(end - start) ; - putTag(tag) ; - } - - - // - // Some standard tags - // - public final static int BooleanTag = 1 ; - public final static int IntegerTag = 2 ; - public final static int OctetStringTag = 4 ; - public final static int NullTag = 5 ; - public final static int OidTag = 6 ; - public final static int SequenceTag = 0x30 ; - - - - - ////////////////////////// PROTECTED /////////////////////////////// - - - - /** - * Put a tag and move the current position backward. - * - * @param tag The tag to encode. - */ - - protected final void putTag(int tag) { - if (tag < 256) { - bytes[--start] = (byte)tag ; - } - else { - while (tag != 0) { - bytes[--start] = (byte)(tag & 127) ; - tag = tag << 7 ; - } - } - } - - - /** - * Put a length and move the current position backward. - * - * @param length The length to encode. - */ - - protected final void putLength(final int length) { - if (length < 0) { - throw new IllegalArgumentException() ; - } - else if (length < 128) { - bytes[--start] = (byte)length ; - } - else if (length < 256) { - bytes[--start] = (byte)length ; - bytes[--start] = (byte)0x81 ; - } - else if (length < 65536) { - bytes[--start] = (byte)(length) ; - bytes[--start] = (byte)(length >> 8) ; - bytes[--start] = (byte)0x82 ; - } - else if (length < 16777126) { - bytes[--start] = (byte)(length) ; - bytes[--start] = (byte)(length >> 8) ; - bytes[--start] = (byte)(length >> 16) ; - bytes[--start] = (byte)0x83 ; - } - else { - bytes[--start] = (byte)(length) ; - bytes[--start] = (byte)(length >> 8) ; - bytes[--start] = (byte)(length >> 16) ; - bytes[--start] = (byte)(length >> 24) ; - bytes[--start] = (byte)0x84 ; - } - } - - - /** - * Put an integer value and move the current position backward. - * - * @param v The integer to encode. - */ - - protected final void putIntegerValue(int v) { - final int end = start ; - int mask = 0x7f800000 ; - int byteNeeded = 4 ; - if (v < 0) { - while (((mask & v) == mask) && (byteNeeded > 1)) { - mask = mask >> 8 ; - byteNeeded-- ; - } - } - else { - while (((mask & v) == 0) && (byteNeeded > 1)) { - mask = mask >> 8 ; - byteNeeded-- ; - } - } - for (int i = 0 ; i < byteNeeded ; i++) { - bytes[--start] = (byte)v ; - v = v >> 8 ; - } - putLength(end - start) ; - } - - - /** - * Put an integer value expressed as a long. - * - * @param v The integer to encode. - */ - - protected final void putIntegerValue(long v) { - final int end = start ; - long mask = 0x7f80000000000000L ; - int byteNeeded = 8 ; - if (v < 0) { - while (((mask & v) == mask) && (byteNeeded > 1)) { - mask = mask >> 8 ; - byteNeeded-- ; - } - } - else { - while (((mask & v) == 0) && (byteNeeded > 1)) { - mask = mask >> 8 ; - byteNeeded-- ; - } - } - for (int i = 0 ; i < byteNeeded ; i++) { - bytes[--start] = (byte)v ; - v = v >> 8 ; - } - putLength(end - start) ; - } - - - /** - * Put a byte string and move the current position backward. - * - * @param s The byte string to encode. - */ - - protected final void putStringValue(byte[] s) { - final int datalen = s.length; - java.lang.System.arraycopy(s,0,bytes,start-datalen,datalen); - start -= datalen; - // for (int i = s.length - 1 ; i >= 0 ; i--) { - // bytes[--start] = s[i] ; - // } - putLength(datalen) ; - } - - - - /** - * Put an oid and move the current position backward. - * - * @param s The oid to encode. - */ - - protected final void putOidValue(final long[] s) { - final int end = start ; - final int slength = s.length; - - // bugId 4641746: 0, 1, and 2 are legal values. - if ((slength < 2) || (s[0] > 2) || (s[1] >= 40)) { - throw new IllegalArgumentException() ; - } - for (int i = slength - 1 ; i >= 2 ; i--) { - long c = s[i] ; - if (c < 0) { - throw new IllegalArgumentException() ; - } - else if (c < 128) { - bytes[--start] = (byte)c ; - } - else { - bytes[--start] = (byte)(c & 127) ; - c = c >> 7 ; - while (c != 0) { - bytes[--start] = (byte)(c | 128) ; - c = c >> 7 ; - } - } - } - bytes[--start] = (byte)(s[0] * 40 + s[1]) ; - putLength(end - start) ; - } - - - // - // This is the byte array containing the encoding. - // - protected final byte bytes[]; - - // - // This is the index of the first byte of the encoding. - // It is initialized to <CODE>bytes.length</CODE> and decrease each time - // an value is put in the encoder. - // - protected int start = -1 ; - - // - // This is the stack where end of sequences are kept. - // A value is computed and pushed in it each time the <CODE>openSequence</CODE> method - // is invoked. - // A value is pulled and checked each time the <CODE>closeSequence</CODE> method is called. - // - protected final int stackBuf[] = new int[200] ; - protected int stackTop = 0 ; - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/BerException.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp; - - - - - -/** - * Exception thrown when a BER encoding/decoding error occurs. - * - * <p><b>This API is a Sun Microsystems internal API and is subject - * to change without notice.</b></p> - * - * @since 1.5 - */ - -public class BerException extends Exception { - private static final long serialVersionUID = 494709767137042951L; - - public static final int BAD_VERSION=1; - - private int errorType= 0; - - public BerException() { - errorType= 0; - } - - public BerException(int x) { - errorType= x; - } - - public boolean isInvalidSnmpVersion() { - if (errorType == BAD_VERSION) - return true; - else - return false; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/EnumRowStatus.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,304 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jmx.snmp; - -import java.io.Serializable; -import java.util.Hashtable; - - -/** - * This class is an internal class which is used to represent RowStatus - * codes as defined in RFC 2579. - * - * It defines an additional code, <i>unspecified</i>, which is - * implementation specific, and is used to identify - * unspecified actions (when for instance the RowStatus variable - * is not present in the varbind list) or uninitialized values. - * - * mibgen does not generate objects of this class but any variable - * using the RowStatus textual convention can be converted into an - * object of this class thanks to the - * <code>EnumRowStatus(Enumerated valueIndex)</code> constructor. - * - * <p><b>This API is a Sun Microsystems internal API and is subject - * to change without notice.</b></p> - **/ - -public class EnumRowStatus extends Enumerated implements Serializable { - private static final long serialVersionUID = 8966519271130162420L; - - /** - * This value is SNMP Runtime implementation specific, and is used to identify - * unspecified actions (when for instance the RowStatus variable - * is not present in the varbind list) or uninitialized values. - */ - public final static int unspecified = 0; - - /** - * This value corresponds to the <i>active</i> RowStatus, as defined in - * RFC 2579 from SMIv2: - * <ul> - * <i>active</i> indicates that the conceptual row is available for - * use by the managed device; - * </ul> - */ - public final static int active = 1; - - /** - * This value corresponds to the <i>notInService</i> RowStatus, as - * defined in RFC 2579 from SMIv2: - * <ul> - * <i>notInService</i> indicates that the conceptual - * row exists in the agent, but is unavailable for use by - * the managed device; <i>notInService</i> has - * no implication regarding the internal consistency of - * the row, availability of resources, or consistency with - * the current state of the managed device; - * </ul> - **/ - public final static int notInService = 2; - - /** - * This value corresponds to the <i>notReady</i> RowStatus, as defined - * in RFC 2579 from SMIv2: - * <ul> - * <i>notReady</i> indicates that the conceptual row - * exists in the agent, but is missing information - * necessary in order to be available for use by the - * managed device (i.e., one or more required columns in - * the conceptual row have not been instantiated); - * </ul> - */ - public final static int notReady = 3; - - /** - * This value corresponds to the <i>createAndGo</i> RowStatus, - * as defined in RFC 2579 from SMIv2: - * <ul> - * <i>createAndGo</i> is supplied by a management - * station wishing to create a new instance of a - * conceptual row and to have its status automatically set - * to active, making it available for use by the managed - * device; - * </ul> - */ - public final static int createAndGo = 4; - - /** - * This value corresponds to the <i>createAndWait</i> RowStatus, - * as defined in RFC 2579 from SMIv2: - * <ul> - * <i>createAndWait</i> is supplied by a management - * station wishing to create a new instance of a - * conceptual row (but not make it available for use by - * the managed device); - * </ul> - */ - public final static int createAndWait = 5; - - /** - * This value corresponds to the <i>destroy</i> RowStatus, as defined in - * RFC 2579 from SMIv2: - * <ul> - * <i>destroy</i> is supplied by a management station - * wishing to delete all of the instances associated with - * an existing conceptual row. - * </ul> - */ - public final static int destroy = 6; - - /** - * Build an <code>EnumRowStatus</code> from an <code>int</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(int valueIndex) - throws IllegalArgumentException { - super(valueIndex); - } - - /** - * Build an <code>EnumRowStatus</code> from an <code>Enumerated</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(Enumerated valueIndex) - throws IllegalArgumentException { - this(valueIndex.intValue()); - } - - /** - * Build an <code>EnumRowStatus</code> from a <code>long</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(long valueIndex) - throws IllegalArgumentException { - this((int)valueIndex); - } - - /** - * Build an <code>EnumRowStatus</code> from an <code>Integer</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(Integer valueIndex) - throws IllegalArgumentException { - super(valueIndex); - } - - /** - * Build an <code>EnumRowStatus</code> from a <code>Long</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(Long valueIndex) - throws IllegalArgumentException { - this(valueIndex.longValue()); - } - - /** - * Build an <code>EnumRowStatus</code> with <i>unspecified</i> value. - **/ - public EnumRowStatus() - throws IllegalArgumentException { - this(unspecified); - } - - /** - * Build an <code>EnumRowStatus</code> from a <code>String</code>. - * @param x should be either "unspecified", or one of - * the values defined in RFC 2579 ("active", "notReady", etc...) - * @exception IllegalArgumentException if the given String - * <code>x</code> is not valid. - **/ - public EnumRowStatus(String x) - throws IllegalArgumentException { - super(x); - } - - /** - * Build an <code>EnumRowStatus</code> from an <code>SnmpInt</code>. - * @param valueIndex should be either 0 (<i>unspecified</i>), or one of - * the values defined in RFC 2579. - * @exception IllegalArgumentException if the given - * <code>valueIndex</code> is not valid. - **/ - public EnumRowStatus(SnmpInt valueIndex) - throws IllegalArgumentException { - this(valueIndex.intValue()); - } - - /** - * Build an SnmpValue from this object. - * - * @exception IllegalArgumentException if this object holds an - * <i>unspecified</i> value. - * @return an SnmpInt containing this object value. - **/ - public SnmpInt toSnmpValue() - throws IllegalArgumentException { - if (value == unspecified) - throw new - IllegalArgumentException("`unspecified' is not a valid SNMP value."); - return new SnmpInt(value); - } - - /** - * Check that the given <code>value</code> is valid. - * - * Valid values are: - * <ul><li><i>unspecified(0)</i></li> - * <li><i>active(1)</i></li> - * <li><i>notInService(2)</i></li> - * <li><i>notReady(3)</i></li> - * <li><i>createAndGo(4)</i></li> - * <li><i>createAndWait(5)</i></li> - * <li><i>destroy(6)</i></li> - * </ul> - * - **/ - static public boolean isValidValue(int value) { - if (value < 0) return false; - if (value > 6) return false; - return true; - } - - // Documented in Enumerated - // - @Override - protected Hashtable<Integer, String> getIntTable() { - return EnumRowStatus.getRSIntTable(); - } - - // Documented in Enumerated - // - @Override - protected Hashtable<String, Integer> getStringTable() { - return EnumRowStatus.getRSStringTable(); - } - - static Hashtable<Integer, String> getRSIntTable() { - return intTable ; - } - - static Hashtable<String, Integer> getRSStringTable() { - return stringTable ; - } - - // Initialize the mapping tables. - // - final static Hashtable<Integer, String> intTable = new Hashtable<>(); - final static Hashtable<String, Integer> stringTable = new Hashtable<>(); - static { - intTable.put(0, "unspecified"); - intTable.put(3, "notReady"); - intTable.put(6, "destroy"); - intTable.put(2, "notInService"); - intTable.put(5, "createAndWait"); - intTable.put(1, "active"); - intTable.put(4, "createAndGo"); - stringTable.put("unspecified", 0); - stringTable.put("notReady", 3); - stringTable.put("destroy", 6); - stringTable.put("notInService", 2); - stringTable.put("createAndWait", 5); - stringTable.put("active", 1); - stringTable.put("createAndGo", 4); - } - - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/Enumerated.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jmx.snmp; - - -import java.io.*; -import java.util.Hashtable; -import java.util.*; - - - -/** This class is used for implementing enumerated values. - * - * An enumeration is represented by a class derived from Enumerated. - * The derived class defines what are the permitted values in the enumeration. - * - * An enumerated value is represented by an instance of the derived class. - * It can be represented : - * - as an integer - * - as a string - * - * <p><b>This API is a Sun Microsystems internal API and is subject - * to change without notice.</b></p> - */ -@SuppressWarnings("serial") // JDK implementation class -abstract public class Enumerated implements Serializable { - - /** - * Construct an enumerated with a default value. - * The default value is the first available in getIntTable(). - * @exception IllegalArgumentException One of the arguments passed to the method is illegal or inappropriate. - */ - public Enumerated() throws IllegalArgumentException { - Enumeration<Integer> e =getIntTable().keys(); - if (e.hasMoreElements()) { - value = e.nextElement().intValue() ; - } - else { - throw new IllegalArgumentException() ; - } - } - - /** - * Construct an enumerated from its integer form. - * - * @param valueIndex The integer form. - * @exception IllegalArgumentException One of the arguments passed to - * the method is illegal or inappropriate. - */ - public Enumerated(int valueIndex) throws IllegalArgumentException { - if (getIntTable().get(valueIndex) == null) { - throw new IllegalArgumentException() ; - } - value = valueIndex ; - } - - /** - * Construct an enumerated from its Integer form. - * - * @param valueIndex The Integer form. - * @exception IllegalArgumentException One of the arguments passed to - * the method is illegal or inappropriate. - */ - public Enumerated(Integer valueIndex) throws IllegalArgumentException { - if (getIntTable().get(valueIndex) == null) { - throw new IllegalArgumentException() ; - } - value = valueIndex.intValue() ; - } - - - /** - * Construct an enumerated from its string form. - * - * @param valueString The string form. - * @exception IllegalArgumentException One of the arguments passed - * to the method is illegal or inappropriate. - */ - public Enumerated(String valueString) throws IllegalArgumentException { - Integer index = getStringTable().get(valueString) ; - if (index == null) { - throw new IllegalArgumentException() ; - } - else { - value = index.intValue() ; - } - } - - - /** - * Return the integer form of the enumerated. - * - * @return The integer form - */ - - public int intValue() { - return value ; - } - - - /** - * Returns an Java enumeration of the permitted integers. - * - * @return An enumeration of Integer instances - */ - - public Enumeration<Integer> valueIndexes() { - return getIntTable().keys() ; - } - - - /** - * Returns an Java enumeration of the permitted strings. - * - * @return An enumeration of String instances - */ - - public Enumeration<String> valueStrings() { - return getStringTable().keys() ; - } - - - /** - * Compares this enumerated to the specified enumerated. - * - * The result is true if and only if the argument is not null - * and is of the same class. - * - * @param obj The object to compare with. - * - * @return True if this and obj are the same; false otherwise - */ - @Override - public boolean equals(Object obj) { - - return ((obj != null) && - (getClass() == obj.getClass()) && - (value == ((Enumerated)obj).value)) ; - } - - - /** - * Returns the hash code for this enumerated. - * - * @return A hash code value for this object. - */ - @Override - public int hashCode() { - String hashString = getClass().getName() + String.valueOf(value) ; - return hashString.hashCode() ; - } - - - /** - * Returns the string form of this enumerated. - * - * @return The string for for this object. - */ - @Override - public String toString() { - return getIntTable().get(value); - } - - - /** - * Returns the hashtable of the integer forms. - * getIntTable().get(x) returns the string form associated - * to the integer x. - * - * This method must be implemented by the derived class. - * - * @return An hashtable for read-only purpose - */ - - protected abstract Hashtable<Integer,String> getIntTable() ; - - - - /** - * Returns the hashtable of the string forms. - * getStringTable().get(s) returns the integer form associated - * to the string s. - * - * This method must be implemented by the derived class. - * - * @return An hashtable for read-only purpose - */ - - protected abstract Hashtable<String,Integer> getStringTable() ; - - - /** - * This variable keeps the integer form of the enumerated. - * The string form is retrieved using getIntTable(). - */ - protected int value ; - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.README Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -WARNING : ASCII_CharStream.java must be PATCHED. - -The following methods should be removed after javacc generation. -The goal is to simplify 100%-pure testing (see bug 4127719). - - - /** - * @deprecated - * @see #getEndColumn - */ - - public final int getColumn() { - return bufcolumn[bufpos]; - } - - /** - * @deprecated - * @see #getEndLine - */ - - public final int getLine() { - return bufline[bufpos]; - }
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,402 +0,0 @@ -/* - * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JavaCC: Do not edit this line. ASCII_CharStream.java Version 0.7pre6 */ -package com.sun.jmx.snmp.IPAcl; - -/** - * An implementation of interface CharStream, where the stream is assumed to - * contain only ASCII characters (without unicode processing). - */ - -final class ASCII_CharStream -{ - public static final boolean staticFlag = false; - int bufsize; - int available; - int tokenBegin; - public int bufpos = -1; - private int bufline[]; - private int bufcolumn[]; - - private int column = 0; - private int line = 1; - - private boolean prevCharIsCR = false; - private boolean prevCharIsLF = false; - - private java.io.Reader inputStream; - - private char[] buffer; - private int maxNextCharInd = 0; - private int inBuf = 0; - - private final void ExpandBuff(boolean wrapAround) - { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try - { - if (wrapAround) - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, - bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - maxNextCharInd = (bufpos += (bufsize - tokenBegin)); - } - else - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - maxNextCharInd = (bufpos -= tokenBegin); - } - } - catch (Throwable t) - { - throw new Error(t.getMessage()); - } - - - bufsize += 2048; - available = bufsize; - tokenBegin = 0; - } - - private final void FillBuff() throws java.io.IOException - { - if (maxNextCharInd == available) - { - if (available == bufsize) - { - if (tokenBegin > 2048) - { - bufpos = maxNextCharInd = 0; - available = tokenBegin; - } - else if (tokenBegin < 0) - bufpos = maxNextCharInd = 0; - else - ExpandBuff(false); - } - else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - int i; - try { - if ((i = inputStream.read(buffer, maxNextCharInd, - available - maxNextCharInd)) == -1) - { - inputStream.close(); - throw new java.io.IOException(); - } - else - maxNextCharInd += i; - return; - } - catch(java.io.IOException e) { - --bufpos; - backup(0); - if (tokenBegin == -1) - tokenBegin = bufpos; - throw e; - } - } - - public final char BeginToken() throws java.io.IOException - { - tokenBegin = -1; - char c = readChar(); - tokenBegin = bufpos; - - return c; - } - - private final void UpdateLineColumn(char c) - { - column++; - - if (prevCharIsLF) - { - prevCharIsLF = false; - line += (column = 1); - } - else if (prevCharIsCR) - { - prevCharIsCR = false; - if (c == '\n') - { - prevCharIsLF = true; - } - else - line += (column = 1); - } - - switch (c) - { - case '\r' : - prevCharIsCR = true; - break; - case '\n' : - prevCharIsLF = true; - break; - case '\t' : - column--; - column += (8 - (column & 07)); - break; - default : - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - - public final char readChar() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - return (char)((char)0xff & buffer[(bufpos == bufsize - 1) ? (bufpos = 0) : ++bufpos]); - } - - if (++bufpos >= maxNextCharInd) - FillBuff(); - - char c = (char)((char)0xff & buffer[bufpos]); - - UpdateLineColumn(c); - return (c); - } - - /** - * @deprecated - * @see #getEndColumn - */ - @Deprecated - public final int getColumn() { - return bufcolumn[bufpos]; - } - - /** - * @deprecated - * @see #getEndLine - */ - @Deprecated - public final int getLine() { - return bufline[bufpos]; - } - - public final int getEndColumn() { - return bufcolumn[bufpos]; - } - - public final int getEndLine() { - return bufline[bufpos]; - } - - public final int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - - public final int getBeginLine() { - return bufline[tokenBegin]; - } - - public final void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; - } - - public ASCII_CharStream(java.io.Reader dstream, int startline, - int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - } - - public ASCII_CharStream(java.io.Reader dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - public void ReInit(java.io.Reader dstream, int startline, - int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) - { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - bufpos = -1; - } - - public void ReInit(java.io.Reader dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - public ASCII_CharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - - public ASCII_CharStream(java.io.InputStream dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - public final String GetImage() - { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - public final char[] GetSuffix(int len) - { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else - { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - public void Done() - { - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) - { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) - { - len = bufpos - tokenBegin + inBuf + 1; - } - else - { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && - bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) - { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) - { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) - { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclEntryImpl.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp.IPAcl; - - - -import java.security.acl.Permission; -import java.util.Vector; -import java.util.Enumeration; -import java.io.Serializable; -import java.net.UnknownHostException; - -import java.security.Principal; -import java.security.acl.AclEntry; - - -/** - * Represent one entry in the Access Control List (ACL). - * This ACL entry object contains a permission associated with a particular principal. - * (A principal represents an entity such as an individual machine or a group). - * - * @see java.security.acl.AclEntry - */ - -class AclEntryImpl implements AclEntry, Serializable { - private static final long serialVersionUID = -5047185131260073216L; - - private AclEntryImpl (AclEntryImpl i) throws UnknownHostException { - setPrincipal(i.getPrincipal()); - permList = new Vector<Permission>(); - commList = new Vector<String>(); - - for (Enumeration<String> en = i.communities(); en.hasMoreElements();){ - addCommunity(en.nextElement()); - } - - for (Enumeration<Permission> en = i.permissions(); en.hasMoreElements();){ - addPermission(en.nextElement()); - } - if (i.isNegative()) setNegativePermissions(); - } - - /** - * Contructs an empty ACL entry. - */ - public AclEntryImpl (){ - princ = null; - permList = new Vector<Permission>(); - commList = new Vector<String>(); - } - - /** - * Constructs an ACL entry with a specified principal. - * - * @param p the principal to be set for this entry. - */ - public AclEntryImpl (Principal p) throws UnknownHostException { - princ = p; - permList = new Vector<Permission>(); - commList = new Vector<String>(); - } - - /** - * Clones this ACL entry. - * - * @return a clone of this ACL entry. - */ - public Object clone() { - AclEntryImpl i; - try { - i = new AclEntryImpl(this); - }catch (UnknownHostException e) { - i = null; - } - return (Object) i; - } - - /** - * Returns true if this is a negative ACL entry (one denying the associated principal - * the set of permissions in the entry), false otherwise. - * - * @return true if this is a negative ACL entry, false if it's not. - */ - public boolean isNegative(){ - return neg; - } - - /** - * Adds the specified permission to this ACL entry. Note: An entry can - * have multiple permissions. - * - * @param perm the permission to be associated with the principal in this - * entry - * @return true if the permission is removed, false if the permission was - * not part of this entry's permission set. - * - */ - public boolean addPermission(java.security.acl.Permission perm){ - if (permList.contains(perm)) return false; - permList.addElement(perm); - return true; - } - - /** - * Removes the specified permission from this ACL entry. - * - * @param perm the permission to be removed from this entry. - * @return true if the permission is removed, false if the permission - * was not part of this entry's permission set. - */ - public boolean removePermission(java.security.acl.Permission perm){ - if (!permList.contains(perm)) return false; - permList.removeElement(perm); - return true; - } - - /** - * Checks if the specified permission is part of the permission set in - * this entry. - * - * @param perm the permission to be checked for. - * @return true if the permission is part of the permission set in this - * entry, false otherwise. - */ - - public boolean checkPermission(java.security.acl.Permission perm){ - return (permList.contains(perm)); - } - - /** - * Returns an enumeration of the permissions in this ACL entry. - * - * @return an enumeration of the permissions in this ACL entry. - */ - public Enumeration<Permission> permissions(){ - return permList.elements(); - } - - /** - * Sets this ACL entry to be a negative one. That is, the associated principal - * (e.g., a user or a group) will be denied the permission set specified in the - * entry. Note: ACL entries are by default positive. An entry becomes a negative - * entry only if this setNegativePermissions method is called on it. - * - * Not Implemented. - */ - public void setNegativePermissions(){ - neg = true; - } - - /** - * Returns the principal for which permissions are granted or denied by this ACL - * entry. Returns null if there is no principal set for this entry yet. - * - * @return the principal associated with this entry. - */ - public Principal getPrincipal(){ - return princ; - } - - /** - * Specifies the principal for which permissions are granted or denied by - * this ACL entry. If a principal was already set for this ACL entry, - * false is returned, otherwise true is returned. - * - * @param p the principal to be set for this entry. - * @return true if the principal is set, false if there was already a - * principal set for this entry. - */ - public boolean setPrincipal(Principal p) { - if (princ != null ) - return false; - princ = p; - return true; - } - - /** - * Returns a string representation of the contents of this ACL entry. - * - * @return a string representation of the contents. - */ - public String toString(){ - return "AclEntry:"+princ.toString(); - } - - /** - * Returns an enumeration of the communities in this ACL entry. - * - * @return an enumeration of the communities in this ACL entry. - */ - public Enumeration<String> communities(){ - return commList.elements(); - } - - /** - * Adds the specified community to this ACL entry. Note: An entry can - * have multiple communities. - * - * @param comm the community to be associated with the principal - * in this entry. - * @return true if the community was added, false if the community was - * already part of this entry's community set. - */ - public boolean addCommunity(String comm){ - if (commList.contains(comm)) return false; - commList.addElement(comm); - return true; - } - - /** - * Removes the specified community from this ACL entry. - * - * @param comm the community to be removed from this entry. - * @return true if the community is removed, false if the community was - * not part of this entry's community set. - */ - public boolean removeCommunity(String comm){ - if (!commList.contains(comm)) return false; - commList.removeElement(comm); - return true; - } - - /** - * Checks if the specified community is part of the community set in this - * entry. - * - * @param comm the community to be checked for. - * @return true if the community is part of the community set in this - * entry, false otherwise. - */ - public boolean checkCommunity(String comm){ - return (commList.contains(comm)); - } - - private Principal princ = null; - private boolean neg = false; - private Vector<Permission> permList = null; - private Vector<String> commList = null; -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/AclImpl.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,295 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp.IPAcl; - - - -import java.security.Principal; -import java.security.acl.Acl; -import java.security.acl.AclEntry; -import java.security.acl.NotOwnerException; - -import java.io.Serializable; -import java.security.acl.Permission; -import java.util.Vector; -import java.util.Enumeration; - - -/** - * Represent an Access Control List (ACL) which is used to guard access to http adaptor. - * <P> - * It is a data structure with multiple ACL entries. Each ACL entry, of interface type - * AclEntry, contains a set of permissions and a set of communities associated with a - * particular principal. (A principal represents an entity such as a host or a group of host). - * Additionally, each ACL entry is specified as being either positive or negative. - * If positive, the permissions are to be granted to the associated principal. - * If negative, the permissions are to be denied. - * - * @see java.security.acl.Acl - */ - -class AclImpl extends OwnerImpl implements Acl, Serializable { - private static final long serialVersionUID = -2250957591085270029L; - - private Vector<AclEntry> entryList = null; - private String aclName = null; - - /** - * Constructs the ACL with a specified owner - * - * @param owner owner of the ACL. - * @param name name of this ACL. - */ - public AclImpl (PrincipalImpl owner, String name) { - super(owner); - entryList = new Vector<>(); - aclName = name; - } - - /** - * Sets the name of this ACL. - * - * @param caller the principal invoking this method. It must be an owner - * of this ACL. - * @param name the name to be given to this ACL. - * - * @exception NotOwnerException if the caller principal is not an owner - * of this ACL. - * @see java.security.Principal - */ - @Override - public void setName(Principal caller, String name) - throws NotOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); - aclName = name; - } - - /** - * Returns the name of this ACL. - * - * @return the name of this ACL. - */ - @Override - public String getName(){ - return aclName; - } - - /** - * Adds an ACL entry to this ACL. An entry associates a principal (e.g., an individual or a group) - * with a set of permissions. Each principal can have at most one positive ACL entry - * (specifying permissions to be granted to the principal) and one negative ACL entry - * (specifying permissions to be denied). If there is already an ACL entry - * of the same type (negative or positive) already in the ACL, false is returned. - * - * @param caller the principal invoking this method. It must be an owner - * of this ACL. - * @param entry the ACL entry to be added to this ACL. - * @return true on success, false if an entry of the same type (positive - * or negative) for the same principal is already present in this ACL. - * @exception NotOwnerException if the caller principal is not an owner of - * this ACL. - * @see java.security.Principal - */ - @Override - public boolean addEntry(Principal caller, AclEntry entry) - throws NotOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); - - if (entryList.contains(entry)) - return false; - /* - for (Enumeration e = entryList.elements();e.hasMoreElements();){ - AclEntry ent = (AclEntry) e.nextElement(); - if (ent.getPrincipal().equals(entry.getPrincipal())) - return false; - } - */ - - entryList.addElement(entry); - return true; - } - - /** - * Removes an ACL entry from this ACL. - * - * @param caller the principal invoking this method. It must be an owner - * of this ACL. - * @param entry the ACL entry to be removed from this ACL. - * @return true on success, false if the entry is not part of this ACL. - * @exception NotOwnerException if the caller principal is not an owner - * of this Acl. - * @see java.security.Principal - * @see java.security.acl.AclEntry - */ - @Override - public boolean removeEntry(Principal caller, AclEntry entry) - throws NotOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); - - return (entryList.removeElement(entry)); - } - - /** - * Removes all ACL entries from this ACL. - * - * @param caller the principal invoking this method. It must be an owner - * of this ACL. - * @exception NotOwnerException if the caller principal is not an owner of - * this Acl. - * @see java.security.Principal - */ - public void removeAll(Principal caller) - throws NotOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); - entryList.removeAllElements(); - } - - /** - * Returns an enumeration for the set of allowed permissions for - * the specified principal - * (representing an entity such as an individual or a group). - * This set of allowed permissions is calculated as follows: - * <UL> - * <LI>If there is no entry in this Access Control List for the specified - * principal, an empty permission set is returned.</LI> - * <LI>Otherwise, the principal's group permission sets are determined. - * (A principal can belong to one or more groups, where a group is a group - * of principals, represented by the Group interface.)</LI> - * </UL> - * @param user the principal whose permission set is to be returned. - * @return the permission set specifying the permissions the principal - * is allowed. - * @see java.security.Principal - */ - @Override - public Enumeration<Permission> getPermissions(Principal user){ - Vector<Permission> empty = new Vector<>(); - for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){ - AclEntry ent = e.nextElement(); - if (ent.getPrincipal().equals(user)) - return ent.permissions(); - } - return empty.elements(); - } - - /** - * Returns an enumeration of the entries in this ACL. Each element in the - * enumeration is of type AclEntry. - * - * @return an enumeration of the entries in this ACL. - */ - @Override - public Enumeration<AclEntry> entries(){ - return entryList.elements(); - } - - /** - * Checks whether or not the specified principal has the specified - * permission. - * If it does, true is returned, otherwise false is returned. - * More specifically, this method checks whether the passed permission - * is a member of the allowed permission set of the specified principal. - * The allowed permission set is determined by the same algorithm as is - * used by the getPermissions method. - * - * @param user the principal, assumed to be a valid authenticated Principal. - * @param perm the permission to be checked for. - * @return true if the principal has the specified permission, - * false otherwise. - * @see java.security.Principal - * @see java.security.Permission - */ - @Override - public boolean checkPermission(Principal user, - java.security.acl.Permission perm) { - for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){ - AclEntry ent = e.nextElement(); - if (ent.getPrincipal().equals(user)) - if (ent.checkPermission(perm)) return true; - } - return false; - } - - /** - * Checks whether or not the specified principal has the specified - * permission. - * If it does, true is returned, otherwise false is returned. - * More specifically, this method checks whether the passed permission - * is a member of the allowed permission set of the specified principal. - * The allowed permission set is determined by the same algorithm as is - * used by the getPermissions method. - * - * @param user the principal, assumed to be a valid authenticated Principal. - * @param community the community name associated with the principal. - * @param perm the permission to be checked for. - * @return true if the principal has the specified permission, false - * otherwise. - * @see java.security.Principal - * @see java.security.Permission - */ - public boolean checkPermission(Principal user, String community, - java.security.acl.Permission perm) { - for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){ - AclEntryImpl ent = (AclEntryImpl) e.nextElement(); - if (ent.getPrincipal().equals(user)) - if (ent.checkPermission(perm) && ent.checkCommunity(community)) return true; - } - return false; - } - - /** - * Checks whether or not the specified community string is defined. - * - * @param community the community name associated with the principal. - * - * @return true if the specified community string is defined, false - * otherwise. - * @see java.security.Principal - * @see java.security.Permission - */ - public boolean checkCommunity(String community) { - for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){ - AclEntryImpl ent = (AclEntryImpl) e.nextElement(); - if (ent.checkCommunity(community)) return true; - } - return false; - } - - /** - * Returns a string representation of the ACL contents. - * - * @return a string representation of the ACL contents. - */ - @Override - public String toString(){ - return ("AclImpl: "+ getName()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/GroupImpl.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp.IPAcl; - - - -import java.util.Vector; -import java.util.Enumeration; -import java.io.Serializable; -import java.net.UnknownHostException; - - -import java.security.Principal; -import java.security.acl.Group; - - -/** - * This class is used to represent a subnet mask (a group of hosts - * matching the same - * IP mask). - * - */ - -class GroupImpl extends PrincipalImpl implements Group, Serializable { - private static final long serialVersionUID = -7777387035032541168L; - - /** - * Constructs an empty group. - * @exception UnknownHostException Not implemented - */ - public GroupImpl () throws UnknownHostException { - } - - /** - * Constructs a group using the specified subnet mask. - * - * @param mask The subnet mask to use to build the group. - * @exception UnknownHostException if the subnet mask cann't be built. - */ - public GroupImpl (String mask) throws UnknownHostException { - super(mask); - } - - /** - * Adds the specified member to the group. - * - * @param p the principal to add to this group. - * @return true if the member was successfully added, false if the - * principal was already a member. - */ - public boolean addMember(Principal p) { - // we don't need to add members because the ip address is a - // subnet mask - return true; - } - - public int hashCode() { - return super.hashCode(); - } - - /** - * Compares this group to the specified object. Returns true if the object - * passed in matches the group represented. - * - * @param p the object to compare with. - * @return true if the object passed in matches the subnet mask, - * false otherwise. - */ - public boolean equals (Object p) { - if (p instanceof PrincipalImpl || p instanceof GroupImpl){ - if ((super.hashCode() & p.hashCode()) == p.hashCode()) return true; - else return false; - } else { - return false; - } - } - - /** - * Returns true if the passed principal is a member of the group. - * - * @param p the principal whose membership is to be checked. - * @return true if the principal is a member of this group, false otherwise. - */ - public boolean isMember(Principal p) { - if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true; - else return false; - } - - /** - * Returns an enumeration which contains the subnet mask. - * - * @return an enumeration which contains the subnet mask. - */ - public Enumeration<? extends Principal> members(){ - Vector<Principal> v = new Vector<Principal>(1); - v.addElement(this); - return v.elements(); - } - - /** - * Removes the specified member from the group. (Not implemented) - * - * @param p the principal to remove from this group. - * @return allways return true. - */ - public boolean removeMember(Principal p) { - return true; - } - - /** - * Prints a string representation of this group. - * - * @return a string representation of this group. - */ - public String toString() { - return ("GroupImpl :"+super.getAddress().toString()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Host.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp.IPAcl; - - - -// java import -// -import java.io.Serializable; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Hashtable; -import java.util.logging.Level; -import java.util.Vector; -import java.security.acl.NotOwnerException; - -import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER; - -/** - * The class defines an abstract representation of a host. - * - */ -@SuppressWarnings("serial") // JDK implementation class -abstract class Host extends SimpleNode implements Serializable { - - public Host(int id) { - super(id); - } - - public Host(Parser p, int id) { - super(p, id); - } - - protected abstract PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException; - - protected abstract String getHname(); - - public void buildAclEntries(PrincipalImpl owner, AclImpl acl) { - // Create a principal - // - PrincipalImpl p=null; - try { - p = createAssociatedPrincipal(); - } catch(UnknownHostException e) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(), - "buildAclEntries", - "Cannot create ACL entry; got exception", e); - } - throw new IllegalArgumentException("Cannot create ACL entry for " + e.getMessage()); - } - - // Create an AclEntry - // - AclEntryImpl entry= null; - try { - entry = new AclEntryImpl(p); - // Add permission - // - registerPermission(entry); - acl.addEntry(owner, entry); - } catch(UnknownHostException e) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(), - "buildAclEntries", - "Cannot create ACL entry; got exception", e); - } - return; - } catch(NotOwnerException a) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(), - "buildAclEntries", - "Cannot create ACL entry; got exception", a); - } - return; - } - } - - private void registerPermission(AclEntryImpl entry) { - JDMHost host= (JDMHost) jjtGetParent(); - JDMManagers manager= (JDMManagers) host.jjtGetParent(); - JDMAclItem acl= (JDMAclItem) manager.jjtGetParent(); - JDMAccess access= acl.getAccess(); - access.putPermission(entry); - JDMCommunities comm= acl.getCommunities(); - comm.buildCommunities(entry); - } - - public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) { - - JDMHostTrap host= (JDMHostTrap) jjtGetParent(); - JDMTrapInterestedHost hosts= (JDMTrapInterestedHost) host.jjtGetParent(); - JDMTrapItem trap = (JDMTrapItem) hosts.jjtGetParent(); - JDMTrapCommunity community = trap.getCommunity(); - String comm = community.getCommunity(); - - InetAddress add = null; - try { - add = java.net.InetAddress.getByName(getHname()); - } catch(UnknownHostException e) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(), - "buildTrapEntries", - "Cannot create TRAP entry; got exception", e); - } - return; - } - - Vector<String> list = null; - if (dest.containsKey(add)){ - list = dest.get(add); - if (!list.contains(comm)){ - list.addElement(comm); - } - } else { - list = new Vector<String>(); - list.addElement(comm); - dest.put(add,list); - } - } - - public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) { - - JDMHostInform host= (JDMHostInform) jjtGetParent(); - JDMInformInterestedHost hosts= (JDMInformInterestedHost) host.jjtGetParent(); - JDMInformItem inform = (JDMInformItem) hosts.jjtGetParent(); - JDMInformCommunity community = inform.getCommunity(); - String comm = community.getCommunity(); - - InetAddress add = null; - try { - add = java.net.InetAddress.getByName(getHname()); - } catch(UnknownHostException e) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, Host.class.getName(), - "buildTrapEntries", - "Cannot create INFORM entry; got exception", e); - } - return; - } - - Vector<String> list = null; - if (dest.containsKey(add)){ - list = dest.get(add); - if (!list.contains(comm)){ - list.addElement(comm); - } - } else { - list = new Vector<String>(); - list.addElement(comm); - dest.put(add,list); - } - } - - - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAccess.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMAccess.java */ - -package com.sun.jmx.snmp.IPAcl; - - -class JDMAccess extends SimpleNode { - protected int access= -1; - - JDMAccess(int id) { - super(id); - } - - JDMAccess(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMAccess(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMAccess(p, id); - } - - protected void putPermission(AclEntryImpl entry) { - if (access == ParserConstants.RO) { - // We have a read-only access. - // - entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getREAD()); - } - if (access == ParserConstants.RW) { - // We have a read-write access. - // - entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getREAD()); - entry.addPermission(com.sun.jmx.snmp.IPAcl.SnmpAcl.getWRITE()); - } - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMAclBlock.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.net.InetAddress; -import java.util.Hashtable; -import java.util.Vector; - -class JDMAclBlock extends SimpleNode { - JDMAclBlock(int id) { - super(id); - } - - JDMAclBlock(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMAclBlock(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMAclBlock(p, id); - } - - /** - * Do no need to go through this part of the tree for - * building TrapEntry. - */ - @Override - public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {} - - /** - * Do no need to go through this part of the tree for - * building InformEntry. - */ - @Override - public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {} -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMAclItem.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMAclItem.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMAclItem extends SimpleNode { - protected JDMAccess access= null; - protected JDMCommunities com= null; - - JDMAclItem(int id) { - super(id); - } - - JDMAclItem(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMAclItem(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMAclItem(p, id); - } - - public JDMAccess getAccess() { - return access; - } - - public JDMCommunities getCommunities() { - return com; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunities.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMCommunities.java */ - -package com.sun.jmx.snmp.IPAcl; - - -class JDMCommunities extends SimpleNode { - JDMCommunities(int id) { - super(id); - } - - JDMCommunities(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMCommunities(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMCommunities(p, id); - } - - public void buildCommunities(AclEntryImpl entry){ - for (int i =0 ; i < children.length ; i++) - entry.addCommunity(((JDMCommunity)children[i]).getCommunity()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMCommunity.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMCommunity.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMCommunity extends SimpleNode { - protected String communityString= ""; - - JDMCommunity(int id) { - super(id); - } - - JDMCommunity(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMCommunity(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMCommunity(p, id); - } - - public String getCommunity(){ - return communityString; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMEnterprise.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMEnterprise.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMEnterprise extends SimpleNode { - protected String enterprise= ""; - - JDMEnterprise(int id) { - super(id); - } - - JDMEnterprise(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMEnterprise(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMEnterprise(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHost.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMHost.java */ - -package com.sun.jmx.snmp.IPAcl; - - -class JDMHost extends SimpleNode { - - JDMHost(int id) { - super(id); - } - - JDMHost(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMHost(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMHost(p, id); - } - - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostInform.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMHostInform.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMHostInform extends SimpleNode { - protected String name= ""; - - JDMHostInform(int id) { - super(id); - } - - JDMHostInform(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMHostInform(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMHostInform(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostName.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMHostName.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.net.UnknownHostException; - -class JDMHostName extends Host { - private static final long serialVersionUID = -9120082068923591122L; - - protected StringBuffer name = new StringBuffer(); - - JDMHostName(int id) { - super(id); - } - - JDMHostName(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMHostName(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMHostName(p, id); - } - - protected String getHname() { - return name.toString(); - } - - protected PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException { - return new PrincipalImpl(name.toString()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMHostTrap.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMHostTrap extends SimpleNode { - protected String name= ""; - - JDMHostTrap(int id) { - super(id); - } - - JDMHostTrap(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMHostTrap(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMHostTrap(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMInformBlock.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.net.InetAddress; -import java.util.Hashtable; -import java.util.Vector; - -class JDMInformBlock extends SimpleNode { - JDMInformBlock(int id) { - super(id); - } - - JDMInformBlock(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMInformBlock(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMInformBlock(p, id); - } - - /** - * Do no need to go through this part of the tree for - * building AclEntry. - */ - @Override - public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {} - - /** - * Do no need to go through this part of the tree for - * building TrapEntry. - */ - @Override - public void buildTrapEntries(Hashtable<InetAddress, Vector<String>> dest) {} -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformCommunity.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMInformCommunity.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMInformCommunity extends SimpleNode { - protected String community= ""; - JDMInformCommunity(int id) { - super(id); - } - - JDMInformCommunity(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMInformCommunity(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMInformCommunity(p, id); - } - - public String getCommunity() { - return community; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformInterestedHost.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMInformInterestedHost.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMInformInterestedHost extends SimpleNode { - JDMInformInterestedHost(int id) { - super(id); - } - - JDMInformInterestedHost(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMInformInterestedHost(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMInformInterestedHost(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMInformItem.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMInformItem.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMInformItem extends SimpleNode { - protected JDMInformCommunity comm = null; - JDMInformItem(int id) { - super(id); - } - - JDMInformItem(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMInformItem(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMInformItem(p, id); - } - - public JDMInformCommunity getCommunity(){ - return comm; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpAddress.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMIpAddress.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.lang.StringBuffer; -import java.net.UnknownHostException; - -class JDMIpAddress extends Host { - private static final long serialVersionUID = 849729919486384484L; - - protected StringBuffer address= new StringBuffer(); - - JDMIpAddress(int id) { - super(id); - } - - JDMIpAddress(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMIpAddress(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMIpAddress(p, id); - } - - protected String getHname() { - return address.toString(); - } - - protected PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException { - return new PrincipalImpl(address.toString()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpMask.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMIpMask.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.lang.StringBuffer; -import java.net.UnknownHostException; - -class JDMIpMask extends Host { - private static final long serialVersionUID = -8211312690652331386L; - - protected StringBuffer address= new StringBuffer(); - - JDMIpMask(int id) { - super(id); - } - - JDMIpMask(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMIpMask(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMIpMask(p, id); - } - - protected String getHname() { - return address.toString(); - } - - protected PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException { - return new GroupImpl(address.toString()); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMIpV6Address.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMIpV6Address.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMIpV6Address extends JDMIpAddress { - private static final long serialVersionUID = -5929917334606674243L; - - public JDMIpV6Address(int id) { - super(id); - } - - public JDMIpV6Address(Parser p, int id) { - super(p, id); - } - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMManagers.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMManagers.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMManagers extends SimpleNode { - JDMManagers(int id) { - super(id); - } - - JDMManagers(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMManagers(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMManagers(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMask.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -/* Generated By:JJTree: Do not edit this line. JDMNetMask.java */ - -package com.sun.jmx.snmp.IPAcl; -import java.net.UnknownHostException; - -class JDMNetMask extends Host { - private static final long serialVersionUID = -1979318280250821787L; - - protected StringBuffer address= new StringBuffer(); - protected String mask = null; - public JDMNetMask(int id) { - super(id); - } - - public JDMNetMask(Parser p, int id) { - super(p, id); - } -public static Node jjtCreate(int id) { - return new JDMNetMask(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMNetMask(p, id); - } - - protected String getHname() { - return address.toString(); - } - - protected PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException { - return new NetMaskImpl(address.toString(), Integer.parseInt(mask)); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMNetMaskV6.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JDMNetMaskV6.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.net.UnknownHostException; - -class JDMNetMaskV6 extends JDMNetMask { - private static final long serialVersionUID = 4505256777680576645L; - - public JDMNetMaskV6(int id) { - super(id); - } - - public JDMNetMaskV6(Parser p, int id) { - super(p, id); - } - protected PrincipalImpl createAssociatedPrincipal() - throws UnknownHostException { - return new NetMaskImpl(address.toString(), Integer.parseInt(mask)); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMSecurityDefs.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMSecurityDefs.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMSecurityDefs extends SimpleNode { - JDMSecurityDefs(int id) { - super(id); - } - - JDMSecurityDefs(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMSecurityDefs(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMSecurityDefs(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMTrapBlock.java */ - -package com.sun.jmx.snmp.IPAcl; - -import java.net.InetAddress; -import java.util.Hashtable; -import java.util.Vector; - -class JDMTrapBlock extends SimpleNode { - JDMTrapBlock(int id) { - super(id); - } - - JDMTrapBlock(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMTrapBlock(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMTrapBlock(p, id); - } - - /** - * Do no need to go through this part of the tree for - * building AclEntry. - */ - @Override - public void buildAclEntries(PrincipalImpl owner, AclImpl acl) {} - - /** - * Do no need to go through this part of the tree for - * building InformEntry. - */ - @Override - public void buildInformEntries(Hashtable<InetAddress, Vector<String>> dest) {} -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapCommunity.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMTrapCommunity.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMTrapCommunity extends SimpleNode { - protected String community= ""; - JDMTrapCommunity(int id) { - super(id); - } - - JDMTrapCommunity(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMTrapCommunity(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMTrapCommunity(p, id); - } - - public String getCommunity() { - return community; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapInterestedHost.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMTrapInterestedHost.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMTrapInterestedHost extends SimpleNode { - JDMTrapInterestedHost(int id) { - super(id); - } - - JDMTrapInterestedHost(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMTrapInterestedHost(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMTrapInterestedHost(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapItem.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMTrapItem.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMTrapItem extends SimpleNode { - protected JDMTrapCommunity comm = null; - - JDMTrapItem(int id) { - super(id); - } - - JDMTrapItem(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMTrapItem(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMTrapItem(p, id); - } - - public JDMTrapCommunity getCommunity(){ - return comm; - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JDMTrapNum.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. JDMTrapNum.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JDMTrapNum extends SimpleNode { - protected int low=0; - protected int high=0; - - JDMTrapNum(int id) { - super(id); - } - - JDMTrapNum(Parser p, int id) { - super(p, id); - } - - public static Node jjtCreate(int id) { - return new JDMTrapNum(id); - } - - public static Node jjtCreate(Parser p, int id) { - return new JDMTrapNum(p, id); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/JJTParserState.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree: Do not edit this line. JJTParserState.java */ - -package com.sun.jmx.snmp.IPAcl; - -class JJTParserState { - private java.util.Stack<Node> nodes; - private java.util.Stack<Integer> marks; - - private int sp; // number of nodes on stack - private int mk; // current mark - private boolean node_created; - - JJTParserState() { - nodes = new java.util.Stack<>(); - marks = new java.util.Stack<>(); - sp = 0; - mk = 0; - } - - /* Determines whether the current node was actually closed and - pushed. This should only be called in the final user action of a - node scope. */ - boolean nodeCreated() { - return node_created; - } - - /* Call this to reinitialize the node stack. It is called - automatically by the parser's ReInit() method. */ - void reset() { - nodes.removeAllElements(); - marks.removeAllElements(); - sp = 0; - mk = 0; - } - - /* Returns the root node of the AST. It only makes sense to call - this after a successful parse. */ - Node rootNode() { - return nodes.elementAt(0); - } - - /* Pushes a node on to the stack. */ - void pushNode(Node n) { - nodes.push(n); - ++sp; - } - - /* Returns the node on the top of the stack, and remove it from the - stack. */ - Node popNode() { - if (--sp < mk) { - mk = marks.pop().intValue(); - } - return nodes.pop(); - } - - /* Returns the node currently on the top of the stack. */ - Node peekNode() { - return nodes.peek(); - } - - /* Returns the number of children on the stack in the current node - scope. */ - int nodeArity() { - return sp - mk; - } - - - void clearNodeScope(Node n) { - while (sp > mk) { - popNode(); - } - mk = marks.pop().intValue(); - } - - - void openNodeScope(Node n) { - marks.push(mk); - mk = sp; - n.jjtOpen(); - } - - - /* A definite node is constructed from a specified number of - children. That number of nodes are popped from the stack and - made the children of the definite node. Then the definite node - is pushed on to the stack. */ - void closeNodeScope(Node n, int num) { - mk = marks.pop().intValue(); - while (num-- > 0) { - Node c = popNode(); - c.jjtSetParent(n); - n.jjtAddChild(c, num); - } - n.jjtClose(); - pushNode(n); - node_created = true; - } - - - /* A conditional node is constructed if its condition is true. All - the nodes that have been pushed since the node was opened are - made children of the the conditional node, which is then pushed - on to the stack. If the condition is false the node is not - constructed and they are left on the stack. */ - void closeNodeScope(Node n, boolean condition) { - if (condition) { - int a = nodeArity(); - mk = marks.pop().intValue(); - while (a-- > 0) { - Node c = popNode(); - c.jjtSetParent(n); - n.jjtAddChild(c, a); - } - n.jjtClose(); - pushNode(n); - node_created = true; - } else { - mk = marks.pop().intValue(); - node_created = false; - } - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.jmx.snmp.IPAcl; - -import static com.sun.jmx.defaults.JmxProperties.SNMP_LOGGER; - -import java.util.logging.Level; -import java.util.Vector; -import java.util.Enumeration; -import java.io.Serializable; -import java.net.UnknownHostException; -import java.net.InetAddress; - -import java.security.Principal; -import java.security.acl.Group; - - -/** - * This class is used to represent a subnet mask (a group of hosts matching the same - * IP mask). - * - * @see java.security.acl.Group - */ - -class NetMaskImpl extends PrincipalImpl implements Group, Serializable { - private static final long serialVersionUID = -7332541893877932896L; - - protected byte[] subnet = null; - protected int prefix = -1; - /** - * Constructs an empty group. - * @exception UnknownHostException Not implemented - */ - public NetMaskImpl () throws UnknownHostException { - } - - private byte[] extractSubNet(byte[] b) { - int addrLength = b.length; - byte[] subnet = null; - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), - "extractSubNet", "BINARY ARRAY :"); - StringBuilder sb = new StringBuilder(); - for(int i =0; i < addrLength; i++) { - sb.append((b[i] & 0xFF) + ":"); - } - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), - "extractSubNet", sb.toString()); - } - - // 8 is a byte size. Common to any InetAddress (V4 or V6). - int fullyCoveredByte = prefix / 8; - if(fullyCoveredByte == addrLength) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "The mask is the complete address, strange..." + addrLength); - } - subnet = b; - return subnet; - } - if(fullyCoveredByte > addrLength) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "The number of covered byte is longer than the address. BUG"); - } - throw new IllegalArgumentException("The number of covered byte is longer than the address."); - } - int partialyCoveredIndex = fullyCoveredByte; - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Partially covered index : " + partialyCoveredIndex); - } - byte toDeal = b[partialyCoveredIndex]; - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Partially covered byte : " + toDeal); - } - - // 8 is a byte size. Common to any InetAddress (V4 or V6). - int nbbits = prefix % 8; - int subnetSize = 0; - - if(nbbits == 0) - subnetSize = partialyCoveredIndex; - else - subnetSize = partialyCoveredIndex + 1; - - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Remains : " + nbbits); - } - - byte mask = 0; - for(int i = 0; i < nbbits; i++) { - mask |= (1 << (7 - i)); - } - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Mask value : " + (mask & 0xFF)); - } - - byte maskedValue = (byte) ((int)toDeal & (int)mask); - - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Masked byte : " + (maskedValue &0xFF)); - } - subnet = new byte[subnetSize]; - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Resulting subnet : "); - } - for(int i = 0; i < partialyCoveredIndex; i++) { - subnet[i] = b[i]; - - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - (subnet[i] & 0xFF) +":"); - } - } - - if(nbbits != 0) { - subnet[partialyCoveredIndex] = maskedValue; - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "extractSubNet", - "Last subnet byte : " + (subnet[partialyCoveredIndex] &0xFF)); - } - } - return subnet; - } - - /** - * Constructs a group using the specified subnet mask. - * THIS ALGORITHM IS V4 and V6 compatible. - * - * @exception UnknownHostException if the subnet mask cann't be built. - */ - public NetMaskImpl (String a, int prefix) throws UnknownHostException { - super(a); - this.prefix = prefix; - subnet = extractSubNet(getAddress().getAddress()); - } - - /** - * Adds the specified member to the group. - * - * @param p the principal to add to this group. - * @return true if the member was successfully added, false if the - * principal was already a member. - */ - public boolean addMember(Principal p) { - // we don't need to add members because the ip address is a subnet mask - return true; - } - - public int hashCode() { - return super.hashCode(); - } - - /** - * Compares this group to the specified object. Returns true if the object - * passed in matches the group represented. - * - * @param p the object to compare with. - * @return true if the object passed in matches the subnet mask, - * false otherwise. - */ - public boolean equals (Object p) { - if (p instanceof PrincipalImpl || p instanceof NetMaskImpl){ - PrincipalImpl received = (PrincipalImpl) p; - InetAddress addr = received.getAddress(); - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", - "Received Address : " + addr); - } - byte[] recAddr = addr.getAddress(); - for(int i = 0; i < subnet.length; i++) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", - "(recAddr[i]) : " + (recAddr[i] & 0xFF)); - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", - "(recAddr[i] & subnet[i]) : " + - ((recAddr[i] & (int)subnet[i]) &0xFF) + - " subnet[i] : " + (subnet[i] &0xFF)); - } - if((recAddr[i] & subnet[i]) != subnet[i]) { - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", - "FALSE"); - } - return false; - } - } - if (SNMP_LOGGER.isLoggable(Level.FINEST)) { - SNMP_LOGGER.logp(Level.FINEST, NetMaskImpl.class.getName(), "equals", - "TRUE"); - } - return true; - } else - return false; - } - /** - * Returns true if the passed principal is a member of the group. - * - * @param p the principal whose membership is to be checked. - * @return true if the principal is a member of this group, false otherwise. - */ - public boolean isMember(Principal p) { - if ((p.hashCode() & super.hashCode()) == p.hashCode()) return true; - else return false; - } - - /** - * Returns an enumeration which contains the subnet mask. - * - * @return an enumeration which contains the subnet mask. - */ - public Enumeration<? extends Principal> members(){ - Vector<Principal> v = new Vector<Principal>(1); - v.addElement(this); - return v.elements(); - } - - /** - * Removes the specified member from the group. (Not implemented) - * - * @param p the principal to remove from this group. - * @return allways return true. - */ - public boolean removeMember(Principal p) { - return true; - } - - /** - * Prints a string representation of this group. - * - * @return a string representation of this group. - */ - public String toString() { - return ("NetMaskImpl :"+ super.getAddress().toString() + "/" + prefix); - } - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Node.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JJTree: Do not edit this line. Node.java */ - -package com.sun.jmx.snmp.IPAcl; - -/* All AST nodes must implement this interface. It provides basic - machinery for constructing the parent and child relationships - between nodes. */ - -interface Node { - - /** This method is called after the node has been made the current - node. It indicates that child nodes can now be added to it. */ - public void jjtOpen(); - - /** This method is called after all the child nodes have been - added. */ - public void jjtClose(); - - /** This pair of methods are used to inform the node of its - parent. */ - public void jjtSetParent(Node n); - public Node jjtGetParent(); - - /** This method tells the node to add its argument to the node's - list of children. */ - public void jjtAddChild(Node n, int i); - - /** This method returns a child node. The children are numbered - from zero, left to right. */ - public Node jjtGetChild(int i); - - /** Return the number of children the node has. */ - public int jjtGetNumChildren(); -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/OwnerImpl.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package com.sun.jmx.snmp.IPAcl; - - - -import java.util.Vector; -import java.io.Serializable; - -import java.security.Principal; -import java.security.acl.Owner; -import java.security.acl.LastOwnerException; -import java.security.acl.NotOwnerException; - - -/** - * Owner of Access Control Lists (ACLs). - * The initial owner Principal should be specified as an - * argument to the constructor of the class AclImpl. - * - * @see java.security.acl.Owner - */ - -class OwnerImpl implements Owner, Serializable { - private static final long serialVersionUID = -576066072046319874L; - - private Vector<Principal> ownerList = null; - - /** - * Constructs an empty list of owner. - */ - public OwnerImpl (){ - ownerList = new Vector<Principal>(); - } - - /** - * Constructs a list of owner with the specified principal as first element. - * - * @param owner the principal added to the owner list. - */ - public OwnerImpl (PrincipalImpl owner){ - ownerList = new Vector<Principal>(); - ownerList.addElement(owner); - } - - /** - * Adds an owner. Only owners can modify ACL contents. The caller principal - * must be an owner of the ACL in order to invoke this method. That is, only - * an owner can add another owner. The initial owner is configured at - * ACL construction time. - * - * @param caller the principal invoking this method. - * It must be an owner of the ACL. - * @param owner the owner that should be added to the list of owners. - * @return true if successful, false if owner is already an owner. - * @exception NotOwnerException if the caller principal is not an owner - * of the ACL. - */ - public boolean addOwner(Principal caller, Principal owner) - throws NotOwnerException { - if (!ownerList.contains(caller)) - throw new NotOwnerException(); - - if (ownerList.contains(owner)) { - return false; - } else { - ownerList.addElement(owner); - return true; - } - } - - /** - * Deletes an owner. If this is the last owner in the ACL, an exception is raised. - *<P> - * The caller principal must be an owner of the ACL in order to invoke this method. - * - * @param caller the principal invoking this method. It must be an owner - * of the ACL. - * @param owner the owner to be removed from the list of owners. - * @return true if successful, false if owner is already an owner. - * @exception NotOwnerException if the caller principal is not an owner - * of the ACL. - * @exception LastOwnerException if there is only one owner left, so that - * deleteOwner would leave the ACL owner-less. - */ - public boolean deleteOwner(Principal caller, Principal owner) - throws NotOwnerException,LastOwnerException { - - if (!ownerList.contains(caller)) - throw new NotOwnerException(); - - if (!ownerList.contains(owner)){ - return false; - } else { - if (ownerList.size() == 1) - throw new LastOwnerException(); - - ownerList.removeElement(owner); - return true; - } - } - - /** - * Returns true if the given principal is an owner of the ACL. - * - * @param owner the principal to be checked to determine whether or - * not it is an owner. - * @return true if the given principal is an owner of the ACL. - */ - public boolean isOwner(Principal owner){ - return ownerList.contains(owner); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseError.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* Generated By:JavaCC: Do not edit this line. ParseError.java Version 0.7pre1 */ -package com.sun.jmx.snmp.IPAcl; - -class ParseError extends Exception { - private static final long serialVersionUID = 4907307342076722310L; - - public ParseError() { - } - public ParseError(String message) { - super(message); - } -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParseException.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 0.7pre6 */ -package com.sun.jmx.snmp.IPAcl; - -/** - * This exception is thrown when parse errors are encountered. - * You can explicitly create objects of this exception type by - * calling the method generateParseException in the generated - * parser. - * - * You can modify this class to customize your error reporting - * mechanisms so long as you retain the public fields. - */ -class ParseException extends Exception { - private static final long serialVersionUID = -3695190720704845876L; - - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. The boolean - * flag "specialConstructor" is also set to true to indicate that - * this constructor was used to create this object. - * This constructor calls its super class with the empty string - * to force the "toString" method of parent class "Throwable" to - * print the error message in the form: - * ParseException: <result of getMessage> - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal - ) - { - super(""); - specialConstructor = true; - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - } - - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way - i.e., as - * documented in the class "Throwable". The fields "errorToken", - * "expectedTokenSequences", and "tokenImage" do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ - - public ParseException() { - super(); - specialConstructor = false; - } - - public ParseException(String message) { - super(message); - specialConstructor = false; - } - - /** - * This variable determines which constructor was used to create - * this object and thereby affects the semantics of the - * "getMessage" method (see below). - */ - protected boolean specialConstructor; - - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; - - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * This method has the standard behavior when this object has been - * created using the standard constructors. Otherwise, it uses - * "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser), then this method is called during the printing - * of the final stack trace, and hence the correct error message - * gets displayed. - */ - public String getMessage() { - if (!specialConstructor) { - return super.getMessage(); - } - String expected = ""; - int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected += tokenImage[expectedTokenSequences[i][j]] + " "; - } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { - expected += "..."; - } - expected += eol + " "; - } - String retval = "Encountered \""; - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - if (i != 0) retval += " "; - if (tok.kind == 0) { - retval += tokenImage[0]; - break; - } - retval += add_escapes(tok.image); - tok = tok.next; - } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol; - if (expectedTokenSequences.length == 1) { - retval += "Was expecting:" + eol + " "; - } else { - retval += "Was expecting one of:" + eol + " "; - } - retval += expected; - return retval; - } - - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); - - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - protected String add_escapes(String str) { - StringBuilder retval = new StringBuilder(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1285 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */ -package com.sun.jmx.snmp.IPAcl; - -import java.io.*; - -@SuppressWarnings("unchecked") // generated code, not worth fixing -class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/ - protected JJTParserState jjtree = new JJTParserState(); - -// A file can contain several acl definitions -// - final public JDMSecurityDefs SecurityDefs() throws ParseException { - /*@bgen(jjtree) SecurityDefs */ - JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ACL: - AclBlock(); - break; - default: - jj_la1[0] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case TRAP: - TrapBlock(); - break; - default: - jj_la1[1] = jj_gen; - ; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INFORM: - InformBlock(); - break; - default: - jj_la1[2] = jj_gen; - ; - } - jj_consume_token(0); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - {if (true) return jjtn000;} - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - throw new Error("Missing return statement in function"); - } - - final public void AclBlock() throws ParseException { - /*@bgen(jjtree) AclBlock */ - JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(ACL); - jj_consume_token(ASSIGN); - jj_consume_token(LBRACE); - label_1: - while (true) { - AclItem(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - ; - break; - default: - jj_la1[3] = jj_gen; - break label_1; - } - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void AclItem() throws ParseException { - /*@bgen(jjtree) AclItem */ - JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(LBRACE); - jjtn000.com = Communities(); - jjtn000.access = Access(); - Managers(); - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public JDMCommunities Communities() throws ParseException { - /*@bgen(jjtree) Communities */ - JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(COMMUNITIES); - jj_consume_token(ASSIGN); - Community(); - label_2: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[4] = jj_gen; - break label_2; - } - jj_consume_token(COMMA); - Community(); - } - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - {if (true) return jjtn000;} - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - throw new Error("Missing return statement in function"); - } - - final public void Community() throws ParseException { - /*@bgen(jjtree) Community */ - JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(IDENTIFIER); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.communityString= t.image; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public JDMAccess Access() throws ParseException { - /*@bgen(jjtree) Access */ - JDMAccess jjtn000 = new JDMAccess(JJTACCESS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(ACCESS); - jj_consume_token(ASSIGN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case RO: - jj_consume_token(RO); - jjtn000.access= RO; - break; - case RW: - jj_consume_token(RW); - jjtn000.access= RW; - break; - default: - jj_la1[5] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - {if (true) return jjtn000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - throw new Error("Missing return statement in function"); - } - - final public void Managers() throws ParseException { - /*@bgen(jjtree) Managers */ - JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(MANAGERS); - jj_consume_token(ASSIGN); - Host(); - label_3: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[6] = jj_gen; - break label_3; - } - jj_consume_token(COMMA); - Host(); - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void Host() throws ParseException { - /*@bgen(jjtree) Host */ - JDMHost jjtn000 = new JDMHost(JJTHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - HostName(); - break; - default: - jj_la1[7] = jj_gen; - if (jj_2_1(2147483647)) { - NetMask(); - } else if (jj_2_2(2147483647)) { - NetMaskV6(); - } else if (jj_2_3(2147483647)) { - IpAddress(); - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case V6_ADDRESS: - IpV6Address(); - break; - case INTEGER_LITERAL: - IpMask(); - break; - default: - jj_la1[8] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void HostName() throws ParseException { - /*@bgen(jjtree) HostName */ - JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(IDENTIFIER); - jjtn000.name.append(t.image); - label_4: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - ; - break; - default: - jj_la1[9] = jj_gen; - break label_4; - } - jj_consume_token(DOT); - t = jj_consume_token(IDENTIFIER); - jjtn000.name.append( "." + t.image); - } - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void IpAddress() throws ParseException { - /*@bgen(jjtree) IpAddress */ -JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append(t.image); - label_5: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - ; - break; - default: - jj_la1[10] = jj_gen; - break label_5; - } - jj_consume_token(DOT); - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); - } - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void IpV6Address() throws ParseException { - /*@bgen(jjtree) IpV6Address */ -JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(V6_ADDRESS); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.address.append(t.image); - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void IpMask() throws ParseException { - /*@bgen(jjtree) IpMask */ -JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append(t.image); - label_6: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case MARK: - ; - break; - default: - jj_la1[11] = jj_gen; - break label_6; - } - jj_consume_token(MARK); - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); - } - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void NetMask() throws ParseException { - /*@bgen(jjtree) NetMask */ -JDMNetMask jjtn000 = new JDMNetMask(JJTNETMASK); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append(t.image); - label_7: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - ; - break; - default: - jj_la1[12] = jj_gen; - break label_7; - } - jj_consume_token(DOT); - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.address.append( "." + t.image); - } - jj_consume_token(MASK); - t = jj_consume_token(INTEGER_LITERAL); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.mask = t.image; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void NetMaskV6() throws ParseException { - /*@bgen(jjtree) NetMaskV6 */ -JDMNetMaskV6 jjtn000 = new JDMNetMaskV6(JJTNETMASKV6); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(V6_ADDRESS); - jjtn000.address.append(t.image); - jj_consume_token(MASK); - t = jj_consume_token(INTEGER_LITERAL); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.mask = t.image; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void TrapBlock() throws ParseException { - /*@bgen(jjtree) TrapBlock */ - JDMTrapBlock jjtn000 = new JDMTrapBlock(JJTTRAPBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(TRAP); - jj_consume_token(ASSIGN); - jj_consume_token(LBRACE); - label_8: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - ; - break; - default: - jj_la1[13] = jj_gen; - break label_8; - } - TrapItem(); - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void TrapItem() throws ParseException { - /*@bgen(jjtree) TrapItem */ - JDMTrapItem jjtn000 = new JDMTrapItem(JJTTRAPITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(LBRACE); - jjtn000.comm = TrapCommunity(); - TrapInterestedHost(); - label_9: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - ; - break; - default: - jj_la1[14] = jj_gen; - break label_9; - } - Enterprise(); - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public JDMTrapCommunity TrapCommunity() throws ParseException { - /*@bgen(jjtree) TrapCommunity */ - JDMTrapCommunity jjtn000 = new JDMTrapCommunity(JJTTRAPCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - jj_consume_token(TRAPCOMMUNITY); - jj_consume_token(ASSIGN); - t = jj_consume_token(IDENTIFIER); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.community= t.image; {if (true) return jjtn000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - throw new Error("Missing return statement in function"); - } - - final public void TrapInterestedHost() throws ParseException { - /*@bgen(jjtree) TrapInterestedHost */ - JDMTrapInterestedHost jjtn000 = new JDMTrapInterestedHost(JJTTRAPINTERESTEDHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(HOSTS); - jj_consume_token(ASSIGN); - HostTrap(); - label_10: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[15] = jj_gen; - break label_10; - } - jj_consume_token(COMMA); - HostTrap(); - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void HostTrap() throws ParseException { - /*@bgen(jjtree) HostTrap */ - JDMHostTrap jjtn000 = new JDMHostTrap(JJTHOSTTRAP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - HostName(); - break; - case INTEGER_LITERAL: - IpAddress(); - break; - case V6_ADDRESS: - IpV6Address(); - break; - default: - jj_la1[16] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void Enterprise() throws ParseException { - /*@bgen(jjtree) Enterprise */ - JDMEnterprise jjtn000 = new JDMEnterprise(JJTENTERPRISE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - jj_consume_token(LBRACE); - jj_consume_token(ENTERPRISE); - jj_consume_token(ASSIGN); - t = jj_consume_token(CSTRING); - jjtn000.enterprise= t.image; - jj_consume_token(TRAPNUM); - jj_consume_token(ASSIGN); - TrapNum(); - label_11: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[17] = jj_gen; - break label_11; - } - jj_consume_token(COMMA); - TrapNum(); - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void TrapNum() throws ParseException { - /*@bgen(jjtree) TrapNum */ - JDMTrapNum jjtn000 = new JDMTrapNum(JJTTRAPNUM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.low= Integer.parseInt(t.image); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case RANGE: - jj_consume_token(RANGE); - t = jj_consume_token(INTEGER_LITERAL); - jjtn000.high= Integer.parseInt(t.image); - break; - default: - jj_la1[18] = jj_gen; - ; - } - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void InformBlock() throws ParseException { - /*@bgen(jjtree) InformBlock */ - JDMInformBlock jjtn000 = new JDMInformBlock(JJTINFORMBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(INFORM); - jj_consume_token(ASSIGN); - jj_consume_token(LBRACE); - label_12: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LBRACE: - ; - break; - default: - jj_la1[19] = jj_gen; - break label_12; - } - InformItem(); - } - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void InformItem() throws ParseException { - /*@bgen(jjtree) InformItem */ - JDMInformItem jjtn000 = new JDMInformItem(JJTINFORMITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(LBRACE); - jjtn000.comm = InformCommunity(); - InformInterestedHost(); - jj_consume_token(RBRACE); - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public JDMInformCommunity InformCommunity() throws ParseException { - /*@bgen(jjtree) InformCommunity */ - JDMInformCommunity jjtn000 = new JDMInformCommunity(JJTINFORMCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - jj_consume_token(INFORMCOMMUNITY); - jj_consume_token(ASSIGN); - t = jj_consume_token(IDENTIFIER); - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - jjtn000.community= t.image; {if (true) return jjtn000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - throw new Error("Missing return statement in function"); - } - - final public void InformInterestedHost() throws ParseException { - /*@bgen(jjtree) InformInterestedHost */ - JDMInformInterestedHost jjtn000 = new JDMInformInterestedHost(JJTINFORMINTERESTEDHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); - try { - jj_consume_token(HOSTS); - jj_consume_token(ASSIGN); - HostInform(); - label_13: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[20] = jj_gen; - break label_13; - } - jj_consume_token(COMMA); - HostInform(); - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final public void HostInform() throws ParseException { - /*@bgen(jjtree) HostInform */ - JDMHostInform jjtn000 = new JDMHostInform(JJTHOSTINFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000);Token t; - try { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENTIFIER: - HostName(); - break; - case INTEGER_LITERAL: - IpAddress(); - break; - case V6_ADDRESS: - IpV6Address(); - break; - default: - jj_la1[21] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - {if (true) throw (RuntimeException)jjte000;} - } - if (jjte000 instanceof ParseException) { - {if (true) throw (ParseException)jjte000;} - } - {if (true) throw (Error)jjte000;} - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } - } - - final private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_1(); - jj_save(0, xla); - return retval; - } - - final private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_2(); - jj_save(1, xla); - return retval; - } - - final private boolean jj_2_3(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - boolean retval = !jj_3_3(); - jj_save(2, xla); - return retval; - } - - final private boolean jj_3_3() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(DOT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3_2() { - if (jj_scan_token(V6_ADDRESS)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(MASK)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3_1() { - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_14()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_scan_token(MASK)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - final private boolean jj_3R_14() { - if (jj_scan_token(DOT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(INTEGER_LITERAL)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - public ParserTokenManager token_source; - ASCII_CharStream jj_input_stream; - public Token token, jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - public boolean lookingAhead = false; - private boolean jj_semLA; - private int jj_gen; - final private int[] jj_la1 = new int[22]; - final private int[] jj_la1_0 = {0x100,0x80000,0x100000,0x2000,0x0,0x60000,0x0,0x80000000,0x11000000,0x0,0x0,0x0,0x0,0x2000,0x2000,0x0,0x91000000,0x0,0x8000,0x2000,0x0,0x91000000,}; - final private int[] jj_la1_1 = {0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x20,0x20,0x40,0x20,0x0,0x0,0x10,0x0,0x10,0x0,0x0,0x10,0x0,}; - final private JJCalls[] jj_2_rtns = new JJCalls[3]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - public Parser(java.io.InputStream stream) { - jj_input_stream = new ASCII_CharStream(stream, 1, 1); - token_source = new ParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - public void ReInit(java.io.InputStream stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - public Parser(java.io.Reader stream) { - jj_input_stream = new ASCII_CharStream(stream, 1, 1); - token_source = new ParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - public Parser(ParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - public void ReInit(ParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jjtree.reset(); - jj_gen = 0; - for (int i = 0; i < 22; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - final private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - final private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - return (jj_scanpos.kind != kind); - } - - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - - final public Token getToken(int index) { - Token t = lookingAhead ? jj_scanpos : token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - final private int jj_ntk() { - if ((jj_nt=token.next) == null) - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.Vector<int[]> jj_expentries = new java.util.Vector<>(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - boolean exists = false; - for (java.util.Enumeration<int[]> enumv = jj_expentries.elements(); enumv.hasMoreElements();) { - int[] oldentry = enumv.nextElement(); - if (oldentry.length == jj_expentry.length) { - exists = true; - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - exists = false; - break; - } - } - if (exists) break; - } - } - if (!exists) jj_expentries.addElement(jj_expentry); - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - final public ParseException generateParseException() { - jj_expentries.removeAllElements(); - boolean[] la1tokens = new boolean[40]; - for (int i = 0; i < 40; i++) { - la1tokens[i] = false; - } - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 22; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1<<j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1<<j)) != 0) { - la1tokens[32+j] = true; - } - } - } - } - for (int i = 0; i < 40; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.addElement(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.elementAt(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - final public void enable_tracing() { - } - - final public void disable_tracing() { - } - - final private void jj_rescan_token() { - jj_rescan = true; - for (int i = 0; i < 3; i++) { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - case 2: jj_3_3(); break; - } - } - p = p.next; - } while (p != null); - } - jj_rescan = false; - } - - final private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jj Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,948 +0,0 @@ -/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. Parser.jj */ -/*@egen*//* - * @(#)file Parser.jjt - * @(#)author Sun Microsystems, Inc. - * - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -options { - STATIC=false; -} - - -PARSER_BEGIN(Parser) - -package com.sun.jmx.snmp.IPAcl; - -import java.io.*; - -public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/ - protected JJTParserState jjtree = new JJTParserState(); - -/*@egen*/ -} - -PARSER_END(Parser) - - -SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| <"--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> -| <"#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> - -} - - - -/* RESERVED WORDS AND LITERALS */ - -TOKEN : -{ - <ACCESS: "access"> -| <ACL: "acl"> -| <ASSIGN: "="> -| <COMMUNITIES: "communities"> -| <ENTERPRISE: "enterprise"> -| <HOSTS: "hosts"> -| <LBRACE: "{"> -| <MANAGERS: "managers"> -| <RANGE: "-"> -| <RBRACE: "}"> -| <RO: "read-only"> -| <RW: "read-write"> -| <TRAP: "trap"> -| <INFORM: "inform"> -| <TRAPCOMMUNITY: "trap-community"> -| <INFORMCOMMUNITY: "inform-community"> -| <TRAPNUM: "trap-num"> -} - - - -TOKEN : /* LITERALS */ -{ - < INTEGER_LITERAL: - <DECIMAL_LITERAL> (["l","L"])? - | <HEX_LITERAL> (["l","L"])? - | <OCTAL_LITERAL> (["l","L"])? - > -| - < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > -| - < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > -| - < #OCTAL_LITERAL: "0" (["0"-"7"])* > -} - -TOKEN : /* V6 LITERALS */ -{ - < V6_ADDRESS: ((( ( (<H> ":")+ (":")?) | "::" ) (<H> ":")* (<H> | (<D> "." <D> "." <D> "." <D>))) | ("::")) | ( (<H> ":")+ ":") > -| - <#H: (["0"-"9","a"-"f","A"-"F"])+ > -| - <#D: (["0"-"9"])+ > -} - -TOKEN : /* IDENTIFIERS */ -{ - < IDENTIFIER: ( (<DIGIT>|<LETTER>)+ (<SEPARATOR>|<LETTER>|<DIGIT>)* (<DIGIT>|<LETTER>)+ ) | (<DIGIT>|<LETTER>)+ > -| - < #LETTER: ["a"-"z","A"-"Z"] > -| - < #SEPARATOR: ["-", "_"] > -| - < #DIGIT: ["0"-"9"] > -| - <CSTRING: "\"" (~["\""])* "\""> -} - - - -TOKEN: /* SEPARATOR */ -{ - < COMMA: "," > -| < DOT: "." > -| < MARK: "!" > -| < MASK: "/"> -} - -// A file can contain several acl definitions -// -JDMSecurityDefs SecurityDefs() : {/*@bgen(jjtree) SecurityDefs */ - JDMSecurityDefs jjtn000 = new JDMSecurityDefs(JJTSECURITYDEFS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) SecurityDefs */ - try { -/*@egen*/ - [AclBlock()] - [TrapBlock()] - [InformBlock()] - <EOF>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ - { return jjtn000;}/*@bgen(jjtree)*/ - } catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } -/*@egen*/ -} - -void AclBlock(): {/*@bgen(jjtree) AclBlock */ - JDMAclBlock jjtn000 = new JDMAclBlock(JJTACLBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) AclBlock */ -try { -/*@egen*/ -"acl" "=" "{" (AclItem())+ "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void AclItem(): {/*@bgen(jjtree) AclItem */ - JDMAclItem jjtn000 = new JDMAclItem(JJTACLITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) AclItem */ -try { -/*@egen*/ -"{" jjtn000.com= Communities() jjtn000.access= Access() Managers() "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -JDMCommunities Communities(): {/*@bgen(jjtree) Communities */ - JDMCommunities jjtn000 = new JDMCommunities(JJTCOMMUNITIES); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Communities */ -try { -/*@egen*/ -"communities" "=" Community() ( "," Community())*/*@bgen(jjtree)*/ -{ - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; -} -/*@egen*/ - -{return jjtn000;}/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ - -} - -void Community(): -{/*@bgen(jjtree) Community */ - JDMCommunity jjtn000 = new JDMCommunity(JJTCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) Community */ -try { -/*@egen*/ -t=<IDENTIFIER>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ {jjtn000.communityString= t.image;}/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -JDMAccess Access(): {/*@bgen(jjtree) Access */ - JDMAccess jjtn000 = new JDMAccess(JJTACCESS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/} -{/*@bgen(jjtree) Access */ -try { -/*@egen*/ -"access" "=" ( <RO> {jjtn000.access= RO;} - | - <RW> {jjtn000.access= RW;} - )/*@bgen(jjtree)*/ -{ - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; -} -/*@egen*/ -{return jjtn000;}/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - - -void Managers() : {/*@bgen(jjtree) Managers */ - JDMManagers jjtn000 = new JDMManagers(JJTMANAGERS); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) Managers */ -try { -/*@egen*/ -"managers" "=" Host() ( "," Host())*/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void Host() : -{/*@bgen(jjtree) Host */ - JDMHost jjtn000 = new JDMHost(JJTHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) Host */ -try { -/*@egen*/ -HostName() -| -LOOKAHEAD(<INTEGER_LITERAL> ( "." <INTEGER_LITERAL> )* "/" <INTEGER_LITERAL>) -NetMask() -| -LOOKAHEAD(<V6_ADDRESS> "/" <INTEGER_LITERAL>) -NetMaskV6() -| -LOOKAHEAD(<INTEGER_LITERAL> ".") -IpAddress() -| -IpV6Address() -| -IpMask()/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void HostName(): -{/*@bgen(jjtree) HostName */ - JDMHostName jjtn000 = new JDMHostName(JJTHOSTNAME); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) HostName */ - try { -/*@egen*/ - t=<IDENTIFIER> { jjtn000.name.append(t.image); } -( -"." t=<IDENTIFIER> - {jjtn000.name.append( "." + t.image); } -)*/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } -/*@egen*/ - -} - -void IpAddress(): -{/*@bgen(jjtree) IpAddress */ -JDMIpAddress jjtn000 = new JDMIpAddress(JJTIPADDRESS); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000); -/*@egen*/ -Token t; -} -{/*@bgen(jjtree) IpAddress */ -try { -/*@egen*/ - -t= <INTEGER_LITERAL> - {jjtn000.address.append(t.image); } -( -"." t= <INTEGER_LITERAL> - {jjtn000.address.append( "." + t.image); } -)*/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ - -} - -void IpV6Address(): -{/*@bgen(jjtree) IpV6Address */ -JDMIpV6Address jjtn000 = new JDMIpV6Address(JJTIPV6ADDRESS); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000); -/*@egen*/ -Token t; -} -{/*@bgen(jjtree) IpV6Address */ -try { -/*@egen*/ - -t= <V6_ADDRESS>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ - {jjtn000.address.append(t.image); }/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void IpMask(): -{/*@bgen(jjtree) IpMask */ -JDMIpMask jjtn000 = new JDMIpMask(JJTIPMASK); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000); -/*@egen*/ -Token t; -} -{/*@bgen(jjtree) IpMask */ -try { -/*@egen*/ - -t= <INTEGER_LITERAL> - {jjtn000.address.append(t.image); } -( -"!" t= <INTEGER_LITERAL> - {jjtn000.address.append( "." + t.image); } -)*/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void NetMask(): -{/*@bgen(jjtree) NetMask */ -JDMNetMask jjtn000 = new JDMNetMask(JJTNETMASK); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000); -/*@egen*/ -Token t; -} -{/*@bgen(jjtree) NetMask */ -try { -/*@egen*/ - -t= <INTEGER_LITERAL> - {jjtn000.address.append(t.image); } -( -"." t= <INTEGER_LITERAL> - {jjtn000.address.append( "." + t.image); } -)* "/" t= <INTEGER_LITERAL>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ {jjtn000.mask = t.image; }/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void NetMaskV6(): -{/*@bgen(jjtree) NetMaskV6 */ -JDMNetMaskV6 jjtn000 = new JDMNetMaskV6(JJTNETMASKV6); -boolean jjtc000 = true; -jjtree.openNodeScope(jjtn000); -/*@egen*/ -Token t; -} -{/*@bgen(jjtree) NetMaskV6 */ -try { -/*@egen*/ - -t= <V6_ADDRESS> - {jjtn000.address.append(t.image); } - -"/" t= <INTEGER_LITERAL>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ {jjtn000.mask = t.image; }/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void TrapBlock(): {/*@bgen(jjtree) TrapBlock */ - JDMTrapBlock jjtn000 = new JDMTrapBlock(JJTTRAPBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) TrapBlock */ -try { -/*@egen*/ -"trap" "=" "{" (TrapItem())* "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void TrapItem(): {/*@bgen(jjtree) TrapItem */ - JDMTrapItem jjtn000 = new JDMTrapItem(JJTTRAPITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) TrapItem */ -try { -/*@egen*/ -"{" jjtn000.comm= TrapCommunity() TrapInterestedHost() (Enterprise())* "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -JDMTrapCommunity TrapCommunity(): -{/*@bgen(jjtree) TrapCommunity */ - JDMTrapCommunity jjtn000 = new JDMTrapCommunity(JJTTRAPCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) TrapCommunity */ -try { -/*@egen*/ -"trap-community" "=" t=<IDENTIFIER>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ { jjtn000.community= t.image; return jjtn000; }/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void TrapInterestedHost(): {/*@bgen(jjtree) TrapInterestedHost */ - JDMTrapInterestedHost jjtn000 = new JDMTrapInterestedHost(JJTTRAPINTERESTEDHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) TrapInterestedHost */ -try { -/*@egen*/ -"hosts" "=" HostTrap() ("," HostTrap())*/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void HostTrap() : -{/*@bgen(jjtree) HostTrap */ - JDMHostTrap jjtn000 = new JDMHostTrap(JJTHOSTTRAP); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) HostTrap */ -try { -/*@egen*/ -HostName() -| -IpAddress() -| -IpV6Address()/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void Enterprise(): -{/*@bgen(jjtree) Enterprise */ - JDMEnterprise jjtn000 = new JDMEnterprise(JJTENTERPRISE); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) Enterprise */ -try { -/*@egen*/ -"{" -"enterprise" "=" t=<CSTRING> {jjtn000.enterprise= t.image;} - -"trap-num" "=" TrapNum() ("," TrapNum())* - -"}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void TrapNum(): -{/*@bgen(jjtree) TrapNum */ - JDMTrapNum jjtn000 = new JDMTrapNum(JJTTRAPNUM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) TrapNum */ - try { -/*@egen*/ - t=<INTEGER_LITERAL> {jjtn000.low= Integer.parseInt(t.image);} -[ - "-" t=<INTEGER_LITERAL> {jjtn000.high= Integer.parseInt(t.image);} -]/*@bgen(jjtree)*/ - } finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } - } -/*@egen*/ -} - - -void InformBlock(): {/*@bgen(jjtree) InformBlock */ - JDMInformBlock jjtn000 = new JDMInformBlock(JJTINFORMBLOCK); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) InformBlock */ -try { -/*@egen*/ -"inform" "=" "{" (InformItem())* "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void InformItem(): {/*@bgen(jjtree) InformItem */ - JDMInformItem jjtn000 = new JDMInformItem(JJTINFORMITEM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) InformItem */ -try { -/*@egen*/ -"{" jjtn000.comm= InformCommunity() InformInterestedHost() "}"/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -JDMInformCommunity InformCommunity(): -{/*@bgen(jjtree) InformCommunity */ - JDMInformCommunity jjtn000 = new JDMInformCommunity(JJTINFORMCOMMUNITY); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) InformCommunity */ -try { -/*@egen*/ -"inform-community" "=" t=<IDENTIFIER>/*@bgen(jjtree)*/ - { - jjtree.closeNodeScope(jjtn000, true); - jjtc000 = false; - } -/*@egen*/ { jjtn000.community= t.image; return jjtn000; }/*@bgen(jjtree)*/ -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void InformInterestedHost(): {/*@bgen(jjtree) InformInterestedHost */ - JDMInformInterestedHost jjtn000 = new JDMInformInterestedHost(JJTINFORMINTERESTEDHOST); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ } -{/*@bgen(jjtree) InformInterestedHost */ -try { -/*@egen*/ -"hosts" "=" HostInform() ("," HostInform())*/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} - -void HostInform() : -{/*@bgen(jjtree) HostInform */ - JDMHostInform jjtn000 = new JDMHostInform(JJTHOSTINFORM); - boolean jjtc000 = true; - jjtree.openNodeScope(jjtn000); -/*@egen*/ - Token t; -} -{/*@bgen(jjtree) HostInform */ -try { -/*@egen*/ -HostName() -| -IpAddress() -| -IpV6Address()/*@bgen(jjtree)*/ -} catch (Throwable jjte000) { - if (jjtc000) { - jjtree.clearNodeScope(jjtn000); - jjtc000 = false; - } else { - jjtree.popNode(); - } - if (jjte000 instanceof RuntimeException) { - throw (RuntimeException)jjte000; - } - if (jjte000 instanceof ParseException) { - throw (ParseException)jjte000; - } - throw (Error)jjte000; -} finally { - if (jjtc000) { - jjtree.closeNodeScope(jjtn000, true); - } -} -/*@egen*/ -} -
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/Parser.jjt Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -/* - * @(#)file Parser.jjt - * @(#)author Sun Microsystems, Inc. - * - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -options { - MULTI=true; - STATIC=false; - NODE_PREFIX= "JDM"; - NODE_PACKAGE="com.sun.jmx.snmp.IPAcl"; -} - - -PARSER_BEGIN(Parser) - -package com.sun.jmx.snmp.IPAcl; - -import java.io.*; - -public class Parser { -} - -PARSER_END(Parser) - - -SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| <"--" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> -| <"#" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> - -} - - - -/* RESERVED WORDS AND LITERALS */ - -TOKEN : -{ - <ACCESS: "access"> -| <ACL: "acl"> -| <ASSIGN: "="> -| <COMMUNITIES: "communities"> -| <ENTERPRISE: "enterprise"> -| <HOSTS: "hosts"> -| <LBRACE: "{"> -| <MANAGERS: "managers"> -| <RANGE: "-"> -| <RBRACE: "}"> -| <RO: "read-only"> -| <RW: "read-write"> -| <TRAP: "trap"> -| <INFORM: "inform"> -| <TRAPCOMMUNITY: "trap-community"> -| <INFORMCOMMUNITY: "inform-community"> -| <TRAPNUM: "trap-num"> -} - - - -TOKEN : /* LITERALS */ -{ - < INTEGER_LITERAL: - <DECIMAL_LITERAL> (["l","L"])? - | <HEX_LITERAL> (["l","L"])? - | <OCTAL_LITERAL> (["l","L"])? - > -| - < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > -| - < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > -| - < #OCTAL_LITERAL: "0" (["0"-"7"])* > -} - -TOKEN : /* V6 LITERALS */ -{ - < V6_ADDRESS: ((( ( (<H> ":")+ (":")?) | "::" ) (<H> ":")* (<H> | (<D> "." <D> "." <D> "." <D>))) | ("::")) | ( (<H> ":")+ ":") > -| - <#H: (["0"-"9","a"-"f","A"-"F"])+ > -| - <#D: (["0"-"9"])+ > -} - -TOKEN : /* IDENTIFIERS */ -{ - < IDENTIFIER: ( (<DIGIT>|<LETTER>)+ (<SEPARATOR>|<LETTER>|<DIGIT>)* (<DIGIT>|<LETTER>)+ ) | (<DIGIT>|<LETTER>)+ > -| - < #LETTER: ["a"-"z","A"-"Z"] > -| - < #SEPARATOR: ["-", "_"] > -| - < #DIGIT: ["0"-"9"] > -| - <CSTRING: "\"" (~["\""])* "\""> -} - - - -TOKEN: /* SEPARATOR */ -{ - < COMMA: "," > -| < DOT: "." > -| < MARK: "!" > -| < MASK: "/"> -} - -// A file can contain several acl definitions -// -JDMSecurityDefs SecurityDefs() : {} -{ - [AclBlock()] - [TrapBlock()] - [InformBlock()] - <EOF> - { return jjtThis;} -} - -void AclBlock(): {} -{ -"acl" "=" "{" (AclItem())+ "}" -} - -void AclItem(): {} -{ -"{" jjtThis.com= Communities() jjtThis.access= Access() Managers() "}" -} - -JDMCommunities Communities(): {} -{ -"communities" "=" Community() ( "," Community())* - -{return jjtThis;} - -} - -void Community(): -{ - Token t; -} -{ -t=<IDENTIFIER> {jjtThis.communityString= t.image;} -} - -JDMAccess Access(): {} -{ -"access" "=" ( <RO> {jjtThis.access= RO;} - | - <RW> {jjtThis.access= RW;} - ) -{return jjtThis;} -} - - -void Managers() : { } -{ -"managers" "=" Host() ( "," Host())* -} - -void Host() : -{ - Token t; -} -{ -HostName() -| -LOOKAHEAD(<INTEGER_LITERAL> ( "." <INTEGER_LITERAL> )* "/" <INTEGER_LITERAL>) -NetMask() -| -LOOKAHEAD(<V6_ADDRESS> "/" <INTEGER_LITERAL>) -NetMaskV6() -| -LOOKAHEAD(<INTEGER_LITERAL> ".") -IpAddress() -| -IpV6Address() -| -IpMask() -} - -void HostName(): -{ - Token t; -} -{ - t=<IDENTIFIER> { jjtThis.name.append(t.image); } -( -"." t=<IDENTIFIER> - {jjtThis.name.append( "." + t.image); } -)* - -} - -void IpAddress(): -{ -Token t; -} -{ - -t= <INTEGER_LITERAL> - {jjtThis.address.append(t.image); } -( -"." t= <INTEGER_LITERAL> - {jjtThis.address.append( "." + t.image); } -)* - -} - -void IpV6Address(): -{ -Token t; -} -{ - -t= <V6_ADDRESS> - {jjtThis.address.append(t.image); } -} - -void IpMask(): -{ -Token t; -} -{ - -t= <INTEGER_LITERAL> - {jjtThis.address.append(t.image); } -( -"!" t= <INTEGER_LITERAL> - {jjtThis.address.append( "." + t.image); } -)* -} - -void NetMask(): -{ -Token t; -} -{ - -t= <INTEGER_LITERAL> - {jjtThis.address.append(t.image); } -( -"." t= <INTEGER_LITERAL> - {jjtThis.address.append( "." + t.image); } -)* "/" t= <INTEGER_LITERAL> {jjtThis.mask = t.image; } -} - -void NetMaskV6(): -{ -Token t; -} -{ - -t= <V6_ADDRESS> - {jjtThis.address.append(t.image); } - -"/" t= <INTEGER_LITERAL> {jjtThis.mask = t.image; } -} - -void TrapBlock(): { } -{ -"trap" "=" "{" (TrapItem())* "}" -} - -void TrapItem(): { } -{ -"{" jjtThis.comm= TrapCommunity() TrapInterestedHost() (Enterprise())* "}" -} - -JDMTrapCommunity TrapCommunity(): -{ - Token t; -} -{ -"trap-community" "=" t=<IDENTIFIER> { jjtThis.community= t.image; return jjtThis; } -} - -void TrapInterestedHost(): { } -{ -"hosts" "=" HostTrap() ("," HostTrap())* -} - -void HostTrap() : -{ - Token t; -} -{ -HostName() -| -IpAddress() -| -IpV6Address() -} - -void Enterprise(): -{ - Token t; -} -{ -"{" -"enterprise" "=" t=<CSTRING> {jjtThis.enterprise= t.image;} - -"trap-num" "=" TrapNum() ("," TrapNum())* - -"}" -} - -void TrapNum(): -{ - Token t; -} -{ - t=<INTEGER_LITERAL> {jjtThis.low= Integer.parseInt(t.image);} -[ - "-" t=<INTEGER_LITERAL> {jjtThis.high= Integer.parseInt(t.image);} -] -} - - -void InformBlock(): { } -{ -"inform" "=" "{" (InformItem())* "}" -} - -void InformItem(): { } -{ -"{" jjtThis.comm= InformCommunity() InformInterestedHost() "}" -} - -JDMInformCommunity InformCommunity(): -{ - Token t; -} -{ -"inform-community" "=" t=<IDENTIFIER> { jjtThis.community= t.image; return jjtThis; } -} - -void InformInterestedHost(): { } -{ -"hosts" "=" HostInform() ("," HostInform())* -} - -void HostInform() : -{ - Token t; -} -{ -HostName() -| -IpAddress() -| -IpV6Address() -} -
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserConstants.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree&JavaCC: Do not edit this line. ParserConstants.java */ -package com.sun.jmx.snmp.IPAcl; - -interface ParserConstants { - - int EOF = 0; - int ACCESS = 7; - int ACL = 8; - int ASSIGN = 9; - int COMMUNITIES = 10; - int ENTERPRISE = 11; - int HOSTS = 12; - int LBRACE = 13; - int MANAGERS = 14; - int RANGE = 15; - int RBRACE = 16; - int RO = 17; - int RW = 18; - int TRAP = 19; - int INFORM = 20; - int TRAPCOMMUNITY = 21; - int INFORMCOMMUNITY = 22; - int TRAPNUM = 23; - int INTEGER_LITERAL = 24; - int DECIMAL_LITERAL = 25; - int HEX_LITERAL = 26; - int OCTAL_LITERAL = 27; - int V6_ADDRESS = 28; - int H = 29; - int D = 30; - int IDENTIFIER = 31; - int LETTER = 32; - int SEPARATOR = 33; - int DIGIT = 34; - int CSTRING = 35; - int COMMA = 36; - int DOT = 37; - int MARK = 38; - int MASK = 39; - - int DEFAULT = 0; - - String[] tokenImage = { - "<EOF>", - "\" \"", - "\"\\t\"", - "\"\\n\"", - "\"\\r\"", - "<token of kind 5>", - "<token of kind 6>", - "\"access\"", - "\"acl\"", - "\"=\"", - "\"communities\"", - "\"enterprise\"", - "\"hosts\"", - "\"{\"", - "\"managers\"", - "\"-\"", - "\"}\"", - "\"read-only\"", - "\"read-write\"", - "\"trap\"", - "\"inform\"", - "\"trap-community\"", - "\"inform-community\"", - "\"trap-num\"", - "<INTEGER_LITERAL>", - "<DECIMAL_LITERAL>", - "<HEX_LITERAL>", - "<OCTAL_LITERAL>", - "<V6_ADDRESS>", - "<H>", - "<D>", - "<IDENTIFIER>", - "<LETTER>", - "<SEPARATOR>", - "<DIGIT>", - "<CSTRING>", - "\",\"", - "\".\"", - "\"!\"", - "\"/\"", - }; - -}
--- a/src/jdk.snmp/share/classes/com/sun/jmx/snmp/IPAcl/ParserTokenManager.java Tue Oct 21 13:56:58 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1514 +0,0 @@ -/* - * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* Generated By:JJTree&JavaCC: Do not edit this line. ParserTokenManager.java */ -package com.sun.jmx.snmp.IPAcl; -import java.io.*; - -class ParserTokenManager implements ParserConstants -{ -private final int jjStopStringLiteralDfa_0(int pos, long active0) -{ - switch (pos) - { - case 0: - if ((active0 & 0x8000L) != 0L) - return 0; - if ((active0 & 0xfe5000L) != 0L) - { - jjmatchedKind = 31; - return 47; - } - if ((active0 & 0xd80L) != 0L) - { - jjmatchedKind = 31; - return 48; - } - return -1; - case 1: - if ((active0 & 0xfe5c00L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 1; - return 49; - } - if ((active0 & 0x180L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 1; - return 50; - } - return -1; - case 2: - if ((active0 & 0xfe5c00L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 2; - return 49; - } - if ((active0 & 0x100L) != 0L) - return 49; - if ((active0 & 0x80L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 2; - return 50; - } - return -1; - case 3: - if ((active0 & 0x565c00L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 31; - jjmatchedPos = 3; - } - return 49; - } - if ((active0 & 0xa80000L) != 0L) - return 49; - if ((active0 & 0x80L) != 0L) - { - if (jjmatchedPos != 3) - { - jjmatchedKind = 31; - jjmatchedPos = 3; - } - return 50; - } - return -1; - case 4: - if ((active0 & 0xa00000L) != 0L) - return 51; - if ((active0 & 0x60000L) != 0L) - { - if (jjmatchedPos < 3) - { - jjmatchedKind = 31; - jjmatchedPos = 3; - } - return 51; - } - if ((active0 & 0x1000L) != 0L) - return 49; - if ((active0 & 0x504c80L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 4; - return 49; - } - return -1; - case 5: - if ((active0 & 0x500080L) != 0L) - return 49; - if ((active0 & 0x4c00L) != 0L) - { - if (jjmatchedPos != 5) - { - jjmatchedKind = 31; - jjmatchedPos = 5; - } - return 49; - } - if ((active0 & 0xa60000L) != 0L) - { - if (jjmatchedPos != 5) - { - jjmatchedKind = 31; - jjmatchedPos = 5; - } - return 51; - } - return -1; - case 6: - if ((active0 & 0x400000L) != 0L) - return 51; - if ((active0 & 0x4c00L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 6; - return 49; - } - if ((active0 & 0xa60000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 6; - return 51; - } - return -1; - case 7: - if ((active0 & 0x660000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 7; - return 51; - } - if ((active0 & 0x800000L) != 0L) - return 51; - if ((active0 & 0x4000L) != 0L) - return 49; - if ((active0 & 0xc00L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 7; - return 49; - } - return -1; - case 8: - if ((active0 & 0x20000L) != 0L) - return 51; - if ((active0 & 0xc00L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 8; - return 49; - } - if ((active0 & 0x640000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 8; - return 51; - } - return -1; - case 9: - if ((active0 & 0x40000L) != 0L) - return 51; - if ((active0 & 0x800L) != 0L) - return 49; - if ((active0 & 0x600000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 9; - return 51; - } - if ((active0 & 0x400L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 9; - return 49; - } - return -1; - case 10: - if ((active0 & 0x600000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 10; - return 51; - } - if ((active0 & 0x400L) != 0L) - return 49; - return -1; - case 11: - if ((active0 & 0x600000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 11; - return 51; - } - return -1; - case 12: - if ((active0 & 0x600000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 12; - return 51; - } - return -1; - case 13: - if ((active0 & 0x400000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 13; - return 51; - } - if ((active0 & 0x200000L) != 0L) - return 51; - return -1; - case 14: - if ((active0 & 0x400000L) != 0L) - { - jjmatchedKind = 31; - jjmatchedPos = 14; - return 51; - } - return -1; - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0) -{ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); -} -private final int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private final int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -private final int jjMoveStringLiteralDfa0_0() -{ - switch(curChar) - { - case 33: - return jjStopAtPos(0, 38); - case 44: - return jjStopAtPos(0, 36); - case 45: - return jjStartNfaWithStates_0(0, 15, 0); - case 46: - return jjStopAtPos(0, 37); - case 47: - return jjStopAtPos(0, 39); - case 61: - return jjStopAtPos(0, 9); - case 97: - return jjMoveStringLiteralDfa1_0(0x180L); - case 99: - return jjMoveStringLiteralDfa1_0(0x400L); - case 101: - return jjMoveStringLiteralDfa1_0(0x800L); - case 104: - return jjMoveStringLiteralDfa1_0(0x1000L); - case 105: - return jjMoveStringLiteralDfa1_0(0x500000L); - case 109: - return jjMoveStringLiteralDfa1_0(0x4000L); - case 114: - return jjMoveStringLiteralDfa1_0(0x60000L); - case 116: - return jjMoveStringLiteralDfa1_0(0xa80000L); - case 123: - return jjStopAtPos(0, 13); - case 125: - return jjStopAtPos(0, 16); - default : - return jjMoveNfa_0(5, 0); - } -} -private final int jjMoveStringLiteralDfa1_0(long active0) -{ - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0); - return 1; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x4000L); - case 99: - return jjMoveStringLiteralDfa2_0(active0, 0x180L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x60000L); - case 110: - return jjMoveStringLiteralDfa2_0(active0, 0x500800L); - case 111: - return jjMoveStringLiteralDfa2_0(active0, 0x1400L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0xa80000L); - default : - break; - } - return jjStartNfa_0(0, active0); -} -private final int jjMoveStringLiteralDfa2_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(0, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0); - return 2; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0xae0000L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x80L); - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x500000L); - case 108: - if ((active0 & 0x100L) != 0L) - return jjStartNfaWithStates_0(2, 8, 49); - break; - case 109: - return jjMoveStringLiteralDfa3_0(active0, 0x400L); - case 110: - return jjMoveStringLiteralDfa3_0(active0, 0x4000L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x1000L); - case 116: - return jjMoveStringLiteralDfa3_0(active0, 0x800L); - default : - break; - } - return jjStartNfa_0(1, active0); -} -private final int jjMoveStringLiteralDfa3_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(1, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0); - return 3; - } - switch(curChar) - { - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x4000L); - case 100: - return jjMoveStringLiteralDfa4_0(active0, 0x60000L); - case 101: - return jjMoveStringLiteralDfa4_0(active0, 0x880L); - case 109: - return jjMoveStringLiteralDfa4_0(active0, 0x400L); - case 111: - return jjMoveStringLiteralDfa4_0(active0, 0x500000L); - case 112: - if ((active0 & 0x80000L) != 0L) - { - jjmatchedKind = 19; - jjmatchedPos = 3; - } - return jjMoveStringLiteralDfa4_0(active0, 0xa00000L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x1000L); - default : - break; - } - return jjStartNfa_0(2, active0); -} -private final int jjMoveStringLiteralDfa4_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(2, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0); - return 4; - } - switch(curChar) - { - case 45: - return jjMoveStringLiteralDfa5_0(active0, 0xa60000L); - case 103: - return jjMoveStringLiteralDfa5_0(active0, 0x4000L); - case 114: - return jjMoveStringLiteralDfa5_0(active0, 0x500800L); - case 115: - if ((active0 & 0x1000L) != 0L) - return jjStartNfaWithStates_0(4, 12, 49); - return jjMoveStringLiteralDfa5_0(active0, 0x80L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x400L); - default : - break; - } - return jjStartNfa_0(3, active0); -} -private final int jjMoveStringLiteralDfa5_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(3, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0); - return 5; - } - switch(curChar) - { - case 99: - return jjMoveStringLiteralDfa6_0(active0, 0x200000L); - case 101: - return jjMoveStringLiteralDfa6_0(active0, 0x4000L); - case 109: - if ((active0 & 0x100000L) != 0L) - { - jjmatchedKind = 20; - jjmatchedPos = 5; - } - return jjMoveStringLiteralDfa6_0(active0, 0x400000L); - case 110: - return jjMoveStringLiteralDfa6_0(active0, 0x800400L); - case 111: - return jjMoveStringLiteralDfa6_0(active0, 0x20000L); - case 112: - return jjMoveStringLiteralDfa6_0(active0, 0x800L); - case 115: - if ((active0 & 0x80L) != 0L) - return jjStartNfaWithStates_0(5, 7, 49); - break; - case 119: - return jjMoveStringLiteralDfa6_0(active0, 0x40000L); - default : - break; - } - return jjStartNfa_0(4, active0); -} -private final int jjMoveStringLiteralDfa6_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(4, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0); - return 6; - } - switch(curChar) - { - case 45: - return jjMoveStringLiteralDfa7_0(active0, 0x400000L); - case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x400L); - case 110: - return jjMoveStringLiteralDfa7_0(active0, 0x20000L); - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x200000L); - case 114: - return jjMoveStringLiteralDfa7_0(active0, 0x44800L); - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x800000L); - default : - break; - } - return jjStartNfa_0(5, active0); -} -private final int jjMoveStringLiteralDfa7_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(5, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0); - return 7; - } - switch(curChar) - { - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x400000L); - case 105: - return jjMoveStringLiteralDfa8_0(active0, 0x40800L); - case 108: - return jjMoveStringLiteralDfa8_0(active0, 0x20000L); - case 109: - if ((active0 & 0x800000L) != 0L) - return jjStartNfaWithStates_0(7, 23, 51); - return jjMoveStringLiteralDfa8_0(active0, 0x200000L); - case 115: - if ((active0 & 0x4000L) != 0L) - return jjStartNfaWithStates_0(7, 14, 49); - break; - case 116: - return jjMoveStringLiteralDfa8_0(active0, 0x400L); - default : - break; - } - return jjStartNfa_0(6, active0); -} -private final int jjMoveStringLiteralDfa8_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(6, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0); - return 8; - } - switch(curChar) - { - case 105: - return jjMoveStringLiteralDfa9_0(active0, 0x400L); - case 109: - return jjMoveStringLiteralDfa9_0(active0, 0x200000L); - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0x400000L); - case 115: - return jjMoveStringLiteralDfa9_0(active0, 0x800L); - case 116: - return jjMoveStringLiteralDfa9_0(active0, 0x40000L); - case 121: - if ((active0 & 0x20000L) != 0L) - return jjStartNfaWithStates_0(8, 17, 51); - break; - default : - break; - } - return jjStartNfa_0(7, active0); -} -private final int jjMoveStringLiteralDfa9_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(7, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0); - return 9; - } - switch(curChar) - { - case 101: - if ((active0 & 0x800L) != 0L) - return jjStartNfaWithStates_0(9, 11, 49); - else if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(9, 18, 51); - return jjMoveStringLiteralDfa10_0(active0, 0x400L); - case 109: - return jjMoveStringLiteralDfa10_0(active0, 0x400000L); - case 117: - return jjMoveStringLiteralDfa10_0(active0, 0x200000L); - default : - break; - } - return jjStartNfa_0(8, active0); -} -private final int jjMoveStringLiteralDfa10_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(8, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(9, active0); - return 10; - } - switch(curChar) - { - case 109: - return jjMoveStringLiteralDfa11_0(active0, 0x400000L); - case 110: - return jjMoveStringLiteralDfa11_0(active0, 0x200000L); - case 115: - if ((active0 & 0x400L) != 0L) - return jjStartNfaWithStates_0(10, 10, 49); - break; - default : - break; - } - return jjStartNfa_0(9, active0); -} -private final int jjMoveStringLiteralDfa11_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(9, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(10, active0); - return 11; - } - switch(curChar) - { - case 105: - return jjMoveStringLiteralDfa12_0(active0, 0x200000L); - case 117: - return jjMoveStringLiteralDfa12_0(active0, 0x400000L); - default : - break; - } - return jjStartNfa_0(10, active0); -} -private final int jjMoveStringLiteralDfa12_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(10, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(11, active0); - return 12; - } - switch(curChar) - { - case 110: - return jjMoveStringLiteralDfa13_0(active0, 0x400000L); - case 116: - return jjMoveStringLiteralDfa13_0(active0, 0x200000L); - default : - break; - } - return jjStartNfa_0(11, active0); -} -private final int jjMoveStringLiteralDfa13_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(11, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(12, active0); - return 13; - } - switch(curChar) - { - case 105: - return jjMoveStringLiteralDfa14_0(active0, 0x400000L); - case 121: - if ((active0 & 0x200000L) != 0L) - return jjStartNfaWithStates_0(13, 21, 51); - break; - default : - break; - } - return jjStartNfa_0(12, active0); -} -private final int jjMoveStringLiteralDfa14_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(12, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(13, active0); - return 14; - } - switch(curChar) - { - case 116: - return jjMoveStringLiteralDfa15_0(active0, 0x400000L); - default : - break; - } - return jjStartNfa_0(13, active0); -} -private final int jjMoveStringLiteralDfa15_0(long old0, long active0) -{ - if (((active0 &= old0)) == 0L) - return jjStartNfa_0(13, old0); - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { - jjStopStringLiteralDfa_0(14, active0); - return 15; - } - switch(curChar) - { - case 121: - if ((active0 & 0x400000L) != 0L) - return jjStartNfaWithStates_0(15, 22, 51); - break; - default : - break; - } - return jjStartNfa_0(14, active0); -} -private final void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private final void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private final void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} -private final void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} -private final void jjCheckNAddStates(int start) -{ - jjCheckNAdd(jjnextStates[start]); - jjCheckNAdd(jjnextStates[start + 1]); -} -static final long[] jjbitVec0 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -private final int jjMoveNfa_0(int startState, int curPos) -{ - int[] nextStates; - int startsAt = 0; - jjnewStateCnt = 47; - int i = 1; - jjstateSet[0] = startState; - int j, kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - MatchLoop: do - { - switch(jjstateSet[--i]) - { - case 49: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(19); - } - break; - case 48: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - else if (curChar == 58) - jjCheckNAddStates(3, 5); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - else if (curChar == 58) - jjCheckNAddTwoStates(23, 25); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(26, 27); - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); - break; - case 47: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - break; - case 50: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - else if (curChar == 58) - jjCheckNAddStates(3, 5); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - else if (curChar == 58) - jjCheckNAddTwoStates(23, 25); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(19); - } - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(26, 27); - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); - break; - case 5: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(6, 9); - else if (curChar == 58) - jjAddStates(10, 11); - else if (curChar == 34) - jjCheckNAddTwoStates(15, 16); - else if (curChar == 35) - jjCheckNAddStates(12, 14); - else if (curChar == 45) - jjstateSet[jjnewStateCnt++] = 0; - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(15, 17); - } - if ((0x3fe000000000000L & l) != 0L) - { - if (kind > 24) - kind = 24; - jjCheckNAddTwoStates(12, 13); - } - else if (curChar == 48) - { - if (kind > 24) - kind = 24; - jjCheckNAddStates(18, 20); - } - break; - case 51: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(19); - } - break; - case 0: - if (curChar == 45) - jjCheckNAddStates(21, 23); - break; - case 1: - if ((0xffffffffffffdbffL & l) != 0L) - jjCheckNAddStates(21, 23); - break; - case 2: - if ((0x2400L & l) != 0L && kind > 5) - kind = 5; - break; - case 3: - if (curChar == 10 && kind > 5) - kind = 5; - break; - case 4: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 3; - break; - case 6: - if (curChar == 35) - jjCheckNAddStates(12, 14); - break; - case 7: - if ((0xffffffffffffdbffL & l) != 0L) - jjCheckNAddStates(12, 14); - break; - case 8: - if ((0x2400L & l) != 0L && kind > 6) - kind = 6; - break; - case 9: - if (curChar == 10 && kind > 6) - kind = 6; - break; - case 10: - if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 9; - break; - case 11: - if ((0x3fe000000000000L & l) == 0L) - break; - if (kind > 24) - kind = 24; - jjCheckNAddTwoStates(12, 13); - break; - case 12: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 24) - kind = 24; - jjCheckNAddTwoStates(12, 13); - break; - case 14: - if (curChar == 34) - jjCheckNAddTwoStates(15, 16); - break; - case 15: - if ((0xfffffffbffffffffL & l) != 0L) - jjCheckNAddTwoStates(15, 16); - break; - case 16: - if (curChar == 34 && kind > 35) - kind = 35; - break; - case 17: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 31) - kind = 31; - jjCheckNAddStates(15, 17); - break; - case 18: - if ((0x3ff200000000000L & l) != 0L) - jjCheckNAddTwoStates(18, 19); - break; - case 19: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 31) - kind = 31; - jjCheckNAdd(19); - break; - case 20: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - break; - case 21: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - break; - case 22: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddStates(6, 9); - break; - case 23: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(23, 24); - break; - case 24: - if (curChar == 58) - jjCheckNAddTwoStates(23, 25); - break; - case 25: - case 41: - if (curChar == 58 && kind > 28) - kind = 28; - break; - case 26: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(26, 27); - break; - case 27: - if (curChar == 58) - jjCheckNAddStates(3, 5); - break; - case 28: - case 42: - if (curChar == 58) - jjCheckNAddTwoStates(29, 36); - break; - case 29: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(29, 30); - break; - case 30: - if (curChar == 46) - jjCheckNAdd(31); - break; - case 31: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(31, 32); - break; - case 32: - if (curChar == 46) - jjCheckNAdd(33); - break; - case 33: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(33, 34); - break; - case 34: - if (curChar == 46) - jjCheckNAdd(35); - break; - case 35: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 28) - kind = 28; - jjCheckNAdd(35); - break; - case 36: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 28) - kind = 28; - jjCheckNAddStates(24, 26); - break; - case 37: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(37, 28); - break; - case 38: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 28) - kind = 28; - jjCheckNAdd(38); - break; - case 39: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 28) - kind = 28; - jjCheckNAddStates(27, 31); - break; - case 40: - if (curChar == 58) - jjAddStates(10, 11); - break; - case 43: - if (curChar != 48) - break; - if (kind > 24) - kind = 24; - jjCheckNAddStates(18, 20); - break; - case 45: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 24) - kind = 24; - jjCheckNAddTwoStates(45, 13); - break; - case 46: - if ((0xff000000000000L & l) == 0L) - break; - if (kind > 24) - kind = 24; - jjCheckNAddTwoStates(46, 13); - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - MatchLoop: do - { - switch(jjstateSet[--i]) - { - case 49: - if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(19); - } - break; - case 48: - if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddTwoStates(26, 27); - if ((0x7e0000007eL & l) != 0L) - jjCheckNAddTwoStates(23, 24); - break; - case 47: - if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - break; - case 50: - if ((0x7fffffe87fffffeL & l) != 0L) - jjCheckNAddTwoStates(18, 19); - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAddStates(0, 2); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31) - kind = 31; - jjCheckNAdd(20); - } - if ((0x7fffffe07fffffeL & l) != 0L) - { - if (kind > 31)