All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about tlv message support
@ 2012-04-13 18:22 NorthPole
  2012-04-15 11:10 ` Vladimir Murzin
  2012-04-16 12:30 ` Javier Martinez Canillas
  0 siblings, 2 replies; 10+ messages in thread
From: NorthPole @ 2012-04-13 18:22 UTC (permalink / raw)
  To: kernelnewbies

Hello everyone

I'm completely new to linux kernel and I would be grateful if you
could help me get started.
I read some basic things about the kernel. But I couldnt find anything
relevant to the question below.

So: Does the kernel have any support for the construction and encoding
of type/length/value (TLV) or other information element messages?
 if it has(or if you dont know) where can I find a list or more documentation?

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

* Question about tlv message support
  2012-04-13 18:22 Question about tlv message support NorthPole
@ 2012-04-15 11:10 ` Vladimir Murzin
  2012-04-16 12:30 ` Javier Martinez Canillas
  1 sibling, 0 replies; 10+ messages in thread
From: Vladimir Murzin @ 2012-04-15 11:10 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Apr 13, 2012 at 09:22:55PM +0300, NorthPole wrote:
> Hello everyone
> 
> I'm completely new to linux kernel and I would be grateful if you
> could help me get started.
> I read some basic things about the kernel. But I couldnt find anything
> relevant to the question below.
> 
> So: Does the kernel have any support for the construction and encoding
> of type/length/value (TLV) or other information element messages?
>  if it has(or if you dont know) where can I find a list or more documentation?
> 
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Hi,

Just do grepping along Linux kernel sources for TLV:
     $grep -rlsw TLV ./

and you get a lot point for investigation. For instance, TLV based
data protocol is used by ALSA driver [1]

[1] http://lxr.linux.no/#linux+v3.3/include/sound/tlv.h

Best wishes
Vladimir Murzin

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

* Question about tlv message support
  2012-04-13 18:22 Question about tlv message support NorthPole
  2012-04-15 11:10 ` Vladimir Murzin
@ 2012-04-16 12:30 ` Javier Martinez Canillas
  2012-04-16 13:00   ` NorthPole
  1 sibling, 1 reply; 10+ messages in thread
From: Javier Martinez Canillas @ 2012-04-16 12:30 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Apr 13, 2012 at 8:22 PM, NorthPole <morfeas3000@gmail.com> wrote:
> Hello everyone
>
> I'm completely new to linux kernel and I would be grateful if you
> could help me get started.
> I read some basic things about the kernel. But I couldnt find anything
> relevant to the question below.
>
> So: Does the kernel have any support for the construction and encoding
> of type/length/value (TLV) or other information element messages?
> ?if it has(or if you dont know) where can I find a list or more documentation?
>

I think what you are looking for is the Generic Netlink API.

Here is a good howto:
http://www.linuxfoundation.org/collaborate/workgroups/networking/genericnetlinkhowto

Hope it helps,

-- 
Javier Mart?nez Canillas
(+34) 682 39 81 69
Barcelona, Spain

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

* Question about tlv message support
  2012-04-16 12:30 ` Javier Martinez Canillas
@ 2012-04-16 13:00   ` NorthPole
  2012-04-16 13:57     ` JAYESH TANK
  2012-04-17  0:17     ` Javier Martinez Canillas
  0 siblings, 2 replies; 10+ messages in thread
From: NorthPole @ 2012-04-16 13:00 UTC (permalink / raw)
  To: kernelnewbies

thx Javier
But isnt the api for use in the user space?
I need something for use in kernel space

On Mon, Apr 16, 2012 at 3:30 PM, Javier Martinez Canillas
<martinez.javier@gmail.com> wrote:
> On Fri, Apr 13, 2012 at 8:22 PM, NorthPole <morfeas3000@gmail.com> wrote:
>> Hello everyone
>>
>> I'm completely new to linux kernel and I would be grateful if you
>> could help me get started.
>> I read some basic things about the kernel. But I couldnt find anything
>> relevant to the question below.
>>
>> So: Does the kernel have any support for the construction and encoding
>> of type/length/value (TLV) or other information element messages?
>> ?if it has(or if you dont know) where can I find a list or more documentation?
>>
>
> I think what you are looking for is the Generic Netlink API.
>
> Here is a good howto:
> http://www.linuxfoundation.org/collaborate/workgroups/networking/genericnetlinkhowto
>
> Hope it helps,
>
> --
> Javier Mart?nez Canillas
> (+34) 682 39 81 69
> Barcelona, Spain

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

* Question about tlv message support
  2012-04-16 13:00   ` NorthPole
@ 2012-04-16 13:57     ` JAYESH TANK
  2012-04-17  0:17     ` Javier Martinez Canillas
  1 sibling, 0 replies; 10+ messages in thread
From: JAYESH TANK @ 2012-04-16 13:57 UTC (permalink / raw)
  To: kernelnewbies

Hi,
I could not locate ready made APIs for TLV construction and encoding but a
more generic implementation/functions can be seen in
include/linux/tipc_config.h file.
Hope that helps.

-Jayesh Kumar
"You don't know, until you know."


On Mon, Apr 16, 2012 at 6:30 PM, NorthPole <morfeas3000@gmail.com> wrote:

> thx Javier
> But isnt the api for use in the user space?
> I need something for use in kernel space
>
> On Mon, Apr 16, 2012 at 3:30 PM, Javier Martinez Canillas
> <martinez.javier@gmail.com> wrote:
> > On Fri, Apr 13, 2012 at 8:22 PM, NorthPole <morfeas3000@gmail.com>
> wrote:
> >> Hello everyone
> >>
> >> I'm completely new to linux kernel and I would be grateful if you
> >> could help me get started.
> >> I read some basic things about the kernel. But I couldnt find anything
> >> relevant to the question below.
> >>
> >> So: Does the kernel have any support for the construction and encoding
> >> of type/length/value (TLV) or other information element messages?
> >>  if it has(or if you dont know) where can I find a list or more
> documentation?
> >>
> >
> > I think what you are looking for is the Generic Netlink API.
> >
> > Here is a good howto:
> >
> http://www.linuxfoundation.org/collaborate/workgroups/networking/genericnetlinkhowto
> >
> > Hope it helps,
> >
> > --
> > Javier Mart?nez Canillas
> > (+34) 682 39 81 69
> > Barcelona, Spain
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120416/f6d26b0d/attachment.html 

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

* Question about tlv message support
  2012-04-16 13:00   ` NorthPole
  2012-04-16 13:57     ` JAYESH TANK
@ 2012-04-17  0:17     ` Javier Martinez Canillas
  2012-04-17  0:36       ` NorthPole
  1 sibling, 1 reply; 10+ messages in thread
From: Javier Martinez Canillas @ 2012-04-17  0:17 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Apr 16, 2012 at 3:00 PM, NorthPole <morfeas3000@gmail.com> wrote:
> thx Javier
> But isnt the api for use in the user space?
> I need something for use in kernel space
>

What exactly do you want to do?

Generic Netlink can be used to communicate both user-space and kernel
code, but you will have general answer to general questions :)

-- 
Javier Mart?nez Canillas
(+34) 682 39 81 69
Barcelona, Spain

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

* Question about tlv message support
  2012-04-17  0:17     ` Javier Martinez Canillas
@ 2012-04-17  0:36       ` NorthPole
  2012-04-17  3:21         ` JAYESH TANK
  2012-04-17  9:34         ` Javier Martinez Canillas
  0 siblings, 2 replies; 10+ messages in thread
From: NorthPole @ 2012-04-17  0:36 UTC (permalink / raw)
  To: kernelnewbies

@JAYESH TANK
thank you very much :-) that was a very good starting poind :D


@Javier
you are right, so here is something more specific

I want to add a framework for tlv message construction and parsing in
a wireless mesh routing protocol so as it can have the advantages of
the tlv way of communication (one of which is backwards compatibility)

afaik tlvs are used in many places in the kernel and as Jayesh stated
there are no ready made apis.
So if I want to do that I have to copy someone else's code and modify
it accordingly

but I have another general question:
In the future if I want to find if the kernel has internal support for
the X thing how can I find out if it has and how it does support?



On Tue, Apr 17, 2012 at 3:17 AM, Javier Martinez Canillas
<martinez.javier@gmail.com> wrote:
> On Mon, Apr 16, 2012 at 3:00 PM, NorthPole <morfeas3000@gmail.com> wrote:
>> thx Javier
>> But isnt the api for use in the user space?
>> I need something for use in kernel space
>>
>
> What exactly do you want to do?
>
> Generic Netlink can be used to communicate both user-space and kernel
> code, but you will have general answer to general questions :)
>
> --
> Javier Mart?nez Canillas
> (+34) 682 39 81 69
> Barcelona, Spain

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

* Question about tlv message support
  2012-04-17  0:36       ` NorthPole
@ 2012-04-17  3:21         ` JAYESH TANK
  2012-04-17  9:34         ` Javier Martinez Canillas
  1 sibling, 0 replies; 10+ messages in thread
From: JAYESH TANK @ 2012-04-17  3:21 UTC (permalink / raw)
  To: kernelnewbies

Hi All,
  I have the answer of that general question.. :)

afaik, this link has listed all the api's which linux kernel supports:
http://www.gnugeneration.com/books/linux/2.6.20/kernel-api/

You can very well go through it and check for certain api availability. As
a point to note, it has api s for 2.6.20 kernel.

Enjoy!!

On Tue, Apr 17, 2012 at 6:06 AM, NorthPole <morfeas3000@gmail.com> wrote:

> @JAYESH TANK
> thank you very much :-) that was a very good starting poind :D
>
>
> @Javier
> you are right, so here is something more specific
>
> I want to add a framework for tlv message construction and parsing in
> a wireless mesh routing protocol so as it can have the advantages of
> the tlv way of communication (one of which is backwards compatibility)
>
> afaik tlvs are used in many places in the kernel and as Jayesh stated
> there are no ready made apis.
> So if I want to do that I have to copy someone else's code and modify
> it accordingly
>
> but I have another general question:
> In the future if I want to find if the kernel has internal support for
> the X thing how can I find out if it has and how it does support?
>
>
>
> On Tue, Apr 17, 2012 at 3:17 AM, Javier Martinez Canillas
> <martinez.javier@gmail.com> wrote:
> > On Mon, Apr 16, 2012 at 3:00 PM, NorthPole <morfeas3000@gmail.com>
> wrote:
> >> thx Javier
> >> But isnt the api for use in the user space?
> >> I need something for use in kernel space
> >>
> >
> > What exactly do you want to do?
> >
> > Generic Netlink can be used to communicate both user-space and kernel
> > code, but you will have general answer to general questions :)
> >
> > --
> > Javier Mart?nez Canillas
> > (+34) 682 39 81 69
> > Barcelona, Spain
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120417/132d6d99/attachment.html 

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

* Question about tlv message support
  2012-04-17  0:36       ` NorthPole
  2012-04-17  3:21         ` JAYESH TANK
@ 2012-04-17  9:34         ` Javier Martinez Canillas
  2012-05-18 14:47           ` NorthPole
  1 sibling, 1 reply; 10+ messages in thread
From: Javier Martinez Canillas @ 2012-04-17  9:34 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Apr 17, 2012 at 2:36 AM, NorthPole <morfeas3000@gmail.com> wrote:
> @JAYESH TANK
> thank you very much :-) that was a very good starting poind :D
>
>
> @Javier
> you are right, so here is something more specific
>
> I want to add a framework for tlv message construction and parsing in
> a wireless mesh routing protocol so as it can have the advantages of
> the tlv way of communication (one of which is backwards compatibility)
>
> afaik tlvs are used in many places in the kernel and as Jayesh stated
> there are no ready made apis.
> So if I want to do that I have to copy someone else's code and modify
> it accordingly
>

Hi,

Netlink has some sort of TLV:

nla_put_string(), nla_put_u32(), nla_put_u8(), etc.

But use a socket buffer (struct sk_buff) to store this data. Since you
will use to store and retrieve this info for a networking protocol
(mesh routing), it probably makes sense to reuse Netlink functions.

Take a look to: include/net/netlink.h

Hope it helps,

-- 
Javier Mart?nez Canillas
(+34) 682 39 81 69
Barcelona, Spain

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

* Question about tlv message support
  2012-04-17  9:34         ` Javier Martinez Canillas
@ 2012-05-18 14:47           ` NorthPole
  0 siblings, 0 replies; 10+ messages in thread
From: NorthPole @ 2012-05-18 14:47 UTC (permalink / raw)
  To: kernelnewbies

Hi all,
Now that I found some time to post

I just wanted to thank you all for the help, your posts helped a lot :-)

On Tue, Apr 17, 2012 at 12:34 PM, Javier Martinez Canillas
<martinez.javier@gmail.com> wrote:
> On Tue, Apr 17, 2012 at 2:36 AM, NorthPole <morfeas3000@gmail.com> wrote:
>> @JAYESH TANK
>> thank you very much :-) that was a very good starting poind :D
>>
>>
>> @Javier
>> you are right, so here is something more specific
>>
>> I want to add a framework for tlv message construction and parsing in
>> a wireless mesh routing protocol so as it can have the advantages of
>> the tlv way of communication (one of which is backwards compatibility)
>>
>> afaik tlvs are used in many places in the kernel and as Jayesh stated
>> there are no ready made apis.
>> So if I want to do that I have to copy someone else's code and modify
>> it accordingly
>>
>
> Hi,
>
> Netlink has some sort of TLV:
>
> nla_put_string(), nla_put_u32(), nla_put_u8(), etc.
>
> But use a socket buffer (struct sk_buff) to store this data. Since you
> will use to store and retrieve this info for a networking protocol
> (mesh routing), it probably makes sense to reuse Netlink functions.
>
> Take a look to: include/net/netlink.h
>
> Hope it helps,
>
> --
> Javier Mart?nez Canillas
> (+34) 682 39 81 69
> Barcelona, Spain

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

end of thread, other threads:[~2012-05-18 14:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-13 18:22 Question about tlv message support NorthPole
2012-04-15 11:10 ` Vladimir Murzin
2012-04-16 12:30 ` Javier Martinez Canillas
2012-04-16 13:00   ` NorthPole
2012-04-16 13:57     ` JAYESH TANK
2012-04-17  0:17     ` Javier Martinez Canillas
2012-04-17  0:36       ` NorthPole
2012-04-17  3:21         ` JAYESH TANK
2012-04-17  9:34         ` Javier Martinez Canillas
2012-05-18 14:47           ` NorthPole

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.