Lines Matching +defs:error +defs:target
51 static struct target *target = NULL;
106 target
164 int error;
166 error = isns_new(conf, $2);
168 if (error != 0)
248 int error;
250 error = auth_group_set_type(auth_group, $2);
252 if (error != 0)
384 int error;
386 error = portal_group_set_filter(portal_group, $2);
388 if (error != 0)
402 int error;
404 error = portal_group_add_listen(portal_group, $2, false);
406 if (error != 0)
413 int error;
415 error = portal_group_add_listen(portal_group, $2, true);
417 if (error != 0)
424 int error;
426 error = portal_group_set_offload(portal_group, $2);
428 if (error != 0)
447 int error;
449 error = portal_group_set_redirection(portal_group, $2);
451 if (error != 0)
548 target: TARGET target_name
551 target = NULL;
557 target = target_new(conf, $1);
559 if (target == NULL)
599 if (target->t_alias != NULL) {
600 log_warnx("alias for target \"%s\" "
601 "specified more than once", target->t_name);
604 target->t_alias = $2;
610 if (target->t_auth_group != NULL) {
611 if (target->t_auth_group->ag_name != NULL)
612 log_warnx("auth-group for target \"%s\" "
613 "specified more than once", target->t_name);
616 "authorisations for target \"%s\"",
617 target->t_name);
620 target->t_auth_group = auth_group_find(conf, $2);
621 if (target->t_auth_group == NULL) {
622 log_warnx("unknown auth-group \"%s\" for target "
623 "\"%s\"", $2, target->t_name);
632 int error;
634 if (target->t_auth_group != NULL) {
635 if (target->t_auth_group->ag_name != NULL) {
637 "auth-type for target \"%s\"",
638 target->t_name);
642 target->t_auth_group = auth_group_new(conf, NULL);
643 if (target->t_auth_group == NULL) {
647 target->t_auth_group->ag_target = target;
649 error = auth_group_set_type(target->t_auth_group, $2);
651 if (error != 0)
660 if (target->t_auth_group != NULL) {
661 if (target->t_auth_group->ag_name != NULL) {
663 "chap for target \"%s\"",
664 target->t_name);
670 target->t_auth_group = auth_group_new(conf, NULL);
671 if (target->t_auth_group == NULL) {
676 target->t_auth_group->ag_target = target;
678 ca = auth_new_chap(target->t_auth_group, $2, $3);
690 if (target->t_auth_group != NULL) {
691 if (target->t_auth_group->ag_name != NULL) {
693 "chap-mutual for target \"%s\"",
694 target->t_name);
702 target->t_auth_group = auth_group_new(conf, NULL);
703 if (target->t_auth_group == NULL) {
710 target->t_auth_group->ag_target = target;
712 ca = auth_new_chap_mutual(target->t_auth_group,
727 if (target->t_auth_group != NULL) {
728 if (target->t_auth_group->ag_name != NULL) {
730 "initiator-name for target \"%s\"",
731 target->t_name);
736 target->t_auth_group = auth_group_new(conf, NULL);
737 if (target->t_auth_group == NULL) {
741 target->t_auth_group->ag_target = target;
743 an = auth_name_new(target->t_auth_group, $2);
754 if (target->t_auth_group != NULL) {
755 if (target->t_auth_group->ag_name != NULL) {
757 "initiator-portal for target \"%s\"",
758 target->t_name);
763 target->t_auth_group = auth_group_new(conf, NULL);
764 if (target->t_auth_group == NULL) {
768 target->t_auth_group->ag_target = target;
770 ap = auth_portal_new(target->t_auth_group, $2);
785 log_warnx("unknown portal-group \"%s\" for target "
786 "\"%s\"", $2, target->t_name);
793 log_warnx("unknown auth-group \"%s\" for target "
794 "\"%s\"", $3, target->t_name);
799 tp = port_new(conf, target, tpg);
801 log_warnx("can't link portal-group \"%s\" to target "
802 "\"%s\"", $2, target->t_name);
817 log_warnx("unknown portal-group \"%s\" for target "
818 "\"%s\"", $2, target->t_name);
822 tp = port_new(conf, target, tpg);
824 log_warnx("can't link portal-group \"%s\" to target "
825 "\"%s\"", $2, target->t_name);
835 target->t_pport = strdup($2);
843 int error;
845 error = target_set_redirection(target, $2);
847 if (error != 0)
876 ret = asprintf(&name, "%s,lun,%ju", target->t_name, tmp);
884 target->t_luns[tmp] = lun;
910 target->t_luns[tmp] = lun;
1099 log_warnx("error in configuration file at line %d near '%s': %s",
1106 int error;
1117 error = yyparse();
1120 target = NULL;
1124 return (error);