lokinet/pybind/llarp/handlers/pyhandler.cpp

19 lines
499 B
C++
Raw Normal View History

#include <llarp/handlers/pyhandler.hpp>
2020-02-28 16:29:15 +00:00
namespace llarp
{
2020-03-07 01:20:11 +00:00
namespace handlers
2020-02-28 16:29:15 +00:00
{
2020-03-07 01:20:11 +00:00
void
PyHandler_Init(py::module& mod)
2020-02-28 16:29:15 +00:00
{
py::class_<PythonEndpoint, PythonEndpoint_ptr>(mod, "Endpoint")
.def(py::init<std::string, Context_ptr>())
2020-03-07 01:20:11 +00:00
.def("SendTo", &PythonEndpoint::SendPacket)
.def("OurAddress", &PythonEndpoint::GetOurAddress)
.def_readwrite("GotPacket", &PythonEndpoint::handlePacket);
2020-02-28 16:29:15 +00:00
}
2020-03-07 01:20:11 +00:00
} // namespace handlers
2020-04-22 20:04:47 +00:00
} // namespace llarp