2018-02-01 17:06:49 +00:00
|
|
|
#include <llarp/msg_handler.h>
|
2018-02-01 17:07:01 +00:00
|
|
|
#include "router.hpp"
|
2018-02-01 17:06:49 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
static struct llarp_frame_handler*
|
|
|
|
find_frame_handler(struct llarp_router* r, const char ch)
|
|
|
|
{
|
|
|
|
auto itr = r->frame_handlers.find(ch);
|
|
|
|
if(itr != r->frame_handlers.end())
|
|
|
|
{
|
|
|
|
auto handler = &itr->second;
|
|
|
|
handler->paths = r->paths;
|
|
|
|
handler->parent = &r->muxer;
|
|
|
|
}
|
|
|
|
return nullptr;
|
2018-02-01 17:06:49 +00:00
|
|
|
}
|
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
static struct llarp_msg_handler*
|
|
|
|
find_msg_handler(struct llarp_router* r, const char ch)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2018-02-01 17:07:01 +00:00
|
|
|
} // namespace llarp
|
|
|
|
|
2018-02-01 17:06:49 +00:00
|
|
|
extern "C" {
|
2018-05-22 15:54:19 +00:00
|
|
|
void
|
|
|
|
llarp_msg_muxer_init(struct llarp_msg_muxer* muxer)
|
|
|
|
{
|
|
|
|
muxer->link_handler_for = &llarp::find_frame_handler;
|
2018-02-01 17:07:01 +00:00
|
|
|
muxer->routing_handler_for = &llarp::find_msg_handler;
|
|
|
|
}
|
2018-02-01 17:06:49 +00:00
|
|
|
}
|