I'm in the process of porting some BSD code over to Linux. One of the functions we need to duplicate is related to performance statistics (network, CPU, hdd, etc). Right now I'm working on the network data. The structure I have to fill up looks like this:
Code:
typedef struct
{
    string *ifcId;
    int64 linkState;
    int64 baudrate;
    int64 rxPkts;
    int64 rxPktsErrors;
    int64 txPkts;
    int64 txPktsErrors;
    int64 collisions;
    int64 rxBytes;
    int64 txBytes;
    int64 rxPktsMcast;
    int64 txPktsMcast;
    int64 iDrops;
} platform_perf_net_attributes;
I accessed some kernel structures in BSD to collect a lot of this information, and naturally this code is completely wrong for Linux. Can someone suggest where I should look to get these fields filled in for Linux? Thanks!