All options should be in a tcp_opt object in the packet's .options collection. For unknown options, I believe the full raw data of the option should be in the tcp_opt's .val attribute.
-- Murphy On Friday, December 27, 2013, Marcus Sandri wrote: > If you don't care, I would like to ask some other question: > > I need access the other bits inside options field, but there is no > implementation on POX yet. So, How could I access that values: by using > full payload (If yes, how to) or implementing module lib/packet/tcp.py? > > > cheers > > > 2013/12/27 Marcus Sandri <mww...@gmail.com <javascript:_e({}, 'cvml', > 'mww...@gmail.com');>> > >> Now I can access those values! >> >> Thanks! >> >> >> 2013/12/26 Murphy McCauley <murphy.mccau...@gmail.com <javascript:_e({}, >> 'cvml', 'murphy.mccau...@gmail.com');>> >> >>> 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 >>> <mww...@gmail.com<javascript:_e({}, 'cvml', 'mww...@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.mccau...@gmail.com<javascript:_e({}, >>> 'cvml', 'murphy.mccau...@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 >>>> <mww...@gmail.com<javascript:_e({}, 'cvml', 'mww...@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. >>>> >>>> >>> >>> >> >