def setUp(self): odl = OpenDaylight() odl.setup['hostname'] = CONTROLLER odl.setup['username'] = USERNAME odl.setup['password'] = PASSWORD self.flow = OpenDaylightFlow(odl) self.node = OpenDaylightNode(odl) self.switch_id_1 = SWITCH_1 self.odl_test_flow_1 = {u'actions': u'DROP', u'etherType': u'0x800', u'ingressPort': u'1', u'installInHw': u'true', u'name': u'odl-test-flow1', u'node': {u'@id': self.switch_id_1, u'@type': u'OF'}, u'priority': u'500'} self.odl_test_flow_2 = {u'actions': u'DROP', u'etherType': u'0x800', u'ingressPort': u'2', u'installInHw': u'true', u'name': u'odl-test-flow2', u'node': {u'@id': self.switch_id_1, u'@type': u'OF'}, u'priority': u'500'}
def setUp(self): odl = OpenDaylight() odl.setup['hostname'] = CONTROLLER odl.setup['username'] = USERNAME odl.setup['password'] = PASSWORD self.flow = OpenDaylightFlow(odl) self.node = OpenDaylightNode(odl) self.switch_id_1 = SWITCH_1 self.odl_test_flow_1 = { u'actions': u'DROP', u'etherType': u'0x800', u'ingressPort': u'1', u'installInHw': u'true', u'name': u'odl-test-flow1', u'node': { u'@id': self.switch_id_1, u'@type': u'OF' }, u'priority': u'500' } self.odl_test_flow_2 = { u'actions': u'DROP', u'etherType': u'0x800', u'ingressPort': u'2', u'installInHw': u'true', u'name': u'odl-test-flow2', u'node': { u'@id': self.switch_id_1, u'@type': u'OF' }, u'priority': u'500' }
# Author: Nabil Maadarani # # This file allows users to add a flow from OpenDaylight import OpenDaylight from OpenDaylight import OpenDaylightFlow # Initiate connection to the ODL controller odl = OpenDaylight() odl.setup[ 'hostname'] = '127.0.0.1' # Replace with the ODL Controller IP addresss odl.setup['username'] = '******' # User ID to login to the ODL Controller odl.setup['password'] = '******' # Password to login to the ODL Controller flow = OpenDaylightFlow(odl) # User instructions print('>> You are about to add a new flow') flowName = 'sshFlow' localIp = '10.0.0.1' # Specific to the local host remoteIp = '10.0.0.3' # Specific to the remote host dstPort = raw_input('>> Enter the port number: ') if (dstPort == ''): # Build the local flow odl_test_flow1 = { 'installInHw': 'true', 'name': flowName + '1', 'node': { 'id': '00:00:00:00:00:00:00:01', 'type': 'OF'
# Author: Nabil Maadarani # # This file allows users to add a flow from OpenDaylight import OpenDaylight from OpenDaylight import OpenDaylightFlow # Initiate connection to the ODL controller odl = OpenDaylight() odl.setup['hostname'] = '127.0.0.1' # Replace with the ODL Controller IP addresss odl.setup['username'] = '******' # User ID to login to the ODL Controller odl.setup['password'] = '******' # Password to login to the ODL Controller flow = OpenDaylightFlow(odl) # User instructions print('>> You are about to add a new flow') flowName = 'sshFlow' localIp = '10.0.0.1' # Specific to the local host remoteIp = '10.0.0.3' # Specific to the remote host dstPort = raw_input('>> Enter the port number: ') if(dstPort == ''): # Build the local flow odl_test_flow1 = { 'installInHw': 'true', 'name': flowName + '1', 'node': {'id': '00:00:00:00:00:00:00:01', 'type': 'OF'}, # Specific to the node being used 'priority': '500', 'nwSrc' : localIp, 'nwDst' : remoteIp,