Class membership

Simon Hobson dhcp1 at thehobsons.co.uk
Sat Oct 17 06:55:23 UTC 2015


Patrick Trapp <ptrapp at nex-tech.com> wrote:

> Am I correct in thinking that I can refer to the class as a whole in addition to the individual subclasses? So given class A with subclass 1A and subclass 2A, I could use an allow statement against class A, subclass 1A, or subclass 2A (or potentially some silly combination thereof)?

No, they don't work like that. The subclasses don't have names, and you can't refer to them.
If you look at the example, it's simply a quick and efficient method to provide a list of members - so I suppose "subclass" is perhaps a slightly misleading name.

If you read down the man page a bit, you'll find there are other things you can do. IIRC the example given is to spawn a subclass based on end-user port (ie option 82) - and apply restrictions per subclass (eg only 3 DHCP leases at any time). But you still cannot refer to any individual subclass by name.


I have no idea how much work it would be to allow a class to be defined by reference to another class membership. I suspect it would be a lot since it's come up before.

One stumbling block I could see (as a non-programmer) is that the config is object based and there is no defined execution order (ie putting one declaration ahead of another in the config file does not mean it'll be executed first) - so you'd need to introduce some ordering to class membership evaluation to ensure that the referenced classes were evaluated for membership priot to other classes that use that information. I suspect this is "non trivial".



More information about the dhcp-users mailing list