1 /* Copyright (c) 2020-2021, The Tor Project, Inc. */ 2 /* See LICENSE for licensing information */ 3 4 /** 5 * @file metrics.h 6 * @brief Header for feature/metrics/metrics.c 7 **/ 8 9 #ifndef TOR_FEATURE_METRICS_METRICS_H 10 #define TOR_FEATURE_METRICS_METRICS_H 11 12 #include "lib/buf/buffers.h" 13 #include "lib/container/smartlist.h" 14 15 #include "app/config/or_options_st.h" 16 17 #include "lib/metrics/metrics_common.h" 18 19 struct connection_t; 20 21 /* Initializer / Cleanup. */ 22 void metrics_init(void); 23 void metrics_cleanup(void); 24 25 /* Accessors. */ 26 buf_t *metrics_get_output(const metrics_format_t fmt); 27 28 /* Connection. */ 29 int metrics_connection_process_inbuf(struct connection_t *conn); 30 int metrics_connection_reached_eof(struct connection_t *conn); 31 int metrics_connection_finished_flushing(struct connection_t *conn); 32 33 /* Configuration. */ 34 int metrics_parse_ports(or_options_t *options, smartlist_t *ports, 35 char **err_msg_out); 36 37 #endif /* !defined(TOR_FEATURE_METRICS_METRICS_H) */ 38