|
24 | 24 | #include <fluent-bit/flb_sds.h> |
25 | 25 | #include <fluent-bit/flb_config.h> |
26 | 26 | #include <fluent-bit/flb_routes_mask.h> |
| 27 | +#include <stdint.h> |
| 28 | + |
| 29 | +struct cio_chunk; |
27 | 30 |
|
28 | 31 | #include <monkey/mk_core.h> |
29 | 32 | #include <msgpack.h> |
|
42 | 45 | /* Number of bytes reserved for Metadata Header on Chunks */ |
43 | 46 | #define FLB_INPUT_CHUNK_META_HEADER 4 |
44 | 47 |
|
| 48 | +/* Chunk metadata flags */ |
| 49 | +#define FLB_CHUNK_FLAG_DIRECT_ROUTES (1 << 0) |
| 50 | +#define FLB_CHUNK_FLAG_DIRECT_ROUTE_LABELS (1 << 1) |
| 51 | +#define FLB_CHUNK_FLAG_DIRECT_ROUTE_WIDE_IDS (1 << 2) |
| 52 | + |
| 53 | +struct flb_chunk_direct_route { |
| 54 | + uint32_t id; |
| 55 | + uint16_t label_length; |
| 56 | + const char *label; |
| 57 | +}; |
| 58 | + |
45 | 59 | /* Chunks magic bytes (starting from Fluent Bit v1.8.10) */ |
46 | 60 | #define FLB_INPUT_CHUNK_MAGIC_BYTE_0 (unsigned char) 0xF1 |
47 | 61 | #define FLB_INPUT_CHUNK_MAGIC_BYTE_1 (unsigned char) 0x77 |
@@ -110,6 +124,18 @@ int flb_input_chunk_get_event_type(struct flb_input_chunk *ic); |
110 | 124 | int flb_input_chunk_get_tag(struct flb_input_chunk *ic, |
111 | 125 | const char **tag_buf, int *tag_len); |
112 | 126 |
|
| 127 | +int flb_input_chunk_write_header_v2(struct cio_chunk *chunk, |
| 128 | + int event_type, |
| 129 | + char *tag, int tag_len, |
| 130 | + const struct flb_chunk_direct_route *routes, |
| 131 | + int route_count); |
| 132 | +int flb_input_chunk_has_direct_routes(struct flb_input_chunk *ic); |
| 133 | +int flb_input_chunk_get_direct_routes(struct flb_input_chunk *ic, |
| 134 | + struct flb_chunk_direct_route **routes, |
| 135 | + int *route_count); |
| 136 | +void flb_input_chunk_destroy_direct_routes(struct flb_chunk_direct_route *routes, |
| 137 | + int route_count); |
| 138 | + |
113 | 139 | void flb_input_chunk_ring_buffer_cleanup(struct flb_input_instance *ins); |
114 | 140 | void flb_input_chunk_ring_buffer_collector(struct flb_config *ctx, void *data); |
115 | 141 | ssize_t flb_input_chunk_get_size(struct flb_input_chunk *ic); |
|
0 commit comments