dankamongmen / libnetstack

Small library around rtnetlink to track networking stack elements
https://nick-black.com/dankwiki/index.php/Libnetstack
Apache License 2.0
10 stars 0 forks source link

Allow the user to inhibit caching of object classes #26

Closed dankamongmen closed 5 years ago

dankamongmen commented 5 years ago

Right now it's all or nothing. The user ought be allowed to supply some manner of bitmask, though interfaces can't ever really be disabled...with our current design, anyway.

dankamongmen commented 5 years ago

Note that we can't base this solely on which callbacks are set, since we still would want to support lookups and enumeration-on-demand even for those we don't provide callbacks for. Saying "I'm uninterested" doesn't mean "don't send a discovery request", but rather "don't deal with these at all."

dankamongmen commented 5 years ago

I've implemented this for ifaces now (the only thing we actually cache yet). Need a unit test for this.

dankamongmen commented 5 years ago

Unit tests added:

      Start 12: NoTrack.NoWorkIsInvalid
12/13 Test #12: NoTrack.NoWorkIsInvalid .............   Passed    0.01 sec
      Start 13: NoTrack.IfaceFailsLookup
13/13 Test #13: NoTrack.IfaceFailsLookup ............   Passed    0.01 sec