예제 #1
0
 def test_field_display(self):
   tf = TF(HS_FORMAT())
   flow_mod = ofp_flow_mod(xid=124, priority=1, match=ofp_match(nw_tos=6), action=ofp_action_output(port=2))
   switch = create_switch(1, 2)
   switch.table.process_flow_mod(flow_mod)
   generate_transfer_function(tf, switch)
   print "tf: %s" % str(tf)
예제 #2
0
 def test_basic(self):
   tf = TF(HS_FORMAT())
   switch = create_switch(1, 2)
   flow_mod = ofp_flow_mod(xid=124, priority=1, match=ofp_match(in_port=1, nw_src="1.2.3.4"), action=ofp_action_output(port=2))
   switch.table.process_flow_mod(flow_mod)
   generate_transfer_function(tf, switch)
   print "tf: %s" % str(tf)
예제 #3
0
 def test_drop(self):
   tf = TF(HS_FORMAT())
   switch = create_switch(1, 2)
   # Don't give it an action
   flow_mod = ofp_flow_mod(xid=124, priority=1, match=ofp_match(in_port=1, nw_src="1.2.3.4"))
   switch.table.process_flow_mod(flow_mod)
   generate_transfer_function(tf, switch)
   print "tf: %s" % str(tf)
예제 #4
0
 def test_eth_display(self):
   tf = TF(HS_FORMAT())
   print "int value is: ", EthAddr("00:00:11:22:33:00").toInt()
   print "string is:", str(EthAddr("00:00:11:22:33:00"))
   flow_mod = ofp_flow_mod(xid=124, priority=1, match=ofp_match(dl_src="00:00:11:22:33:00"), action=ofp_action_output(port=2))
   switch = create_switch(1, 2)
   switch.table.process_flow_mod(flow_mod)
   generate_transfer_function(tf, switch)
   print "tf: %s" % str(tf)