0

Is there any utility function on the Kernel like the ipv6_skip_exthdr() [1] for instance, which doesn't uses sk_buff as input to handle ipv6 packets? I need some basic functionality to handle IPv6 packets, I know Kernel does this, but I wasn't able to figure the utility functions to do that, functions that I can use on the user-space to handle raw packets that I have (without sk_buff structure).

Thanks !

Sangeeth Saravanaraj
  • 16,027
  • 21
  • 69
  • 98
Tarantula
  • 19,031
  • 12
  • 54
  • 71
  • May I ask what you are trying to achieve? I'm not sure I understand the question. – Quentin Casasnovas Jan 26 '12 at 23:57
  • I just want to manually parse packets from a userspace application, using libipq for instance. I have the raw packet contents only, I just need to structures needed to parse it without pain hehe. – Tarantula Jan 27 '12 at 12:11
  • Oo from userspace! Sorry with your linux-kernel tag I thought you wanted to do this in kernel space. May I ask why are you not using http://www.netfilter.org/projects/libnetfilter_queue/index.html ? – Quentin Casasnovas Jan 27 '12 at 16:38
  • I would also like to use libnetfilter_queue, but isn't an option right now. Thanks anyway. – Tarantula Jan 28 '12 at 15:41

1 Answers1

2

RFC 3542 describes an advanced API to parse IPv6 headers:

http://www.ietf.org/rfc/rfc3542.txt

It also has suggestions which headers and functions to use for specific tasks. Give it a try.

ldx
  • 3,984
  • 23
  • 28