LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2017, 02:36 PM   #1
NetworkNewbie
LQ Newbie
 
Registered: Feb 2017
Location: France
Posts: 1

Rep: Reputation: Disabled
Unhappy How to set Hop by Hop header in ipv6 packet after queueing it in userspace?


Hello everybody,


I try to write a C code in userspace which must check a ipv6 packet header. If the the ipv6 header contains a HOP by HOP options(meaning next header is hop by hop header ), i want to store this hop by hop options data else (no hop hop header) i want to include a stored options data in the ipv6 header.

I use libnetfilter_queue to intercept packet and nfq_verdict t send them after.

My current code can intercept packet, check it to get ipv6 header and print ipsrc, ipdst and ip6_nxt.(ifip6_nxt==0 the header contains hop by hop header, else no header).

But I don't understant how i can store a hop by hop options data or set them to another ipv6 header before sending the packets.

Can someone help me. Thank you in advance.
Code:


Last edited by NetworkNewbie; 03-01-2017 at 07:41 AM.
 
Old 03-01-2017, 04:05 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
I suspect that userland can't do that sort of thing.
 
Old 03-01-2017, 04:29 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Please do not remove information from your posts which is necessary for others to understand your question.

Remember that your question and all replies will show up in search engines for a very long time and become part of a widely shared knowledge base. With vital information now missing from the post it greatly reduces the usefulness to others searching for similar answers.

Please review the Site FAQ for guidance on forum use.

And welcome to LQ! We look forward to your continuing participation!
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i set next hop of nodes in NS2 ? ali_it Linux - Networking 1 06-15-2015 04:35 AM
how to create our own option type for hop by hop extention header manin Linux - Kernel 0 08-20-2014 09:44 PM
6to4 tunnel does NOT accept packet whose next-hop is with 2002 prefix bingel Linux - Networking 0 05-09-2012 10:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration