- /* create a Trust Router instance */
- if (NULL == (tr = tr_create())) {
- fprintf(stderr, "Unable to create Trust Router instance, exiting.\n");
+ /* we're going to be multithreaded, so disable null context tracking */
+ talloc_set_abort_fn(tr_abort);
+ talloc_disable_null_tracking();
+#if TALLOC_DEBUG_ENABLE
+ talloc_set_log_fn(tr_talloc_log);
+#endif /* TALLOC_DEBUG_ENABLE */
+ main_ctx=talloc_new(NULL);
+
+ /* Use standalone logging */
+ tr_log_open();
+
+ /***** parse command-line arguments *****/
+ /* set defaults */
+ opts.version_requested=0;
+ opts.config_dir=".";
+
+ /* parse the command line*/
+ argp_parse(&argp, argc, argv, 0, 0, &opts);
+
+ /* process options */
+ remove_trailing_slash(opts.config_dir);
+
+
+ /***** Print version info *****/
+ print_version_info();
+ if (opts.version_requested)
+ return 0; /* requested that we print version and exit */
+
+ /***** create a Trust Router instance *****/
+ if (NULL == (tr = tr_create(main_ctx))) {
+ tr_crit("Unable to create Trust Router instance, exiting.");