| To: | linux lover <linux_lover2004@xxxxxxxxx> |
|---|---|
| Subject: | Re: Function to read IP address in dot format |
| From: | "Randy.Dunlap" <rddunlap@xxxxxxxx> |
| Date: | Mon, 11 Apr 2005 07:07:23 -0700 |
| Cc: | netdev@xxxxxxxxxxx |
| In-reply-to: | <20050411060510.12208.qmail@web52201.mail.yahoo.com> |
| Organization: | OSDL |
| References: | <20050411060510.12208.qmail@web52201.mail.yahoo.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
On Sun, 10 Apr 2005 23:05:10 -0700 (PDT) linux lover wrote: | | Hello, | what is the function to read IP address in | kernel code as human readable dot quad format? IP | address are unsigned int's in ip.h file as | __u32 saddr; | __u32 daddr; | In ip_build_xmit ip header gets IP addresses | from rtable struct as | iph->saddr=rt->rt_src; | iph->daddr=rt->rt_dst; | Now if i want to know to which ip current | packet is being sent i am using printks but it prints | iph->saddr in int format not in user readable format. | how to do that? Look at the NIPQUAD() macro in include/linux/kernel.h and at some example uses of it. --- ~Randy |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [1/1] connector/CBUS: new messaging subsystem. Revision number next., Thomas Graf |
|---|---|
| Next by Date: | Re: Function to read IP address in dot format, Arnaldo Carvalho de Melo |
| Previous by Thread: | Function to read IP address in dot format, linux lover |
| Next by Thread: | Re: Function to read IP address in dot format, Arnaldo Carvalho de Melo |
| Indexes: | [Date] [Thread] [Top] [All Lists] |