Bug 248584

Summary: usr.sbin/bluetooth/btpand: rc script to start btpand
Product: Base System Reporter: Tatsuki Makino <tatsuki_makino>
Component: confAssignee: freebsd-wireless (Nobody) <wireless>
Status: Open ---    
Severity: Affects Only Me CC: emax, lwhsu, takawata
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to head/libexec/rc/rc.d/Makefile
none
patch to head/libexec/rc/rc.d/btpand
none
patch to head/libexec/rc/rc.d/btpand
none
patch to head/libexec/rc/rc.d/btpand none

Description Tatsuki Makino 2020-08-11 05:04:38 UTC
Created attachment 217142 [details]
patch to head/libexec/rc/rc.d/Makefile

Add /etc/rc.d/btpand for btpand.
If you already have one that you use, bring it here :)
Comment 1 Tatsuki Makino 2020-08-11 05:07:56 UTC
Created attachment 217143 [details]
patch to head/libexec/rc/rc.d/btpand

This was made by me.
Use it as a base for reworking :)

Below is a setting you can put in /etc/rc.conf.

# Set the tap0
cloned_interfaces="${cloned_interfaces:+${cloned_interfaces} }tap0"
ifconfig_tap0_alias0="inet6 2001:db8::746f:6f74:6575:6c42 prefixlen 64"
ifconfig_tap0_alias1="inet 192.0.2.66 netmask 255.255.255.0"

# The normal configuration of btpand.
btpand_enable="YES"
btpand_device="58:9c:fc:00:0e:b3"
btpand_service="NAP"

# Multi-profile settings
btpand_profiles="panu gn nap"
btpand_panu_enable="YES"
btpand_panu_device="ubt0"	# can set bluetooth device name
btpand_panu_service="PANU"
btpand_panu_remote="58:9c:fc:ed:8c:0e"	# client mode
btpand_gn_enable="YES"
btpand_gn_device="phone"	# Strings that are not device names are from /etc/bluetooth/hosts
btpand_gn_service="GN"
btpand_nap_enable="YES"
btpand_nap_device="58:9c:fc:00:0e:b3"
btpand_nap_service="NAP"
Comment 2 Tatsuki Makino 2020-08-11 05:18:22 UTC
(In reply to Tatsuki Makino from comment #1)
forgotten items orz

btpand_tapif="tap0"

btpand_panu_tapif="tap2"
btpand_gn_tapif="tap1"
btpand_nap_tapif="tap0"
Comment 3 Tatsuki Makino 2020-08-11 07:15:09 UTC
Created attachment 217146 [details]
patch to head/libexec/rc/rc.d/btpand

Removed useless bt_devaddr(3) emulation :)
Comment 4 Tatsuki Makino 2020-08-22 00:02:15 UTC
Created attachment 217433 [details]
patch to head/libexec/rc/rc.d/btpand

Pattern matching in case怜esac was not working properly.