From patchwork Fri Apr 14 10:58:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 97429 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp237544obc; Fri, 14 Apr 2017 03:58:23 -0700 (PDT) X-Received: by 10.55.128.198 with SMTP id b189mr6140704qkd.301.1492167503661; Fri, 14 Apr 2017 03:58:23 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g184si1467224qkc.190.2017.04.14.03.58.23; Fri, 14 Apr 2017 03:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EFFB164D9E; Fri, 14 Apr 2017 10:58:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D9D4D62D6A; Fri, 14 Apr 2017 10:58:20 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 112C16486A; Fri, 14 Apr 2017 10:58:20 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id BF19B62D33 for ; Fri, 14 Apr 2017 10:58:17 +0000 (UTC) Received: by mail-lf0-f53.google.com with SMTP id t144so40944871lff.1 for ; Fri, 14 Apr 2017 03:58:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=4vLKd/JYhSZ003fhZQULx7Lg/X3UrrPhdmkHgqyHZW0=; b=iJqplSypYZCayRKcmng6m3xRowFOoipGtMscEY8f3W8Ytm7w3DQcy69vyeNiZ7FSzT W1/dQk5FDuYZJZnsRwC306kBKvfn0S3BKsF+YEFU+ENZlTH4aC6yicEgXW2FmeWKdA0i EV117kivQ9pC11PUhgHaKZhmh+w7pJ+W6LP0F4lRNJuUooWgKKKz1ji2L87zoU8BfXOz R2Z049IsF00+9Ww8M3GO3brgeOuMCV6feoDsSdGG+iS743CekeEEaUTreS2q8iyXNnAH 9G9KxJUIGYYcrK7zgpMFMd/4ly66BQlEvaoXTGzu0Ib82Hl7R02c4V1911khYELbJ88p YLDA== X-Gm-Message-State: AN3rC/7jQVW+kEPFxuFILNChHe3ArgDytajCqeOIFjA0M03RN561bo70 vtCh8+xEJN8KXk0KdJLtJlup X-Received: by 10.25.159.79 with SMTP id i76mr2747368lfe.73.1492167496022; Fri, 14 Apr 2017 03:58:16 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.229.52]) by smtp.gmail.com with ESMTPSA id x10sm229744lfb.54.2017.04.14.03.58.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 03:58:15 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Fri, 14 Apr 2017 13:58:13 +0300 Message-Id: <20170414105813.26652-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [API-NEXT] api: ipsec: factor out definitions for feature support levels X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Instead of having magic 0-1-2 numbers, let's have the special enum for feature support levels (unsupported/supported/preferred). Signed-off-by: Dmitry Eremin-Solenikov --- include/odp/api/spec/ipsec.h | 56 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) -- 2.11.0 diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index a0ceb11a..7011e3cf 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -224,44 +224,46 @@ typedef struct odp_ipsec_outbound_config_t { } odp_ipsec_outbound_config_t; /** + * IPSEC operation mode support + */ +typedef enum odp_ipsec_op_mode_support_t { + /** + * Mode is not supported + */ + ODP_IPSEC_OP_MODE_UNSUPPORTED = 0, + /** + * Mode is supported + */ + ODP_IPSEC_OP_MODE_SUPPORTED, + /** + * Mode is supported and preferred + */ + ODP_IPSEC_OP_MODE_PREFERRED, +} odp_ipsec_op_mode_support_t; + +/** * IPSEC capability */ typedef struct odp_ipsec_capability_t { /** Maximum number of IPSEC SAs */ uint32_t max_num_sa; - /** Synchronous IPSEC operation mode (ODP_IPSEC_OP_MODE_SYNC) support - * - * 0: Synchronous mode is not supported - * 1: Synchronous mode is supported - * 2: Synchronous mode is supported and preferred - */ - uint8_t op_mode_sync; + /** Synchronous IPSEC operation mode (ODP_IPSEC_OP_MODE_SYNC) support */ + odp_ipsec_op_mode_support_t op_mode_sync; - /** Asynchronous IPSEC operation mode (ODP_IPSEC_OP_MODE_ASYNC) support - * - * 0: Asynchronous mode is not supported - * 1: Asynchronous mode is supported - * 2: Asynchronous mode is supported and preferred + /** + * Asynchronous IPSEC operation mode (ODP_IPSEC_OP_MODE_ASYNC) support */ - uint8_t op_mode_async; + odp_ipsec_op_mode_support_t op_mode_async; - /** Inline IPSEC operation mode (ODP_IPSEC_OP_MODE_INLINE) support - * - * 0: Inline IPSEC operation is not supported - * 1: Inline IPSEC operation is supported - * 2: Inline IPSEC operation is supported and preferred - */ - uint8_t op_mode_inline; + /** Inline IPSEC operation mode (ODP_IPSEC_OP_MODE_INLINE) support */ + odp_ipsec_op_mode_support_t op_mode_inline; - /** Support of pipelined classification (ODP_IPSEC_PIPELINE_CLS) of - * resulting inbound packets. - * - * 0: Classification of resulting packets is not supported - * 1: Classification of resulting packets is supported - * 2: Classification of resulting packets is supported and preferred + /** + * Support of pipelined classification (ODP_IPSEC_PIPELINE_CLS) of + * resulting inbound packets */ - uint8_t pipeline_cls; + odp_ipsec_op_mode_support_t pipeline_cls; /** Soft expiry limit in seconds support *