Are you sure you haven't changed the code that you originally posted?
Specifically, are you still setting the ethernet source address using:
eth.src = octstr_to_array(SOURCE_MAC_ADDR) 
?

-- Murphy

On Feb 26, 2012, at 9:23 PM, Volodymyr Bulakh wrote:

> Hi,
> 
> Thank you for the reply.  I am getting the following error message when I 
> call tostring():
> 
> 00067|pyrt|ERR:unable to invoke a Python event handler:
> Traceback (most recent call last):
>  File "./nox/lib/util.py", line 116, in f
>    event.total_len, buffer_id, packet)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 207, in packet_in_callback
>    self.learn_and_forward(dpid, inport, packet, packet.arr, bufid)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 186, in learn_and_forward
>    self.send_arp_reply(dpid, packet, inport)
>  File "./nox/coreapps/tutorial/pytutorial.py", line 63, in send_arp_reply
>    self.send_openflow_packet(dp, replypkt.tostring(), inport)
>  File "./nox/lib/packet/packet_base.py", line 109, in tostring
>    buf = self.hdr()
>  File "./nox/lib/packet/ethernet.py", line 107, in hdr
>    src = src.tostring()
> AttributeError: 'long' object has no attribute 'tostring'
> 
> The imports are below:
> 
> import socket
> from nox.lib.core import *
> import nox.lib.openflow as openflow
> from nox.lib.packet.ethernet import ethernet, __str__
> from nox.lib.packet.packet_utils import mac_to_str, mac_to_int, ip_to_str, 
> ipstr_to_int, octstr_to_array
> from nox.lib.packet.ipv4 import ipv4
> from socket import ntohs, htons
> from nox.lib.packet.arp import arp
> from nox.lib.packet.packet_base import packet_base
> 
> 
> 
> On 2/26/2012 8:19 PM, Heryandi wrote:
>> Hi,
>> 
>> Instead of this:
>> self.send_openflow_packet(dpid, eth.__str__(), inport)
>> 
>> Try this:
>> self.send_openflow_packet(dpid, eth.tostring(), inport)
> _______________________________________________
> nox-dev mailing list
> nox-dev@noxrepo.org
> http://noxrepo.org/mailman/listinfo/nox-dev

_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev

Reply via email to