Sir
I am referencing to the code given below to attach flow entries in
switch.But it is showing some errors like undefined variable.So what steps
should be followed to remove this errors.
Is there any other way already in POX to install flow entries.
CODE::
def create_flow_install_msg(ip, table, mask, srcMac, dstMac, dstPort):
ofm = ofp_flow_mod()
ofm_match_dl(ofm, OFPFW_DL_TYPE, 0x0800)
if (MATCH_L2):
ofm_match_dl(ofm, OFPFW_DL_DST, srcMac)
ofm.match.set_nw_dst(ip)
ofm.priority = OFP_DEFAULT_PRIORITY + mask
ofm.command = 1 #(OFPFC_ADD)
if (mask == 32):
ofm.idle_timeout = 300
else:
ofm.idle_timeout = OFP_FLOW_PERMANENT
ofm.hard_timeout = OFP_FLOW_PERMANENT
ofm.out_port = OFPP_NONE
ofm.actions.append(ofp_action_dl_addr(type=OFPAT_SET_DL_SRC,dl_addr=EthAddr(srcMac)))
ofm.actions.append(ofp_action_dl_addr(type=OFPAT_SET_DL_DST,dl_addr=EthAddr(dstMac)))
#ofm.actions.append(ofp_action_tp_port(type=OFPAT_SET_TP_DST,tp_port=20005))
ofm.actions.append(ofp_action_output(port=dstPort))
return ofm