How to check if ObjectIdentifier is root of another ObjectIdentifier? (SnmpSharpNet)

104 Views Asked by At

How would I check if an ObjectIdentifier is parent/root of another ObjectIdentifier?

For example:

ObjectIdentifier rootId = ...;
Variable variable = ...;
if (rootId.IsRootOf(variable.Id))
{
    // The variable's id is a child of root id!
}

I can't seem to find any method like that in SnmpSharpNet.

1

There are 1 best solutions below

2
On

rootId is a parent if this is true

is-equal (rootId, variableId, len(rootId))