search.c (124317) | search.c (128076) |
---|---|
1/* 2 * search.c 3 * 4 * Copyright (c) 2001-2003 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: search.c,v 1.2 2003/09/08 17:35:15 max Exp $ | 1/* 2 * search.c 3 * 4 * Copyright (c) 2001-2003 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: search.c,v 1.2 2003/09/08 17:35:15 max Exp $ |
29 * $FreeBSD: head/usr.sbin/bluetooth/sdpcontrol/search.c 124317 2004-01-09 22:44:28Z emax $ | 29 * $FreeBSD: head/usr.sbin/bluetooth/sdpcontrol/search.c 128076 2004-04-09 23:01:42Z emax $ |
30 */ 31 32#include <bluetooth.h> 33#include <ctype.h> 34#include <sdp.h> 35#include <stdio.h> 36#include <stdlib.h> 37#include "sdpcontrol.h" --- 33 unchanged lines hidden (view full) --- 71 72static void 73print_service_class_id_list(uint8_t const *start, uint8_t const *end) 74{ 75 uint32_t type, len, value; 76 77 if (end - start < 2) { 78 fprintf(stderr, "Invalid Service Class ID List. " \ | 30 */ 31 32#include <bluetooth.h> 33#include <ctype.h> 34#include <sdp.h> 35#include <stdio.h> 36#include <stdlib.h> 37#include "sdpcontrol.h" --- 33 unchanged lines hidden (view full) --- 71 72static void 73print_service_class_id_list(uint8_t const *start, uint8_t const *end) 74{ 75 uint32_t type, len, value; 76 77 if (end - start < 2) { 78 fprintf(stderr, "Invalid Service Class ID List. " \ |
79 "Too short, len=%d\n", end - start); | 79 "Too short, len=%zd\n", end - start); |
80 return; 81 } 82 83 SDP_GET8(type, start); 84 switch (type) { 85 case SDP_DATA_SEQ8: 86 SDP_GET8(len, start); 87 break; --- 137 unchanged lines hidden (view full) --- 225 case SDP_DATA_UUID32: 226 SDP_GET32(value.uint32, start); 227 fprintf(stdout, "u/int/uuid32 %u\n", value.uint32); 228 break; 229 230 case SDP_DATA_UINT64: 231 case SDP_DATA_INT64: 232 SDP_GET64(value.uint64, start); | 80 return; 81 } 82 83 SDP_GET8(type, start); 84 switch (type) { 85 case SDP_DATA_SEQ8: 86 SDP_GET8(len, start); 87 break; --- 137 unchanged lines hidden (view full) --- 225 case SDP_DATA_UUID32: 226 SDP_GET32(value.uint32, start); 227 fprintf(stdout, "u/int/uuid32 %u\n", value.uint32); 228 break; 229 230 case SDP_DATA_UINT64: 231 case SDP_DATA_INT64: 232 SDP_GET64(value.uint64, start); |
233 fprintf(stdout, "u/int64 %llu\n", value.uint64); | 233 fprintf(stdout, "u/int64 %ju\n", value.uint64); |
234 break; 235 236 case SDP_DATA_UINT128: 237 case SDP_DATA_INT128: 238 case SDP_DATA_UUID128: 239 SDP_GET128(&value.int128, start); 240 fprintf(stdout, "u/int/uuid128 %#8.8x-%4.4x-%4.4x-%4.4x-%4.4x%8.8x\n", 241 *(uint32_t *)&value.int128.b[0], --- 60 unchanged lines hidden (view full) --- 302 303static void 304print_protocol_descriptor_list(uint8_t const *start, uint8_t const *end) 305{ 306 uint32_t type, len; 307 308 if (end - start < 2) { 309 fprintf(stderr, "Invalid Protocol Descriptor List. " \ | 234 break; 235 236 case SDP_DATA_UINT128: 237 case SDP_DATA_INT128: 238 case SDP_DATA_UUID128: 239 SDP_GET128(&value.int128, start); 240 fprintf(stdout, "u/int/uuid128 %#8.8x-%4.4x-%4.4x-%4.4x-%4.4x%8.8x\n", 241 *(uint32_t *)&value.int128.b[0], --- 60 unchanged lines hidden (view full) --- 302 303static void 304print_protocol_descriptor_list(uint8_t const *start, uint8_t const *end) 305{ 306 uint32_t type, len; 307 308 if (end - start < 2) { 309 fprintf(stderr, "Invalid Protocol Descriptor List. " \ |
310 "Too short, len=%d\n", end - start); | 310 "Too short, len=%zd\n", end - start); |
311 return; 312 } 313 314 SDP_GET8(type, start); 315 switch (type) { 316 case SDP_DATA_SEQ8: 317 SDP_GET8(len, start); 318 break; --- 57 unchanged lines hidden (view full) --- 376 377static void 378print_bluetooth_profile_descriptor_list(uint8_t const *start, uint8_t const *end) 379{ 380 uint32_t type, len, value; 381 382 if (end - start < 2) { 383 fprintf(stderr, "Invalid Bluetooth Profile Descriptor List. " \ | 311 return; 312 } 313 314 SDP_GET8(type, start); 315 switch (type) { 316 case SDP_DATA_SEQ8: 317 SDP_GET8(len, start); 318 break; --- 57 unchanged lines hidden (view full) --- 376 377static void 378print_bluetooth_profile_descriptor_list(uint8_t const *start, uint8_t const *end) 379{ 380 uint32_t type, len, value; 381 382 if (end - start < 2) { 383 fprintf(stderr, "Invalid Bluetooth Profile Descriptor List. " \ |
384 "Too short, len=%d\n", end - start); | 384 "Too short, len=%zd\n", end - start); |
385 return; 386 } 387 388 SDP_GET8(type, start); 389 switch (type) { 390 case SDP_DATA_SEQ8: 391 SDP_GET8(len, start); 392 break; --- 315 unchanged lines hidden --- | 385 return; 386 } 387 388 SDP_GET8(type, start); 389 switch (type) { 390 case SDP_DATA_SEQ8: 391 SDP_GET8(len, start); 392 break; --- 315 unchanged lines hidden --- |