Meaning of ADAPTER_ID column value in rule table
4 posts · Closed
Within the Bandwidth Manager.DB, the rule table has an ADAPTER_ID column. I am trying to figure out what the column value translates to in terms of the actual adapter.
For instance, it shows 1381106261; what value is this referring to? I thought maybe it would store the interface index or something, but nothing I can get from PowerShell etc. returns 1381106261.
Thank you for your assistance!
We were unable to use interface index as it turned out that adapter indices can change between reboots or system upgrades.
Instead we take the system adapter name (GUID) and compute a 32-bit hash value of it. The names and their hashes remain the same throughout the lifespan of the system.
If you just need to know the mapping once off in a single system, the simplest way would be to create a rule and assign an adapter to it to see what ID gets written into the database.
Alternatively we can simply add a new table in the database listing all available adapters and their IDs.
So the InterfaceGuid is used (in this test system case, the value returned by Get-NetworkAdapter is {2C58A09A-A27F-44CD-A457-CD2DEF8302AD})
We know the interface name (Ethernet), just need a way to pragmatically set the ADAPTER_ID in the table from the InterfaceGuid.
As mentioned earlier, the simplest way would be to add a new table to the database listing all available interfaces and their IDs. We use a custom hashing function for the ID and calculating it outside the software would be complicated.
So if you download and install the latest build, you will see there is a new table ADAPTER that has all the information you need.