From patchwork Fri Apr 14 15:29:00 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: 97437 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp340362qgf; Fri, 14 Apr 2017 08:29:09 -0700 (PDT) X-Received: by 10.237.61.5 with SMTP id g5mr8761664qtf.179.1492183749822; Fri, 14 Apr 2017 08:29:09 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 52si2096277qty.179.2017.04.14.08.29.09; Fri, 14 Apr 2017 08:29:09 -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 EFE0462E2C; Fri, 14 Apr 2017 15:29:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D9A3C62E1E; Fri, 14 Apr 2017 15:29:06 +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 AA3BD62E23; Fri, 14 Apr 2017 15:29:06 +0000 (UTC) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id 6447262E12 for ; Fri, 14 Apr 2017 15:29:04 +0000 (UTC) Received: by mail-lf0-f44.google.com with SMTP id t144so43490332lff.1 for ; Fri, 14 Apr 2017 08:29:04 -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=owvNETrzYhU6HqLse02CPP6V/3SOpWpvmiOu4kT28haM7nyWVsNA2Q6kYHnyfAoGmq v5jBjf1IjaG1iDLJKw4JCttiq/fkQMS7arAKBM3oe1l1ApTUUH8iO8nFJFchJnqgAvJZ YjnEqNNQdi/iuVkODL3d0eACTJ2pzvSqAatJ7Z8HF+gI22qV+VhgB4ltZ+6C0WT6BBd0 w0bkXV7ZB6fkES05Z5gNCeB007QTlCcO0PpAGqhQKLqdWyfU7SG65twnCY/VOt147dkQ wgzyizdgygeSbYmeBOrflAnRr8Qza1G4csD68sSiUF1/en4UjjjO+JMJeSP3lBetmeKf 8r0A== X-Gm-Message-State: AN3rC/7d3Y+2GKjEfrG+48rJI+1hGqCncoGMG7yclAkHqaOss9QzJCDs 2JWqn5vq2rIUB07yN2pdk4AY X-Received: by 10.25.16.93 with SMTP id f90mr3377600lfi.91.1492183742971; Fri, 14 Apr 2017 08:29:02 -0700 (PDT) Received: from forlindon.lumag.auriga.ru ([94.25.229.88]) by smtp.gmail.com with ESMTPSA id p23sm436445lfj.35.2017.04.14.08.29.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2017 08:29:02 -0700 (PDT) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Fri, 14 Apr 2017 18:29:00 +0300 Message-Id: <20170414152900.1289-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 *