Hi Immad,

You can call Component's send_openflow_packet() method to send out your ICMP
reply.
(Please see nox/lib/core.py for its method definition.)

To construct an ICMP reply, you need packet_base's set_payload() to build a
protocol headers chain.

e.g.)
 from nox.lib.packet.ethernet import ethernet
from nox.lib.packet.icmp import echo
from nox.lib.packet.icmp import icmp

e = echo()
# fill e's members...

i = icmp()
# fill i's members...
i.set_payload(e)

eth = ethernet()
# fill eth's members..
eth.set_payload(i)

# send out eth..
# Here, I assume self is instance of Component..
self.send_openflow_packet(dpid, eth.tostring(), port_number)



On Sat, Feb 20, 2010 at 9:39 AM, Muhammad Immad Uddin
<[email protected]>wrote:

> Hi:
>
> I am trying to use nox controller to act as a proxy for a host, especially
> for icmp and arp request. I need tp have nox controller generate icmp echo
> reply packet on behalf of a host. I was able to make nox intercept a icmp
> echo request. The thing I am unable to achieve is to make nox create a icmp
> packet  and send it on behalf of the host. Is there a clean API for
> generating a packet? I tried looking into the classes for icmp, ip, arp but
> I could not find any function that can encapsulate the stuff into a single
> packet.
>
> -Immad
>
>
> _______________________________________________
> nox-dev mailing list
> [email protected]
> http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
>
>


-- 
Best,

DK
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to