ifconfig.h 519 B

123456789101112131415161718192021222324252627
  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[32];
  7. char mask[32];
  8. char mac[32];
  9. } ifconfig_t;
  10. /*
  11. * @test
  12. std::vector<ifconfig_t> ifcs;
  13. ifconfig(ifcs);
  14. for (auto& item : ifcs) {
  15. printf("%s\nip: %s\nmask: %s\nmac: %s\n\n",
  16. item.name,
  17. item.ip,
  18. item.mask,
  19. item.mac);
  20. }
  21. */
  22. int ifconfig(std::vector<ifconfig_t>& ifcs);
  23. #endif // HV_IFCONFIG_H_