Here's a real example of a test (currently in production with the "old" DHCP 
server):

  {
      "name": "phones",
      "test": "(substring(pkt4.mac,0,3) == 0x08000f) or 
(substring(pkt4.mac,0,3) == 0x000d65) or (substring(pkt4.mac,0,3) == 0x000413) 
or (substring(pkt4.mac,0,3) == 0x0050c2) or (substring(pkt4.mac,0,3) == 
0x0004f2) or (substring(pkt4.mac,0,3) == 0x64167f)"
  }

It's a silly but effective test to determine which devices are to be considered 
as phones. In Kea 1.3.0, I need to use this as the "not":

  {
      "name": "not_phones",
      "test": "not (substring(pkt4.mac,0,3) == 0x08000f) and not 
(substring(pkt4.mac,0,3) == 0x000d65) and not (substring(pkt4.mac,0,3) == 
0x000413) and not (substring(pkt4.mac,0,3) == 0x0050c2) and not 
(substring(pkt4.mac,0,3) == 0x0004f2) and not (substring(pkt4.mac,0,3) == 
0x64167f)"
  }

Rob

-----Original Message-----
From: Francis Dupont [mailto:[email protected]] 
Sent: Thursday, November 02, 2017 6:21 PM
To: Sutherland, Rob
Cc: [email protected]
Subject: Re: [Kea-users] Client classification

"Sutherland, Rob" writes:
> I have a quick question: if I have a client class named, say, "foo", 
> how do I define a class for everything NOT in "foo" (without negating 
> the entire test defined in "foo")?

=> not yet but it is in my TODO list. BTW if you have a concrete example it 
will help for the documentation (real world examples are always better) and to 
convince my colleagues there is an important item which should be do in Kea 1.4 
with a good priority. Note there should be a design phase as it is not the only 
thing which can (should!) be improved in client classification and it is not 
trivial too (dependency loops must be detected).

Thanks

Francis Dupont <[email protected]>
_______________________________________________
Kea-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to