| 274 | } |
| 275 | |
| 276 | const struct rte_security_capability * |
| 277 | rte_security_capability_get(void *ctx, struct rte_security_capability_idx *idx) |
| 278 | { |
| 279 | const struct rte_security_capability *capabilities; |
| 280 | const struct rte_security_capability *capability; |
| 281 | struct rte_security_ctx *instance = ctx; |
| 282 | uint16_t i = 0; |
| 283 | |
| 284 | RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, capabilities_get, NULL, NULL); |
| 285 | RTE_PTR_OR_ERR_RET(idx, NULL); |
| 286 | |
| 287 | capabilities = instance->ops->capabilities_get(instance->device); |
| 288 | |
| 289 | if (capabilities == NULL) |
| 290 | return NULL; |
| 291 | |
| 292 | while ((capability = &capabilities[i++])->action |
| 293 | != RTE_SECURITY_ACTION_TYPE_NONE) { |
| 294 | if (capability->action == idx->action && |
| 295 | capability->protocol == idx->protocol) { |
| 296 | if (idx->protocol == RTE_SECURITY_PROTOCOL_IPSEC) { |
| 297 | if (capability->ipsec.proto == |
| 298 | idx->ipsec.proto && |
| 299 | capability->ipsec.mode == |
| 300 | idx->ipsec.mode && |
| 301 | capability->ipsec.direction == |
| 302 | idx->ipsec.direction) |
| 303 | return capability; |
| 304 | } else if (idx->protocol == RTE_SECURITY_PROTOCOL_PDCP) { |
| 305 | if (capability->pdcp.domain == |
| 306 | idx->pdcp.domain) |
| 307 | return capability; |
| 308 | } else if (idx->protocol == |
| 309 | RTE_SECURITY_PROTOCOL_DOCSIS) { |
| 310 | if (capability->docsis.direction == |
| 311 | idx->docsis.direction) |
| 312 | return capability; |
| 313 | } else if (idx->protocol == |
| 314 | RTE_SECURITY_PROTOCOL_MACSEC) { |
| 315 | if (idx->macsec.alg == capability->macsec.alg) |
| 316 | return capability; |
| 317 | } else if (idx->protocol == RTE_SECURITY_PROTOCOL_TLS_RECORD) { |
| 318 | if (capability->tls_record.ver == idx->tls_record.ver && |
| 319 | capability->tls_record.type == idx->tls_record.type) |
| 320 | return capability; |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | return NULL; |
| 326 | } |
| 327 | |
| 328 | int |
| 329 | rte_security_rx_inject_configure(void *ctx, uint16_t port_id, bool enable) |
no outgoing calls