summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-03-18 01:36:34 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-03-18 01:36:34 +0100
commit73071f996142d7cffe61a1922089f8e8b2928e64 (patch)
tree22db061412afa9bc68b6eef4138a3b4007d2d9f3 /include
parente7f622e99de8a8d36bd0341abd4f7bc540e103c7 (diff)
downloadgmrf-73071f996142d7cffe61a1922089f8e8b2928e64.tar
gmrf-73071f996142d7cffe61a1922089f8e8b2928e64.zip
Implement packet queueing
Diffstat (limited to 'include')
-rw-r--r--include/gmrf/gmrf.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/gmrf/gmrf.h b/include/gmrf/gmrf.h
index 02442b1..05657fd 100644
--- a/include/gmrf/gmrf.h
+++ b/include/gmrf/gmrf.h
@@ -30,24 +30,32 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+#include <string.h>
typedef struct gmrf_context gmrf_context_t;
typedef struct gmrf_iface gmrf_iface_t;
+#define GMRF_ADDR_LEN 8
+
typedef struct gmrf_addr {
- uint8_t d[8];
+ uint8_t d[GMRF_ADDR_LEN];
} gmrf_addr_t;
static const gmrf_addr_t gmrf_addr_unspec = {};
+static inline bool gmrf_addr_equal(const gmrf_addr_t *addr1, const gmrf_addr_t *addr2) {
+ return (memcmp(addr1->d, addr2->d, GMRF_ADDR_LEN) == 0);
+}
+
+
gmrf_addr_t gmrf_iface_get_addr(gmrf_context_t *ctx, gmrf_iface_t *iface);
size_t gmrf_iface_get_mtu(gmrf_context_t *ctx, gmrf_iface_t *iface);
-bool gmrf_iface_send(gmrf_context_t *ctx, gmrf_iface_t *iface, void *data, size_t len, gmrf_addr_t dest);
-bool gmrf_iface_send_bc(gmrf_context_t *ctx, gmrf_iface_t *iface, void *data, size_t len);
+bool gmrf_iface_send(gmrf_context_t *ctx, gmrf_iface_t *iface, const void *data, size_t len, const gmrf_addr_t *dest);
+bool gmrf_iface_send_bc(gmrf_context_t *ctx, gmrf_iface_t *iface, const void *data, size_t len);
#endif /* _GMRF_GMRF_H_ */