[Devel] find_export("append_hf") - usage?
Daniel-Constantin Mierla
daniel at voice-system.ro
Fri Mar 3 12:49:30 CET 2006
Hello,
On 03/02/06 20:29, Daniel Hsueh wrote:
> Hello,
>
> I need to add a header to a sip message from within a module.
>
> Instead of fighting with the struct lump mechanism, is it simply
> easier to find the "append_hf" function and call it directly?
you should take care of parameter format, since append_hf() uses a fixup
for its parameters.
> And how is memory managed for the string passed in? (My guess is that
> the caller manages its own buffer, and the append_hf code stores its
> own copy -- this is suggested by the usage in modules/osp/sipheader.c
> and modules/alias_db/alookup.c, yes?
If you do not pass special flag to add/insert lump functions, then the
core makes a copy. Just take a look at add_hf_helper() function in
textops, it is pretty easy to use the lumps. You have to locate the
position within the original message where to insert and then just pass
the buffer to add/insert lump function.
Cheers,
Daniel
>
> (Or if someone wants to help me through the struct lump mechanism,
> I'll try it.)
>
> Thanks!
>
More information about the Devel
mailing list