Lines Matching refs:sub
345 uint sub, uint iidx __unused, enum snmp_op op) in op_dot1d_base_port() argument
359 if (val->var.len - sub != 1) in op_dot1d_base_port()
361 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_base_port()
367 if (val->var.len - sub == 0) { in op_dot1d_base_port()
371 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_base_port()
376 val->var.len = sub + 1; in op_dot1d_base_port()
377 val->var.subs[sub] = bp->port_no; in op_dot1d_base_port()
390 switch (val->var.subs[sub - 1]) { in op_dot1d_base_port()
417 uint sub, uint iidx __unused, enum snmp_op op) in op_dot1d_stp_port() argument
431 if (val->var.len - sub != 1) in op_dot1d_stp_port()
433 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_port()
439 if (val->var.len - sub == 0) { in op_dot1d_stp_port()
443 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_port()
448 val->var.len = sub + 1; in op_dot1d_stp_port()
449 val->var.subs[sub] = bp->port_no; in op_dot1d_stp_port()
453 if (val->var.len - sub != 1) in op_dot1d_stp_port()
455 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_port()
459 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_port()
504 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_port()
507 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_port()
529 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_port()
575 uint sub, uint iidx __unused, enum snmp_op op) in op_dot1d_stp_ext_port() argument
589 if (val->var.len - sub != 1) in op_dot1d_stp_ext_port()
591 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_ext_port()
597 if (val->var.len - sub == 0) { in op_dot1d_stp_ext_port()
601 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_ext_port()
606 val->var.len = sub + 1; in op_dot1d_stp_ext_port()
607 val->var.subs[sub] = bp->port_no; in op_dot1d_stp_ext_port()
611 if (val->var.len - sub != 1) in op_dot1d_stp_ext_port()
613 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_ext_port()
617 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_ext_port()
659 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_stp_ext_port()
663 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_ext_port()
685 switch (val->var.subs[sub - 1]) { in op_dot1d_stp_ext_port()
716 uint sub, uint iidx __unused, enum snmp_op op) in op_dot1d_tp_port() argument
730 if (val->var.len - sub != 1) in op_dot1d_tp_port()
732 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_tp_port()
738 if (val->var.len - sub == 0) { in op_dot1d_tp_port()
742 if ((bp = bridge_port_find(val->var.subs[sub], in op_dot1d_tp_port()
747 val->var.len = sub + 1; in op_dot1d_tp_port()
748 val->var.subs[sub] = bp->port_no; in op_dot1d_tp_port()
761 switch (val->var.subs[sub - 1]) { in op_dot1d_tp_port()
794 bridge_port_index_append(struct asn_oid *oid, uint sub, in bridge_port_index_append() argument
803 oid->len = sub + strlen(b_name) + 1 + 1; in bridge_port_index_append()
804 oid->subs[sub] = strlen(b_name); in bridge_port_index_append()
807 oid->subs[sub + i] = b_name[i - 1]; in bridge_port_index_append()
809 oid->subs[sub + i] = bp->port_no; in bridge_port_index_append()
818 bridge_port_index_get(const struct asn_oid *oid, uint sub, int8_t status) in bridge_port_index_get() argument
826 if (oid->len - sub != oid->subs[sub] + 2 || in bridge_port_index_get()
827 oid->subs[sub] >= IFNAMSIZ) in bridge_port_index_get()
830 for (i = 0; i < oid->subs[sub]; i++) in bridge_port_index_get()
831 bif_name[i] = oid->subs[sub + i + 1]; in bridge_port_index_get()
834 port_no = oid->subs[sub + i + 1]; in bridge_port_index_get()
850 bridge_port_index_getnext(const struct asn_oid *oid, uint sub, int8_t status) in bridge_port_index_getnext() argument
858 if (oid->len - sub == 0) in bridge_port_index_getnext()
861 if (oid->len - sub != oid->subs[sub] + 2 || in bridge_port_index_getnext()
862 oid->subs[sub] >= IFNAMSIZ) in bridge_port_index_getnext()
865 for (i = 0; i < oid->subs[sub]; i++) in bridge_port_index_getnext()
866 bif_name[i] = oid->subs[sub + i + 1]; in bridge_port_index_getnext()
869 port_no = oid->subs[sub + i + 1]; in bridge_port_index_getnext()
894 bridge_port_index_decode(const struct asn_oid *oid, uint sub, in bridge_port_index_decode() argument
899 if (oid->len - sub != oid->subs[sub] + 2 || in bridge_port_index_decode()
900 oid->subs[sub] >= IFNAMSIZ) in bridge_port_index_decode()
903 for (i = 0; i < oid->subs[sub]; i++) in bridge_port_index_decode()
904 b_name[i] = oid->subs[sub + i + 1]; in bridge_port_index_decode()
907 *idx = oid->subs[sub + i + 1]; in bridge_port_index_decode()
913 struct snmp_value *val, uint sub) in bridge_port_set_status() argument
921 if (bridge_port_index_decode(&val->var, sub, b_name, &if_idx) < 0) in bridge_port_set_status()
980 struct snmp_value *val, uint sub) in bridge_port_rollback_status() argument
987 if (bridge_port_index_decode(&val->var, sub, b_name, &if_idx) < 0) in bridge_port_rollback_status()
1003 bridge_port_commit_status(struct snmp_value *val, uint sub) in bridge_port_commit_status() argument
1010 if (bridge_port_index_decode(&val->var, sub, b_name, &if_idx) < 0) in bridge_port_commit_status()
1035 struct snmp_value *val, uint sub) in bridge_port_set_span_enable() argument
1047 if (bridge_port_index_decode(&val->var, sub, b_name, &if_idx) < 0) in bridge_port_set_span_enable()
1075 uint sub, uint iidx __unused, enum snmp_op op) in op_begemot_base_port() argument
1084 which = val->var.subs[sub - 1]; in op_begemot_base_port()
1092 if ((bp = bridge_port_index_get(&val->var, sub, in op_begemot_base_port()
1101 if ((bp = bridge_port_index_getnext(&val->var, sub, in op_begemot_base_port()
1103 bridge_port_index_append(&val->var, sub, bp) < 0) in op_begemot_base_port()
1110 return (bridge_port_set_span_enable(ctx, val, sub)); in op_begemot_base_port()
1113 return (bridge_port_set_status(ctx, val, sub)); in op_begemot_base_port()
1116 if ((bp = bridge_port_index_get(&val->var, sub, in op_begemot_base_port()
1138 return (bridge_port_rollback_status(ctx, val, sub)); in op_begemot_base_port()
1140 if ((bp = bridge_port_index_get(&val->var, sub, in op_begemot_base_port()
1152 return (bridge_port_commit_status(val, sub)); in op_begemot_base_port()
1194 uint sub, uint iidx __unused, enum snmp_op op) in op_begemot_stp_port() argument
1204 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL) in op_begemot_stp_port()
1209 if ((bp = bridge_port_index_getnext(&val->var, sub, 0)) == in op_begemot_stp_port()
1210 NULL || bridge_port_index_append(&val->var, sub, bp) < 0) in op_begemot_stp_port()
1215 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL) in op_begemot_stp_port()
1220 switch (val->var.subs[sub - 1]) { in op_begemot_stp_port()
1267 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL || in op_begemot_stp_port()
1271 switch (val->var.subs[sub - 1]) { in op_begemot_stp_port()
1293 switch (val->var.subs[sub - 1]) { in op_begemot_stp_port()
1337 uint sub, uint iidx __unused, enum snmp_op op) in op_begemot_stp_ext_port() argument
1347 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL) in op_begemot_stp_ext_port()
1352 if ((bp = bridge_port_index_getnext(&val->var, sub, 0)) == in op_begemot_stp_ext_port()
1353 NULL || bridge_port_index_append(&val->var, sub, bp) < 0) in op_begemot_stp_ext_port()
1358 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL) in op_begemot_stp_ext_port()
1363 switch (val->var.subs[sub - 1]) { in op_begemot_stp_ext_port()
1405 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL || in op_begemot_stp_ext_port()
1409 switch (val->var.subs[sub - 1]) { in op_begemot_stp_ext_port()
1431 switch (val->var.subs[sub - 1]) { in op_begemot_stp_ext_port()
1462 uint sub, uint iidx __unused, enum snmp_op op) in op_begemot_tp_port() argument
1471 if ((bp = bridge_port_index_get(&val->var, sub, 0)) == NULL) in op_begemot_tp_port()
1476 if ((bp = bridge_port_index_getnext(&val->var, sub, 0)) == in op_begemot_tp_port()
1477 NULL || bridge_port_index_append(&val->var, sub, bp) < 0) in op_begemot_tp_port()
1491 switch (val->var.subs[sub - 1]) { in op_begemot_tp_port()