Lines Matching refs:index
116 int index, i = 0, j = 0; in security_create() local
119 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in security_create()
120 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in security_create()
127 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in security_create()
128 if (!inst[index].obj) { in security_create()
133 if (index >= MAX_INSTANCE_COUNT) { in security_create()
140 security_uri[index][0] = '\0'; in security_create()
141 client_identity[index][0] = '\0'; in security_create()
142 bootstrap_flag[index] = 0; in security_create()
143 security_mode[index] = 0U; in security_create()
144 short_server_id[index] = 0U; in security_create()
146 (void)memset(res[index], 0, in security_create()
147 sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in security_create()
148 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in security_create()
151 INIT_OBJ_RES_DATA_LEN(SECURITY_SERVER_URI_ID, res[index], i, in security_create()
152 res_inst[index], j, in security_create()
153 security_uri[index], SECURITY_URI_LEN, 0); in security_create()
154 INIT_OBJ_RES_DATA(SECURITY_BOOTSTRAP_FLAG_ID, res[index], i, in security_create()
155 res_inst[index], j, in security_create()
156 &bootstrap_flag[index], sizeof(*bootstrap_flag)); in security_create()
157 INIT_OBJ_RES_DATA(SECURITY_MODE_ID, res[index], i, in security_create()
158 res_inst[index], j, in security_create()
159 &security_mode[index], sizeof(*security_mode)); in security_create()
160 INIT_OBJ_RES_DATA_LEN(SECURITY_CLIENT_PK_ID, res[index], i, in security_create()
161 res_inst[index], j, in security_create()
162 &client_identity[index], IDENTITY_LEN, 0); in security_create()
163 INIT_OBJ_RES_DATA_LEN(SECURITY_SERVER_PK_ID, res[index], i, in security_create()
164 res_inst[index], j, in security_create()
165 &server_pk[index], KEY_LEN, 0); in security_create()
166 INIT_OBJ_RES_DATA_LEN(SECURITY_SECRET_KEY_ID, res[index], i, in security_create()
167 res_inst[index], j, in security_create()
168 &secret_key[index], KEY_LEN, 0); in security_create()
169 INIT_OBJ_RES_DATA(SECURITY_SHORT_SERVER_ID, res[index], i, in security_create()
170 res_inst[index], j, in security_create()
171 &short_server_id[index], sizeof(*short_server_id)); in security_create()
173 INIT_OBJ_RES_OPTDATA(SECURITY_MATCHING_TYPE_ID, res[index], i, res_inst[index], j); in security_create()
174 INIT_OBJ_RES_OPTDATA(SECURITY_SNI_ID, res[index], i, res_inst[index], j); in security_create()
175 INIT_OBJ_RES_OPTDATA(SECURITY_CERTIFICATE_USAGE_ID, res[index], i, res_inst[index], j); in security_create()
176 INIT_OBJ_RES_MULTI_OPTDATA(SECURITY_DTLS_TLS_CIPHERSUITE_ID, res[index], i, in security_create()
177 res_inst[index], j, DTLS_TLS_CIPHERSUITE_MAX, false); in security_create()
178 INIT_OBJ_RES_OPTDATA(SECURITY_OSCORE_SEC_MODE_ID, res[index], i, res_inst[index], j); in security_create()
181 inst[index].resources = res[index]; in security_create()
182 inst[index].resource_count = i; in security_create()
185 return &inst[index]; in security_create()
201 int lwm2m_security_index_to_inst_id(int index) in lwm2m_security_index_to_inst_id() argument
203 if (index >= MAX_INSTANCE_COUNT) { in lwm2m_security_index_to_inst_id()
208 if (!inst[index].obj) { in lwm2m_security_index_to_inst_id()
212 return inst[index].obj_inst_id; in lwm2m_security_index_to_inst_id()