예제 #1
0
 def process_flow_mod(self, pkt):
     print("This is a [flow mod packet]")
     print(pkt.show())
     # if pkt.command == 0:
     #     # OFPFC_ADD
     #     _GINIC.gini_ofp_flow_mod_ADD(pkt.pack())
     # if pkt.command == 1:
     #     # OFPFC_MODIFY
     #     _GINIC.gini_ofp_flow_mod_MODIFY(pkt.pack())
     # if pkt.command == 2:
     #     # OFPFC_MODIFY_STRICT
     #     _GINIC.gini_ofp_flow_mod_MODIFY_STRICT(pkt.pack())
     # if pkt.command == 3:
     #     # OFPFC_DELETE
     #     _GINIC.gini_ofp_flow_mod_DELETE(pkt.pack())
     # if pkt.command == 4:
     #     # OFPFC_DELETE_STRICT
     #     _GINIC.gini_ofp_flow_mod_DELETE_STRICT(pkt.pack())
     print('test length {0}->{1}'.format(len(pkt.pack()), len(pkt.pack_for_gini())))
     _GINIC.gini_ofp_flow_mod(pkt.pack_for_gini())
     pkt_echo_reply = of.ofp_echo_reply() #???
     self.s.send(pkt_echo_reply.pack())  #???
     # if gini_ofp_flow_mod(pkt) == True:
     #     print('flow mod succesful!')
     print("[process_set_mod] sent")
예제 #2
0
파일: GINIC.py 프로젝트: draringi/gini-sdn
def gini_ofp_flow_mod(*args):
  return _GINIC.gini_ofp_flow_mod(*args)