#include "nvlib.h" #include using namespace std; using namespace boost; void print_ramht(shared_ptr ramht) { for(unsigned i = 0; i < ramht->entries; ++i) { nv_ramht_entry entry = ramht->get_at(i); if(!entry.valid) continue; cout << "[" << i << "] " << make_pair(ramht->dev, entry) << endl; } } int main(int argc, char** argv) { unique_ptr dev(nv_device::open_default()); if(dev->dev_ramht) print_ramht(dev->dev_ramht); else { unsigned chans = 0; for(unsigned i = 0; i < dev->channels; ++i) { shared_ptr hwchan = dev->hwchannel(i); if(!hwchan) continue; if(chans) cout << endl; cout << "Channel " << dec << i << endl; print_ramht(hwchan->ramht); ++chans; } } return 0; }