udhcpc: option -x OPT:VAL clarification

Abdoulaye Walsimou GAYE awg at embtoolkit.org
Mon Dec 6 22:11:24 UTC 2010


On 12/05/2010 11:22 PM, Denys Vlasenko wrote:
> On Sunday 05 December 2010 20:05, Abdoulaye Walsimou GAYE wrote:
>    
>> Can someone clarify usage of -x OPT:VAL please?
>>      
> $ udhcpc --help
> BusyBox v1.18.0 (2010-11-23 00:11:12 CET) multi-call binary.
>
> Usage: udhcpc [-fbnqvoCR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]
>          [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL]... [-O OPT]...
> ...
>          -x OPT:VAL              Include option OPT in sent packets (cumulative)
>                                  Examples of string, numeric, and hex byte opts:
>                                  -x hostname:bbox - option 12
>                                  -x lease:3600 - option 51 (lease time)
>                                  -x 0x3d:0100BEEFC0FFEE - option 61 (client id)
>
>
> Is this text unclear?
> Please provide question(s) it doesn't answer.


I am using busybox-1.17.4 and the help is not displayed like this.
Thanks for clarification.


> Well, the picture seems to be garbled. "option-data1" looks strange.
> Ypou meant:
>
>     The format of the V-I Vendor Class option is as follows:
>
>                          1 1 1 1 1 1
>      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>     |  option-code  |  option-len   |
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>     |      enterprise-number1       |
>     |                               |
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>     |   data-len1   |               |
>     +-+-+-+-+-+-+-+-+               |
>     /      vendor-class-data1       /
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
>     |      enterprise-number2       |   ^
>     |                               |   |
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |
>     |   data-len2   |               | optional
>     +-+-+-+-+-+-+-+-+               |   |
>     /      vendor-class-data2       /   |
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |
>     ~            ...                ~   V
>     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
>
>
> Since enterprise-number1, data-len1, vendor-class-data1
> are likely to be nonrepresentable as strings,
> encode them as hex bytes:
>
> -x 125:010203040506070809
>
> replace 01 with the value of 1st byte, 02 with with the value
> of 2nd one and so on.
>
>    


Indeed this is tedious but it works.

Thanks,
AWG



More information about the busybox mailing list