On Thu, 19 Jul 2018 11:01:45 +0900, knet solutions wrote: > > [1 <text/plain; UTF-8 (7bit)>] > Hi IWAMOTO, > > I followed this. but get_protocol doesnt give the payload of the protocol, > it gives only header.
AFAIK the packet library isn't designed for such a purpose. Subclassing the Packet class and making your _parse function may address your problem. > My use case is , > > Check the TTL Expiry for IP Packet, If expired, send the ICMP TTL > EXCEEDED Message to the sender. > Here the problem is In the ICMP TTL Expiry message the payload should be > received IP Packet as it is. > > > thanks > suresh > > > > > > > > > > On Thu, Jul 19, 2018 at 7:09 AM, IWAMOTO Toshihiro <iwam...@valinux.co.jp> > wrote: > > > On Tue, 17 Jul 2018 10:30:19 +0900, > > knet solutions wrote: > > > > > > [1 <multipart/alternative (7bit)>] > > > [1.1 <text/plain; UTF-8 (7bit)>] > > > Hi, > > > > > > How do we extract the payload from the packet. > > > > > > > > > > > > Ethernet Header + (Payload) > > > IP Header + (Payload) > > > TCP/UDP Header > > > + (Payload) > > > > > > > > > > > > On different scenarios, i require different payloads (ethernet payload, > > IP > > > payload, TCP/UDP Payload). > > > > > > > > > I referred earlier mailing list, and it was mentioned as, > > > > > > pkt.protocols[-1] > > > > > > > > > But this gives only payload for TCP or UDP Protocols. > > > > > > How to extract other protocol payloads? > > > > > > > use get_protocol. See: > > > > http://osrg.github.io/ryu-book/en/html/packet_lib.html#basic-usage > > > > -- > > IWAMOTO Toshihiro > > > > > > -- > > *Regards, * > *Knet solutions.* > > https://github.com/knetsolutions/KNet > http://knet-topology-builder.readthedocs.io/ > http://knetsolutions.in/ > [2 <text/html; UTF-8 (quoted-printable)>] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel