MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sp6_init

Function sp6_init

dpdk/examples/ipsec-secgw/sp6.c:685–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683}
684
685void
686sp6_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
726static int
727sp_cmp(const void *p, const void *q)

Callers 1

mainFunction · 0.85

Calls 3

rte_exitFunction · 0.85
acl6_initFunction · 0.85
check_spi_valueFunction · 0.70

Tested by

no test coverage detected