@@ -656,7 +656,7 @@ def nuclear_install(classifier):
656
656
:param classifier: the input classifer
657
657
:type classifier: Classifier
658
658
"""
659
- switches = self .network .switches ()
659
+ switches = self .network .switch_list ()
660
660
classifier = switchify (classifier ,switches )
661
661
classifier = concretize (classifier )
662
662
classifier = check_OF_rules (classifier )
@@ -697,7 +697,7 @@ def install_diff_rules(classifier):
697
697
"""
698
698
with self .old_rules_lock :
699
699
old_rules = self .old_rules
700
- switches = self .network .switches ()
700
+ switches = self .network .switch_list ()
701
701
classifier = switchify (classifier ,switches )
702
702
classifier = concretize (classifier )
703
703
classifier = OF_inportize (classifier )
@@ -782,7 +782,7 @@ def pull_bucket_stats():
782
782
if 'switch' in concrete_pred :
783
783
switch_list .append (concrete_pred ['switch' ])
784
784
else :
785
- switch_list = self .network .switches ()
785
+ switch_list = self .network .switch_list ()
786
786
break
787
787
for s in switch_list :
788
788
bucket .add_outstanding_switch_query (s )
@@ -885,7 +885,7 @@ def send_clear(self,switch):
885
885
886
886
def clear_all (self ):
887
887
def f ():
888
- switches = self .network .switches ()
888
+ switches = self .network .switch_list ()
889
889
for s in switches :
890
890
self .send_barrier (s )
891
891
self .send_clear (s )
@@ -912,11 +912,11 @@ def handle_switch_join(self,switch_id):
912
912
def handle_switch_part (self ,switch_id ):
913
913
self .network .handle_switch_part (switch_id )
914
914
915
- def handle_port_join (self ,switch_id ,port_id ,conf_up ,stat_up ):
916
- self .network .handle_port_join (switch_id ,port_id ,conf_up ,stat_up )
915
+ def handle_port_join (self ,switch_id ,port_id ,conf_up ,stat_up , port_type ):
916
+ self .network .handle_port_join (switch_id ,port_id ,conf_up ,stat_up , port_type )
917
917
918
- def handle_port_mod (self , switch , port_no , config , status ):
919
- self .network .handle_port_mod (switch , port_no , config , status )
918
+ def handle_port_mod (self ,switch_id , port_id , conf_up , stat_up , port_type ):
919
+ self .network .handle_port_mod (switch_id , port_id , conf_up , stat_up , port_type )
920
920
921
921
def handle_port_part (self , switch , port_no ):
922
922
self .network .handle_port_part (switch , port_no )
@@ -1074,10 +1074,10 @@ def handle_switch_part(self, switch):
1074
1074
self .debug_log .debug (str (self .next_topo ))
1075
1075
self .queue_update (self .get_update_no ())
1076
1076
1077
- def handle_port_join (self , switch , port_no , config , status ):
1077
+ def handle_port_join (self , switch , port_no , config , status , port_type ):
1078
1078
self .debug_log .debug ("handle_port_joins %s:%s:%s:%s" % (switch , port_no , config , status ))
1079
1079
this_update_no = self .get_update_no ()
1080
- self .next_topo .add_port (switch ,port_no ,config ,status )
1080
+ self .next_topo .add_port (switch ,port_no ,config ,status , port_type )
1081
1081
if config or status :
1082
1082
self .inject_discovery_packet (switch ,port_no )
1083
1083
self .debug_log .debug (str (self .next_topo ))
@@ -1093,12 +1093,13 @@ def handle_port_part(self, switch, port_no):
1093
1093
except KeyError :
1094
1094
pass # THE SWITCH HAS ALREADY BEEN REMOVED BY handle_switch_parts
1095
1095
1096
- def handle_port_mod (self , switch , port_no , config , status ):
1096
+ def handle_port_mod (self , switch , port_no , config , status , port_type ):
1097
1097
self .debug_log .debug ("handle_port_mods %s:%s:%s:%s" % (switch , port_no , config , status ))
1098
1098
# GET PREV VALUES
1099
1099
try :
1100
1100
prev_config = self .next_topo .node [switch ]["ports" ][port_no ].config
1101
1101
prev_status = self .next_topo .node [switch ]["ports" ][port_no ].status
1102
+ prev_port_type = self .next_topo .node [switch ]["ports" ][port_no ].port_type
1102
1103
except KeyError :
1103
1104
self .log .warning ("KeyError CASE!!!!!!!!" )
1104
1105
self .port_down (switch , port_no )
@@ -1107,6 +1108,8 @@ def handle_port_mod(self, switch, port_no, config, status):
1107
1108
# UPDATE VALUES
1108
1109
self .next_topo .node [switch ]["ports" ][port_no ].config = config
1109
1110
self .next_topo .node [switch ]["ports" ][port_no ].status = status
1111
+ self .next_topo .node [switch ]["ports" ][port_no ].port_type = port_type
1112
+
1110
1113
1111
1114
# DETERMINE IF/WHAT CHANGED
1112
1115
if (prev_config and not config ):
@@ -1170,7 +1173,13 @@ def handle_link_update(self, s1, p_no1, s2, p_no2):
1170
1173
if p1 .possibly_up () and p2 .possibly_up ():
1171
1174
self .next_topo .node [s1 ]["ports" ][p_no1 ].linked_to = Location (s2 ,p_no2 )
1172
1175
self .next_topo .node [s2 ]["ports" ][p_no2 ].linked_to = Location (s1 ,p_no1 )
1173
- self .next_topo .add_edge (s1 , s2 , {s1 : p_no1 , s2 : p_no2 })
1176
+ pt1 = self .next_topo .node [s1 ]["ports" ][p_no1 ].port_type
1177
+ pt2 = self .next_topo .node [s2 ]["ports" ][p_no2 ].port_type
1178
+ if pt1 != pt2 :
1179
+ print "MISMATCH " ,
1180
+ print pt1
1181
+ print pt2
1182
+ self .next_topo .add_edge (s1 , s2 , {s1 : p_no1 , s2 : p_no2 , 'type' : pt1 })
1174
1183
1175
1184
# IF REACHED, WE'VE REMOVED AN EDGE, OR ADDED ONE, OR BOTH
1176
1185
self .debug_log .debug (self .next_topo )
0 commit comments