Thanks for replying Santosh! On Sat, Mar 16, 2013 at 6:16 AM, santosh sharma <[email protected]>wrote:
> Hope this will help . > > http://comments.gmane.org/gmane.network.nox.devel/3374 > > (I have used controller for building dynamic overlay networks,2 years > back, > You need to verify with current releases) > > On Wed, Mar 13, 2013 at 6:21 AM, Dushyant Arora <[email protected] > > wrote: > >> Hi, >> >> I know how to do this in python: >> >> if packet.type == ethernet.ARP_TYPE and packet.next.opcode == >> arp.REQUEST: >> if packet.next.protodst in arp_dict.keys(): >> arp_reply_packet = >> array_to_str(packet.src)+arp_dict[packet.next.protodst]+.... >> inst.send_openflow_packet(dpid, array.array('B', >> arp_reply_packet.decode("hex")), inport, openflow.OFPP_NONE) >> return CONTINUE >> >> but now I need to write it in a C++ component: >> >> Disposition handler(const Event& e) >> { >> const Ofp_msg_event& pi = assert_cast<const Ofp_msg_event&>(e); >> struct ofl_msg_packet_in *in = (struct ofl_msg_packet_in >> *)**pi.msg; >> >> Flow *flow = new Flow((struct ofl_match*) in->match); >> >> uint16_t dl_type; >> >> flow->get_Field<uint16_t>("eth_type",&dl_type); >> flow->get_Field("eth_src", eth_src); >> flow->get_Field("eth_dst", eth_dst); >> flow->get_Field<uint32_t>("in_port", &in_port); >> >> if (dl_type == ethernet::LLDP){ >> return CONTINUE; >> } >> >> if (dl_type == 0x0806){ >> /* Send an ARP reply */ >> } >> > What I want to know is what function should I use in place of >> send_openflow_packet and how do I parse the incoming packet to get ARP >> target IP address, source IP address etc. >> >> Thanks, >> >> Dushyant >> > > > > -- > Santosh >
