btpand.c (187938) | btpand.c (188013) |
---|---|
1/* $NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ 2 3/*- 4 * Copyright (c) 2008 Iain Hibbert 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 | 1/* $NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $ */ 2 3/*- 4 * Copyright (c) 2008 Iain Hibbert 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 |
28/* $FreeBSD: head/usr.sbin/bluetooth/btpand/btpand.c 187938 2009-01-30 22:23:21Z emax $ */ | 28/* $FreeBSD: head/usr.sbin/bluetooth/btpand/btpand.c 188013 2009-02-02 18:08:22Z emax $ */ |
29 30#include <sys/cdefs.h> 31__COPYRIGHT("@(#) Copyright (c) 2008 Iain Hibbert. All rights reserved."); 32__RCSID("$NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $"); 33 34#include <sys/wait.h> 35 36#include <bluetooth.h> --- 12 unchanged lines hidden (view full) --- 49/* global variables */ 50const char * control_path; /* -c <path> */ 51const char * interface_name; /* -i <ifname> */ 52const char * service_name; /* -s <service> */ 53uint16_t service_class; 54 55bdaddr_t local_bdaddr; /* -d <addr> */ 56bdaddr_t remote_bdaddr; /* -a <addr> */ | 29 30#include <sys/cdefs.h> 31__COPYRIGHT("@(#) Copyright (c) 2008 Iain Hibbert. All rights reserved."); 32__RCSID("$NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $"); 33 34#include <sys/wait.h> 35 36#include <bluetooth.h> --- 12 unchanged lines hidden (view full) --- 49/* global variables */ 50const char * control_path; /* -c <path> */ 51const char * interface_name; /* -i <ifname> */ 52const char * service_name; /* -s <service> */ 53uint16_t service_class; 54 55bdaddr_t local_bdaddr; /* -d <addr> */ 56bdaddr_t remote_bdaddr; /* -a <addr> */ |
57uint16_t l2cap_psm = 15; /* -p <psm> */ 58int l2cap_mode = 0; /* -m <mode> */ | 57uint16_t l2cap_psm; /* -p 58int l2cap_mode; /* -m |
59 60int server_limit; /* -n <limit> */ 61 62static const struct { 63 const char * name; 64 uint16_t class; 65 const char * desc; 66} services[] = { --- 105 unchanged lines hidden (view full) --- 172 if (!bdaddr_any(&remote_bdaddr) && (server_limit != 0 || 173 control_path != 0 || (service_name != NULL && l2cap_psm != 0))) 174 usage(); 175 176 /* default options */ 177 if (interface_name == NULL) 178 interface_name = "/dev/tap"; 179 | 59 60int server_limit; /* -n <limit> */ 61 62static const struct { 63 const char * name; 64 uint16_t class; 65 const char * desc; 66} services[] = { --- 105 unchanged lines hidden (view full) --- 172 if (!bdaddr_any(&remote_bdaddr) && (server_limit != 0 || 173 control_path != 0 || (service_name != NULL && l2cap_psm != 0))) 174 usage(); 175 176 /* default options */ 177 if (interface_name == NULL) 178 interface_name = "/dev/tap"; 179 |
180 if (l2cap_psm == 0) 181 l2cap_psm = L2CAP_PSM_BNEP; 182 |
|
180 if (bdaddr_any(&remote_bdaddr) && server_limit == 0) { 181 if (service_class == SDP_SERVICE_CLASS_PANU) 182 server_limit = 1; 183 else 184 server_limit = 7; 185 } 186 187#ifdef L2CAP_LM_MASTER --- 103 unchanged lines hidden --- | 183 if (bdaddr_any(&remote_bdaddr) && server_limit == 0) { 184 if (service_class == SDP_SERVICE_CLASS_PANU) 185 server_limit = 1; 186 else 187 server_limit = 7; 188 } 189 190#ifdef L2CAP_LM_MASTER --- 103 unchanged lines hidden --- |