* [RFC][GENETLINK] introduce command names
@ 2006-12-02 12:11 jamal
2006-12-04 9:28 ` Thomas Graf
0 siblings, 1 reply; 5+ messages in thread
From: jamal @ 2006-12-02 12:11 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, netdev
[-- Attachment #1: Type: text/plain, Size: 126 bytes --]
Dave,
Same as before:
If there is no objections on this approach, please apply this patch.
Against net-2.6.20
cheers,
jamal
[-- Attachment #2: genl_cmd_name --]
[-- Type: text/plain, Size: 1338 bytes --]
[GENETLINK] introduce command names
Introduce optional command names.
While command names can be put in user space by the author of the
command, this alleviates things for the discovery process without
requiring any user space code written.
In a recent tutorial that i gave, the desire for this feature was
the highest.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
---
commit c3b92488bea3f11a6cc7c1c59101444c26ad12ce
tree 52166fb1ea684e989fef16de89c85fb9bf551bb8
parent b6ac8f41bdd2edd9d215e376efa47261e9b118a1
author Jamal Hadi Salim <hadi@cyberus.ca> Sat, 02 Dec 2006 07:08:15 -0500
committer Jamal Hadi Salim <hadi@cyberus.ca> Sat, 02 Dec 2006 07:08:15 -0500
include/net/genetlink.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 7fd131c..52bc278 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -49,6 +49,7 @@ struct genl_info
/**
* struct genl_ops - generic netlink operations
* @cmd: command identifier
+ * @name: command name
* @flags: flags
* @policy: attribute validation policy
* @doit: standard command callback
@@ -58,6 +59,7 @@ struct genl_info
struct genl_ops
{
u8 cmd;
+ char name[GENL_NAMSIZ];
unsigned int flags;
struct nla_policy *policy;
int (*doit)(struct sk_buff *skb,
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [RFC][GENETLINK] introduce command names
2006-12-02 12:11 [RFC][GENETLINK] introduce command names jamal
@ 2006-12-04 9:28 ` Thomas Graf
2006-12-04 13:09 ` jamal
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Graf @ 2006-12-04 9:28 UTC (permalink / raw)
To: jamal; +Cc: davem, netdev
* jamal <hadi@cyberus.ca> 2006-12-02 07:11
> [GENETLINK] introduce command names
>
> Introduce optional command names.
> While command names can be put in user space by the author of the
> command, this alleviates things for the discovery process without
> requiring any user space code written.
> In a recent tutorial that i gave, the desire for this feature was
> the highest.
I assume you're planning to export this to userspace at some point?
What's the real advantage besides that when listing avaiable
operations we can output names instead of numbers? Userspace should
be aware of operation numbers when using it. I'm all for this if
the direction is to move towards having some form of scriptable
genetlink tool which can be used to communicate with simple genetlink
families.
I guess the desire was the highest because you sold it as such :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][GENETLINK] introduce command names
2006-12-04 9:28 ` Thomas Graf
@ 2006-12-04 13:09 ` jamal
2006-12-04 16:34 ` Thomas Graf
0 siblings, 1 reply; 5+ messages in thread
From: jamal @ 2006-12-04 13:09 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, netdev
On Mon, 2006-04-12 at 10:28 +0100, Thomas Graf wrote:
> * jamal <hadi@cyberus.ca> 2006-12-02 07:11
> > [GENETLINK] introduce command names
> >
> > Introduce optional command names.
> > While command names can be put in user space by the author of the
> > command, this alleviates things for the discovery process without
> > requiring any user space code written.
> > In a recent tutorial that i gave, the desire for this feature was
> > the highest.
>
> I assume you're planning to export this to userspace at some point?
Right.
> What's the real advantage besides that when listing avaiable
> operations we can output names instead of numbers?
Just makes the discovery more knowledgeable.
Theres a hidden meaning in that i would like if possible to create
as much of user space as possible without the user having a single line
written. Heres how i output the discovered families at the moment
without the patch.
-----
hadi@lilsol:~/git-trees/iproute2/nov22/genl$ ./genl ctrl ls
Added Family Name: nlctrl
ID: 0x10 Version: 0x1 header size: 0 max attribs: 6
commands supported:
#1: ID-0x3 flags-0x0
Capabilities: has policy; can doit; can dumpit
Added Family Name: TASKSTATS
ID: 0x11 Version: 0x1 header size: 0 max attribs: 4
commands supported:
#1: ID-0x1 flags-0x0
Capabilities: has policy; can doit;
hadi@lilsol:~/git-trees/iproute2/nov22/genl$
-----------
It would be a lot more human friendly to put better readability in the
commands.
> Userspace should
> be aware of operation numbers when using it. I'm all for this if
> the direction is to move towards having some form of scriptable
> genetlink tool which can be used to communicate with simple genetlink
> families.
>
That is the real agenda actually. To be honest i dont know how realistic
it would be. But one of the next things is to output the command
policies.
> I guess the desire was the highest because you sold it as such :-)
Theres some truth to that ;-> But i didnt start it;->, after two people
asking why they couldnt tell the command name, it connected to me i also
need it for this other reason.
cheers,
jamal
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC][GENETLINK] introduce command names
2006-12-04 13:09 ` jamal
@ 2006-12-04 16:34 ` Thomas Graf
2006-12-04 17:49 ` jamal
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Graf @ 2006-12-04 16:34 UTC (permalink / raw)
To: jamal; +Cc: davem, netdev
* jamal <hadi@cyberus.ca> 2006-12-04 08:09
> Just makes the discovery more knowledgeable.
> Theres a hidden meaning in that i would like if possible to create
> as much of user space as possible without the user having a single line
> written. Heres how i output the discovered families at the moment
> without the patch.
>
> -----
> hadi@lilsol:~/git-trees/iproute2/nov22/genl$ ./genl ctrl ls
> Added Family Name: nlctrl
> ID: 0x10 Version: 0x1 header size: 0 max attribs: 6
> commands supported:
> #1: ID-0x3 flags-0x0
> Capabilities: has policy; can doit; can dumpit
>
> Added Family Name: TASKSTATS
> ID: 0x11 Version: 0x1 header size: 0 max attribs: 4
> commands supported:
> #1: ID-0x1 flags-0x0
> Capabilities: has policy; can doit;
>
> hadi@lilsol:~/git-trees/iproute2/nov22/genl$
> -----------
>
> It would be a lot more human friendly to put better readability in the
> commands.
I don't agree to waste so much text section just to fancy up some
userspace tool which is mainly a toy while developing. If you
really need it, do it in userspace like libnl.
> > Userspace should
> > be aware of operation numbers when using it. I'm all for this if
> > the direction is to move towards having some form of scriptable
> > genetlink tool which can be used to communicate with simple genetlink
> > families.
> >
>
> That is the real agenda actually. To be honest i dont know how realistic
> it would be. But one of the next things is to output the command
> policies.
Once we go that path we can reconsider a patch based on this which
includes the bits to dump the information to userspace. Until then
I don't see the point in this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC][GENETLINK] introduce command names
2006-12-04 16:34 ` Thomas Graf
@ 2006-12-04 17:49 ` jamal
0 siblings, 0 replies; 5+ messages in thread
From: jamal @ 2006-12-04 17:49 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, netdev
On Mon, 2006-04-12 at 17:34 +0100, Thomas Graf wrote:
> * jamal <hadi@cyberus.ca> 2006-12-04 08:09
> > Just makes the discovery more knowledgeable.
...
...
> > It would be a lot more human friendly to put better readability in the
> > commands.
>
> I don't agree to waste so much text section just to fancy up some
> userspace tool which is mainly a toy while developing.
Hey, it is not a toy ;->
> If you
> really need it, do it in userspace like libnl.
...
....
> > That is the real agenda actually. To be honest i dont know how realistic
> > it would be. But one of the next things is to output the command
> > policies.
>
> Once we go that path we can reconsider a patch based on this which
> includes the bits to dump the information to userspace. Until then
> I don't see the point in this.
Ok, fair enough lets defer it for then.
cheers,
jamal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-12-04 17:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-02 12:11 [RFC][GENETLINK] introduce command names jamal
2006-12-04 9:28 ` Thomas Graf
2006-12-04 13:09 ` jamal
2006-12-04 16:34 ` Thomas Graf
2006-12-04 17:49 ` jamal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).