[sr-dev] multiple values in mtree modes

Daniel-Constantin Mierla miconda at gmail.com
Sun Aug 28 10:27:24 CEST 2011


Hello,

On 8/28/11 9:43 AM, Juha Heinanen wrote:
> daniel,
>
> i started to add support to mtree for integer values and allowing
> each node to have more that one value.
>
> this would be much easier, it i would not need to support the
> currently undocumented MT_TREE_DW value type. can i drop MT_TREE_DW
> value type from the implementation or do you need it?  if support for
> MT_TREE_DW is needed, it would be easier for me to leave the current
> module alone and write a new version of the module.

keep the MT_TREE_DW. The module should have to the flexibility of being 
able to deal with different modes, no matter of what kind, to be 
specified on a per tree basis -- an update for the next devel cycle. The 
current mode 1 is not only about storing integer values, but some 
sorting of the values as well. I don't think a new module makes sense, 
since such modes will be wanted there at some point ...

I was thinking to some generic design, like a profile for tree value 
type, to have:
- a function for parsing before caching and store compiled value in tree 
(in a container structure)
- a function for matching - meaning to add the matched value in a list
- a sorting function for the list
- a conversion from the internal list to config (e.g., to avp/pv/xavp)
- a function to free the cached value (for shutdown cleanup)

... and maybe more as needed.

So adding a new type means implementing a generic interface, without 
messing with the tree structure and navigation through it.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-dev mailing list