]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add binary to print out structure sizes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Jan 2022 21:08:28 +0000 (15:08 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 28 Jan 2022 21:08:28 +0000 (15:08 -0600)
src/bin/radsizes.mk [new file with mode: 0644]
src/bin/sizes.c [new file with mode: 0644]

diff --git a/src/bin/radsizes.mk b/src/bin/radsizes.mk
new file mode 100644 (file)
index 0000000..84c9146
--- /dev/null
@@ -0,0 +1,2 @@
+TARGET         := radsizes
+SOURCES                := sizes.c
diff --git a/src/bin/sizes.c b/src/bin/sizes.c
new file mode 100644 (file)
index 0000000..10d27a0
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+#include <freeradius-devel/unlang/xlat_priv.h>
+#include <freeradius-devel/server/tmpl.h>
+#include <freeradius-devel/util/value.h>
+
+int main(UNUSED int argc, UNUSED char **argv)
+{
+#define SIZEOF(_struct)        printf("%s %zu bytes\n", STRINGIFY(_struct), sizeof(_struct))
+
+       SIZEOF(xlat_exp_t);
+       SIZEOF(xlat_call_t);
+       SIZEOF(tmpl_t);
+       SIZEOF(tmpl_rules_t);
+       SIZEOF(tmpl_attr_rules_t);
+       SIZEOF(tmpl_xlat_rules_t);
+       SIZEOF(fr_value_box_t);
+       SIZEOF(fr_pair_t);
+
+       return 0;
+}