Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2361962pxy; Tue, 3 Aug 2021 04:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygTwRytxdXacFY5Hoh4S6oQk24Cw0tDmfEbOYcichhJeCCtaevahKEaMTO0Js9YnsCHMgz X-Received: by 2002:a17:906:1f8b:: with SMTP id t11mr20248866ejr.131.1627991179483; Tue, 03 Aug 2021 04:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627991179; cv=none; d=google.com; s=arc-20160816; b=DOGSMrd7X9nXXJ2ipT2cCCabRj8gMFzeQ/qeXzXhvud2Wcb07GWLOyi3HQwHfOxaV/ R39UhcoNKaR85FD1+pEPK2WTNbSTt7TAOc+A4Hp1VXkxM9SR75ACB7xdcRTYOzt2ap+r jxnYPYJcqiq6IEO1bV774BhtKLR1c17xiOVCFn/5WP7AvsbrTWAA08teWMDhL/MyHD+9 wN3h2M29wMT/kewjfZ41YM/2vt/Lu6dcOsyG5ywcRaxWfU2FIu7f4h82gjdpjOrA8wjz 69LQkBDfRQ5wK6NvG8FxxN90Il55PTsJk7l/Fs9YzxsFyESJ7sfkFXrG+RWYlVbHUKSb +pTA== 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=UzdNVOOIZJ4I9w1ipcijSbEWYIKVvmbRq1TXf70XknGzpCQtNiNZsTcVIih3NK/aZh Yziyl/W1TwUsyLTdgZEf+f2IQHrukZs2ehV4FtPWSEjob18bpNeq2vIR3ZZriFXM+HIA 1UmZLTdWdTGM4mjjbBmKmSBM49Z7dWQDX2kes54VgEcqg58tw+tC2udyqVPz5KHtP5Tf kqvz0T+FPh8Rm4ZCYn7w5gDj/jWBi3W2dpKe9SdVr+LZpVZ3eHhBuTCAiRiJoOTw/0WI VrDqT8obvES3MrYN/JdObgfBTD+w00QdftvfzP5hOQkWDYCjeM0+TiA2VuAY7OYOUuT+ I0hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sOR0vGFX; 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 bx17si12252024edb.464.2021.08.03.04.45.43; Tue, 03 Aug 2021 04:46:19 -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=sOR0vGFX; 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 S236005AbhHCLop (ORCPT + 99 others); Tue, 3 Aug 2021 07:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234693AbhHCLn5 (ORCPT ); Tue, 3 Aug 2021 07:43:57 -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 CA48CC06175F for ; Tue, 3 Aug 2021 04:43:45 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id f3-20020a25cf030000b029055a2303fc2dso22574803ybg.11 for ; Tue, 03 Aug 2021 04:43:45 -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=sOR0vGFXbXEJ7HK7fHJQ0NbV+cMlmdzOlXAwaTfCkqpvTcYMO4YYyFtXffII8yQZEY iteQg1cscKQCaEWm9uVTF3pH4PsWYpaFjXwjKlUIkeOFCAlegAVAYJmIf0jhzy11bD4f /AZX7DjjqXWBq3o8WsIatSn9twe72/PHwlmLe7EdyS2gF8JWHkIWJ852GqLXsd965slW 6ZBRwzo6oNNRFb+su+M1KTMxe/8v/xYvO6GnKHK+JcuJqXHu27VPqB72C/4fCskOZfsz 9wbdL9ZGh9uiOLNIhSvgaR1/9yvcWq52RrB36IU3N4h2yf64ICoovjUonyWZgptY/nal Otzg== 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=KR08obdu0HyJS3I6lJ3elUYKhJycG1KVkrAunSTy7RZ689BELF4AB68T/IVvU2nVt2 0hI4aTQXFJazhwVtW1SG4e30whFg2g4EHDVlJhqvmJR9W/2pVVVvoQy/qDPuFBpQi5Mn ptcWoWYSUIi08Gh19sV441wC0+qN8Bqxq+Q3dCTdFWdnuYWFXTL1RB2tgEqL/xd98rRx lVm/lpu2mk2BSSEbZvHb+ue5SUGIBzgy5iJ0EVNon8GTjkMwi9Rl1RZO5nxyZ+8oQUu5 d16Dp5CPbpFlJFgULo8K7GSdVNALeqzoInDs6MqAMFVjVmAlTGTkBYaLvuQ6EGqv+eH/ c+Vg== X-Gm-Message-State: AOAM531SVRLSVGl5wnidQLer9vaXVs8Pb6ma3iPXX6PyQt0sZHqr/3yX 00B161xbEa0Hg+MIm1i300kII5w9klbGOsnexrho8lQpsZgmldT0al175LAxrye2AvQKWvwymdd mwc8N52tcT4k5LmAdFIDULseUa7xfE5+i829+bEy9uPDLcFWZhlrvKBA16bB1nU2X8A1cby7U6n ijMtMMyFE2loc= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:ef55:8161:c77b:7a8d]) (user=howardchung job=sendgmr) by 2002:a25:2785:: with SMTP id n127mr26741690ybn.235.1627991025047; Tue, 03 Aug 2021 04:43:45 -0700 (PDT) Date: Tue, 3 Aug 2021 19:43:09 +0800 In-Reply-To: <20210803114317.801840-1-howardchung@google.com> Message-Id: <20210803194127.Bluez.v9.5.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid> Mime-Version: 1.0 References: <20210803114317.801840-1-howardchung@google.com> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog Subject: [Bluez PATCH v9 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 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