[sr-dev] git:master: modules_k/nathelper: Add is_rfc1918(ip_addr) function to test ip_addr for rfc1918addresses.

Daniel-Constantin Mierla miconda at gmail.com
Mon Aug 1 18:38:31 CEST 2011


Hello,

On 8/1/11 6:31 PM, Henning Westerholt wrote:
> On Monday 01 August 2011, Iñaki Baz Castillo wrote:
>> 2011/8/1 Henning Westerholt<henning.westerholt at 1und1.de>:
>>> ok, understand. I think we should not introduce two functions with
>>> similar names and the same behaviour in two modules. Even worse, both
>>> use different implementations (table matching vs. ragel parser). So one
>>> commit should be reverted.
>> I agree.
>>
>>> A generic is_rfc1918 function in ipops would be nice, but the nathelper
>>> module also needs this test internally. What about move one of the
>>> parsers to the library dir, and then just including it from both
>>> modules?
>> It would be nice. Is there an already existing library file in which
>> such function would fit well?
> Hi Iñaki,
>
> i don't think so. But you could simply add a new small library, there are
> several small ones like dtrie or shm_regexp.
if it is just about one function with no external dependencies (I guess 
nathelper version does not have any), better add it in core in 
ip_addr.{c,h}. Probably it is used in modules_s/nathelper as well.

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