Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5931662pxv; Thu, 29 Jul 2021 01:58:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx594ESpKvGtHjFkLmqydokfr2Cc68e4GUUlM++Y773TFHUOYGKF1Y8iyrYuFOjI1k0UC2d X-Received: by 2002:a05:6402:270f:: with SMTP id y15mr4782363edd.65.1627549122788; Thu, 29 Jul 2021 01:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627549122; cv=none; d=google.com; s=arc-20160816; b=leY93vJv5jVThMk0wL4vYKsv2DtDfCDg5f4BiCw1zIs06BmvMO8ie7Avkd8i/0rG1b nOV4e70v9VWmrSlX8+t2KJ4gTTzZoOmYZ4EzUG8wJUoKyf1IWk2pA8fyQ3YlLZpXv1KM iUa8oGuMvFXDBemez3gOdzREBy4iaOLscJ1UyzQRNPBkQToUZGSooRvq0xGFjm6cYVk2 iaaYDQtW21+osI3NMJ6xprUYlGw7WYkNnJcEHqQPD6f+6UpNHzK8HCdqp/qqH6pkyU+a Zovv790e4Q2/HRMNyN2deLVj/thKKJY6MHfVCIeEq/a4DXsi9Su1dr45C5Mo56F58Faw 9UTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=mDdEFCjpHD/uWglCa7g2e7wWzLT0QoSSZnVpKWZCPo4=; b=UqA4HzWNQuyCbTqgpFBbqgFPQskAcy6qdbuyz2VFFo3TXdBbRYzLkZKsx8+mQv7mmE oXKDDsOzcS34fjRpQThh2G/8o2tD+ZzYJOwG4Cg2zyVAKVLxgZJvgvazPDoJPXOJyIF+ Lw3/NDp8T5nrBCaykPmQI51wbrNokravmQh/ii/7ZZx5GmpHUmc3wW0GKfhOuiHsQglo eVHQMs6r2x7zoXad7sU6G6cBqr22KU6JGqlwtLMX5QkN7CH3CSCG7xu7/K6Izc4pR/tR t+GRpzSqLCsfWZlHqlIhtXh1lAJYx830hbxpCL/SIeGeTvgOLbJ3s4TScdigw/V3+ZIG nIZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BgMhzD3R; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf17si2228046edb.120.2021.07.29.01.58.19; Thu, 29 Jul 2021 01:58:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BgMhzD3R; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235224AbhG2I5c (ORCPT + 99 others); Thu, 29 Jul 2021 04:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbhG2I5c (ORCPT ); Thu, 29 Jul 2021 04:57:32 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB641C061757 for ; Thu, 29 Jul 2021 01:57:28 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id o5-20020a2581050000b029055ab4873f4cso6052054ybk.22 for ; Thu, 29 Jul 2021 01:57:28 -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=BgMhzD3RjVUi9qqY9wsPDmqr2KGXDKN/FBLAYrHuQS1fTjxz0PldaXiAhvQs0Ah+7J ciY1EUMKNkExaIorB7T77Q0fMphBWeMxrrNY8GMWIrx4lRjKih0Ub9GNO6rFq4UvYv8N r+M/AKKtOE9qZxZkel4H7gdJcYVVRPRLfq32/B0SAfO4wyqzGAYb25tYpYZVPGJtsZmd cqwwmTo337R5IBOXvNgDfLnAhxOCkFdSMVtP5n8GlFYFlJQFiaJXpR0vfTgITgzHA3ce jocd9s7KijhqpmsbrTe2gWEIrwAmwwBTqnbZVe3Jc60/+e1zPcTz62kVOGvF+gr3VmYu p+8Q== 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=NdOyEuOMvLYBuIYwMXa6zYWDcJbfQRwbM6XHWykeI7mCu2c8k6LN5FR0s0/mb1R3K6 l+Kowf3hdi2gyFJqOhIczBFooFLfQaaLLqN/DIGXKj17oZMd1gLidz1jJHHyDKhjptWA y/p+IqhUAfScSJ1WuqjFyRgaQz83BldGemheF8zN/rFGIemaijTcMsRG4ZXdO/x8DCZI qjH4dsmylIxkjR8v3GQmtRb3AOUv2vYGioe1kTmmgGh12FmU5WQ+AUa13lWFi7e8dO+t il31rI1I8XH04H7h88P0n81p7NNSx1wcrxqS5ab6yjSQqVTLq7QUttZYxDp0PEIwsbRd WAoA== X-Gm-Message-State: AOAM53362h6zF+nnxNxxhV02CjsKV73kKYHhzwrIW5I1ZxB0I1ovdjnu pvdGF2k3PPnsr95o5uGfnposfFmOBVAB8oZ52MX5aq0t9MwNz4IlzwfTL6sj2drdWGkI6mAX9BF 6oTVbWg0rdMslhiFkGFYweIyMLc824hM4/bqNsuQt1QkI4LQkw2t406KVsRDQMrzh0+m43cren3 S7XnJE86FGjrY= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:ff72:1420:4502:fdaf]) (user=howardchung job=sendgmr) by 2002:a25:2008:: with SMTP id g8mr4995955ybg.502.1627549048046; Thu, 29 Jul 2021 01:57:28 -0700 (PDT) Date: Thu, 29 Jul 2021 16:56:44 +0800 In-Reply-To: <20210729085651.3600926-1-howardchung@google.com> Message-Id: <20210729165211.Bluez.v5.6.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid> Mime-Version: 1.0 References: <20210729085651.3600926-1-howardchung@google.com> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [Bluez PATCH v5 06/13] plugins: new plugin From: Howard Chung To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: Yun-Hao Chung , Miao-chen Chou Content-Type: text/plain; charset="UTF-8" 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) -- 2.32.0.554.ge1b32706d8-goog