Пример #1
0
 def delete(self):
     """
     Destructor: Remove itself from collection
     """
     if not self.valid:
         return
     self.valid = False
     if self.src_dvg == self.dst_dvg:
         # Restore to default allow policy and send update to VNID
         self.update(0, 67108864, struct.pack(Policy.fmt_action_struct_hdr, 0, 0, Policy.action_forward))
         if self.domain.active:
             DpsCollection.policy_update_queue.put((self.src_dvg, self.traffic_type))
     else:
         # Remove self from Domain, SRC and DST VNID/DVG
         DVG.policy_del_dst(self.dst_dvg, self.src_dvg.unique_id, self.traffic_type)
         DVG.policy_del_src(self.src_dvg, self.dst_dvg.unique_id, self.traffic_type)
         Domain.policy_del(self.domain, self)
Пример #2
0
 def delete(self):
     '''
     Destructor: Remove itself from collection
     '''
     if not self.valid:
         return
     self.valid = False
     if self.src_dvg == self.dst_dvg:
         #Restore to default allow policy and send update to VNID
         self.update(0, 67108864, struct.pack(Policy.fmt_action_struct_hdr,
                                              0, 0, Policy.action_forward))
         if self.domain.active:
             DpsCollection.policy_update_queue.put((self.src_dvg, self.traffic_type))
     else:
         #Remove self from Domain, SRC and DST VNID/DVG
         DVG.policy_del_dst(self.dst_dvg, self.src_dvg.unique_id, self.traffic_type)
         DVG.policy_del_src(self.src_dvg, self.dst_dvg.unique_id, self.traffic_type)
         Domain.policy_del(self.domain, self)