link.h 559 B

12345678910111213141516171819202122232425
  1. #ifndef _IPYML_LINK_H
  2. #define _IPYML_LINK_H
  3. #include "hardware_address.h"
  4. #include "operstate.h"
  5. #include "yaml.h"
  6. #include <linux/netlink.h>
  7. #include <ostream>
  8. #include <string>
  9. class Link : public YamlObject {
  10. std::string ifname;
  11. HardwareAddress hwaddr, broadcast;
  12. OperState operstate;
  13. public:
  14. // typedef int (*mnl_attr_cb_t)(const struct nlattr *attr, void *data);
  15. static int mnl_attr_cb(const nlattr *attr, void *data);
  16. void write_yaml(std::ostream &stream,
  17. const yaml_indent_level_t indent_level = 0) const;
  18. };
  19. #endif