On Mon, Sep 6, 2010 at 7:48 PM, Denys Vlasenko <[email protected]> wrote:
> On Mon, Sep 6, 2010 at 4:07 PM, Smith Will <[email protected]> wrote:
>> On Mon, Sep 6, 2010 at 5:17 PM, Denys Vlasenko <[email protected]>
>> wrote:
>> > On Mon, Sep 6, 2010 at 11:14 AM, Smith Will <[email protected]> wrote:
>> >> Hi list,
>> >> Seems dhcp server within busybox does not yet has support for
>> >> interpreting user/vendor classes. I checked code for busybox-1.17.2
>> >
>> > What do you mean by "interpreting"?
>> >
>> Means if the busybox dhcp server understands these options.. :)
>
> Aha, you want udhcpd to _analyze_ options sent by clients.
>
Correct.
>> >> Did i miss something or this feature hasnt been looked into yet?
>> >
>> > It is somewhat hard to spot. Look into examples/udhcp/udhcpd.conf
>> > file:
>> >
>> > ...
>> > # Arbitrary option in hex form:
>> > option 0x08 01020304 # option 8: "cookie server IP addr:
>> > 1.2.3.4"
>> > ...
>> >
>> > Basically, if you want udhcpd to advertise an option and it is not
>> > supported by name, you can still add it with the above format.
>> > For vendor info element, you need to use
>> >
>> > option 0x2b <hex string>
>>
>> Ok, i have this scenario:
>>
>> I use ISC dhclient ( version 3.1.1) and within my dhclient.conf i use
>> " send user-class "busybox-dhcp" ".
>> My intention is that busybox dhcp server assigns me one of the address
>> from non-default/non-global pool of addresses ( as an example, default
>> pool can be 192.168.1.50 to 192.168.1.100 while for the "busybox-dhcp"
>> user class, i would want udhcpd from busybox to give out an address
>> from 192.168.1.150 to 192.168.1.200).Is this possible?
>> Within /etc/udhcpd.conf, i can use "start 192.168.1.50" and "end
>> 192.168.1.100" for default pool but for the user class pool of
>> "busybox-dhcp", how do i specify?
>
> udhcpd can not send options selectively.
>
>
>> option 0x4d < how do i specify the other pool name and range? >
>
> option directive simply adds (or replaces) options to the set of options
> sent by udhcpd in replies to DHCPDISCOVER/DHCPREQUEST packets
> from clients.
>
> That is,
>
> option 0x4d 1122334455
>
> means "among other options, send option with code 0x4d, length 5
> and contents 1122334455".
>
> There is no way to specify "add this option only if some conditions are met".
Hmm..But wouldnt it be nice if this feature is also supported by busybox udhcpd?
I looked at couple of other servers ( ISC and dnsmasq) who support
these kind of features.
While the ISC one have braces ( { and } to define classes or in
general to identify different "sections" within the configuration
file) while the dnsmasq seems to rely on one liner with delimiters
(,=).
Some thoughts to start with user class support for udhcpd:
1. Have like this in udhcpd.conf:
=======================================
option userclass <start-address>: <end-address>:<max-leases>
========================================
":" is just an example but this could be anything.
This aprroach is similar to dnsmasq.
2. Have like this in udhcpd.conf:
=======================
option userclass start
start < start-address>
end <end-addresses>
max_leases <num>
option userclass end
========================
This approach is similar to ISC ( start = { and end = } )
I just took range and max_leases as examples but practially, lot of
default/global options can be overridden within a specific class.
The first approach requires special handling within "udhcp_str2optset"
function but a need to re-invent the method of specfiying parameters
and their order arises ( with ":" ) ?
The second approach gives an advantage of the fact that the parameters
can be _exactly_ used within class as like we do globally. We just
treat a class as a sub-set of "keywords".But needs special handling
within "read_config" ?
First of all, does extending udhcpd in this way makes sense?
If it does, do the above approaches make sense or there is any simpler approach?
Any suggestions are welcome.
> --
> vda
>
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox