[pox-dev] [TCP-OPT ISSUE]
Murphy McCauley
murphy.mccauley at gmail.com
Thu Dec 26 10:27:33 PST 2013
You need to get an actual instance of the tcp_opt class (stored in the .options attribute of the TCP object). Try something like:
packet = event.parsed
packet_tcp = packet.find("tcp")
if packet_tcp:
for opt in packet_tcp.options:
print "type:%s data:%s" % (opt.type, opt.val)
-- Murphy
On Dec 26, 2013, at 5:54 AM, Marcus Sandri <mwws55 at gmail.com> wrote:
> Exactly,
>
>
> But how can I access .val atributes?
> I tried:
>
> packet = event.parsed
> packet_tcp = packet.find("tcp")
> if(packet_tcp):
>
> tcp_raw = tcp_opt.val
>
>
> But it returns: line 29, in _handle_PacketIn
> tcp_options = tcp_opt.val
> AttributeError: class tcp_opt has no attribute 'val'
>
> It works with the tcp_opt constants, such as: EOL, SACK, etc.
>
> Am I doing something wrong?
>
>
> 2013/12/26 Murphy McCauley <murphy.mccauley at gmail.com>
> When the packet library parses it, it should end up in the TCP object's .options collection. The packet library doesn't currently have support for MPTCP, so I think it should just end up with the raw bytes in the tcp_opt object's .val attribute.
>
> -- Murphy
>
> On Dec 25, 2013, at 6:45 PM, Marcus Sandri <mwws55 at gmail.com> wrote:
>
> > Hello,
> >
> > I've working with MPTCP protocol and I need access the OPTIONS field from TCP protocol. How can I access the OPTIONS field, using tcp_opt class?
> >
> >
> >
> > cheers,
> > marcus.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.noxrepo.org/pipermail/pox-dev-noxrepo.org/attachments/20131226/467bf7c1/attachment-0002.htm>
More information about the pox-dev
mailing list