/* This file contains Python bindings for the IpAddr and MacAddr classes. */ #include #include #include #include #include "network_utils.h" namespace py = pybind11; using sls::IpAddr; using sls::MacAddr; void init_network(py::module &m) { py::class_ (m, "IpAddr") .def(py::init()) .def(py::init()) .def(py::init()) .def(py::init()) .def("hex", &IpAddr::hex) .def("uint32", &IpAddr::uint32) .def(py::self == py::self) .def("__repr__", &IpAddr::str) .def("str", &IpAddr::str); py::class_ (m, "MacAddr") .def(py::init()) .def(py::init()) .def(py::init()) .def(py::init()) .def("hex", &MacAddr::hex) .def(py::self == py::self) .def("uint64", &MacAddr::uint64) .def("__repr__", &MacAddr::str) .def("str", &MacAddr::str); }