Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp170157pxv; Wed, 7 Jul 2021 23:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhkrPWo89BCnmS7HOXwws2XLqZIDQkxXLfg3yJp1ETZlE2hWXGfNWnbXlLn8nnUxP4RvJd X-Received: by 2002:a17:907:c1d:: with SMTP id ga29mr25075220ejc.284.1625725550228; Wed, 07 Jul 2021 23:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625725550; cv=none; d=google.com; s=arc-20160816; b=tROZ2Sg2AuoVeRYWjW1gR+oXNaMXNWk2JSzaF9od9lq4MTzZGzq4O1X1sACiaHR8OZ //EFrDeQ0bG5wxHttG5CkvoTFsbuKReU0zCzqKE5LeJTTrqhWh9Qt+nqqtxwHIRFvt3v zR6ZTjaNta+GDAg3YB3hfreg5GtjuaeopmIw0ymYcMLv2XknIcKhE3cZtR7LwfIxvked zqXldVSOlEUVSQSUE6FOV2m+CK/B0NslQyB9JCCcsYb3iCDAdTFoYGzI6vmbQ/ZH4U4Q 5+hVQlAqNL8yvjvQRJvyKSWY249qAZOjIf6mgCtbQdo7zdmTIqTlPBmaOB+vFZFkK6UK /UNQ== 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=w16n9MQt4OHipTQ2Rw2GOOnH2k4YMLK6G//sUcAoKMU=; b=lFkC/VKTEn8pBkuPc+hsgnWD/4+7twwGjAqrOxDGzYIOdsMsj8FHLdpHIua93bZnm+ YOqRxtRjXJkTRhly6z0SXbI1ciZfFrr7i4ftaNzWyRRp3Ia7Yz1oP8bzByelAIDMJTDZ 6S2JYAD4rVD4ohz4iMOv35ZElTmM0hAlBoEWChM9XcVQkvjQ2fs1DIX8/fx28WZBCLIq UFP7ke6y5D4lZVVpWne71v3ep4A4L+KmJ3/7zZb1/8sj7qcpJX2Bgkaf+nYZ9RNhxaUo ZJUsvFUI43LNDo8VZ3BBRGObDn3LErbYpc1JpuBjkA2jJJY/4sAdrX93g/XmkwsVAxAb KqAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kkvXW4I3; 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 j29si1651438ejj.60.2021.07.07.23.25.00; Wed, 07 Jul 2021 23:25: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=kkvXW4I3; 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 S229842AbhGHG0b (ORCPT + 99 others); Thu, 8 Jul 2021 02:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbhGHG0a (ORCPT ); Thu, 8 Jul 2021 02:26:30 -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 87E93C061574 for ; Wed, 7 Jul 2021 23:23:49 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id k11-20020a056902070bb029055a2303fc2dso5718993ybt.11 for ; Wed, 07 Jul 2021 23:23:49 -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=w16n9MQt4OHipTQ2Rw2GOOnH2k4YMLK6G//sUcAoKMU=; b=kkvXW4I3g8f/D/1Xb5QHu8Ahzq2iKwNVLywHzVslnd3xC+Oe7quG6JZsmic7Kj9CYd iEIZ3mHudshC6LH6vW1eJUoEm2XnIrQupZD6jjrpmkdAcb078Nf0WTPOtqjb6nXKpDgr 0BMJprbrOMa3Q0YEBF1+IGyQF3vdaoi34Ddnjm1VfoWC7V7qHpbaeJcjQNvH+ZM4+CKs DwE+6+jjD0FKap8xPT6c4AYf38O0N1TasFVWzIRyfCd9WRdouaB5myZpfK/CSHjbCu1S 26Jm7JKvjIUM4aM9Q3PUFIzVRmHrW8TEWouRNacCbmo39rJMjo0EVcx1r0rYw9E8yaik n8RQ== 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=w16n9MQt4OHipTQ2Rw2GOOnH2k4YMLK6G//sUcAoKMU=; b=kavhH6wbOizZ/dZ7p9Pu/SvGL1nbB8QcVZ6isfDZqKlZTR/34L6b7gSak6vqwc/EhF yjcwuEbYs0x6Sq1478EEMicRkpBjcd16Sv1swOl1HkGcoUSShUdyu/VjvXggor8f6nVa jXMma5g0vZ0FspvdEkKJGEnmMjx4McDcROqON6z60cedTpe2cmGb005HIumPTFxB6J0H 3xSDUq5aZ7RyuGSf+EDEkw+2lbrozsfcVTIVgztIO3Nrdxt5H8AZ30SIv4WSuyK2Niju Q7ulueeyIgmsuQv6c8Su2Sed9z6T5bVzWSpYLD+UppS7/SwghTmc97jw5PZ3xwGLPOV6 hZvw== X-Gm-Message-State: AOAM533z2g5acNQdMvdxd+K5qIDMuEc3o7Xve43jhse0BnfEJWwE1UkD LhpeuLTE3HP+VplJgpaFLJBHx0s4YXbNXONrpsurPRpK9KYPbcn08AESZ0JMH8Mvao7KKpIrsZg jLM35X9gJAWgzbTMZ0z6iXcVNcWyS5683ZhXzofjyCpAapE0F/MoLdikb9qX/MiIe1dGIhL7DrH OH38+CoDy6Czs= X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:de70:7033:67f7:8d0b]) (user=howardchung job=sendgmr) by 2002:a25:3486:: with SMTP id b128mr40693149yba.523.1625725428653; Wed, 07 Jul 2021 23:23:48 -0700 (PDT) Date: Thu, 8 Jul 2021 14:23:07 +0800 In-Reply-To: <20210708062314.245754-1-howardchung@google.com> Message-Id: <20210708142059.Bluez.v1.7.Id0842634d98a21fbdfa5cc72c76a462a98bf6f40@changeid> Mime-Version: 1.0 References: <20210708062314.245754-1-howardchung@google.com> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog Subject: [Bluez PATCH v1 07/14] plugins: add a new plugin for admin_policy From: Howard Chung To: linux-bluetooth@vger.kernel.org, luiz.dentz@gmail.com Cc: Yun-Hao Chung , Miao-chen Chou , Shyh-In Hwang 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_policy. Reviewed-by: Miao-chen Chou Reviewed-by: Shyh-In Hwang --- 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 \ --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 +#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) -- 2.32.0.93.g670b81a890-goog