Version 15 (modified by adam, 8 years ago)

darft

Switch Interface

In this document we describe the functions that the switch library code needs to implement. The class structure for the switch is : Switch -> VendorSwitch -> ModelVendorSwitch . Following standard oo conventions functions are generically implemented in the Switch super class and more specifically implemented in the Vendor and Model sub-classes.

Environmental monitoring and other generic functions such as getName etc will be implemented in the hardware super class, more details to follow.

switch.py def init(self, switchNode, macIDLength=None):

def setSwitchID(self, s): def getSwitchID(self): def setIPAddress(self, i): def getIPAddress(self): def setMACIDLength(self, i): def getMACIDLength(self): def setCommunity(self, c): def getCommunity(self): def setSNMPgetCommand(self, s): def getSNMPgetCommand(self): def setSNMPwalkCommand(self, s): def getSNMPwalkCommand(self): def setSNMPsetCommand(self, s): def getSNMPsetCommand(self): def getChassisTemperature(self): def getNumberPorts(self): def getSwitchName(self): def getSwitchDescription(self): def getSwitchUptime(self): def getSwitchContact(self): def getSwitchLocation(self): def getVLANToInterfacesTable(self): def getConnectedPortsTable(self): def getInterfaceDescriptionTable(self): def getLearnedAddresses(self): def getLearnedPorts(self): def getAddressesStatus(self): def getPortIDs(self): def getPortInternalID(self, portNumber): def getPortStatus(self, portNumber): def enablePort(self, portNumber): def disablePort(self, portNumber): def getFullMACTable(self): def getSNMPResultVLANTable(self, command): def getSNMPResultTable(self, command, idLength=1, format="normal"): def getSNMPResultID(self, command, idLength): def getSNMPResultValue(self, command): def parseSNMPResultID(self, snmpResult, idLength, format="normal"): def parseSNMPResultSpecificID(self, snmpResult, idNumber): def parseSNMPResultValue(self, result):

linksys.py

def init(self, switchNode, minimumVLANInternalID, maximumVLANInternalID, minimumInterfaceInternalID, maximumInterfaceInternalID):

def setMinimumVLANInternalID(self, m): def getMinimumVLANInternalID(self): def setMaximumVLANInternalID(self, m): def getMaximumVLANInternalID(self): def getVLANNames(self):

# default vlan does not show up in linksys tables, hard code it here

def getFullVLANInfo(self, theVLANName=None): def createVLAN(self, vlan): def addPorts(self, vlanName, ports): def deletePorts(self, vlanName, ports): def deleteVLAN(self, vlanName): def getTaggedPorts(self, vlanID ): def isPortTagged(self, portID, portInternalIDToVLANInternalID): def getVLANInternalID(self, vlanName):

# no default vlan in the snmp tables for the linksys

def getNextVLANID(self): def getVLANExternalIDs(self): def parseSNMPResultSpecificID(self, snmpResult, idNumber): def setPortList(self,pl,internal_port,value): def parsePortList(self,pl,tagged): def init(self, switchNode): def getNumberofPorts(self):

Cisco SNMP tool

When developing support for a switch this is very useful.

 http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en