Add protocol module API library
This commit is contained in:
parent
77199be682
commit
7d4283f8f5
7 changed files with 71 additions and 7 deletions
13
mmss/mmss.c
13
mmss/mmss.c
|
@ -39,11 +39,20 @@ static void init_nodes(gmrf_t *nodes) {
|
|||
}
|
||||
|
||||
|
||||
int main() {
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s protocol_module\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const mmss_protocol_t *proto = mmss_load_protocol(argv[1]);
|
||||
if (!proto)
|
||||
return 1;
|
||||
|
||||
mmss_t mmss = { .now = 0 };
|
||||
|
||||
mmss_network_t net = { .mtu = 1500 };
|
||||
gmrf_t node1 = { .mmss = &mmss }, node2 = { .mmss = &mmss };
|
||||
gmrf_t node1 = { .mmss = &mmss, .proto = proto }, node2 = { .mmss = &mmss, .proto = proto };
|
||||
gmrf_iface_t iface1 = {}, iface2 = {};
|
||||
|
||||
iface1.net = &net;
|
||||
|
|
|
@ -64,7 +64,7 @@ struct gmrf {
|
|||
gmrf_context_t *ctx;
|
||||
gmrf_iface_t *interfaces;
|
||||
|
||||
mmss_protocol_t *proto;
|
||||
const mmss_protocol_t *proto;
|
||||
};
|
||||
|
||||
struct gmrf_iface {
|
||||
|
|
Reference in a new issue