|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.adaptation.snmp.CiscoTransmit
public class CiscoTransmit
Collection of methods to send and receive configuration file to/from Cisco router.
| Field Summary | |
|---|---|
static org.snmp4j.smi.OID |
ccCopyFailCause
SNMP ID for the the failure reason (if copy state returns 4). |
static org.snmp4j.smi.OID |
ccCopyState
SNMP ID for the state of this copy. |
private org.snmp4j.smi.OctetString |
communityName
|
private org.snmp4j.CommunityTarget |
comtarget
|
private String |
hostIP
|
private Logger |
logger
|
static int |
RUNNING_CONFIG
Specifies the running-config file as configuration file choice |
static int |
STARTUP_CONFIG
Specifies the startup-config file as configuration file choice |
private org.snmp4j.smi.Address |
targetaddress
|
private org.snmp4j.TransportMapping |
transport
|
| Constructor Summary | |
|---|---|
CiscoTransmit(String remoteIP,
String localIP,
String communityName,
String snmpVersion)
Creates a CiscoTransmit instance for sending or receiving a config file with snmp version 1 or 2c. |
|
CiscoTransmit(String target,
String hostIP,
String userName,
String securityLevel,
String authFunction,
String authPasswd,
String privFunction,
String privPasswd)
Creates a CiscoTransmit instance for sending or receiving a config file with snmp version 3, which add security aspect
to snmp in adding authentication and/or encryption. |
|
| Method Summary | |
|---|---|
private org.snmp4j.smi.VariableBinding[] |
buildReceivingVb(String targFileName)
Initialisation of the variable binding for receiving running-config |
private org.snmp4j.smi.VariableBinding[] |
buildSendingVbRC(String srcFileName)
Initialisation of the variable binding for running-config |
private org.snmp4j.smi.VariableBinding[] |
buildSendingVbSC(String srcFileName)
Initialisation of the variable binding for startup-config file |
private void |
checkStatus(org.snmp4j.Snmp snmp)
To check if the sending/receiving was sucessful, i.e does not quit until finished the process |
boolean |
isListeningT()
Only for test purposes |
void |
receiveConfig(String targFileName)
For receiving the configuration file from Cisco router. |
void |
secureReceiveConfig()
Still have to be implemented !! |
void |
secureSendConfig(int choice)
Still have to be implemented !! |
void |
sendConfig(int configType,
String srcFileName)
Sends running-config or startup-config file, depending on choice
This will be used to send a config file when using snmp version 1 or 2c |
private void |
sendResetRow(int row,
org.snmp4j.Snmp snmp)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.snmp4j.smi.OID ccCopyState
public static final org.snmp4j.smi.OID ccCopyFailCause
private org.snmp4j.smi.Address targetaddress
private org.snmp4j.smi.OctetString communityName
private String hostIP
private org.snmp4j.TransportMapping transport
private org.snmp4j.CommunityTarget comtarget
public static final int RUNNING_CONFIG
public static final int STARTUP_CONFIG
private Logger logger
| Constructor Detail |
|---|
public CiscoTransmit(String remoteIP,
String localIP,
String communityName,
String snmpVersion)
throws VerinecException
CiscoTransmit instance for sending or receiving a config file with snmp version 1 or 2c.
remoteIP - IP address of the Cisco routerlocalIP - IP address of the hostcommunityName - Community name that have to be used with snmp version 1 or 2csnmpVersion - SNMP version to use : v1 or v2c
VerinecException - Throws VerinecException if could not create the transport channel
public CiscoTransmit(String target,
String hostIP,
String userName,
String securityLevel,
String authFunction,
String authPasswd,
String privFunction,
String privPasswd)
throws VerinecException
CiscoTransmit instance for sending or receiving a config file with snmp version 3, which add security aspect
to snmp in adding authentication and/or encryption.
target - IP address of the Cisco routerhostIP - IP address of the hostuserName - User name that have to be used for snmp version 3securityLevel - Specifies the security level to use :
authFunction - Cryptography function to use for authentication : MD5 | SHAauthPasswd - Choosen password for authenticationprivFunction - Cryptography function to use for encryption : AES128 | AES192 | AES256 | DESprivPasswd - Choosen password for encryption
VerinecException - Throws VerinecException if could not create the transport channel| Method Detail |
|---|
private org.snmp4j.smi.VariableBinding[] buildSendingVbSC(String srcFileName)
srcFileName - The filename of configuration to send relative to the tftp root folder
private org.snmp4j.smi.VariableBinding[] buildSendingVbRC(String srcFileName)
srcFileName - The filename of configuration to send relative to the tftp root folder
private org.snmp4j.smi.VariableBinding[] buildReceivingVb(String targFileName)
targFileName - The filename where the cisco has to store the configuration to. Relative to tftp root folder.
private void sendResetRow(int row,
org.snmp4j.Snmp snmp)
throws VerinecException
VerinecException
private void checkStatus(org.snmp4j.Snmp snmp)
throws VerinecException
snmp - The connection
VerinecException - On communication error
public void sendConfig(int configType,
String srcFileName)
throws VerinecException
choice
This will be used to send a config file when using snmp version 1 or 2c
configType - To decide if sending running-config or startup-config filesrcFileName - File that have to be sent to the router (can be NULL for receiving). local to the root directory of the tftp server
VerinecException - If it is not possible to listen on the givent transport channelRUNNING_CONFIG,
STARTUP_CONFIGpublic void secureSendConfig(int choice)
choice
This will actually be used to send a config file when using snmp version 3
choice - To decide if sending running-config or startup-config fileRUNNING_CONFIG,
STARTUP_CONFIG
public void receiveConfig(String targFileName)
throws VerinecException
Uses snmp version 1 or 2c to tell cisco to upload the config file
targFileName - Target file name for the upload, relative to tftp server root.
VerinecException - If impossible to listen on the transport chanel or problems to receive the configuration filepublic void secureReceiveConfig()
This will actually be used to receive a config file when using snmp version 3
public boolean isListeningT()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||