Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/ctld/uclparse.c
Show First 20 Lines • Show All 752 Lines • ▼ Show 20 Lines | if (!strcmp(key, "portal-group")) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!strcmp(key, "port")) { | if (!strcmp(key, "port")) { | ||||
struct pport *pp; | struct pport *pp; | ||||
struct port *tp; | struct port *tp; | ||||
const char *value = ucl_object_tostring(obj); | const char *value = ucl_object_tostring(obj); | ||||
int ret, i_pp, i_vp = 0; | |||||
ret = sscanf(value, "ioctl/%d/%d", &i_pp, &i_vp); | |||||
if (ret > 0) { | |||||
tp = port_new_ioctl(conf, target, i_pp, i_vp); | |||||
if (tp == NULL) { | |||||
log_warnx("can't create new ioctl port " | |||||
"for target \"%s\"", target->t_name); | |||||
return (1); | |||||
} | |||||
return (0); | |||||
} | |||||
pp = pport_find(conf, value); | pp = pport_find(conf, value); | ||||
if (pp == NULL) { | if (pp == NULL) { | ||||
log_warnx("unknown port \"%s\" for target \"%s\"", | log_warnx("unknown port \"%s\" for target \"%s\"", | ||||
value, target->t_name); | value, target->t_name); | ||||
return (1); | return (1); | ||||
} | } | ||||
if (!TAILQ_EMPTY(&pp->pp_ports)) { | if (!TAILQ_EMPTY(&pp->pp_ports)) { | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |