* socket filter
@ 2010-08-20 4:27 krunal patel
2010-08-20 5:04 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: krunal patel @ 2010-08-20 4:27 UTC (permalink / raw)
To: netfilter-devel
Hi,
There are ioctl's for attaching bpf like filters to socket. I found it
in kernel documentation.
setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &Filter, sizeof(Filter));
I doubt is can we attach filters in case of netlink socket.
I am logging all packets using ULOG target and using ulogd.
Is it possible to use same ioctl for netlink socket we create in ulogd?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: socket filter
2010-08-20 4:27 socket filter krunal patel
@ 2010-08-20 5:04 ` Stephen Hemminger
[not found] ` <AANLkTimqZR0S0H_SO=xkBEWbC2zc92gSFp4hi=EpFTP5@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2010-08-20 5:04 UTC (permalink / raw)
To: krunal patel; +Cc: netfilter-devel
On Fri, 20 Aug 2010 09:57:33 +0530
krunal patel <krunal.raj@gmail.com> wrote:
> Hi,
>
> There are ioctl's for attaching bpf like filters to socket. I found it
> in kernel documentation.
> setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &Filter, sizeof(Filter));
> I doubt is can we attach filters in case of netlink socket.
> I am logging all packets using ULOG target and using ulogd.
> Is it possible to use same ioctl for netlink socket we create in ulogd?
You can use socket filters on netlink sockets since 2.6.26
^ permalink raw reply [flat|nested] 3+ messages in thread
* Fwd: socket filter
[not found] ` <AANLkTimqZR0S0H_SO=xkBEWbC2zc92gSFp4hi=EpFTP5@mail.gmail.com>
@ 2010-08-21 10:11 ` krunal patel
0 siblings, 0 replies; 3+ messages in thread
From: krunal patel @ 2010-08-21 10:11 UTC (permalink / raw)
To: netfilter-devel
Thank you Stepen. My kernel is 2.6.27.45 :).
I am taking bpf string like "host <ip>" from command prompt and doing
"pcap_compile_nopcap". Create my filter and do setsockopt but I am not
able to get result i wanted. May be i am doing something wrong in
creating filters. I am using link type as DLT_RAW.
On Fri, Aug 20, 2010 at 10:34 AM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> On Fri, 20 Aug 2010 09:57:33 +0530
> krunal patel <krunal.raj@gmail.com> wrote:
>
>> Hi,
>>
>> There are ioctl's for attaching bpf like filters to socket. I found it
>> in kernel documentation.
>> setsockopt(sockfd, SOL_SOCKET, SO_ATTACH_FILTER, &Filter, sizeof(Filter));
>> I doubt is can we attach filters in case of netlink socket.
>> I am logging all packets using ULOG target and using ulogd.
>> Is it possible to use same ioctl for netlink socket we create in ulogd?
>
> You can use socket filters on netlink sockets since 2.6.26
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-21 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-20 4:27 socket filter krunal patel
2010-08-20 5:04 ` Stephen Hemminger
[not found] ` <AANLkTimqZR0S0H_SO=xkBEWbC2zc92gSFp4hi=EpFTP5@mail.gmail.com>
2010-08-21 10:11 ` Fwd: " krunal patel
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.