Lines Matching refs:conf

68 init_tcsd_config(struct tcsd_config *conf)
70 conf->port = -1;
71 conf->num_threads = -1;
72 conf->system_ps_file = NULL;
73 conf->system_ps_dir = NULL;
74 conf->firmware_log_file = NULL;
75 conf->firmware_pcrs = 0;
76 conf->kernel_log_file = NULL;
77 conf->kernel_pcrs = 0;
78 conf->platform_cred = NULL;
79 conf->conformance_cred = NULL;
80 conf->endorsement_cred = NULL;
81 memset(conf->remote_ops, 0, sizeof(conf->remote_ops));
82 conf->unset = 0xffffffff;
83 conf->exclusive_transport = 0;
84 conf->host_platform_class = NULL;
85 conf->all_platform_classes = NULL;
89 platform_class_list_append(struct tcsd_config *conf, char *specName, TSS_BOOL is_main)
117 tmp = conf->host_platform_class;
118 conf->host_platform_class = new_class;
120 tmp = conf->all_platform_classes;
121 conf->all_platform_classes = new_class;
135 config_set_defaults(struct tcsd_config *conf)
138 if (conf->unset & TCSD_OPTION_PORT)
139 conf->port = TCSD_DEFAULT_PORT;
141 if (conf->unset & TCSD_OPTION_MAX_THREADS)
142 conf->num_threads = TCSD_DEFAULT_MAX_THREADS;
144 if (conf->unset & TCSD_OPTION_FIRMWARE_PCRS)
145 conf->firmware_pcrs = TCSD_DEFAULT_FIRMWARE_PCRS;
147 if (conf->unset & TCSD_OPTION_KERNEL_PCRS)
148 conf->kernel_pcrs = TCSD_DEFAULT_KERNEL_PCRS;
151 if (conf->unset & TCSD_OPTION_SYSTEM_PSFILE) {
152 conf->system_ps_file = strdup(TCSD_DEFAULT_SYSTEM_PS_FILE);
153 conf->system_ps_dir = strdup(TCSD_DEFAULT_SYSTEM_PS_DIR);
156 if (conf->unset & TCSD_OPTION_FIRMWARE_LOGFILE)
157 conf->firmware_log_file = strdup(TCSD_DEFAULT_FIRMWARE_LOG_FILE);
159 if (conf->unset & TCSD_OPTION_KERNEL_LOGFILE)
160 conf->kernel_log_file = strdup(TCSD_DEFAULT_KERNEL_LOG_FILE);
162 if (conf->unset & TCSD_OPTION_HOST_PLATFORM_CLASS)
163 platform_class_list_append(conf, "PC_12", TRUE);
247 tcsd_set_remote_op(struct tcsd_config *conf, char *op_name)
254 tcsd_add_op(conf->remote_ops, tcsd_ops[i]->op);
265 read_conf_line(char *buf, int line_num, struct tcsd_config *conf)
292 conf->port = tmp_int;
293 conf->unset &= ~TCSD_OPTION_PORT;
303 conf->num_threads = tmp_int;
304 conf->unset &= ~TCSD_OPTION_MAX_THREADS;
308 conf->unset &= ~TCSD_OPTION_FIRMWARE_PCRS;
319 conf->firmware_pcrs |= (1 << tmp_int);
330 conf->firmware_pcrs |= (1 << tmp_int);
337 conf->unset &= ~TCSD_OPTION_KERNEL_PCRS;
348 conf->kernel_pcrs |= (1 << tmp_int);
359 conf->kernel_pcrs |= (1 << tmp_int);
385 if (conf->system_ps_file)
386 free(conf->system_ps_file);
387 if (conf->system_ps_dir)
388 free(conf->system_ps_dir);
394 conf->system_ps_dir = strdup("/");
396 conf->system_ps_dir = strdup(tmp_ptr);
398 if (conf->system_ps_dir == NULL) {
404 conf->system_ps_file = tmp_ptr;
405 conf->unset &= ~TCSD_OPTION_SYSTEM_PSFILE;
427 if (conf->kernel_log_file)
428 free(conf->kernel_log_file);
430 conf->kernel_log_file = tmp_ptr;
431 conf->unset &= ~TCSD_OPTION_KERNEL_LOGFILE;
453 if (conf->firmware_log_file)
454 free(conf->firmware_log_file);
456 conf->firmware_log_file = tmp_ptr;
457 conf->unset &= ~TCSD_OPTION_FIRMWARE_LOGFILE;
479 if (conf->platform_cred)
480 free(conf->platform_cred);
482 conf->platform_cred = tmp_ptr;
483 conf->unset &= ~TCSD_OPTION_PLATFORM_CRED;
505 if (conf->conformance_cred)
506 free(conf->conformance_cred);
508 conf->conformance_cred = tmp_ptr;
509 conf->unset &= ~TCSD_OPTION_CONFORMANCE_CRED;
531 if (conf->endorsement_cred)
532 free(conf->endorsement_cred);
534 conf->endorsement_cred = tmp_ptr;
535 conf->unset &= ~TCSD_OPTION_ENDORSEMENT_CRED;
539 conf->unset &= ~TCSD_OPTION_REMOTE_OPS;
549 if (tcsd_set_remote_op(conf, comma)) {
559 if (tcsd_set_remote_op(conf, comma)) {
572 conf->exclusive_transport = tmp_int;
573 conf->unset &= ~TCSD_OPTION_EXCLUSIVE_TRANSPORT;
578 conf->unset &= ~TCSD_OPTION_HOST_PLATFORM_CLASS;
591 if ((result = platform_class_list_append(conf, comma, TRUE))){
610 if ((result = platform_class_list_append(conf, comma,
622 if ((result = platform_class_list_append(conf, comma, FALSE))) {
639 read_conf_file(FILE *f, struct tcsd_config *conf)
646 if (read_conf_line(buf, line_num, conf))
668 conf_file_final(struct tcsd_config *conf)
670 free(conf->system_ps_file);
671 free(conf->system_ps_dir);
672 free(conf->kernel_log_file);
673 free(conf->firmware_log_file);
674 free(conf->platform_cred);
675 free(conf->conformance_cred);
676 free(conf->endorsement_cred);
677 free_platform_lists(conf->host_platform_class);
678 free_platform_lists(conf->all_platform_classes);
705 conf_file_init(struct tcsd_config *conf)
716 init_tcsd_config(conf);
730 config_set_defaults(conf);
740 /* find the gid that owns the conf file */
765 /* make sure user/group TSS owns the conf file */
784 result = read_conf_file(f, conf);
788 config_set_defaults(conf);
796 (void) memset(conf->remote_ops, 0, sizeof(conf->remote_ops));
797 conf->unset |= TCSD_OPTION_REMOTE_OPS;