summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-03-18 17:13:15 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-03-18 17:13:15 +0100
commit7d4283f8f54e9836c59d6507d0cfb0464ffb9e74 (patch)
tree7d3df167b95fab4dfcfae9996ccb14c91f0502ac /include
parent77199be682daa1797a4518b3958d58c133dd88f2 (diff)
downloadgmrf-7d4283f8f54e9836c59d6507d0cfb0464ffb9e74.tar
gmrf-7d4283f8f54e9836c59d6507d0cfb0464ffb9e74.zip
Add protocol module API library
Diffstat (limited to 'include')
-rw-r--r--include/gmrf/gmrf.h8
-rw-r--r--include/mmss/protocol.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/include/gmrf/gmrf.h b/include/gmrf/gmrf.h
index 3634b29..f6cf9c4 100644
--- a/include/gmrf/gmrf.h
+++ b/include/gmrf/gmrf.h
@@ -59,7 +59,11 @@ size_t gmrf_iface_get_mtu(gmrf_t *gmrf, gmrf_iface_t *iface);
bool gmrf_iface_send(gmrf_t *gmrf, gmrf_iface_t *iface, const void *data, size_t len, const gmrf_addr_t *dest);
bool gmrf_iface_send_bc(gmrf_t *gmrf, gmrf_iface_t *iface, const void *data, size_t len);
-gmrf_context_t* gmrf_init(gmrf_t *gmrf);
-void gmrf_handle_packet(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);
+/* implemented by protocol */
+extern const char *gmrf_protocol_name;
+extern const char *gmrf_protocol_version;
+
+gmrf_context_t* gmrf_protocol_init(gmrf_t *gmrf);
+void gmrf_protocol_handle_packet(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);
#endif /* _GMRF_GMRF_H_ */
diff --git a/include/mmss/protocol.h b/include/mmss/protocol.h
index 502a923..7d131d2 100644
--- a/include/mmss/protocol.h
+++ b/include/mmss/protocol.h
@@ -31,8 +31,8 @@
typedef struct mmss_protocol {
- const char *name;
- const char *version;
+ const char* (*get_name)(void);
+ const char* (*get_version)(void);
gmrf_context_t* (*init)(gmrf_t *gmrf);
void (*handle_packet)(gmrf_t *gmrf, gmrf_context_t *ctx, gmrf_iface_t *iface, const gmrf_addr_t *source, const void *data, size_t len);