jay-g-mehta / pydhcpdparser

pydhcpdparser is a pure python based, DHCPD configuration parser. pydhcpdparser can be used to verify syntax of DHCPD configurations, parse and extract values from configuration files and access them as python variables.
GNU General Public License v3.0
9 stars 9 forks source link

range as subnet option do not work #7

Closed dlyr closed 4 years ago

dlyr commented 5 years ago

Hi, I have trouble with pydhcpdparser (current pip version, but do not seems to have been corrected in last version): the range keyword is only recognized as a pool member, not direct subnet member. The dhcpd.conf allow range as a direct subnet option. Here are a minimal example:

subnet 192.168.16.0 netmask 255.255.255.0 {      
    option routers 192.168.16.1;
    option domain-name-servers 192.168.1.254;
    pool{
        range 192.168.16.100 192.168.16.200;
    }
}

subnet 192.168.32.0 netmask 255.255.255.0 {      
    option routers 192.168.32.1;
    option domain-name-servers 192.168.1.254;
    range 192.168.32.100 192.168.32.200;
}

got Syntax error in input! LexToken(RANGE,'range',12,326)

I'm not sure how to correct this, but feel free to ask if I can help. ++ dlyr

jay-g-mehta commented 4 years ago

pushed out new commit fixing this issue. Please check. If it looks good, I will release 0.0.10 on pypi

dlyr commented 4 years ago

works for me ! thanks.