Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6055545pxv; Thu, 29 Jul 2021 05:29:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz54c6djVVFHGYoh8PUrK3/eMCf5EbG8Ck9S+jrzFELBPOhoyFRzT90c9eeYWxKdbBQISYM X-Received: by 2002:a05:6402:1396:: with SMTP id b22mr5752087edv.380.1627561790239; Thu, 29 Jul 2021 05:29:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627561790; cv=none; d=google.com; s=arc-20160816; b=i8nVm+Bh7WmAs0jEwM8SsxYuk6KBaYM3+a2G+ZwYa/O5hsKdfa72pAalQwC3sYCn4z apopyHlm2ONE7K6ZJVxhdeWBbwnjp2bhmgfCYWDKuYouu2TYZ0FgLbjcJv3MacdA+Lud ouHd3PByZAq9kTpnlVk8eyGkvK5l66qtE0+2VigPbuMRSfAvkA5n2DmCOQfeQomQnW+S ubFZ4TXwyMmfLvGHnQQDKBxfpD+b1wldovPNOteDsJF4YX16wEaKbxBr/Xl8+EECLg6v aGbIKCruEq/GKFraWVFw6nyTUYbUqL86E8OUsmv5d6f7ONuLtx4a3u0AZ/Zg6jH9vjhi pGdg== 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=L+Tr1aJ/1U7SSoQFvZY18daFxyz7tyr2ijgcaPyf236SlgVdwCtwmU5BETAe0J7BZI y3B+TgO04MMN7Xp8bgl8EncYbTxFPdnL7hT6NGsrYPQAD1czFUaDVxs2VN+GwxNkwIde vVd+vz0U1zkW0N9U5ipYpII0xh6ryDwN0Slr6CIMVhXxouRuLboqr85UITQmP58hKYIP VPtcwaRFPJXbGoqd9U8TVfy7czyNTW9LXQijWhZfG/dlbtKiwzlUoU84pPkyR4ZlxfX2 +hqRTTHJ3MqBzz/elVZ4S+zFduqQ2spYfNbxGkXvUOt9emvcYZInUrjcy+Tonc5h18v4 v/Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AyXyOWfB; 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 m23si2623486edr.595.2021.07.29.05.29.25; Thu, 29 Jul 2021 05:29:50 -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=AyXyOWfB; 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 S236916AbhG2M2f (ORCPT + 99 others); Thu, 29 Jul 2021 08:28:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236976AbhG2M2e (ORCPT ); Thu, 29 Jul 2021 08:28:34 -0400 Received: from mail-qk1-x74a.google.com (mail-qk1-x74a.google.com [IPv6:2607:f8b0:4864:20::74a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA16EC061765 for ; Thu, 29 Jul 2021 05:28:30 -0700 (PDT) Received: by mail-qk1-x74a.google.com with SMTP id u22-20020ae9c0160000b02903b488f9d348so3702377qkk.20 for ; Thu, 29 Jul 2021 05:28:30 -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=AyXyOWfBN7ZM6tBAQpok+eKjmCT++RGqnUTSOzcKp5APcOjqxsoiZVp9QDlW4O6/ne 2WderqJU2PEEra8xg9gpYCfg58OWldSofqLqh7rOUsnji7HZ6B3T5f3G4OWB8MwTy+Pk Im5c3/hV69W9/e2IGIda89KsX3rMUJrVwroK40y3hcxNqnHFb0YZJ/rgF9lrJAQN+ftq XvMSrN+N9GJQFu7quBHy+HUWThgAjrgteonZuvO1Y2LSgNVhBlLaLZ7/cyfSoX+dDf2R o4Y5e8Kms+3zxkd6kVlk2es1KgQTjUh2wtfHuuA4UjNU3F8uJlSW3K5bZROeqngqIvRf Jlqg== 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=h1Vg8Ymvp54dAt1XipTSMtUgKi8KREJ6wTzkEQwcW032A3XWo631vULKm3H1WpDgN5 okBdgbFsaNYPB/CSq/jEmYGAw7J6FIE00teTPuiZ7shnBxBMTuUUzXVQgoAQYkKX137g Ispuio29YHDCFLvtMfrBmYwYw4UwswtMG3IBu60SCPCIAXSRCUCOHSlMsgK1CdbgrN35 xl7JgTK6dCfomAMwfbh+muZTmRHdQtlDCRmBXBRInht0thek4y16xzAVmWERzInZ2y0S XE7j0diIFqROIKdTIm1nb98prqmYwp0Ppt7d4C3AhAgcVTuQo4kX4CUOnB6zgFqtM0+R t0Hw== X-Gm-Message-State: AOAM531btjeIsaDVcVhtlHJUAu24jFgjv5uGcZxsJJ6KruE5PA4fo2CK 2JNDeG5qmIfS0niUt57FTb1dFP0jB9nsf0vvqTaEB5i3dZsuCaN7jHnsK6OVrCd5BPI0tXcHA8Q +oS28EH7h7WJTr3xM33EpZ4iYEDuXH+gafgjofGrluoqPcjPLSJ1RHlkMFx81IUfWS+N09+oQnK ddfRZqU0cAROk= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:ff72:1420:4502:fdaf]) (user=howardchung job=sendgmr) by 2002:a0c:fbd1:: with SMTP id n17mr5013725qvp.19.1627561710030; Thu, 29 Jul 2021 05:28:30 -0700 (PDT) Date: Thu, 29 Jul 2021 20:27:44 +0800 In-Reply-To: <20210729122751.3728885-1-howardchung@google.com> Message-Id: <20210729202648.Bluez.v6.6.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid> Mime-Version: 1.0 References: <20210729122751.3728885-1-howardchung@google.com> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [Bluez PATCH v6 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