All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinay Reddy <vinayvinay@gmail.com>
To: cranium2003 <cranium2003@yahoo.com>, netfilter-devel@lists.netfilter.org
Subject: Re: Urgent SNAT help required
Date: Mon, 9 May 2005 18:32:16 +0530	[thread overview]
Message-ID: <537f59d105050906025948aa0c@mail.gmail.com> (raw)
In-Reply-To: <20050509083018.20467.qmail@web41413.mail.yahoo.com>

On 5/9/05, cranium2003 <cranium2003@yahoo.com> wrote:
> hello,
>          I want to execute my code at
> NF_IP_POST_ROUTING. For that First i want to know
> which functions are executing at NF_IP_POST_ROUTING
> Hook. Then i have enabled SNAT and I have wrriten code
> at NF_IP_POST_ROUTING but i want to get outgoing
> packets' IP address as new one SNAT'ed IP address not
> the one that is before SNAT? How can i do that?
Execute your code after SNAT has finished.
>          I observe that my code and SNAT are executing
> at same HOOK NF_IP_POST_ROUTING. But my code is
> executed first and then SANT is doen but how to
> reverse that?
Use the following while declaring an nf_hook_ops struct:
struct nf_hook_ops post_route = {
  {NULL, NULL},
  post_route_handler,
  THIS_MODULE,
  PF_INET,
  NF_IP_POST_ROUTING,
  NF_IP_PRI_NAT_SRC +1,  // <--- This is important. It is the priority.
};

Note that the last field gives the priority for this handler. The
higher it is, the earlier it is executed.

HTH,
Vinay

> regards,
> cranium
> 
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
> 


-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

  reply	other threads:[~2005-05-09 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09  8:30 Urgent SNAT help required cranium2003
2005-05-09 13:02 ` Vinay Reddy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-09 13:47 cranium2003

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537f59d105050906025948aa0c@mail.gmail.com \
    --to=vinayvinay@gmail.com \
    --cc=cranium2003@yahoo.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.