All of lore.kernel.org
 help / color / mirror / Atom feed
* Parsing ULOG message received on netlink socket
@ 2006-09-28  4:11 Retesh Chadha
  2006-09-29 13:40 ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: Retesh Chadha @ 2006-09-28  4:11 UTC (permalink / raw)
  To: netfilter-devel

Hi All
I am trying to ULOG certain packets based on a iptable rule.

When the ulog daemon receives data on the netlink socket, it is raw
data, which I dont know how to parse, apart from structure nlmsghdr,
that is its header.

My requirement is to parse the received buffer on netlink socket so as
to get the source IP address of the IP packet. Are there any routines
or macros to do so? I think struct sk_buff is the buffer received on
netlink socket, but not sure.

Please let me know if someone is aware of the same, or some pointers
where I can get this info.

Thanks in advance
With Regards
Retesh Chadha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Parsing ULOG message received on netlink socket
  2006-09-28  4:11 Parsing ULOG message received on netlink socket Retesh Chadha
@ 2006-09-29 13:40 ` Patrick McHardy
  2006-09-29 14:07   ` Maik Hentsche
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2006-09-29 13:40 UTC (permalink / raw)
  To: Retesh Chadha; +Cc: netfilter-devel

Retesh Chadha wrote:
> Hi All
> I am trying to ULOG certain packets based on a iptable rule.
> 
> When the ulog daemon receives data on the netlink socket, it is raw
> data, which I dont know how to parse, apart from structure nlmsghdr,
> that is its header.
> 
> My requirement is to parse the received buffer on netlink socket so as
> to get the source IP address of the IP packet. Are there any routines
> or macros to do so? I think struct sk_buff is the buffer received on
> netlink socket, but not sure.
> 
> Please let me know if someone is aware of the same, or some pointers
> where I can get this info.

Check out ulogd or nfnetlink_log and libnfnetlink.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Parsing ULOG message received on netlink socket
  2006-09-29 13:40 ` Patrick McHardy
@ 2006-09-29 14:07   ` Maik Hentsche
  2006-10-05  7:11     ` Retesh Chadha
  0 siblings, 1 reply; 4+ messages in thread
From: Maik Hentsche @ 2006-09-29 14:07 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Retesh Chadha

Zitat von Patrick McHardy <kaber@trash.net>:

> Check out ulogd or nfnetlink_log and libnfnetlink.

ulogd seems to be abandoned, so specter
(http://joker.linuxstuff.pl/specter/) might be the better advice. Both
specter and ulogd already have plugins for parsing the raw data. Having
written an output plugin (to log into prelude) for both I feel this is
easier for specter because of the better defined structure of the
passed values. If Retesh ever feels, his (or her? can't tell from the
name, sorry) work should become open source, the chance to get a new
plugin into specter seems to be far better then getting one into ulogd
since the author of the former does answer mails and the author of the
later does not.

Just my 2 ¢.

so long
Maik

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Parsing ULOG message received on netlink socket
  2006-09-29 14:07   ` Maik Hentsche
@ 2006-10-05  7:11     ` Retesh Chadha
  0 siblings, 0 replies; 4+ messages in thread
From: Retesh Chadha @ 2006-10-05  7:11 UTC (permalink / raw)
  To: Maik Hentsche; +Cc: netfilter-devel

Hi
I am able to parse the ULOG message (raw buffer) by skipping the
netlink header and a few more bytes(fixed size around - 160 bytes) to
get the IP header. This works for me for UDP, ICMP and TCP.

Rgds
Retesh

On 9/29/06, Maik Hentsche <netfilter@mm-double.de> wrote:
> Zitat von Patrick McHardy <kaber@trash.net>:
>
> > Check out ulogd or nfnetlink_log and libnfnetlink.
>
> ulogd seems to be abandoned, so specter
> (http://joker.linuxstuff.pl/specter/) might be the better advice. Both
> specter and ulogd already have plugins for parsing the raw data. Having
> written an output plugin (to log into prelude) for both I feel this is
> easier for specter because of the better defined structure of the
> passed values. If Retesh ever feels, his (or her? can't tell from the
> name, sorry) work should become open source, the chance to get a new
> plugin into specter seems to be far better then getting one into ulogd
> since the author of the former does answer mails and the author of the
> later does not.
>
> Just my 2 ¢.
>
> so long
> Maik
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-05  7:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-28  4:11 Parsing ULOG message received on netlink socket Retesh Chadha
2006-09-29 13:40 ` Patrick McHardy
2006-09-29 14:07   ` Maik Hentsche
2006-10-05  7:11     ` Retesh Chadha

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.