Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2253820pxy; Tue, 3 Aug 2021 01:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLWKiLEIIfSEJBLnQNKA5FfUalsafX5F+aBMC/F01/ON3LU3tLyskMyyqnfQxXH9B7IkaR X-Received: by 2002:a05:6402:10d9:: with SMTP id p25mr23718301edu.51.1627979117776; Tue, 03 Aug 2021 01:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627979117; cv=none; d=google.com; s=arc-20160816; b=YU5tXIgTvN1ELjxUOD8VWGCdapGNjDf1w/DJJwMRAHSCEX6dzcIFS9aI4cphBwrdvk zhhBKYs1+a7XXh+Q6nJ7IE2KW3ciIODpRmikx17opHJdoe3oZzTpouL8x4k3xEC+uFjE NTfO5Y/eGVSxLy/kOy/4XdtpBMsLvOZbA7DnKsVsg/vucj6LLd7M0Kh+MTeQxF/qlXMw pfcR4BOw8IXc4a4DpN2DTWsI/PqPqeQ5Jz40f9lkz921/tW1n7j0WpApywj3epZFlueV yc1we+fdKUdisMlHkcOEX2E/y8ZfA3+g1A5a0hsEIjmd4Zcd9L+9CmkQJHaFhl4ij75/ EwkA== 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=QSoOoVc5aWrxDqP7d7LQBU5PuhxUf/Uesg3q8jc9VkamO+ioqs6uTtWOkrd8GinxfY uzO+skdMbDamIRJu7OJ0dK9/r87mvgsLS6Rk2iAgXmyj8Im/cChwXWyiQRlXKRwm7t2G duhX2ciRTbWJ3b35HO19GBKRkMWNRiP4pvCn5xmnn/R5m3pAiH6rl2JM5uIYgUH5LHvw RpSlRhBeB3OF5gmeVXw+pMaMSoGnhVLuBCeK94zy9awR4H8r81QGXQHbK8JNp3VGNX+o tnwQ+hLZCZgpoTjJOoxbxkpdDIEyDeZawqFYRPPdGqbmjRHtvyASiWpSAWCf9nCYm5P8 B6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XwmmyjYy; 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 p23si10647714edw.135.2021.08.03.01.24.49; Tue, 03 Aug 2021 01:25:17 -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=XwmmyjYy; 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 S234431AbhHCIXd (ORCPT + 99 others); Tue, 3 Aug 2021 04:23:33 -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-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 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