[ previous ] [ next ] [ threads ]
 
 From:  Alexander Schaber <lists at alexanderschaber dot de>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  Extra DHCP options in the webgui
 Date:  Mon, 6 Nov 2006 21:52:53 +0100
Hello m0n0-devs,

I've started a little patch for m0n0, which includes an extra page for DHCP
related options.
I changed as little as possible of the original code and tried to keep the
code conform to the m0n0 standards. (By using files that already existed ;) )

Now concerning the problem I'm having:

Once I add an option through I get this (exerpt) from print_r($config); :

...
    [dnsupdate] =>
    [dhcpd] => Array
        (
            [lan] => Array
                (
                    [enable] =>
                    [range] => Array
                        (
                            [from] => 192.168.2.201
                            [to] => 192.168.2.250
                        )

                    [options] => Array
                        (
                            [0] => Array
                                (
                                    [name] => option-name
                                    [value] => option-value
                                    [descr] => Description
                                )
                        )
                )
        )
    [pptpd] => Array
...

This seems correct to me, but there is one (big) problem:
If the config file is actually written by write_config(); an error is
returned:
XML error: not well-formed (invalid token) at line 68
This is in an original config.xml this line:
    <dhcpd>
        <lan>
            <enable/>
            <range>
                <from>192.168.2.201</from>
                <to>192.168.2.250</to>
            </range>
        </lan>
    </dhcpd> (line 68)

Attached you'll find the patch. (The patch for the repo from this morning, 
which was r168 and my changes).

Note: I've changed the files from the latest svn-repo, but uploaded it onto
 an 1.22 vmware appliance. I've figured, that there were no significant
 changes to any problem related files b/w 1.22 and the current svn. Neither
 in the webgui nor in the phpconf.

Important Note: This patch is not yet ready to use!! It WILL break your m0n0
config, therefore don't use it yet if you do not know what you're doing!! It
is intended for the m0n0 devs who might want to look over the code and maybe
give me a hint, what went wrong.

Last note: Checked this out: http://svn.m0n0.ch/wall/branches/1.23/.

Really last note: I've leaved the credits/headers as they were and used the
services_dhcp_edit.php as a template for services_dhcp_options_edit.php.

Greetings
 Alexander
dhcp-options.patch (8.3 KB, text/x-diff)