Lines Matching refs:sub
91 uint32_t sub, uint32_t iidx __unused, enum snmp_op op) in op_vacm_context() argument
97 if (val->var.subs[sub - 1] != LEAF_vacmContextName) in op_vacm_context()
102 if ((vacm_ctx = vacm_get_context(&val->var, sub)) == NULL) in op_vacm_context()
107 if ((vacm_ctx = vacm_get_next_context(&val->var, sub)) == NULL) in op_vacm_context()
109 vacm_append_ctxindex(&val->var, sub, vacm_ctx); in op_vacm_context()
113 if ((vacm_ctx = vacm_get_context(&val->var, sub)) != NULL) in op_vacm_context()
117 if (val->var.subs[sub] >= SNMP_ADM_STR32_SIZ) in op_vacm_context()
119 if (index_decode(&val->var, sub, iidx, &cname, &cnamelen)) in op_vacm_context()
139 uint32_t sub, uint32_t iidx __unused, enum snmp_op op) in op_vacm_security_to_group() argument
147 if ((user = vacm_get_user(&val->var, sub)) == NULL) in op_vacm_security_to_group()
152 if ((user = vacm_get_next_user(&val->var, sub)) == NULL) in op_vacm_security_to_group()
154 vacm_append_userindex(&val->var, sub, user); in op_vacm_security_to_group()
158 if ((user = vacm_get_user(&val->var, sub)) == NULL && in op_vacm_security_to_group()
159 val->var.subs[sub - 1] != LEAF_vacmSecurityToGroupStatus) in op_vacm_security_to_group()
171 switch (val->var.subs[sub - 1]) { in op_vacm_security_to_group()
184 vacm_user_index_decode(&val->var, sub, in op_vacm_security_to_group()
205 if (val->var.subs[sub - 1] != LEAF_vacmSecurityToGroupStatus) in op_vacm_security_to_group()
207 if ((user = vacm_get_user(&val->var, sub)) == NULL) in op_vacm_security_to_group()
223 if ((user = vacm_get_user(&val->var, sub)) == NULL) in op_vacm_security_to_group()
225 switch (val->var.subs[sub - 1]) { in op_vacm_security_to_group()
245 switch (val->var.subs[sub - 1]) { in op_vacm_security_to_group()
262 op_vacm_access(struct snmp_context *ctx, struct snmp_value *val, uint32_t sub, in op_vacm_access() argument
271 if ((acl = vacm_get_access_rule(&val->var, sub)) == NULL) in op_vacm_access()
276 if ((acl = vacm_get_next_access_rule(&val->var, sub)) == NULL) in op_vacm_access()
278 vacm_append_access_rule_index(&val->var, sub, acl); in op_vacm_access()
282 if ((acl = vacm_get_access_rule(&val->var, sub)) == NULL && in op_vacm_access()
283 val->var.subs[sub - 1] != LEAF_vacmAccessStatus) in op_vacm_access()
289 switch (val->var.subs[sub - 1]) { in op_vacm_access()
336 sub, gname, cprefix, &smodel, &slevel) < 0) in op_vacm_access()
356 if (val->var.subs[sub - 1] != LEAF_vacmAccessStatus) in op_vacm_access()
358 if ((acl = vacm_get_access_rule(&val->var, sub)) == NULL) in op_vacm_access()
367 if ((acl = vacm_get_access_rule(&val->var, sub)) == NULL) in op_vacm_access()
369 switch (val->var.subs[sub - 1]) { in op_vacm_access()
394 switch (val->var.subs[sub - 1]) { in op_vacm_access()
427 uint32_t sub, uint32_t iidx __unused, enum snmp_op op) in op_vacm_view_lock() argument
429 if (val->var.subs[sub - 1] != LEAF_vacmViewSpinLock) in op_vacm_view_lock()
457 op_vacm_view(struct snmp_context *ctx, struct snmp_value *val, uint32_t sub, in op_vacm_view() argument
466 if ((view = vacm_get_view(&val->var, sub)) == NULL) in op_vacm_view()
471 if ((view = vacm_get_next_view(&val->var, sub)) == NULL) in op_vacm_view()
473 vacm_append_viewindex(&val->var, sub, view); in op_vacm_view()
477 if ((view = vacm_get_view(&val->var, sub)) == NULL && in op_vacm_view()
478 val->var.subs[sub - 1] != LEAF_vacmViewTreeFamilyStatus) in op_vacm_view()
490 switch (val->var.subs[sub - 1]) { in op_vacm_view()
520 vacm_view_index_decode(&val->var, sub, vname, in op_vacm_view()
540 switch (val->var.subs[sub - 1]) { in op_vacm_view()
545 if ((view = vacm_get_view(&val->var, sub)) == NULL) in op_vacm_view()
565 if ((view = vacm_get_view(&val->var, sub)) == NULL) in op_vacm_view()
567 switch (val->var.subs[sub - 1]) { in op_vacm_view()
589 switch (val->var.subs[sub - 1]) { in op_vacm_view()
612 vacm_append_userindex(struct asn_oid *oid, uint sub, in vacm_append_userindex() argument
617 oid->len = sub + strlen(user->secname) + 2; in vacm_append_userindex()
618 oid->subs[sub++] = user->sec_model; in vacm_append_userindex()
619 oid->subs[sub] = strlen(user->secname); in vacm_append_userindex()
621 oid->subs[sub + i] = user->secname[i - 1]; in vacm_append_userindex()
625 vacm_user_index_decode(const struct asn_oid *oid, uint sub, in vacm_user_index_decode() argument
630 *smodel = oid->subs[sub++]; in vacm_user_index_decode()
632 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_user_index_decode()
635 for (i = 0; i < oid->subs[sub]; i++) in vacm_user_index_decode()
636 uname[i] = oid->subs[sub + i + 1]; in vacm_user_index_decode()
643 vacm_get_user(const struct asn_oid *oid, uint sub) in vacm_get_user() argument
649 if (vacm_user_index_decode(oid, sub, &smodel, uname) < 0) in vacm_get_user()
661 vacm_get_next_user(const struct asn_oid *oid, uint sub) in vacm_get_next_user() argument
667 if (oid->len - sub == 0) in vacm_get_next_user()
670 if (vacm_user_index_decode(oid, sub, &smodel, uname) < 0) in vacm_get_next_user()
682 vacm_append_access_rule_index(struct asn_oid *oid, uint sub, in vacm_append_access_rule_index() argument
687 oid->len = sub + strlen(acl->group->groupname) + in vacm_append_access_rule_index()
690 oid->subs[sub] = strlen(acl->group->groupname); in vacm_append_access_rule_index()
692 oid->subs[sub + i] = acl->group->groupname[i - 1]; in vacm_append_access_rule_index()
693 sub += strlen(acl->group->groupname) + 1; in vacm_append_access_rule_index()
695 oid->subs[sub] = strlen(acl->ctx_prefix); in vacm_append_access_rule_index()
697 oid->subs[sub + i] = acl->ctx_prefix[i - 1]; in vacm_append_access_rule_index()
698 sub += strlen(acl->ctx_prefix) + 1; in vacm_append_access_rule_index()
699 oid->subs[sub++] = acl->sec_model; in vacm_append_access_rule_index()
700 oid->subs[sub] = acl->sec_level; in vacm_append_access_rule_index()
704 vacm_access_rule_index_decode(const struct asn_oid *oid, uint sub, char *gname, in vacm_access_rule_index_decode() argument
709 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_access_rule_index_decode()
712 for (i = 0; i < oid->subs[sub]; i++) in vacm_access_rule_index_decode()
713 gname[i] = oid->subs[sub + i + 1]; in vacm_access_rule_index_decode()
715 sub += strlen(gname) + 1; in vacm_access_rule_index_decode()
717 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_access_rule_index_decode()
720 for (i = 0; i < oid->subs[sub]; i++) in vacm_access_rule_index_decode()
721 cprefix[i] = oid->subs[sub + i + 1]; in vacm_access_rule_index_decode()
723 sub += strlen(cprefix) + 1; in vacm_access_rule_index_decode()
725 *smodel = oid->subs[sub++]; in vacm_access_rule_index_decode()
726 *slevel = oid->subs[sub]; in vacm_access_rule_index_decode()
732 vacm_get_access_rule(const struct asn_oid *oid, uint sub) in vacm_get_access_rule() argument
738 if (vacm_access_rule_index_decode(oid, sub, gname, prefix, &smodel, in vacm_get_access_rule()
753 vacm_get_next_access_rule(const struct asn_oid *oid __unused, uint sub __unused) in vacm_get_next_access_rule()
759 if (oid->len - sub == 0) in vacm_get_next_access_rule()
762 if (vacm_access_rule_index_decode(oid, sub, gname, prefix, &smodel, in vacm_get_next_access_rule()
777 vacm_view_index_decode(const struct asn_oid *oid, uint sub, char *vname, in vacm_view_index_decode() argument
783 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_view_index_decode()
786 for (i = 0; i < oid->subs[sub]; i++) in vacm_view_index_decode()
787 vname[i] = oid->subs[sub + i + 1]; in vacm_view_index_decode()
790 viod_off = sub + oid->subs[sub] + 1; in vacm_view_index_decode()
801 vacm_append_viewindex(struct asn_oid *oid, uint sub, const struct vacm_view *view) in vacm_append_viewindex() argument
805 oid->len = sub + strlen(view->viewname) + 1; in vacm_append_viewindex()
806 oid->subs[sub] = strlen(view->viewname); in vacm_append_viewindex()
808 oid->subs[sub + i] = view->viewname[i - 1]; in vacm_append_viewindex()
810 sub += strlen(view->viewname) + 1; in vacm_append_viewindex()
811 oid->subs[sub] = view->subtree.len; in vacm_append_viewindex()
817 vacm_get_view(const struct asn_oid *oid, uint sub) in vacm_get_view() argument
823 if (vacm_view_index_decode(oid, sub, vname, &subtree) < 0) in vacm_get_view()
835 vacm_get_next_view(const struct asn_oid *oid, uint sub) in vacm_get_next_view() argument
841 if (oid->len - sub == 0) in vacm_get_next_view()
844 if (vacm_view_index_decode(oid, sub, vname, &subtree) < 0) in vacm_get_next_view()
869 vacm_get_context(const struct asn_oid *oid, uint sub) in vacm_get_context() argument
876 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_get_context()
881 if (index_decode(oid, sub, index_count, &cname, &cnamelen)) in vacm_get_context()
893 vacm_get_next_context(const struct asn_oid *oid, uint sub) in vacm_get_next_context() argument
900 if (oid->len - sub == 0) in vacm_get_next_context()
903 if (oid->subs[sub] >= SNMP_ADM_STR32_SIZ) in vacm_get_next_context()
908 if (index_decode(oid, sub, index_count, &cname, &cnamelen)) in vacm_get_next_context()
920 vacm_append_ctxindex(struct asn_oid *oid, uint sub, in vacm_append_ctxindex() argument
925 oid->len = sub + strlen(ctx->ctxname) + 1; in vacm_append_ctxindex()
926 oid->subs[sub] = strlen(ctx->ctxname); in vacm_append_ctxindex()
928 oid->subs[sub + i] = ctx->ctxname[i - 1]; in vacm_append_ctxindex()