[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dhcp-client
Subject:    Need help with decoding vendor-encapsulated-options.
From:       chirag radhakrishnan <chiragrkn () yahoo ! com>
Date:       2005-10-19 4:23:19
Message-ID: 20051019042319.39334.qmail () web61018 ! mail ! yahoo ! com
[Download RAW message or body]

   *** From dhcp-client -- To unsubscribe, see the end of this message. ***

I have been trying to configure my dhclient.conf to obtain vendor encapsulated \
options. I am using package dhcp3.0.3 on my client and server.  
My dhclient.conf looks like this:
<snip>
option space XAN; # Defined my vendor space.
option XAN.xadmin code 134 = ip-address; # defined an option here
vendor option space XAN; #declaring that client expects this vendor options
send vendor-class-identifier "XAN";
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name,
        netbios-name-servers, netbios-scope, vendor-encapsulated-options;
</snip>
My dhcpd.conf looks like this
 
<snip>
#### Defining option space and option. 
   option space XAN;
        option XAN.xadmin code 134 = string;
#### Defining a class to catch clients with this vendor class
 
   class "vendorclass1" {
    match if substring (option vendor-class-identifier, 0, 3) = "XAN";
        vendor-option-space XAN;
        option routers 172.16.4.250;
        option domain-name "foo.com";
        option domain-name-servers 211.11.11.11;
        option XAN.xadmin "superadmin";
}
 
#### Subnet definition.
 
subnet 172.16.4.0 netmask 255.255.255.0 {
    pool {
    allow members of "vendorclass1";
    range 172.16.4.200 172.16.4.205;
    }
}
</snip>
 
##############################################
On the client machine, dhclient.leases file does show that the option XAN.admin has \
been given to this client, but I am not sure how I would incorporate a script in the \
dhcp-script to read this vendor encapsulated option. A small script that I tried but \
doesnt help: <snip>
parseValue ()
{
        local sData="$1"
        local sKeyToFind="$2"
        for sOption in $sData; do
                sKey=`echo $sOption | awk -F"=" '{print $1}'`
                if [ "$sKey" == "$sKeyToFind" ]; then
                        result= `echo $sOption | awk -F"=" '{print $2}'`
                        return "$result"
                        break;
                fi
        done
}
echo "$new_vendor_encapsulated_options" >> /etc/test.txt
optionval1= `parseValue "$new_vendor_encapsulated_options" "xDMSldap"`
echo "$optionval1" >> /etc/test.txt

</snip>
This script tries to
1. Match the vendor encapsulated option.
2. If confdition 1 is true search for the option inside and return the value of this \
option.  
###################################################
I managed to reach this far browsing through mailing list, but couldnt find anything \
specific to this problem and I am bust at this point of time :(.  Can any one help me \
or atleast throw some bread crums?  
 
Thanks,
Chirag R.

		
---------------------------------
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

-----------------------------------------------------------------------
To unsubscribe from this list, visit http://www.isc.org/dhcp-lists.html
or send mail to dhcp-client-request@isc.org with the subject line of
'unsubscribe'.
-----------------------------------------------------------------------


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic