[sr-dev] git:master: core: new command line option -I

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 27 16:16:47 CEST 2011


Module: sip-router
Branch: master
Commit: f5803916a37e0f2151335e65283060c6a88de9e0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f5803916a37e0f2151335e65283060c6a88de9e0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Oct 27 05:09:03 2011 +0200

core: new command line option -I

- print details about default internal attributes

---

 main.c |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/main.c b/main.c
index 5e4defa..741bdad 100644
--- a/main.c
+++ b/main.c
@@ -282,6 +282,34 @@ void print_ct_constants()
 #endif
 }
 
+/* print compile-time constants */
+void print_internals()
+{
+	printf("Print out of %s internals\n", NAME);
+	printf("  Version: %s\n", full_version);
+	printf("  Default config: %s\n", CFG_FILE);
+	printf("  Default paths to modules: %s\n", MODS_DIR);
+	printf("  Compile flags: %s\n", ver_flags );
+	printf("  MAX_RECV_BUFFER_SIZE=%d\n", MAX_RECV_BUFFER_SIZE);
+	printf("  MAX_LISTEN=%d\n", MAX_LISTEN);
+	printf("  MAX_URI_SIZE=%d\n", MAX_URI_SIZE);
+	printf("  BUF_SIZE=%d\n", BUF_SIZE);
+	printf("  DEFAULT PKG_SIZE=%uMB\n", PKG_MEM_SIZE);
+#ifdef SHM_MEM
+	printf("  DEFAULT SHM_SIZE=%uMB\n", SHM_MEM_SIZE);
+#endif
+#ifdef ADAPTIVE_WAIT
+	printf("  ADAPTIVE_WAIT_LOOPS=%d\n", ADAPTIVE_WAIT_LOOPS);
+#endif
+#ifdef USE_TCP
+	printf("  TCP poll methods: %s\n", poll_support);
+#endif
+	printf("  Source code revision ID: %s\n", ver_id);
+	printf("  Compiled with: %s\n", ver_compiler);
+	printf("  Compiled on: %s\n", ver_compiled_time);
+	printf("Thank you for flying %s!\n", NAME);
+}
+
 /* debugging function */
 /*
 void receive_stdin_loop()
@@ -1788,7 +1816,7 @@ int main(int argc, char** argv)
 
 	daemon_status_init();
 	/* command line options */
-	options=  ":f:cm:M:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
+	options=  ":f:cm:M:dVIhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:"
 #ifdef STATS
 		"s:"
 #endif
@@ -1898,6 +1926,10 @@ int main(int argc, char** argv)
 
 					exit(0);
 					break;
+			case 'I':
+					print_internals();
+					exit(0);
+					break;
 			case 'E':
 					/* ignore it, was parsed immediately after startup */
 					break;
@@ -2048,6 +2080,7 @@ try_again:
 			case 'M':
 			case 'd':
 			case 'V':
+			case 'I':
 			case 'h':
 			case 'O':
 			case 'A':




More information about the sr-dev mailing list