• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/usr.sbin/ctld/

Lines Matching refs:ag

116 	struct auth_group *ag, *cagtmp;
127 TAILQ_FOREACH_SAFE(ag, &conf->conf_auth_groups, ag_next, cagtmp)
128 auth_group_delete(ag);
141 auth_new(struct auth_group *ag)
148 auth->a_auth_group = ag;
149 TAILQ_INSERT_TAIL(&ag->ag_auths, auth, a_next);
166 auth_find(const struct auth_group *ag, const char *user)
170 TAILQ_FOREACH(auth, &ag->ag_auths, a_next) {
240 auth_new_chap(struct auth_group *ag, const char *user,
245 if (ag->ag_type == AG_TYPE_UNKNOWN)
246 ag->ag_type = AG_TYPE_CHAP;
247 if (ag->ag_type != AG_TYPE_CHAP) {
248 if (ag->ag_name != NULL)
250 "other types for auth-group \"%s\"", ag->ag_name);
254 ag->ag_target->t_name);
258 auth = auth_new(ag);
268 auth_new_chap_mutual(struct auth_group *ag, const char *user,
273 if (ag->ag_type == AG_TYPE_UNKNOWN)
274 ag->ag_type = AG_TYPE_CHAP_MUTUAL;
275 if (ag->ag_type != AG_TYPE_CHAP_MUTUAL) {
276 if (ag->ag_name != NULL)
279 ag->ag_name);
283 ag->ag_target->t_name);
287 auth = auth_new(ag);
299 auth_name_new(struct auth_group *ag, const char *name)
306 an->an_auth_group = ag;
308 TAILQ_INSERT_TAIL(&ag->ag_names, an, an_next);
322 auth_name_defined(const struct auth_group *ag)
324 if (TAILQ_EMPTY(&ag->ag_names))
330 auth_name_find(const struct auth_group *ag, const char *name)
334 TAILQ_FOREACH(auth_name, &ag->ag_names, an_next) {
343 auth_name_check(const struct auth_group *ag, const char *initiator_name)
345 if (!auth_name_defined(ag))
348 if (auth_name_find(ag, initiator_name) == NULL)
355 auth_portal_new(struct auth_group *ag, const char *portal)
364 ap->ap_auth_group = ag;
402 TAILQ_INSERT_TAIL(&ag->ag_portals, ap, ap_next);
422 auth_portal_defined(const struct auth_group *ag)
424 if (TAILQ_EMPTY(&ag->ag_portals))
430 auth_portal_find(const struct auth_group *ag, const struct sockaddr_storage *ss)
437 TAILQ_FOREACH(ap, &ag->ag_portals, ap_next) {
469 auth_portal_check(const struct auth_group *ag, const struct sockaddr_storage *sa)
472 if (!auth_portal_defined(ag))
475 if (auth_portal_find(ag, sa) == NULL)
484 struct auth_group *ag;
487 ag = auth_group_find(conf, name);
488 if (ag != NULL) {
494 ag = calloc(1, sizeof(*ag));
495 if (ag == NULL)
498 ag->ag_name = checked_strdup(name);
499 TAILQ_INIT(&ag->ag_auths);
500 TAILQ_INIT(&ag->ag_names);
501 TAILQ_INIT(&ag->ag_portals);
502 ag->ag_conf = conf;
503 TAILQ_INSERT_TAIL(&conf->conf_auth_groups, ag, ag_next);
505 return (ag);
509 auth_group_delete(struct auth_group *ag)
515 TAILQ_REMOVE(&ag->ag_conf->conf_auth_groups, ag, ag_next);
517 TAILQ_FOREACH_SAFE(auth, &ag->ag_auths, a_next, auth_tmp)
519 TAILQ_FOREACH_SAFE(auth_name, &ag->ag_names, an_next, auth_name_tmp)
521 TAILQ_FOREACH_SAFE(auth_portal, &ag->ag_portals, ap_next,
524 free(ag->ag_name);
525 free(ag);
531 struct auth_group *ag;
533 TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) {
534 if (ag->ag_name != NULL && strcmp(ag->ag_name, name) == 0)
535 return (ag);
542 auth_group_set_type(struct auth_group *ag, const char *str)
555 if (ag->ag_name != NULL)
557 "\"%s\"", str, ag->ag_name);
560 "\"%s\"", str, ag->ag_target->t_name);
564 if (ag->ag_type != AG_TYPE_UNKNOWN && ag->ag_type != type) {
565 if (ag->ag_name != NULL) {
568 "type", str, ag->ag_name);
572 str, ag->ag_target->t_name);
577 ag->ag_type = type;
1658 struct auth_group *ag;
1668 TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) {
1669 fprintf(stderr, "auth-group %s {\n", ag->ag_name);
1670 TAILQ_FOREACH(auth, &ag->ag_auths, a_next)
1674 TAILQ_FOREACH(auth_name, &ag->ag_names, an_next)
1677 TAILQ_FOREACH(auth_portal, &ag->ag_portals, ap_next)
1764 struct auth_group *ag;
1834 TAILQ_FOREACH(ag, &conf->conf_auth_groups, ag_next) {
1835 if (ag->ag_name == NULL)
1836 assert(ag->ag_target != NULL);
1838 assert(ag->ag_target == NULL);
1842 if (targ->t_auth_group == ag) {
1848 if (port->p_auth_group == ag) {
1854 if (pg->pg_discovery_auth_group == ag) {
1859 if (!found && ag->ag_name != NULL &&
1860 strcmp(ag->ag_name, "default") != 0 &&
1861 strcmp(ag->ag_name, "no-authentication") != 0 &&
1862 strcmp(ag->ag_name, "no-access") != 0) {
1864 "to any target", ag->ag_name);
2619 struct auth_group *ag;
2631 ag = auth_group_new(conf, "default");
2632 assert(ag != NULL);
2634 ag = auth_group_new(conf, "no-authentication");
2635 assert(ag != NULL);
2636 ag->ag_type = AG_TYPE_NO_AUTHENTICATION;
2638 ag = auth_group_new(conf, "no-access");
2639 assert(ag != NULL);
2640 ag->ag_type = AG_TYPE_DENY;
2660 ag = auth_group_find(conf, "default");
2661 assert(ag != NULL);
2662 ag->ag_type = AG_TYPE_DENY;