| 683 | } |
| 684 | |
| 685 | void |
| 686 | sp6_init(struct socket_ctx *ctx, int32_t socket_id) |
| 687 | { |
| 688 | const char *name; |
| 689 | |
| 690 | if (ctx == NULL) |
| 691 | rte_exit(EXIT_FAILURE, "NULL context.\n"); |
| 692 | |
| 693 | if (ctx->sp_ip6_in != NULL) |
| 694 | rte_exit(EXIT_FAILURE, "Inbound IPv6 SP DB for socket %u " |
| 695 | "already initialized\n", socket_id); |
| 696 | |
| 697 | if (ctx->sp_ip6_out != NULL) |
| 698 | rte_exit(EXIT_FAILURE, "Outbound IPv6 SP DB for socket %u " |
| 699 | "already initialized\n", socket_id); |
| 700 | |
| 701 | if (check_spi_value(ctx->sa_in, 1) < 0) |
| 702 | rte_exit(EXIT_FAILURE, |
| 703 | "Inbound IPv6 SP DB has unmatched in SAD SPIs\n"); |
| 704 | |
| 705 | if (check_spi_value(ctx->sa_out, 0) < 0) |
| 706 | rte_exit(EXIT_FAILURE, |
| 707 | "Outbound IPv6 SP DB has unmatched in SAD SPIs\n"); |
| 708 | |
| 709 | if (nb_acl6_rules_in > 0) { |
| 710 | name = "sp_ip6_in"; |
| 711 | ctx->sp_ip6_in = (struct sp_ctx *)acl6_init(name, |
| 712 | socket_id, acl6_rules_in, nb_acl6_rules_in); |
| 713 | } else |
| 714 | RTE_LOG(WARNING, IPSEC, "No IPv6 SP Inbound rule " |
| 715 | "specified\n"); |
| 716 | |
| 717 | if (nb_acl6_rules_out > 0) { |
| 718 | name = "sp_ip6_out"; |
| 719 | ctx->sp_ip6_out = (struct sp_ctx *)acl6_init(name, |
| 720 | socket_id, acl6_rules_out, nb_acl6_rules_out); |
| 721 | } else |
| 722 | RTE_LOG(WARNING, IPSEC, "No IPv6 SP Outbound rule " |
| 723 | "specified\n"); |
| 724 | } |
| 725 | |
| 726 | static int |
| 727 | sp_cmp(const void *p, const void *q) |
no test coverage detected