mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
921 B
C
39 lines
921 B
C
#ifndef LLARP_MSG_HANDLER_H_
|
|
#define LLARP_MSG_HANDLER_H_
|
|
#include <llarp/buffer.h>
|
|
#include <llarp/link.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct llarp_frame_handler
|
|
{
|
|
struct llarp_obmd * outbound;
|
|
struct llarp_ibmq * inbound;
|
|
bool (*process)(struct llarp_frame_handler *, struct llarp_link_session *, llarp_buffer_t);
|
|
};
|
|
|
|
struct llarp_msg_handler
|
|
{
|
|
struct llarp_path_context * paths;
|
|
};
|
|
|
|
struct llarp_msg_muxer
|
|
{
|
|
/** get a message handler for a link level message given msg.a */
|
|
struct llarp_frame_handler * (*link_handler_for)(const char *);
|
|
/** get a message handler for a routing layer message given msg.A */
|
|
struct llarp_msg_handler * (*routing_handler_for)(const char *);
|
|
};
|
|
|
|
/** fill function pointers with default values */
|
|
void llarp_msg_handler_mux_init(struct llarp_msg_muxer * muxer);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|