/src/fluent-bit/include/fluent-bit/flb_config_map.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* Fluent Bit |
4 | | * ========== |
5 | | * Copyright (C) 2015-2022 The Fluent Bit Authors |
6 | | * |
7 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
8 | | * you may not use this file except in compliance with the License. |
9 | | * You may obtain a copy of the License at |
10 | | * |
11 | | * http://www.apache.org/licenses/LICENSE-2.0 |
12 | | * |
13 | | * Unless required by applicable law or agreed to in writing, software |
14 | | * distributed under the License is distributed on an "AS IS" BASIS, |
15 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | | * See the License for the specific language governing permissions and |
17 | | * limitations under the License. |
18 | | */ |
19 | | |
20 | | #ifndef FLB_CONFIG_MAP_H |
21 | | #define FLB_CONFIG_MAP_H |
22 | | |
23 | | #include <fluent-bit/flb_info.h> |
24 | | #include <fluent-bit/flb_slist.h> |
25 | | #include <fluent-bit/flb_sds.h> |
26 | | #include <monkey/mk_core.h> |
27 | | |
28 | | /* Configuration types */ |
29 | 188k | #define FLB_CONFIG_MAP_STR 0 /* string */ |
30 | 37.3k | #define FLB_CONFIG_MAP_STR_PREFIX 1 /* string that starts with */ |
31 | 36.8k | #define FLB_CONFIG_MAP_INT 2 /* integer */ |
32 | 35.6k | #define FLB_CONFIG_MAP_BOOL 3 /* boolean */ |
33 | 30.9k | #define FLB_CONFIG_MAP_DOUBLE 4 /* double */ |
34 | 28.2k | #define FLB_CONFIG_MAP_SIZE 5 /* string size to integer (e.g: 2M) */ |
35 | 26.6k | #define FLB_CONFIG_MAP_TIME 6 /* string time to integer seconds (e.g: 2H) */ |
36 | 461 | #define FLB_CONFIG_MAP_DEPRECATED 7 /* for deprecated parameter */ |
37 | | |
38 | 151k | #define FLB_CONFIG_MAP_CLIST 30 /* comma separated list of strings */ |
39 | 56 | #define FLB_CONFIG_MAP_CLIST_1 31 /* split up to 1 node + remaining data */ |
40 | 56 | #define FLB_CONFIG_MAP_CLIST_2 32 /* split up to 2 nodes + remaining data */ |
41 | 56 | #define FLB_CONFIG_MAP_CLIST_3 33 /* split up to 3 nodes + remaining data */ |
42 | 14 | #define FLB_CONFIG_MAP_CLIST_4 34 /* split up to 4 nodes + remaining data */ |
43 | | |
44 | 10.4k | #define FLB_CONFIG_MAP_SLIST 40 /* empty space separated list of strings */ |
45 | 112 | #define FLB_CONFIG_MAP_SLIST_1 41 /* split up to 1 node + remaining data */ |
46 | 112 | #define FLB_CONFIG_MAP_SLIST_2 42 /* split up to 2 nodes + remaining data */ |
47 | 112 | #define FLB_CONFIG_MAP_SLIST_3 43 /* split up to 3 nodes + remaining data */ |
48 | 6.96k | #define FLB_CONFIG_MAP_SLIST_4 44 /* split up to 4 nodes + remaining data */ |
49 | | |
50 | 305k | #define FLB_CONFIG_MAP_MULT 1 |
51 | | |
52 | | struct flb_config_map_val { |
53 | | union { |
54 | | int i_num; /* FLB_CONFIG_MAP_INT */ |
55 | | char boolean; /* FLB_CONFIG_MAP_BOOL */ |
56 | | double d_num; /* FLB_CONFIG_MAP_DOUBLE */ |
57 | | size_t s_num; /* FLB_CONFIG_MAP_SIZE */ |
58 | | flb_sds_t str; /* FLB_CONFIG_MAP_STR */ |
59 | | struct mk_list *list; /* FLB_CONFIG_MAP_CLIST and FLB_CONFIG_MAP_SLIST */ |
60 | | } val; |
61 | | struct mk_list *mult; |
62 | | struct mk_list _head; /* Link to list if this entry is a 'multiple' entry */ |
63 | | }; |
64 | | |
65 | | struct flb_config_map { |
66 | | /* Public fields used by plugins at registration */ |
67 | | int type; /* type */ |
68 | | flb_sds_t name; /* property name */ |
69 | | flb_sds_t def_value; /* default value */ |
70 | | int flags; /* option flags (e.g: multiple entries allowed) */ |
71 | | int set_property; /* set context property ? (use offset ?) */ |
72 | | uintptr_t offset; /* member offset */ |
73 | | flb_sds_t desc; /* description */ |
74 | | |
75 | | struct flb_config_map_val value; /* lookup value */ |
76 | | struct mk_list _head; |
77 | | }; |
78 | | |
79 | | #define flb_config_map_foreach(curr, v, head) \ |
80 | 0 | for (curr = (head)->next, v = mk_list_entry(curr, \ |
81 | 0 | struct flb_config_map_val, \ |
82 | 0 | _head); \ |
83 | 0 | curr != (head); curr = curr->next, v = mk_list_entry(curr, \ |
84 | 0 | struct flb_config_map_val, \ |
85 | 0 | _head)) |
86 | | |
87 | | static inline int flb_config_map_mult_type(int type) |
88 | 0 | { |
89 | 0 | if (type >= FLB_CONFIG_MAP_CLIST && type <= FLB_CONFIG_MAP_CLIST_4) { |
90 | 0 | return FLB_CONFIG_MAP_CLIST; |
91 | 0 | } |
92 | 0 |
|
93 | 0 | if (type >= FLB_CONFIG_MAP_SLIST && type <= FLB_CONFIG_MAP_SLIST_4) { |
94 | 0 | return FLB_CONFIG_MAP_SLIST; |
95 | 0 | } |
96 | 0 |
|
97 | 0 | return -1; |
98 | 0 | } Unexecuted instantiation: flb_utils.c:flb_config_map_mult_type Unexecuted instantiation: flb_pipe.c:flb_config_map_mult_type Unexecuted instantiation: flb_time.c:flb_config_map_mult_type Unexecuted instantiation: config_random_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: flb_config.c:flb_config_map_mult_type Unexecuted instantiation: flb_scheduler.c:flb_config_map_mult_type Unexecuted instantiation: flb_plugin.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser_regex.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser_json.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser_decoder.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser_ltsv.c:flb_config_map_mult_type Unexecuted instantiation: flb_parser_logfmt.c:flb_config_map_mult_type Unexecuted instantiation: flb_plugin_proxy.c:flb_config_map_mult_type Unexecuted instantiation: flb_api.c:flb_config_map_mult_type Unexecuted instantiation: flb_pack.c:flb_config_map_mult_type Unexecuted instantiation: flb_input.c:flb_config_map_mult_type Unexecuted instantiation: flb_input_log.c:flb_config_map_mult_type Unexecuted instantiation: flb_input_thread.c:flb_config_map_mult_type Unexecuted instantiation: flb_output.c:flb_config_map_mult_type Unexecuted instantiation: flb_output_thread.c:flb_config_map_mult_type Unexecuted instantiation: flb_config_map.c:flb_config_map_mult_type Unexecuted instantiation: flb_network.c:flb_config_map_mult_type Unexecuted instantiation: flb_engine.c:flb_config_map_mult_type Unexecuted instantiation: flb_engine_dispatch.c:flb_config_map_mult_type Unexecuted instantiation: flb_task.c:flb_config_map_mult_type Unexecuted instantiation: flb_storage.c:flb_config_map_mult_type Unexecuted instantiation: flb_downstream.c:flb_config_map_mult_type Unexecuted instantiation: flb_upstream.c:flb_config_map_mult_type Unexecuted instantiation: flb_router.c:flb_config_map_mult_type Unexecuted instantiation: flb_sosreport.c:flb_config_map_mult_type Unexecuted instantiation: flb_strptime.c:flb_config_map_mult_type Unexecuted instantiation: flb_routes_mask.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_stream.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_group.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_rule.c:flb_config_map_mult_type Unexecuted instantiation: flb_tls.c:flb_config_map_mult_type Unexecuted instantiation: flb_metrics_exporter.c:flb_config_map_mult_type Unexecuted instantiation: flb_chunk_trace.c:flb_config_map_mult_type Unexecuted instantiation: flb_lib.c:flb_config_map_mult_type Unexecuted instantiation: flb_custom.c:flb_config_map_mult_type Unexecuted instantiation: flb_input_chunk.c:flb_config_map_mult_type Unexecuted instantiation: flb_filter.c:flb_config_map_mult_type Unexecuted instantiation: flb_io.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_cri.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_docker.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_python.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_java.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_go.c:flb_config_map_mult_type Unexecuted instantiation: flb_ml_parser_ruby.c:flb_config_map_mult_type Unexecuted instantiation: flb_record_accessor.c:flb_config_map_mult_type Unexecuted instantiation: flb_sds_list.c:flb_config_map_mult_type Unexecuted instantiation: flb_hs_endpoints.c:flb_config_map_mult_type Unexecuted instantiation: calyptia.c:flb_config_map_mult_type Unexecuted instantiation: docker_events.c:flb_config_map_mult_type Unexecuted instantiation: docker_events_config.c:flb_config_map_mult_type Unexecuted instantiation: ne.c:flb_config_map_mult_type Unexecuted instantiation: ne_cpu.c:flb_config_map_mult_type Unexecuted instantiation: ne_meminfo.c:flb_config_map_mult_type Unexecuted instantiation: ne_diskstats.c:flb_config_map_mult_type Unexecuted instantiation: ne_filesystem.c:flb_config_map_mult_type Unexecuted instantiation: ne_uname.c:flb_config_map_mult_type Unexecuted instantiation: ne_stat_linux.c:flb_config_map_mult_type Unexecuted instantiation: ne_vmstat_linux.c:flb_config_map_mult_type Unexecuted instantiation: ne_netdev.c:flb_config_map_mult_type Unexecuted instantiation: ne_time.c:flb_config_map_mult_type Unexecuted instantiation: ne_loadavg.c:flb_config_map_mult_type Unexecuted instantiation: ne_filefd_linux.c:flb_config_map_mult_type Unexecuted instantiation: ne_utils.c:flb_config_map_mult_type Unexecuted instantiation: ne_config.c:flb_config_map_mult_type Unexecuted instantiation: metrics.c:flb_config_map_mult_type Unexecuted instantiation: prom_scrape.c:flb_config_map_mult_type Unexecuted instantiation: emitter.c:flb_config_map_mult_type Unexecuted instantiation: in_dummy.c:flb_config_map_mult_type Unexecuted instantiation: http.c:flb_config_map_mult_type Unexecuted instantiation: http_conn.c:flb_config_map_mult_type Unexecuted instantiation: http_prot.c:flb_config_map_mult_type Unexecuted instantiation: http_config.c:flb_config_map_mult_type Unexecuted instantiation: statsd.c:flb_config_map_mult_type Unexecuted instantiation: opentelemetry.c:flb_config_map_mult_type Unexecuted instantiation: opentelemetry_config.c:flb_config_map_mult_type Unexecuted instantiation: opentelemetry_prot.c:flb_config_map_mult_type Unexecuted instantiation: in_elasticsearch.c:flb_config_map_mult_type Unexecuted instantiation: in_elasticsearch_config.c:flb_config_map_mult_type Unexecuted instantiation: in_elasticsearch_bulk_conn.c:flb_config_map_mult_type Unexecuted instantiation: in_elasticsearch_bulk_prot.c:flb_config_map_mult_type Unexecuted instantiation: event_test.c:flb_config_map_mult_type Unexecuted instantiation: event_type.c:flb_config_map_mult_type Unexecuted instantiation: sb.c:flb_config_map_mult_type Unexecuted instantiation: nginx.c:flb_config_map_mult_type Unexecuted instantiation: udp.c:flb_config_map_mult_type Unexecuted instantiation: udp_conn.c:flb_config_map_mult_type Unexecuted instantiation: udp_config.c:flb_config_map_mult_type Unexecuted instantiation: in_exec_wasi.c:flb_config_map_mult_type Unexecuted instantiation: in_lib.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob_uri.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob_conf.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob_http.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob_appendblob.c:flb_config_map_mult_type Unexecuted instantiation: azure_blob_blockblob.c:flb_config_map_mult_type Unexecuted instantiation: azure_kusto.c:flb_config_map_mult_type Unexecuted instantiation: azure_kusto_conf.c:flb_config_map_mult_type Unexecuted instantiation: azure_kusto_ingest.c:flb_config_map_mult_type Unexecuted instantiation: exit.c:flb_config_map_mult_type Unexecuted instantiation: http_conf.c:flb_config_map_mult_type Unexecuted instantiation: logdna.c:flb_config_map_mult_type Unexecuted instantiation: opensearch.c:flb_config_map_mult_type Unexecuted instantiation: os_conf.c:flb_config_map_mult_type Unexecuted instantiation: skywalking.c:flb_config_map_mult_type Unexecuted instantiation: stdout.c:flb_config_map_mult_type Unexecuted instantiation: udp_conf.c:flb_config_map_mult_type Unexecuted instantiation: td.c:flb_config_map_mult_type Unexecuted instantiation: td_http.c:flb_config_map_mult_type Unexecuted instantiation: td_config.c:flb_config_map_mult_type Unexecuted instantiation: out_lib.c:flb_config_map_mult_type Unexecuted instantiation: websocket.c:flb_config_map_mult_type Unexecuted instantiation: websocket_conf.c:flb_config_map_mult_type Unexecuted instantiation: cloudwatch_logs.c:flb_config_map_mult_type Unexecuted instantiation: cloudwatch_api.c:flb_config_map_mult_type Unexecuted instantiation: firehose.c:flb_config_map_mult_type Unexecuted instantiation: firehose_api.c:flb_config_map_mult_type Unexecuted instantiation: kinesis.c:flb_config_map_mult_type Unexecuted instantiation: kinesis_api.c:flb_config_map_mult_type Unexecuted instantiation: opentelemetry_conf.c:flb_config_map_mult_type Unexecuted instantiation: prom.c:flb_config_map_mult_type Unexecuted instantiation: prom_http.c:flb_config_map_mult_type Unexecuted instantiation: remote_write.c:flb_config_map_mult_type Unexecuted instantiation: remote_write_conf.c:flb_config_map_mult_type Unexecuted instantiation: s3.c:flb_config_map_mult_type Unexecuted instantiation: s3_store.c:flb_config_map_mult_type Unexecuted instantiation: s3_multipart.c:flb_config_map_mult_type Unexecuted instantiation: vivo.c:flb_config_map_mult_type Unexecuted instantiation: vivo_http.c:flb_config_map_mult_type Unexecuted instantiation: vivo_stream.c:flb_config_map_mult_type Unexecuted instantiation: alter_size.c:flb_config_map_mult_type Unexecuted instantiation: aws.c:flb_config_map_mult_type Unexecuted instantiation: checklist.c:flb_config_map_mult_type Unexecuted instantiation: ecs.c:flb_config_map_mult_type Unexecuted instantiation: filter_modifier.c:flb_config_map_mult_type Unexecuted instantiation: throttle.c:flb_config_map_mult_type Unexecuted instantiation: window.c:flb_config_map_mult_type Unexecuted instantiation: type_converter.c:flb_config_map_mult_type Unexecuted instantiation: kubernetes.c:flb_config_map_mult_type Unexecuted instantiation: kube_conf.c:flb_config_map_mult_type Unexecuted instantiation: kube_meta.c:flb_config_map_mult_type Unexecuted instantiation: kube_regex.c:flb_config_map_mult_type Unexecuted instantiation: kube_property.c:flb_config_map_mult_type Unexecuted instantiation: modify.c:flb_config_map_mult_type Unexecuted instantiation: ml.c:flb_config_map_mult_type Unexecuted instantiation: ml_concat.c:flb_config_map_mult_type Unexecuted instantiation: nest.c:flb_config_map_mult_type Unexecuted instantiation: filter_parser.c:flb_config_map_mult_type Unexecuted instantiation: expect.c:flb_config_map_mult_type Unexecuted instantiation: grep.c:flb_config_map_mult_type Unexecuted instantiation: rewrite_tag.c:flb_config_map_mult_type Unexecuted instantiation: log_to_metrics.c:flb_config_map_mult_type Unexecuted instantiation: geoip2.c:flb_config_map_mult_type Unexecuted instantiation: nightfall.c:flb_config_map_mult_type Unexecuted instantiation: nightfall_api.c:flb_config_map_mult_type Unexecuted instantiation: filter_wasm.c:flb_config_map_mult_type Unexecuted instantiation: health.c:flb_config_map_mult_type Unexecuted instantiation: trace.c:flb_config_map_mult_type Unexecuted instantiation: uptime.c:flb_config_map_mult_type Unexecuted instantiation: storage.c:flb_config_map_mult_type Unexecuted instantiation: plugins.c:flb_config_map_mult_type Unexecuted instantiation: flb_pack_gelf.c:flb_config_map_mult_type Unexecuted instantiation: flb_input_metric.c:flb_config_map_mult_type Unexecuted instantiation: flb_input_trace.c:flb_config_map_mult_type Unexecuted instantiation: flb_signv4.c:flb_config_map_mult_type Unexecuted instantiation: flb_sqldb.c:flb_config_map_mult_type Unexecuted instantiation: go.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_util.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials_sts.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials_ec2.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_imds.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials_http.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials_profile.c:flb_config_map_mult_type Unexecuted instantiation: flb_aws_credentials_process.c:flb_config_map_mult_type Unexecuted instantiation: flb_wasm.c:flb_config_map_mult_type Unexecuted instantiation: aws_util_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: config_map_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: parser_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: http_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: record_ac_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: parse_json_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: parse_logfmt_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: engine_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: filter_stdout_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: flb_json_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: msgpack_to_gelf_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: pack_json_state_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: multiline_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: strp_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: parse_ltsv_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: aws_credentials_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: msgpack_parse_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: signv4_fuzzer.c:flb_config_map_mult_type Unexecuted instantiation: config_fuzzer.c:flb_config_map_mult_type |
99 | | |
100 | | int flb_config_map_properties_check(char *context_name, |
101 | | struct mk_list *in_properties, |
102 | | struct mk_list *map); |
103 | | struct mk_list *flb_config_map_create(struct flb_config *config, |
104 | | struct flb_config_map *map); |
105 | | void flb_config_map_destroy(struct mk_list *list); |
106 | | int flb_config_map_expected_values(int type); |
107 | | int flb_config_map_set(struct mk_list *properties, struct mk_list *map, void *context); |
108 | | |
109 | | #endif |