mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-06-26 05:34:39 +08:00
21 lines
805 B
C
21 lines
805 B
C
#ifndef MESSAGE_LOG_H
|
|
#define MESSAGE_LOG_H
|
|
|
|
#include "message.h"
|
|
|
|
#define MESSAGE_LOG_MAX_LINE 2048
|
|
|
|
void message_log_format_timestamp_utc(time_t ts, char *buffer,
|
|
size_t buf_size);
|
|
|
|
/* Parse one complete messages.log v1 record. `now` is used to reject records
|
|
* outside TNT's accepted replay window. */
|
|
bool message_log_parse_record(const char *line, message_t *out, time_t now);
|
|
|
|
/* Format one messages.log v1 record. record_len receives the number of bytes
|
|
* that would be written, excluding the trailing NUL. Passing NULL/0 for the
|
|
* output buffer is allowed when only the length is needed. */
|
|
int message_log_format_record(const message_t *msg, char *buffer,
|
|
size_t buf_size, size_t *record_len);
|
|
|
|
#endif /* MESSAGE_LOG_H */
|