Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/ctld/uclparse.c
Show First 20 Lines • Show All 666 Lines • ▼ Show 20 Lines | if (!strcmp(key, "dscp")) { | ||||
else if (strcmp(key, "af43")) | else if (strcmp(key, "af43")) | ||||
portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2; | portal_group->pg_dscp = IPTOS_DSCP_AF43 >> 2; | ||||
else { | else { | ||||
log_warnx("\"dscp\" property value is not a supported textual value"); | log_warnx("\"dscp\" property value is not a supported textual value"); | ||||
return (1); | return (1); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!strcmp(key, "pcp")) { | |||||
if (obj->type != UCL_INT) { | |||||
log_warnx("\"pcp\" property of portal group " | |||||
"\"%s\" is not an integer", portal_group->pg_name); | |||||
return(1); | |||||
} | |||||
portal_group->pg_pcp = ucl_object_toint(obj); | |||||
if (!((portal_group->pg_pcp >= 0) && (portal_group->pg_pcp <= 7))) { | |||||
log_warnx("invalid \"pcp\" value %d, using default", portal_group->pg_pcp); | |||||
portal_group->pg_pcp = -1; | |||||
} | |||||
} | |||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
uclparse_target(const char *name, const ucl_object_t *top) | uclparse_target(const char *name, const ucl_object_t *top) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |