Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_sysctl.c
Show First 20 Lines • Show All 1,120 Lines • ▼ Show 20 Lines | SLIST_FOREACH(oidp, lsp, oid_link) { | ||||
if (honor_skip && (oidp->oid_kind & CTLFLAG_SKIP) != 0) | if (honor_skip && (oidp->oid_kind & CTLFLAG_SKIP) != 0) | ||||
continue; | continue; | ||||
if (namelen == 0) { | if (namelen == 0) { | ||||
/* | /* | ||||
* We have reached a node with a full name match and are | * We have reached a node with a full name match and are | ||||
* looking for the next oid in its children. | * looking for the next oid in its children. | ||||
* | * | ||||
* For CTL_SYSCTL_NEXTNOSKIP we are done. | |||||
* | |||||
* For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it | * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it | ||||
* has a handler) and move on to the children. | * has a handler) and move on to the children. | ||||
*/ | */ | ||||
if (!honor_skip) | |||||
return (0); | |||||
if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) | if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) | ||||
return (0); | return (0); | ||||
if (oidp->oid_handler) | if (oidp->oid_handler) | ||||
return (0); | return (0); | ||||
lsp = SYSCTL_CHILDREN(oidp); | lsp = SYSCTL_CHILDREN(oidp); | ||||
if (!sysctl_sysctl_next_ls(lsp, NULL, 0, next + 1, len, | if (!sysctl_sysctl_next_ls(lsp, NULL, 0, next + 1, len, | ||||
level + 1, honor_skip)) | level + 1, honor_skip)) | ||||
return (0); | return (0); | ||||
Show All 18 Lines | SLIST_FOREACH(oidp, lsp, oid_link) { | ||||
* have to find a node to continue searching at the next level. | * have to find a node to continue searching at the next level. | ||||
*/ | */ | ||||
if (oidp->oid_number < *name) | if (oidp->oid_number < *name) | ||||
continue; | continue; | ||||
if (oidp->oid_number > *name) { | if (oidp->oid_number > *name) { | ||||
/* | /* | ||||
* We have reached the next oid. | * We have reached the next oid. | ||||
* | * | ||||
* For CTL_SYSCTL_NEXTNOSKIP we are done. | |||||
* | |||||
* For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it | * For CTL_SYSCTL_NEXT we skip CTLTYPE_NODE (unless it | ||||
* has a handler) and move on to the children. | * has a handler) and move on to the children. | ||||
*/ | */ | ||||
if (!honor_skip) | |||||
return (0); | |||||
if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) | if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) | ||||
return (0); | return (0); | ||||
if (oidp->oid_handler) | if (oidp->oid_handler) | ||||
return (0); | return (0); | ||||
lsp = SYSCTL_CHILDREN(oidp); | lsp = SYSCTL_CHILDREN(oidp); | ||||
if (!sysctl_sysctl_next_ls(lsp, name + 1, namelen - 1, | if (!sysctl_sysctl_next_ls(lsp, name + 1, namelen - 1, | ||||
next + 1, len, level + 1, honor_skip)) | next + 1, len, level + 1, honor_skip)) | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 1,760 Lines • Show Last 20 Lines |