Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8733320ybi; Tue, 9 Jul 2019 22:12:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVut1f9h3JaTTLdA6yklAtT2P08Gd5IicmEObLERCRCC/tQV65s+0WvPoo/8sF4+NVQpIB X-Received: by 2002:a17:90a:b00b:: with SMTP id x11mr4610480pjq.120.1562735547670; Tue, 09 Jul 2019 22:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562735547; cv=none; d=google.com; s=arc-20160816; b=FVEDn/acY+H4fXUmN6rojD5aZhooLDWjf/bMNx+Am6Jbzn5uVHhOslF0/I3xurzFkg zFMesjMcIZly5hlYv0HfnolKQ0ojLVKurH9xr981HtDrQBKmtOQWQ7njpnHvxzB3f+Pg 3wSyWzkPYiPxB6YgEgNDAN0sIf+2Qg1rNMdHSSyDuEqVcAoCobs6B5zkl/OxzqWw/vEt B+V0xJ6B40I4uyzflsEAbneecFlECZTbZyPt48BYNZjbqijopQxnhessf1nO7q1VzHTU KJzvt7+SjdjxnHbd1GtTrfdeF36b2ienVneBzqriXJX9FBhAJpzyJ56HkMlZOWZbqZie 643w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Lg/2i9scrfJDKHqxAO0r/xLaXgHGudLv7ihQU35N9WY=; b=ATcz9tVAwtFHhrAkNqaA3IUDS4mx4C7Ek57eWQIWK8hPsXxBI+pLV1rUXgnCOa4x1J 4JAsXE4QfE4UxjRWx4EeYQ5vnpcA7XZSHh7ulUz3yZUddnEwfj6fxYQqnyh6zO0waQCJ prYaWPr5Lh8tcM+1A0QvGV9eyC+ZpVE4eJiuYmRbtFacuW27PLJeW2WbR/n5dS2xip4o gbEKHMOJ0LgVKGi9ioPwIWawO6ogK8YBpdJIHDxUBCYrFcGJ5wr+DKMq1AHDO13KcbDd GShG32YCy+mXUlNKhTLX0H/zK506xwNyCC0JVN2rbu7eBa+Tcbw5IpiWF9/2WqgqDkcu inSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si1141786pjp.78.2019.07.09.22.12.13; Tue, 09 Jul 2019 22:12:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726186AbfGJFKI (ORCPT + 99 others); Wed, 10 Jul 2019 01:10:08 -0400 Received: from mga18.intel.com ([134.134.136.126]:28143 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfGJFKI (ORCPT ); Wed, 10 Jul 2019 01:10:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 22:10:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,473,1557212400"; d="scan'208";a="189050343" Received: from ingas-nuc1.sea.intel.com ([10.254.182.100]) by fmsmga004.fm.intel.com with ESMTP; 09 Jul 2019 22:10:07 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, michal.lowas-rzechonek@silvair.com, jakub.witowski@silvair.com, Inga Stotland Subject: [PATCH BlueZ 6/9] mesh: Define storage format specific read/write routines Date: Tue, 9 Jul 2019 22:09:56 -0700 Message-Id: <20190710050959.7321-7-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190710050959.7321-1-inga.stotland@intel.com> References: <20190710050959.7321-1-inga.stotland@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds the following generic APIs to mesh-config.h void *mesh_config_create_config(void); void mesh_config_release_config(void *config); void *mesh_config_get_config(const char *dir); void *mesh_config_get_config_backup(const char *dir); bool mesh_config_restore_backup(const char *dir); bool mesh_config_save_config(const char *dir, void *cfg); The implementation of these API routines depends on the underlying storage directory structure and can be specific to a chosen configuration file format. --- mesh/mesh-config.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mesh/mesh-config.h b/mesh/mesh-config.h index ab101a331..077c59bbb 100644 --- a/mesh/mesh-config.h +++ b/mesh/mesh-config.h @@ -100,6 +100,13 @@ typedef bool (*mesh_config_app_key_cb)(uint16_t idx, uint16_t net_idx, typedef bool (*mesh_config_node_cb)(struct mesh_config_node *node, void *user_data); +void *mesh_config_create_config(void); +void mesh_config_release_config(void *config); +void *mesh_config_get_config(const char *dir); +void *mesh_config_get_config_backup(const char *dir); +bool mesh_config_restore_backup(const char *dir); +bool mesh_config_save_config(const char *dir, void *cfg); + bool mesh_config_read_node(void *cfg, mesh_config_node_cb cb, void *user_data); bool mesh_config_add_node(void *cfg, struct mesh_config_node *node); bool mesh_config_read_iv_index(void *cfg, uint32_t *idx, bool *update); -- 2.21.0