Problem with a conditional evaluation from Microsoft to ISC

Bernardo Pita bpita at netcombbs.com
Wed Jan 21 14:56:21 UTC 2009


Hi Bruce, after some modifications in your code it's working !

suffix(binary-to-ascii(16, 8, "", packet(7, 1)), 1) = "0"

Thanks for your help.

Bernardo.

-------- Mensaje original --------
De: Bruce Hudson <Bruce.Hudson at Dal.Ca>
Para: dhcp-users at lists.isc.org
Asunto: Re:Problem with a conditional evaluation from Microsoft to ISC
Fecha: 19/01/2009 18:50
>  
>   
>> Hi, I need to migrate a Microsoft DHCP configuration to ISC DCHP from a
>> client. In the original configuration (Microsoft) they have this
>> conditional evaluation:
>>
>> [($TIME ("integer")&1)==1 ?"file.a.bin":"file.b.bin"]
>>
>> As you can see the idea of the line it's like a random condition $TIME,
>> the server offers a diferente file to the client request. They use this
>> to obtain a basic balancing for two CMTS.
>>
>> I read dhcp-eval and I can't find anything like this... any ideas that
>> allow me to obtain the same result with ISC ?
>>
>>     
>
>     Off the top of my head, the following code should work. It uses the 
> last byte of the client supplied "XID" value (the 8th byte of the the
> packet) as a source of randomness; converts it to is binary value as an
> ASCII string; and extracts the final bit. 
>
>     if (suffix (binary-to-ascii (2, 8, ".", packet(7, 1)), 1) = 0) {
>         myfile = "file.a.bin";
>     } else {
>         myfile = "file.b.bin";
>     }
>
>     This is not inline as your original expression seems to be. It stores
> the file name into a variable. You can then use that in what-ever 
> statement the expression was taken from.
>
>     The client's hardware address might also serve to balance requests.
> It would have the (dis)advantage that a client will always get the same
> CMTS.
> --
> Bruce A. Hudson				| Bruce.Hudson at Dal.CA
> UCIS, Networks and Systems		|
> Dalhousie University			|
> Halifax, Nova Scotia, Canada		| (902) 494-3405
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>   

-- 
Bernardo Pita
Netcom BBS http://www.netcombbs.com
Phone/Fax: (54) 2964-425870
Agente Oficial UOL Sinectis http://www.uolsinectis.com.ar

Mucha más Internet, te lo vas a perder?




More information about the dhcp-users mailing list