linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Howard Chung <howardchung@google.com>
Cc: "linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>,
	Yun-Hao Chung <howardchung@chromium.org>,
	Miao-chen Chou <mcchou@chromium.org>
Subject: Re: [Bluez PATCH v2 04/11] plugins: new plugin
Date: Thu, 22 Jul 2021 10:49:14 -0700	[thread overview]
Message-ID: <CABBYNZJzSSQizXAHQ-uWBAy9Hvw8gTp+Wcu=yU6giwx2fGAbSQ@mail.gmail.com> (raw)
In-Reply-To: <20210722152159.Bluez.v2.4.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid>

Hi Howard,

On Thu, Jul 22, 2021 at 12:23 AM Howard Chung <howardchung@google.com> wrote:
>
> From: Yun-Hao Chung <howardchung@chromium.org>
>
> This adds an initial code for a new plugin admin_policy.
>
> Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
> ---
>
> (no changes since v1)
>
>  Makefile.plugins       |  5 +++++
>  bootstrap-configure    |  1 +
>  configure.ac           |  4 ++++
>  plugins/admin_policy.c | 30 ++++++++++++++++++++++++++++++
>  4 files changed, 40 insertions(+)
>  create mode 100644 plugins/admin_policy.c
>
> diff --git a/Makefile.plugins b/Makefile.plugins
> index 4e6a72b0bdf6..b6be0e0d559d 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_POLICY
> +builtin_modules += admin_policy
> +builtin_sources += plugins/admin_policy.c
> +endif
> +
>  if NFC
>  builtin_modules += neard
>  builtin_sources += plugins/neard.c
> diff --git a/bootstrap-configure b/bootstrap-configure
> index 0efd83abc2c4..89c0747b0256 100755
> --- a/bootstrap-configure
> +++ b/bootstrap-configure
> @@ -30,4 +30,5 @@ fi
>                 --enable-pie \
>                 --enable-cups \
>                 --enable-library \
> +               --enable-admin_policy \

Let have this as --enable-admin-plugin

>                 --disable-datafiles $*
> diff --git a/configure.ac b/configure.ac
> index be32782a641d..53ed8911f95c 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_policy, AC_HELP_STRING([--enable-admin_policy],
> +               [enable admin policy plugin]), [enable_admin_policy=${enableval}])
> +AM_CONDITIONAL(ADMIN_POLICY, test "${enable_admin_policy}" = "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_policy.c b/plugins/admin_policy.c
> new file mode 100644
> index 000000000000..dd8d8973636f
> --- /dev/null
> +++ b/plugins/admin_policy.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 <config.h>
> +#endif
> +
> +#include "src/log.h"
> +#include "src/plugin.h"
> +
> +static int admin_policy_init(void)
> +{
> +       DBG("");
> +}
> +
> +static void admin_policy_exit(void)
> +{
> +       DBG("");
> +}
> +
> +BLUETOOTH_PLUGIN_DEFINE(admin_policy, VERSION,
> +                       BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
> +                       admin_policy_init, admin_policy_exit)

Let's have it as just admin, since you can have multiple drivers
registered by the same plugin you just have to name the driver as
admin-policy that way it is simpler to extend if we found other uses
for the plugin.

> --
> 2.32.0.402.g57bb445576-goog
>


-- 
Luiz Augusto von Dentz

  reply	other threads:[~2021-07-22 17:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  7:23 [Bluez PATCH v2 00/11] Hi manintainers, Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 01/11] core: add is_allowed property in btd_service Howard Chung
2021-07-22  7:50   ` Hi manintainers, bluez.test.bot
2021-07-22  7:23 ` [Bluez PATCH v2 02/11] core: add adapter and device allowed_uuid functions Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 03/11] profiles: ignore incoming connection of not allowed service Howard Chung
2021-07-23  7:40   ` Yun-hao Chung
2021-07-22  7:23 ` [Bluez PATCH v2 04/11] plugins: new plugin Howard Chung
2021-07-22 17:49   ` Luiz Augusto von Dentz [this message]
2021-07-22  7:23 ` [Bluez PATCH v2 05/11] plugins/admin_policy: add admin_policy adapter driver Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 06/11] plugins/admin_policy: add ServiceAllowList method Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 07/11] plugins/admin_policy: add ServiceAllowList property Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 08/11] plugins/admin_policy: listen for device add and remove Howard Chung
2021-07-22 18:02   ` Luiz Augusto von Dentz
2021-07-22  7:23 ` [Bluez PATCH v2 09/11] plugins/admin_policy: add AffectedByPolicy property Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 10/11] plugins/admin_policy: persist policy settings Howard Chung
2021-07-22  7:23 ` [Bluez PATCH v2 11/11] doc: add description of admin policy Howard Chung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABBYNZJzSSQizXAHQ-uWBAy9Hvw8gTp+Wcu=yU6giwx2fGAbSQ@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=howardchung@chromium.org \
    --cc=howardchung@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mcchou@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).