summaryrefslogtreecommitdiffstats
path: root/lspcidrake.c
blob: faec0216d2a26140cef80a7f7c01a8c5caf7ec78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libldetect.h"

void pci_printit(struct pci_entries entries) {
  int i;
  for (i = 0; i < entries.nb; i++) {
    struct pci_entry e = entries.entries[i];
    printf("%s:\t%s", e.module ? e.module : "unknown", e.text);
    if (e.class) {
      const char *class = pci_class2text(e.class);
      if (strcmp(class, "NOT_DEFINED") != 0) printf(" [%s]", class);
    }
    printf("\n");
  }
}

int main(int argc, char **argv) {
  struct pci_entries entries = pci_probe(1);
  pci_printit(entries);
  pci_free(entries);
  exit(0);
}