Implement packet queueing
This commit is contained in:
parent
e7f622e99d
commit
73071f9961
4 changed files with 47 additions and 13 deletions
|
@ -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_ */
|
||||
|
|
Reference in a new issue