ifconfig.h 590 B

1234567891011121314151617181920212223242526272829
  1. #ifndef HV_IFCONFIG_H_
  2. #define HV_IFCONFIG_H_
  3. #include <vector>
  4. typedef struct ifconfig_s {
  5. char name[128];
  6. char ip[16];
  7. char mask[16];
  8. char broadcast[16];
  9. char mac[20];
  10. } ifconfig_t;
  11. /*
  12. * @test
  13. std::vector<ifconfig_t> ifcs;
  14. ifconfig(ifcs);
  15. for (auto& item : ifcs) {
  16. printf("%s\nip: %s\nmask: %s\nbroadcast: %s\nmac: %s\n\n",
  17. item.name,
  18. item.ip,
  19. item.mask,
  20. item.broadcast,
  21. item.mac);
  22. }
  23. */
  24. int ifconfig(std::vector<ifconfig_t>& ifcs);
  25. #endif // HV_IFCONFIG_H_