All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about netlink
@ 2003-07-08 18:43 Krishna Kumar
  2003-07-08 19:04 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 1 reply; 9+ messages in thread
From: Krishna Kumar @ 2003-07-08 18:43 UTC (permalink / raw)
  To: David S. Miller, kuznet, netdev

Hi,

Some of the netlink routines (eg rtnetlink_dump_ifinfo or inet6_dump_ifaddr) seem to get
user arguments from cb->args['n']. However I was not able to figure out where the
arguments are being set, can anyone help ?

netlink_dump_start() is where the cb gets allocated (initialized to 0), and that calls
netlink_dump(), which calls the assigned routine. I couldn't find where the args gets
initialized to user provided values. Any pointer to what to look for is very much
appreciated.

Thanks,

- KK

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

* Re: Question about netlink
  2003-07-08 18:43 Question about netlink Krishna Kumar
@ 2003-07-08 19:04 ` YOSHIFUJI Hideaki / 吉藤英明
  2003-07-08 20:27   ` Krishna Kumar
  0 siblings, 1 reply; 9+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2003-07-08 19:04 UTC (permalink / raw)
  To: krkumar; +Cc: davem, kuznet, netdev

In article <3F0B10E3.9050700@us.ibm.com> (at Tue, 08 Jul 2003 11:43:47 -0700), Krishna Kumar <krkumar@us.ibm.com> says:

> Some of the netlink routines (eg rtnetlink_dump_ifinfo or inet6_dump_ifaddr) seem to get
> user arguments from cb->args['n']. However I was not able to figure out where the
> arguments are being set, can anyone help ?

Take a look at net/core/rtnelink.c:rtnetlink_dump_ifinfo()
               net/core/neighbour.c:neigh_dump_{info,table}()
and seek the truth. :-)

--yoshfuji

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

* Re: Question about netlink
  2003-07-08 19:04 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2003-07-08 20:27   ` Krishna Kumar
  2003-07-08 23:50     ` kuznet
  0 siblings, 1 reply; 9+ messages in thread
From: Krishna Kumar @ 2003-07-08 20:27 UTC (permalink / raw)
  To: yoshfuji; +Cc: davem, kuznet, netdev

I am still not convinced how it works, though I have been trying to seek the truth for some
time now :-).

These routines 'get' the value of args[0] and then 'set' it to the resultant value. How is
this value set in the first place to the user provided value ? It seems to be initialized
to ZERO in netlink_dump_start(). The only way it seems to use the value is if it gets
called twice from netlink_dump(), the first time cb->args will be set to zero's while the
second time it will have the values set by the first invocation to the same routine. Am I
missing something or is 'args' not intended for user specified arguments ? If so, how
should we access the arguments passed by the user ?

Thanks,

- KK

YOSHIFUJI Hideaki wrote:
> In article <3F0B10E3.9050700@us.ibm.com> (at Tue, 08 Jul 2003 11:43:47 -0700), Krishna Kumar <krkumar@us.ibm.com> says:
> 
> 
>>Some of the netlink routines (eg rtnetlink_dump_ifinfo or inet6_dump_ifaddr) seem to get
>>user arguments from cb->args['n']. However I was not able to figure out where the
>>arguments are being set, can anyone help ?
> 
> 
> Take a look at net/core/rtnelink.c:rtnetlink_dump_ifinfo()
>                net/core/neighbour.c:neigh_dump_{info,table}()
> and seek the truth. :-)
> 
> --yoshfuji
> 

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

* Re: Question about netlink
  2003-07-08 20:27   ` Krishna Kumar
@ 2003-07-08 23:50     ` kuznet
  0 siblings, 0 replies; 9+ messages in thread
From: kuznet @ 2003-07-08 23:50 UTC (permalink / raw)
  To: Krishna Kumar; +Cc: yoshfuji, davem, netdev

Hello!

> These routines 'get' the value of args[0] and then 'set' it to the resultant value. How is
> this value set in the first place to the user provided value ?

It is not. Zero values means that dump starts from the very beginning.
It is supposed to be done at the first entry to the ->dump(),
but selective dumps are not implemented in the most of ->dump() methods.


> missing something or is 'args' not intended for user specified arguments ? If so, how
> should we access the arguments passed by the user ?

The pointer to nlmsg header is kept in cb->nlh. So, you can refer to
it to get user supplied values of selector to rewind the dump to required
point at the first entry or to select some specific entries while scanning
a table.

F.e. look into sch_api.c:tc_dump_tclass(), it scopes dump to a netdevice
(tcp_ifindex), and filters answers to a specific qdisc (tcp_parent).
It is also partial. More finegrain selection is not required, but desired,
feel free to implement. F.e. implementation of "ip route ls root 3ffe::/24",
which translates to selection of a root node for fib6_walk() to a more
specific place and filtering out some nodes while walking, would be cool.

Alexey

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

* Question about NetLink
  2007-06-09 19:08 [PATCH 6/7] scsi-hw-handler: rm dm-hw-handler code michaelc
@ 2007-06-11 15:09 ` Wood, Brian J
  2007-06-12 19:37   ` Mike Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Wood, Brian J @ 2007-06-11 15:09 UTC (permalink / raw)
  To: device-mapper development

Hello, Alasdair recently said that device-mapper was moving to the a
netlink event reporting model (and I see the patches have been posted).
I found an article (2 years old) describing this at:
http://www.linuxjournal.com/article/7356. I wanted to read up on this
and wondered if this article was a good starting point.

Thank you, 

Brian Wood
Intel Corporation 
Digital Enterprise Group
Manageability & Platform Software Division
brian.j.wood@intel.com

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

* Re: Question about NetLink
  2007-06-11 15:09 ` Question about NetLink Wood, Brian J
@ 2007-06-12 19:37   ` Mike Anderson
  2007-09-11 15:48     ` Wood, Brian J
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Anderson @ 2007-06-12 19:37 UTC (permalink / raw)
  To: device-mapper development

Wood, Brian J <brian.j.wood@intel.com> wrote:
> Hello, Alasdair recently said that device-mapper was moving to the a
> netlink event reporting model (and I see the patches have been posted).
> I found an article (2 years old) describing this at:
> http://www.linuxjournal.com/article/7356. I wanted to read up on this
> and wondered if this article was a good starting point.
> 

I found that it was easier to use the libnl interface.
http://people.suug.ch/~tgr/libnl/

I have previously posted a test program using the libnl interface with the
dm netlink patches. You should be able to find the program in the
archives.

or

I updated the demo program some so ping me if you would like an updated
copy.

-andmike
--
Michael Anderson
andmike@us.ibm.com

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

* RE: Question about NetLink
  2007-06-12 19:37   ` Mike Anderson
@ 2007-09-11 15:48     ` Wood, Brian J
  2007-09-11 16:45       ` Hall, Eric R
  0 siblings, 1 reply; 9+ messages in thread
From: Wood, Brian J @ 2007-09-11 15:48 UTC (permalink / raw)
  To: device-mapper development

>-----Original Message-----
>From: dm-devel-bounces@redhat.com [mailto:dm-devel-bounces@redhat.com]
On
>Behalf Of Mike Anderson
>Sent: Tuesday, June 12, 2007 12:38 PM
>To: device-mapper development
>Subject: Re: [dm-devel] Question about NetLink
>
>Wood, Brian J <brian.j.wood@intel.com> wrote:
>> Hello, Alasdair recently said that device-mapper was moving to the a
>> netlink event reporting model (and I see the patches have been
posted).
>> I found an article (2 years old) describing this at:
>> http://www.linuxjournal.com/article/7356. I wanted to read up on this
>> and wondered if this article was a good starting point.
>>
>
>I found that it was easier to use the libnl interface.
>http://people.suug.ch/~tgr/libnl/
>
>I have previously posted a test program using the libnl interface with
the
>dm netlink patches. You should be able to find the program in the
>archives.
>
>or
>
>I updated the demo program some so ping me if you would like an updated
>copy.

Hello Michael, I just found this email sorted into a folder by mistake.
Could you send me an updated copy of this program (or a link to a site
where it might be posted)? I would like to see netlink in action. 


>
>-andmike
>--
>Michael Anderson
>andmike@us.ibm.com
>
>--
>dm-devel mailing list
>dm-devel@redhat.com
>https://www.redhat.com/mailman/listinfo/dm-devel

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

* RE: Question about NetLink
  2007-09-11 15:48     ` Wood, Brian J
@ 2007-09-11 16:45       ` Hall, Eric R
  2007-09-11 18:16         ` Mike Anderson
  0 siblings, 1 reply; 9+ messages in thread
From: Hall, Eric R @ 2007-09-11 16:45 UTC (permalink / raw)
  To: Wood, Brian J; +Cc: device-mapper development

First link on Google when searching for "Mike Anderson libnl":

http://www.redhat.com/archives/dm-devel/2005-November/msg00128.html



>-----Original Message-----
>From: dm-devel-bounces@redhat.com [mailto:dm-devel-bounces@redhat.com]
On
>Behalf Of Wood, Brian J
>Sent: Tuesday, September 11, 2007 8:48 AM
>To: device-mapper development
>Subject: RE: [dm-devel] Question about NetLink
>
>>-----Original Message-----
>>From: dm-devel-bounces@redhat.com [mailto:dm-devel-bounces@redhat.com]
>On
>>Behalf Of Mike Anderson
>>Sent: Tuesday, June 12, 2007 12:38 PM
>>To: device-mapper development
>>Subject: Re: [dm-devel] Question about NetLink
>>
>>Wood, Brian J <brian.j.wood@intel.com> wrote:
>>> Hello, Alasdair recently said that device-mapper was moving to the a
>>> netlink event reporting model (and I see the patches have been
>posted).
>>> I found an article (2 years old) describing this at:
>>> http://www.linuxjournal.com/article/7356. I wanted to read up on
this
>>> and wondered if this article was a good starting point.
>>>
>>
>>I found that it was easier to use the libnl interface.
>>http://people.suug.ch/~tgr/libnl/
>>
>>I have previously posted a test program using the libnl interface with
>the
>>dm netlink patches. You should be able to find the program in the
>>archives.
>>
>>or
>>
>>I updated the demo program some so ping me if you would like an
updated
>>copy.
>
>Hello Michael, I just found this email sorted into a folder by mistake.
>Could you send me an updated copy of this program (or a link to a site
>where it might be posted)? I would like to see netlink in action.
>
>
>>
>>-andmike
>>--
>>Michael Anderson
>>andmike@us.ibm.com
>>
>>--
>>dm-devel mailing list
>>dm-devel@redhat.com
>>https://www.redhat.com/mailman/listinfo/dm-devel
>
>--
>dm-devel mailing list
>dm-devel@redhat.com
>https://www.redhat.com/mailman/listinfo/dm-devel

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

* Re: Question about NetLink
  2007-09-11 16:45       ` Hall, Eric R
@ 2007-09-11 18:16         ` Mike Anderson
  0 siblings, 0 replies; 9+ messages in thread
From: Mike Anderson @ 2007-09-11 18:16 UTC (permalink / raw)
  To: device-mapper development

Hall, Eric R <eric.r.hall@intel.com> wrote:
> First link on Google when searching for "Mike Anderson libnl":
> 
> http://www.redhat.com/archives/dm-devel/2005-November/msg00128.html
> 


Thanks for providing the link.

Please note that based on discussions held on this list and lkml that I
generated a patch that uses kobject uevents instead of a new netlink
channel. The url to a archive of the article is given below.

http://article.gmane.org/gmane.linux.kernel.device-mapper.devel/3949

The advantage of the kobject uevent interface is that you could trigger
off a udev rule, interface through dbus/hal, or interface directly to the
uevent socket like multipathd does.

I am just finishing up testing on an update to the previous posted patch
that aligns the calls in my patch with the updated kobject uevent
interface in the latest -mm tree. I will post soon.

-andmike
--
Michael Anderson
andmike@us.ibm.com

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

end of thread, other threads:[~2007-09-11 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-08 18:43 Question about netlink Krishna Kumar
2003-07-08 19:04 ` YOSHIFUJI Hideaki / 吉藤英明
2003-07-08 20:27   ` Krishna Kumar
2003-07-08 23:50     ` kuznet
  -- strict thread matches above, loose matches on Subject: below --
2007-06-09 19:08 [PATCH 6/7] scsi-hw-handler: rm dm-hw-handler code michaelc
2007-06-11 15:09 ` Question about NetLink Wood, Brian J
2007-06-12 19:37   ` Mike Anderson
2007-09-11 15:48     ` Wood, Brian J
2007-09-11 16:45       ` Hall, Eric R
2007-09-11 18:16         ` Mike Anderson

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.