diff options
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c index f936787..6598ad8 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -1041,3 +1041,17 @@ char **prne_htbt_parse_args ( return ret; } + +uint16_t prne_htbt_gen_msgid (void *ctx, uint16_t(*rnd_f)(void*)) { + return (rnd_f(ctx) % PRNE_HTBT_MSG_ID_DELTA) + PRNE_HTBT_MSG_ID_MIN; +} + +const char *prne_htbt_serrc_tostr (const prne_htbt_ser_rc_t x) { + switch (x) { + case PRNE_HTBT_SER_RC_OK: return "ok"; + case PRNE_HTBT_SER_RC_MORE_BUF: return "more buf"; + case PRNE_HTBT_SER_RC_ERRNO: return "errno"; + case PRNE_HTBT_SER_RC_FMT_ERR: return "format error"; + } + return NULL; +} |