Question about tlv message support
Javier Martinez Canillas
martinez.javier at gmail.com
Tue Apr 17 05:34:24 EDT 2012
On Tue, Apr 17, 2012 at 2:36 AM, NorthPole <morfeas3000 at 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
More information about the Kernelnewbies
mailing list