[OpenSER-Devel] Request for comment: module interface extension

Dan Pascu dan at ag-projects.com
Mon Dec 17 12:55:47 UTC 2007


On Monday 17 December 2007, Henning Westerholt wrote:
> On Monday 17 December 2007, Juha Heinanen wrote:
> > Henning Westerholt writes:
> >  > We would suggest a extension to make this interface more flexible,
> >  > to support more module function parameter, and to remove the
> >  > unnecessary ones too.
> >
> > henning,
> >
> > it is great if you have time to work on this, but i would like to
> > first see an exact syntax of what you plan to implement.
> >
> > for example, regarding module interface, would each function argument
> > have its own fixup function instead of one fixup function taking care
> > of all arguments?  if each would have its own, then i would think
> > that it would be easier to build a generic fixup function library.
> >
> > also, would the new interface support optional function arguments,
> > default values for missing arguments, how it is told which argument
> > is what if arguments can be optional, etc.
>
> Hi Juha,
>
> changes like this are quite much work, e.g. even for the proposed small
> change its necessary to change the functions exports of over 80
> modules.
>
> Extensions like you suggested is even more work for code and
> documentation. And beside the work, i prefer to work incrementally with
> a codebase like this.
>
> So for now i suggest only to change the module functions export to:
>
> typedef int (*cmd_function)(struct sip_msg*, int count, char **params);

I do not like this model too much. All arguments are hidden inside an 
array, from where the function must take and assign them to variables.
No clear function prototype can be defined by this model and calling 
functions exported by other modules will become complex and awkward.

>
> The fixup functions are of course an area that could need some love
> too.. :-) A generic library of fixup functions would be great, i
> already moved some functions into modfix.h.
>
> Cheers,
>
> Henning
>
> _______________________________________________
> Devel mailing list
> Devel at lists.openser.org
> http://lists.openser.org/cgi-bin/mailman/listinfo/devel



-- 
Dan



More information about the Devel mailing list