Re: [PATCH] crypto: compress - Add pcomp interface
From: Herbert Xu
Date: Thu Feb 19 2009 - 05:43:11 EST
On Thu, Feb 19, 2009 at 10:12:18AM +0100, Geert Uytterhoeven wrote:
>
> IIUC, my setup() routines should decode the parameters using nla_parse()?
Right.
> And the caller of a setup() routine should encode the data. But how? All the
> nla_put*() routines seem to be targeted at skb's.
The callers in the kernel should just lay it out on the stack, e.g.,
struct {
struct nlattr foo;
u32 foo_val;
struct nlattr bar;
u32 bar_val;
...
};
Note that the netlink alignment is 4 so u32 doesn't need any padding
though u8/u16 would need padding before the next nlattr. Although
for our purposes u32 should be sufficient.
> The only place where nla_parse() is called with a void */length pair is
> net/sched/em_meta.c:em_meta_change(). But I can find no place where the actual
> TCA_EM_META_* fields are encoded.
For simple things like u32 the format is just header followed by
the u32. See nla_get_u32 for details.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/