bluez/tools/hcisecfilter.c
Tedd Ho-Jeong An 0a259dd05b tools: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 GPL-2.0-or-later     :     97
 LGPL-2.1-or-later    :     38
 GPL-2.0-only         :      2

License: GPL-2.0-or-later
   tools/l2cap-tester.c
   tools/hcisecfilter.c
   tools/ciptool.c
   tools/btsnoop.c
   tools/check-selftest.c
   tools/btpclientctl.c
   tools/hci-tester.c
   tools/hcitool.c
   tools/btiotest.c
   tools/oobtest.c
   tools/btinfo.c
   tools/hwdb.c
   tools/hciattach_bcm43xx.c
   tools/mgmt-tester.c
   tools/hex2hcd.c
   tools/hciattach_st.c
   tools/smp-tester.c
   tools/bluetooth-player.c
   tools/hciattach_tialt.c
   tools/gap-tester.c
   tools/bluemoon.c
   tools/bneptest.c
   tools/gatt-service.c
   tools/rctest.c
   tools/rfcomm-tester.c
   tools/hcieventmask.c
   tools/hciattach_ti.c
   tools/seq2bseq.c
   tools/scotest.c
   tools/bcmfw.c
   tools/hciconfig.c
   tools/btattach.c
   tools/l2ping.c
   tools/obexctl.c
   tools/l2test.c
   tools/hciattach_intel.c
   tools/hciattach.h
   tools/create-image.c
   tools/bnep-tester.c
   tools/userchan-tester.c
   tools/rfcomm.c
   tools/btmon-logger.c
   tools/hcidump.c
   tools/rtlfw.c
   tools/hciattach_qualcomm.c
   tools/btproxy.c
   tools/nokfw.c
   tools/hciattach_ath3k.c
   tools/3dsp.c
   tools/bdaddr.c
   tools/sco-tester.c
   tools/hciattach.c
   tools/amptest.c
   tools/btgatt-server.c
   tools/btgatt-client.c
   tools/cltest.c
   tools/ibeacon.c
   tools/mcaptest.c
   tools/hid2hci.c
   tools/btmgmt.c
   tools/advtest.c
   tools/eddystone.c
   tools/avtest.c
   tools/mpris-proxy.c
   tools/avinfo.c
   tools/sdptool.c
   tools/btconfig.c
   tools/update_compids.sh
   tools/parser/parser.h
   tools/parser/obex.c
   tools/parser/amp.c
   tools/parser/sdp.c
   tools/parser/tcpip.c
   tools/parser/sap.c
   tools/parser/cmtp.c
   tools/parser/avctp.c
   tools/parser/lmp.c
   tools/parser/ppp.c
   tools/parser/rfcomm.h
   tools/parser/hci.c
   tools/parser/sdp.h
   tools/parser/parser.c
   tools/parser/rfcomm.c
   tools/parser/avdtp.c
   tools/parser/avrcp.c
   tools/parser/ericsson.c
   tools/parser/hcrp.c
   tools/parser/bpa.c
   tools/parser/hidp.c
   tools/parser/bnep.c
   tools/parser/capi.c
   tools/parser/att.c
   tools/parser/l2cap.c
   tools/parser/smp.c
   tools/parser/csr.c
   tools/parser/l2cap.h
   tools/parse_companies.pl

License: LGPL-2.1-or-later
   tools/test-runner.c
   tools/btpclient.c
   tools/meshctl.c
   tools/mesh-cfgclient.c
   tools/mesh/model.h
   tools/mesh/util.h
   tools/mesh/config-model.h
   tools/mesh/cfgcli.h
   tools/mesh/mesh-db.c
   tools/mesh/mesh-db.h
   tools/mesh/keys.c
   tools/mesh/util.c
   tools/mesh/agent.h
   tools/mesh/remote.c
   tools/mesh/keys.h
   tools/mesh/agent.c
   tools/mesh/cfgcli.c
   tools/mesh/remote.h
   tools/mesh-gatt/prov.c
   tools/mesh-gatt/util.h
   tools/mesh-gatt/prov.h
   tools/mesh-gatt/net.c
   tools/mesh-gatt/util.c
   tools/mesh-gatt/prov-db.h
   tools/mesh-gatt/crypto.c
   tools/mesh-gatt/crypto.h
   tools/mesh-gatt/gatt.c
   tools/mesh-gatt/config-server.c
   tools/mesh-gatt/keys.h
   tools/mesh-gatt/onoff-model.c
   tools/mesh-gatt/net.h
   tools/mesh-gatt/gatt.h
   tools/mesh-gatt/node.c
   tools/mesh-gatt/config-client.c
   tools/mesh-gatt/mesh-net.h
   tools/mesh-gatt/node.h
   tools/mesh-gatt/onoff-model.h
   tools/mesh-gatt/prov-db.c

License: GPL-2.0-only
   tools/obex-server-tool.c
   tools/obex-client-tool.c
2020-09-29 14:37:23 -07:00

143 lines
5.2 KiB
C

// SPDX-License-Identifier: GPL-2.0-or-later
/*
*
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
*
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <sys/socket.h>
#include "lib/bluetooth.h"
#include "lib/hci.h"
#include "lib/hci_lib.h"
int main(int argc, char *argv[])
{
uint32_t type_mask;
uint32_t event_mask[2];
uint32_t ocf_mask[4];
/* Packet types */
memset(&type_mask, 0, sizeof(type_mask));
hci_set_bit(HCI_EVENT_PKT, &type_mask);
printf("Type mask: { 0x%02x }\n", type_mask);
/* Events */
memset(event_mask, 0, sizeof(event_mask));
hci_set_bit(EVT_INQUIRY_COMPLETE, event_mask);
hci_set_bit(EVT_INQUIRY_RESULT, event_mask);
hci_set_bit(EVT_CONN_COMPLETE, event_mask);
hci_set_bit(EVT_CONN_REQUEST, event_mask);
hci_set_bit(EVT_DISCONN_COMPLETE, event_mask);
hci_set_bit(EVT_AUTH_COMPLETE, event_mask);
hci_set_bit(EVT_REMOTE_NAME_REQ_COMPLETE, event_mask);
hci_set_bit(EVT_ENCRYPT_CHANGE, event_mask);
hci_set_bit(EVT_READ_REMOTE_FEATURES_COMPLETE, event_mask);
hci_set_bit(EVT_READ_REMOTE_VERSION_COMPLETE, event_mask);
hci_set_bit(EVT_CMD_COMPLETE, event_mask);
hci_set_bit(EVT_CMD_STATUS, event_mask);
hci_set_bit(EVT_READ_CLOCK_OFFSET_COMPLETE, event_mask);
hci_set_bit(EVT_INQUIRY_RESULT_WITH_RSSI, event_mask);
hci_set_bit(EVT_READ_REMOTE_EXT_FEATURES_COMPLETE, event_mask);
hci_set_bit(EVT_SYNC_CONN_COMPLETE, event_mask);
hci_set_bit(EVT_SYNC_CONN_CHANGED, event_mask);
hci_set_bit(EVT_EXTENDED_INQUIRY_RESULT, event_mask);
printf("Event mask: { 0x%08x, 0x%08x }\n",
event_mask[0], event_mask[1]);
/* OGF_LINK_CTL */
memset(ocf_mask, 0, sizeof(ocf_mask));
hci_set_bit(OCF_INQUIRY, ocf_mask);
hci_set_bit(OCF_INQUIRY_CANCEL, ocf_mask);
hci_set_bit(OCF_REMOTE_NAME_REQ, ocf_mask);
hci_set_bit(OCF_REMOTE_NAME_REQ_CANCEL, ocf_mask);
hci_set_bit(OCF_READ_REMOTE_FEATURES, ocf_mask);
hci_set_bit(OCF_READ_REMOTE_EXT_FEATURES, ocf_mask);
hci_set_bit(OCF_READ_REMOTE_VERSION, ocf_mask);
hci_set_bit(OCF_READ_CLOCK_OFFSET, ocf_mask);
hci_set_bit(OCF_READ_LMP_HANDLE, ocf_mask);
printf("OGF_LINK_CTL: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_LINK_POLICY */
memset(ocf_mask, 0, sizeof(ocf_mask));
hci_set_bit(OCF_ROLE_DISCOVERY, ocf_mask);
hci_set_bit(OCF_READ_LINK_POLICY, ocf_mask);
hci_set_bit(OCF_READ_DEFAULT_LINK_POLICY, ocf_mask);
printf("OGF_LINK_POLICY: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_HOST_CTL */
memset(ocf_mask, 0, sizeof(ocf_mask));
hci_set_bit(OCF_READ_PIN_TYPE, ocf_mask);
hci_set_bit(OCF_READ_LOCAL_NAME, ocf_mask);
hci_set_bit(OCF_READ_CONN_ACCEPT_TIMEOUT, ocf_mask);
hci_set_bit(OCF_READ_PAGE_TIMEOUT, ocf_mask);
hci_set_bit(OCF_READ_SCAN_ENABLE, ocf_mask);
hci_set_bit(OCF_READ_PAGE_ACTIVITY, ocf_mask);
hci_set_bit(OCF_READ_INQ_ACTIVITY, ocf_mask);
hci_set_bit(OCF_READ_AUTH_ENABLE, ocf_mask);
hci_set_bit(OCF_READ_ENCRYPT_MODE, ocf_mask);
hci_set_bit(OCF_READ_CLASS_OF_DEV, ocf_mask);
hci_set_bit(OCF_READ_VOICE_SETTING, ocf_mask);
hci_set_bit(OCF_READ_AUTOMATIC_FLUSH_TIMEOUT, ocf_mask);
hci_set_bit(OCF_READ_NUM_BROADCAST_RETRANS, ocf_mask);
hci_set_bit(OCF_READ_HOLD_MODE_ACTIVITY, ocf_mask);
hci_set_bit(OCF_READ_TRANSMIT_POWER_LEVEL, ocf_mask);
hci_set_bit(OCF_READ_LINK_SUPERVISION_TIMEOUT, ocf_mask);
hci_set_bit(OCF_READ_NUM_SUPPORTED_IAC, ocf_mask);
hci_set_bit(OCF_READ_CURRENT_IAC_LAP, ocf_mask);
hci_set_bit(OCF_READ_PAGE_SCAN_PERIOD_MODE, ocf_mask);
hci_set_bit(OCF_READ_PAGE_SCAN_MODE, ocf_mask);
hci_set_bit(OCF_READ_INQUIRY_SCAN_TYPE, ocf_mask);
hci_set_bit(OCF_READ_INQUIRY_MODE, ocf_mask);
hci_set_bit(OCF_READ_PAGE_SCAN_TYPE, ocf_mask);
hci_set_bit(OCF_READ_AFH_MODE, ocf_mask);
hci_set_bit(OCF_READ_EXT_INQUIRY_RESPONSE, ocf_mask);
hci_set_bit(OCF_READ_SIMPLE_PAIRING_MODE, ocf_mask);
hci_set_bit(OCF_READ_INQ_RESPONSE_TX_POWER_LEVEL, ocf_mask);
hci_set_bit(OCF_READ_DEFAULT_ERROR_DATA_REPORTING, ocf_mask);
printf("OGF_HOST_CTL: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_INFO_PARAM */
memset(ocf_mask, 0, sizeof(ocf_mask));
hci_set_bit(OCF_READ_LOCAL_VERSION, ocf_mask);
hci_set_bit(OCF_READ_LOCAL_COMMANDS, ocf_mask);
hci_set_bit(OCF_READ_LOCAL_FEATURES, ocf_mask);
hci_set_bit(OCF_READ_LOCAL_EXT_FEATURES, ocf_mask);
hci_set_bit(OCF_READ_BUFFER_SIZE, ocf_mask);
hci_set_bit(OCF_READ_COUNTRY_CODE, ocf_mask);
hci_set_bit(OCF_READ_BD_ADDR, ocf_mask);
printf("OGF_INFO_PARAM: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
/* OGF_STATUS_PARAM */
memset(ocf_mask, 0, sizeof(ocf_mask));
hci_set_bit(OCF_READ_FAILED_CONTACT_COUNTER, ocf_mask);
hci_set_bit(OCF_READ_LINK_QUALITY, ocf_mask);
hci_set_bit(OCF_READ_RSSI, ocf_mask);
hci_set_bit(OCF_READ_AFH_MAP, ocf_mask);
hci_set_bit(OCF_READ_CLOCK, ocf_mask);
printf("OGF_STATUS_PARAM: { 0x%08x, 0x%08x, 0x%08x, 0x%02x }\n",
ocf_mask[0], ocf_mask[1], ocf_mask[2], ocf_mask[3]);
return 0;
}