2021-03-09 22:24:35 +00:00
|
|
|
#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
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
py::class_<PythonEndpoint, PythonEndpoint_ptr>(mod, "Endpoint")
|
2020-05-06 14:45:30 +00:00
|
|
|
.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
|