-/* $OpenBSD: bgpctl.h,v 1.19 2023/01/24 11:29:34 claudio Exp $ */
+/* $OpenBSD: bgpctl.h,v 1.20 2023/03/28 12:07:09 claudio Exp $ */
/*
* Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org>
};
extern const struct output show_output, json_output, ometric_output;
-extern const size_t pt_sizes[];
#define EOL0(flag) ((flag & F_CTL_SSV) ? ';' : '\n')
-/* $OpenBSD: output.c,v 1.37 2023/03/09 13:13:14 claudio Exp $ */
+/* $OpenBSD: output.c,v 1.38 2023/03/28 12:07:09 claudio Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
#include "bgpctl.h"
#include "parser.h"
-const size_t pt_sizes[AID_MAX] = AID_PTSIZE;
-
static void
show_head(struct parse_result *res)
{
for (i = 0; i < AID_MAX; i++) {
if (stats->pt_cnt[i] == 0)
continue;
- pts += stats->pt_cnt[i] * pt_sizes[i];
+ pts += stats->pt_size[i];
printf("%10lld %s network entries using %s of memory\n",
stats->pt_cnt[i], aid_vals[i].name,
- fmt_mem(stats->pt_cnt[i] * pt_sizes[i]));
+ fmt_mem(stats->pt_size[i]));
}
printf("%10lld rib entries using %s of memory\n",
stats->rib_cnt, fmt_mem(stats->rib_cnt *
-/* $OpenBSD: output_json.c,v 1.30 2023/03/09 13:13:14 claudio Exp $ */
+/* $OpenBSD: output_json.c,v 1.31 2023/03/28 12:07:09 claudio Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
for (i = 0; i < AID_MAX; i++) {
if (stats->pt_cnt[i] == 0)
continue;
- pts += stats->pt_cnt[i] * pt_sizes[i];
+ pts += stats->pt_size[i];
json_rib_mem_element(aid_vals[i].name, stats->pt_cnt[i],
- stats->pt_cnt[i] * pt_sizes[i], UINT64_MAX);
+ stats->pt_size[i], UINT64_MAX);
}
json_rib_mem_element("rib", stats->rib_cnt,
stats->rib_cnt * sizeof(struct rib_entry), UINT64_MAX);
-/* $OpenBSD: output_ometric.c,v 1.10 2022/12/12 09:51:04 claudio Exp $ */
+/* $OpenBSD: output_ometric.c,v 1.11 2023/03/28 12:07:09 claudio Exp $ */
/*
* Copyright (c) 2022 Claudio Jeker <claudio@openbsd.org>
for (i = 0; i < AID_MAX; i++) {
if (stats->pt_cnt[i] == 0)
continue;
- pts += stats->pt_cnt[i] * pt_sizes[i];
+ pts += stats->pt_size[i];
ometric_rib_mem_element(aid_vals[i].name, stats->pt_cnt[i],
- stats->pt_cnt[i] * pt_sizes[i], UINT64_MAX);
+ stats->pt_size[i], UINT64_MAX);
}
ometric_rib_mem_element("rib", stats->rib_cnt,
stats->rib_cnt * sizeof(struct rib_entry), UINT64_MAX);