示例#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())))
     if _gini_error == 0:
         _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
 def process_set_config(self, pkt):
     print("This is a [set config packet]")
     print(pkt.show())
     #TODO: miss_send_len is received
     pkt_echo_rep = of.ofp_echo_reply()
     self.s.send(pkt_echo_rep.pack()) # TODO: not need. But cant connect when missing....
     print("[process_set_config] done")
示例#3
0
 def process_set_config(self, pkt):
     print("This is a [set config packet]")
     print(pkt.show())
     #TODO: miss_send_len is received
     pkt_reply = of.ofp_echo_reply()  # TODO: why cannot reply with config_reply
     self.s.send(pkt_reply.pack())
     # pkt_get_config_reply = of.ofp_get_config_reply()
     # pkt_get_config_reply.xid = pkt.xid
     # pkt_get_config_reply.flags = 0
     # pkt_get_config_reply.miss_send_len = pkt.miss_send_len
     # self.s.send(pkt_get_config_reply.pack()) # TODO: not need. But cant connect when missing....
     print("[process_set_config] done")
示例#4
0
 def process_echo_request(self, pkt):
     print("This is a [Echo request packet]")
     pkt_echo_reply = of.ofp_echo_reply()
     self.s.send(pkt_echo_reply.pack())