Question about tlv message support
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?
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@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
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/genericnetl... Hope it helps, -- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain
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/genericnetl...
Hope it helps,
-- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain
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/genericnetl...
Hope it helps,
-- Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/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
@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
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
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
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
participants (4)
-
Javier Martinez Canillas -
JAYESH TANK -
NorthPole -
Vladimir Murzin