From patchwork Tue Aug 3 08:22:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Howard Chung X-Patchwork-Id: 491802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F564C4338F for ; Tue, 3 Aug 2021 08:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5279360F70 for ; Tue, 3 Aug 2021 08:23:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234585AbhHCIXe (ORCPT ); Tue, 3 Aug 2021 04:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbhHCIXc (ORCPT ); Tue, 3 Aug 2021 04:23:32 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D0DC06175F for ; Tue, 3 Aug 2021 01:23:21 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id t101-20020a25aaee0000b0290578c0c455b2so21971224ybi.13 for ; Tue, 03 Aug 2021 01:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=mDdEFCjpHD/uWglCa7g2e7wWzLT0QoSSZnVpKWZCPo4=; b=XwmmyjYyzNS1bqmWrMHXF12gPmfT9YMWoDYpD3xW5E3OoxfUCjG93+/AqVvzxsPObo JDeiSpnZoJMEUPjrxbJBa3pP5GDDKTbRXJC+sWDuRjUJix64iUxW7El/5ZsUeWvt1HA+ elUPF+Fcc71GYuH85IXs9q1091twoESLucztn6wFvh6vmYwltErznM8v/dBs3V6gL9jt YAxasV7pp7gM82B/XC2iopjvm7U4NJ8omtclKi+7laXn3SaxUiYkLEkQf9ch8zdmLXFF 4jdwn2OSZf0wSDD5hjwTrcrau72w92PMmZ9VaPLWcO/liQyRuDZ9ntOSE1iQu2TVwE0m 7rZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=mDdEFCjpHD/uWglCa7g2e7wWzLT0QoSSZnVpKWZCPo4=; b=FHdGgY0EgHgpJ7R+iz18ZAGETQOWQOVzTwRACU1zxfi253Pl7l1bhsQ02II7xsoLiI ZLCocpI0lDVsshQtX1dpLIPwt5tgJUeEmXdVBeruMQKuaRvjlsq8ljHeGFQksMmKpTkA A0o0PxTLzifXmR14nINzdpmFVS9gIk1IQHpKwN/CFOafLUiHovfxwVIMO9L4/lJD3wdn 1B356twKTRcuNWAgq2elehiiTd1hkTWlIEcw9zk96buwnuSJ6I9UDY0/D/9A87lluai8 dyD394BflqyJtIfX0qF3HAkrI4LlnHyeNvplYu2E3RQhx3wBiO2KCGRtV2EOB8PsuwwA eEyQ== X-Gm-Message-State: AOAM531MReLRMhB00GkXiYLgqeae4s11mjBKoQ5YTlE4U8TCuS6sYvvD B0hFEp+S9eOpi7ABEP9limbFZo6icnXw2ayIS6Lg0MLgJSJ8KzSpML8LY/JCg5+colEW2mW+rnc vqa3qfnm1kpC00dztrqwchIRnFl5tpbkGFvSTkm1muGzrRX/5ZvvtKxd1SsEMN9mo1iRz8+dNbl NlGMCgnRlfsFc= X-Google-Smtp-Source: ABdhPJxCUoVVpkyPbVxthaqUgAoj0CkCNUWOLcY9yQywb84ZnI3TodrqKe/JHbu0Q1+xzO1iu/umvEYxGqSM1BMJvQ== X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:ef55:8161:c77b:7a8d]) (user=howardchung job=sendgmr) by 2002:a25:24d4:: with SMTP id k203mr25740223ybk.383.1627979001144; Tue, 03 Aug 2021 01:23:21 -0700 (PDT) Date: Tue, 3 Aug 2021 16:22:29 +0800 In-Reply-To: <20210803082237.723766-1-howardchung@google.com> Message-Id: <20210803161319.Bluez.v8.5.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid> Mime-Version: 1.0 References: <20210803082237.723766-1-howardchung@google.com> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [Bluez PATCH v8 05/13] plugins: new plugin From: Howard Chung To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: Yun-Hao Chung , Miao-chen Chou Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Yun-Hao Chung This adds an initial code for a new plugin admin. Reviewed-by: Miao-chen Chou --- (no changes since v1) Makefile.plugins | 5 +++++ bootstrap-configure | 1 + configure.ac | 4 ++++ plugins/admin.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 plugins/admin.c diff --git a/Makefile.plugins b/Makefile.plugins index 4e6a72b0bdf6..69fb01001cc6 100644 --- a/Makefile.plugins +++ b/Makefile.plugins @@ -11,6 +11,11 @@ builtin_sources += plugins/autopair.c builtin_modules += policy builtin_sources += plugins/policy.c +if ADMIN +builtin_modules += admin +builtin_sources += plugins/admin.c +endif + if NFC builtin_modules += neard builtin_sources += plugins/neard.c diff --git a/bootstrap-configure b/bootstrap-configure index 0efd83abc2c4..a34be832068e 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -30,4 +30,5 @@ fi --enable-pie \ --enable-cups \ --enable-library \ + --enable-admin \ --disable-datafiles $* diff --git a/configure.ac b/configure.ac index a5afaea6cfcd..0744860b89fb 100644 --- a/configure.ac +++ b/configure.ac @@ -364,6 +364,10 @@ AC_ARG_ENABLE(logger, AC_HELP_STRING([--enable-logger], [enable HCI logger service]), [enable_logger=${enableval}]) AM_CONDITIONAL(LOGGER, test "${enable_logger}" = "yes") +AC_ARG_ENABLE(admin, AC_HELP_STRING([--enable-admin], + [enable admin policy plugin]), [enable_admin=${enableval}]) +AM_CONDITIONAL(ADMIN, test "${enable_admin}" = "yes") + if (test "${prefix}" = "NONE"); then dnl no prefix and no localstatedir, so default to /var if (test "$localstatedir" = '${prefix}/var'); then diff --git a/plugins/admin.c b/plugins/admin.c new file mode 100644 index 000000000000..42866bcf7be2 --- /dev/null +++ b/plugins/admin.c @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2021 Google LLC + * + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "src/log.h" +#include "src/plugin.h" + +static int admin_init(void) +{ + DBG(""); +} + +static void admin_exit(void) +{ + DBG(""); +} + +BLUETOOTH_PLUGIN_DEFINE(admin, VERSION, + BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, + admin_init, admin_exit)