link_policy.c (122451) | link_policy.c (128079) |
---|---|
1/* 2 * link_policy.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 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 --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: link_policy.c,v 1.3 2003/08/18 19:19:54 max Exp $ | 1/* 2 * link_policy.c 3 * 4 * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 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 --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * $Id: link_policy.c,v 1.3 2003/08/18 19:19:54 max Exp $ |
29 * $FreeBSD: head/usr.sbin/bluetooth/hccontrol/link_policy.c 122451 2003-11-11 02:43:10Z emax $ | 29 * $FreeBSD: head/usr.sbin/bluetooth/hccontrol/link_policy.c 128079 2004-04-09 23:58:53Z emax $ |
30 */ 31 32#include <bluetooth.h> 33#include <errno.h> 34#include <stdio.h> 35#include <string.h> 36#include "hccontrol.h" 37 --- 7 unchanged lines hidden (view full) --- 45 46 /* parse command parameters */ 47 switch (argc) { 48 case 1: 49 /* connection handle */ 50 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 51 return (USAGE); 52 | 30 */ 31 32#include <bluetooth.h> 33#include <errno.h> 34#include <stdio.h> 35#include <string.h> 36#include "hccontrol.h" 37 --- 7 unchanged lines hidden (view full) --- 45 46 /* parse command parameters */ 47 switch (argc) { 48 case 1: 49 /* connection handle */ 50 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 51 return (USAGE); 52 |
53 cp.con_handle = (u_int16_t) (n & 0x0fff); | 53 cp.con_handle = (uint16_t) (n & 0x0fff); |
54 cp.con_handle = htole16(cp.con_handle); 55 break; 56 57 default: 58 return (USAGE); 59 } 60 61 /* send request */ --- 99 unchanged lines hidden (view full) --- 161 162 /* parse command parameters */ 163 switch (argc) { 164 case 1: 165 /* connection handle */ 166 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 167 return (USAGE); 168 | 54 cp.con_handle = htole16(cp.con_handle); 55 break; 56 57 default: 58 return (USAGE); 59 } 60 61 /* send request */ --- 99 unchanged lines hidden (view full) --- 161 162 /* parse command parameters */ 163 switch (argc) { 164 case 1: 165 /* connection handle */ 166 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 167 return (USAGE); 168 |
169 cp.con_handle = (u_int16_t) (n & 0x0fff); | 169 cp.con_handle = (uint16_t) (n & 0x0fff); |
170 cp.con_handle = htole16(cp.con_handle); 171 break; 172 173 default: 174 return (USAGE); 175 } 176 177 /* send request */ --- 26 unchanged lines hidden (view full) --- 204 205 /* parse command parameters */ 206 switch (argc) { 207 case 2: 208 /* connection handle */ 209 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 210 return (USAGE); 211 | 170 cp.con_handle = htole16(cp.con_handle); 171 break; 172 173 default: 174 return (USAGE); 175 } 176 177 /* send request */ --- 26 unchanged lines hidden (view full) --- 204 205 /* parse command parameters */ 206 switch (argc) { 207 case 2: 208 /* connection handle */ 209 if (sscanf(argv[0], "%d", &n) != 1 || n <= 0 || n > 0x0eff) 210 return (USAGE); 211 |
212 cp.con_handle = (u_int16_t) (n & 0x0fff); | 212 cp.con_handle = (uint16_t) (n & 0x0fff); |
213 cp.con_handle = htole16(cp.con_handle); 214 215 /* link policy settings */ 216 if (sscanf(argv[1], "%x", &n) != 1) 217 return (USAGE); 218 | 213 cp.con_handle = htole16(cp.con_handle); 214 215 /* link policy settings */ 216 if (sscanf(argv[1], "%x", &n) != 1) 217 return (USAGE); 218 |
219 cp.settings = (u_int16_t) (n & 0x0ffff); | 219 cp.settings = (uint16_t) (n & 0x0ffff); |
220 cp.settings = htole16(cp.settings); 221 break; 222 223 default: 224 return (USAGE); 225 } 226 227 /* send request */ --- 78 unchanged lines hidden --- | 220 cp.settings = htole16(cp.settings); 221 break; 222 223 default: 224 return (USAGE); 225 } 226 227 /* send request */ --- 78 unchanged lines hidden --- |