blob: 155f413b111f5f807ecde3ea52432c479e8375c4 [file] [log] [blame]
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +02001#pragma once
2
Pau Espin Pedrol6a305fe2019-05-24 19:58:20 +02003#include <osmocom/core/rate_ctr.h>
4#include <osmocom/vty/command.h>
5
6enum TrxCtr {
Pau Espin Pedrol6a305fe2019-05-24 19:58:20 +02007 TRX_CTR_RX_OVERRUNS,
8 TRX_CTR_TX_UNDERRUNS,
9 TRX_CTR_RX_DROP_EV,
10 TRX_CTR_RX_DROP_SMPL,
Pau Espin Pedrol68a78092019-07-29 20:11:25 +020011 TRX_CTR_TX_DROP_EV,
12 TRX_CTR_TX_DROP_SMPL,
Pau Espin Pedrol6a305fe2019-05-24 19:58:20 +020013};
14
15struct ctr_threshold {
16 /*! Linked list of all counter groups in the system */
17 struct llist_head list;
18 enum rate_ctr_intv intv;
19 enum TrxCtr ctr_id;
20 uint32_t val;
21};
22
23extern const struct value_string rate_ctr_intv[];
24extern const struct value_string trx_chan_ctr_names[];
25
Pau Espin Pedrol4456b6f2019-05-24 16:54:19 +020026struct trx_ctx;
27void trx_rate_ctr_init(void *ctx, struct trx_ctx* trx_ctx);
Pau Espin Pedrol6a305fe2019-05-24 19:58:20 +020028void trx_rate_ctr_threshold_add(struct ctr_threshold *ctr);
29int trx_rate_ctr_threshold_del(struct ctr_threshold *del_ctr);
30void trx_rate_ctr_threshold_write_config(struct vty *vty, char *indent_prefix);