diff options
author | 2015-05-20 21:38:40 +0200 | |
---|---|---|
committer | 2015-05-20 21:38:40 +0200 | |
commit | faa1bb4ebcb69df870737b5ecc003e2e5ca1f1ed (patch) | |
tree | 8fdb7cf48720075cc3e81bb36164da9d7b66c8b0 | |
parent | fix tag define (diff) | |
download | OpenSMTPD-faa1bb4ebcb69df870737b5ecc003e2e5ca1f1ed.tar.xz OpenSMTPD-faa1bb4ebcb69df870737b5ecc003e2e5ca1f1ed.zip |
show sizes to debug size of structures
-rw-r--r-- | smtpd/smtpctl.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/smtpd/smtpctl.c b/smtpd/smtpctl.c index abb61cc4..0f1d879b 100644 --- a/smtpd/smtpctl.c +++ b/smtpd/smtpctl.c @@ -699,6 +699,31 @@ do_show_routes(int argc, struct parameter *argv) return (0); } +#if 1 +static int +do_show_sizes(int argc, struct parameter *argv) +{ + printf("struct userinfo=%ld\n", sizeof (struct userinfo)); + printf("struct netaddr=%ld\n", sizeof (struct netaddr)); + printf("struct relayhost=%ld\n", sizeof (struct relayhost)); + printf("struct credentials=%ld\n", sizeof (struct credentials)); + printf("struct destination=%ld\n", sizeof (struct destination)); + printf("struct source=%ld\n", sizeof (struct source)); + printf("struct addrname=%ld\n", sizeof (struct addrname)); + printf("union lookup=%ld\n", sizeof (union lookup)); + printf("struct delivery_mda=%ld\n", sizeof (struct delivery_mda)); + printf("struct delivery_mta=%ld\n", sizeof (struct delivery_mta)); + printf("struct envelope=%ld\n", sizeof (struct envelope)); + printf("struct forward_req=%ld\n", sizeof (struct forward_req)); + printf("struct deliver=%ld\n", sizeof (struct deliver)); + printf("struct bounce_req_msg=%ld\n", sizeof (struct bounce_req_msg)); + printf("struct ca_cert_req_msg=%ld\n", sizeof (struct ca_cert_req_msg)); + printf("struct ca_vrfy_req_msg=%ld\n", sizeof (struct ca_vrfy_req_msg)); + return 0; +} +#endif + + static int do_show_stats(int argc, struct parameter *argv) { @@ -990,6 +1015,12 @@ main(int argc, char **argv) cmd_install("untrace <str>", do_untrace); cmd_install("update table <str>", do_update_table); +#if 1 + /* print size of various structures */ + cmd_install("show sizes", do_show_sizes); +#endif + + if (strcmp(__progname, "mailq") == 0) return cmd_run(2, argv_mailq); if (strcmp(__progname, "smtpctl") == 0) |