11#ifndef ASRT_DIAG_PROTO_H
12#define ASRT_DIAG_PROTO_H
18#include "../asrtl/chann.h"
19#include "../asrtl/status.h"
20#include "../asrtl/util.h"
22enum asrt_diag_message_id_e
24 ASRT_DIAG_MSG_RECORD = 0x01,
27typedef uint8_t asrt_diag_message_id;
43 uint8_t* p = msg->hdr;
44 *p++ = ASRT_DIAG_MSG_RECORD;
45 asrt_add_u32( &p, line );
46 size_t file_len = strlen( file );
47 if ( file_len > UINT8_MAX ) {
48 file =
"filename too long";
49 file_len = strlen( file );
51 *p++ = (uint8_t) file_len;
54 (
struct asrt_span ){ .
b = (uint8_t*) file, .
e = (uint8_t*) file + file_len };
55 uint32_t rest_count = 1;
58 .
b = (uint8_t*) extra, .
e = (uint8_t*) extra + strlen( extra ) };
63 .e = msg->hdr +
sizeof msg->hdr,
Definition: diag_proto.h:30
An outgoing message request placed in a module's send queue.
Definition: chann.h:64
struct asrt_span_span buff
Message payload (scatter-gather).
Definition: chann.h:65
Scatter-gather buffer: a primary byte range [b, e) followed by rest_count additional spans.
Definition: span.h:37
uint32_t rest_count
Number of entries in rest.
Definition: span.h:41
uint8_t * b
Primary buffer start.
Definition: span.h:38
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee ...
Definition: span.h:23
uint8_t * b
Pointer to the first byte.
Definition: span.h:24
uint8_t * e
One-past-the-end pointer.
Definition: span.h:25