btsockstat.c (121064) | btsockstat.c (128076) |
---|---|
1/* 2 * btsockstat.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: btsockstat.c,v 1.8 2003/05/21 22:40:25 max Exp $ | 1/* 2 * btsockstat.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: btsockstat.c,v 1.8 2003/05/21 22:40:25 max Exp $ |
29 * $FreeBSD: head/usr.bin/bluetooth/btsockstat/btsockstat.c 121064 2003-10-13 05:30:20Z bde $ | 29 * $FreeBSD: head/usr.bin/bluetooth/btsockstat/btsockstat.c 128076 2004-04-09 23:01:42Z emax $ |
30 */ 31 32#include <sys/types.h> 33#include <sys/callout.h> 34#include <sys/param.h> 35#include <sys/queue.h> 36#include <sys/socket.h> 37#include <sys/socketvar.h> --- 207 unchanged lines hidden (view full) --- 245 } 246 247 if (pcb.addr.hci_node[0] == 0) { 248 pcb.addr.hci_node[0] = '*'; 249 pcb.addr.hci_node[1] = 0; 250 } 251 252 fprintf(stdout, | 30 */ 31 32#include <sys/types.h> 33#include <sys/callout.h> 34#include <sys/param.h> 35#include <sys/queue.h> 36#include <sys/socket.h> 37#include <sys/socketvar.h> --- 207 unchanged lines hidden (view full) --- 245 } 246 247 if (pcb.addr.hci_node[0] == 0) { 248 pcb.addr.hci_node[0] = '*'; 249 pcb.addr.hci_node[1] = 0; 250 } 251 252 fprintf(stdout, |
253"%-8.8x %-8.8x %-6.6x %6d %6d %-16.16s\n", 254 (int) pcb.so, 255 (int) this, | 253"%-8lx %-8lx %-6.6x %6d %6d %-16.16s\n", 254 (unsigned long) pcb.so, 255 (unsigned long) this, |
256 pcb.flags, 257 so.so_rcv.sb_cc, 258 so.so_snd.sb_cc, 259 pcb.addr.hci_node); 260 } 261} /* hcirawpr */ 262 263/* --- 30 unchanged lines hidden (view full) --- 294 "Socket", 295 "PCB", 296 "Recv-Q", 297 "Send-Q", 298 "Local address"); 299 } 300 301 fprintf(stdout, | 256 pcb.flags, 257 so.so_rcv.sb_cc, 258 so.so_snd.sb_cc, 259 pcb.addr.hci_node); 260 } 261} /* hcirawpr */ 262 263/* --- 30 unchanged lines hidden (view full) --- 294 "Socket", 295 "PCB", 296 "Recv-Q", 297 "Send-Q", 298 "Local address"); 299 } 300 301 fprintf(stdout, |
302"%-8.8x %-8.8x %6d %6d %-17.17s\n", 303 (int) pcb.so, 304 (int) this, | 302"%-8lx %-8lx %6d %6d %-17.17s\n", 303 (unsigned long) pcb.so, 304 (unsigned long) this, |
305 so.so_rcv.sb_cc, 306 so.so_snd.sb_cc, 307 bdaddrpr(&pcb.src, NULL, 0)); 308 } 309} /* l2caprawpr */ 310 311/* 312 * Print L2CAP sockets --- 40 unchanged lines hidden (view full) --- 353 "Send-Q", 354 "Local address/PSM", 355 "Foreign address", 356 "CID", 357 "State"); 358 } 359 360 fprintf(stdout, | 305 so.so_rcv.sb_cc, 306 so.so_snd.sb_cc, 307 bdaddrpr(&pcb.src, NULL, 0)); 308 } 309} /* l2caprawpr */ 310 311/* 312 * Print L2CAP sockets --- 40 unchanged lines hidden (view full) --- 353 "Send-Q", 354 "Local address/PSM", 355 "Foreign address", 356 "CID", 357 "State"); 358 } 359 360 fprintf(stdout, |
361"%-8.8x %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", 362 (int) this, | 361"%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", 362 (unsigned long) this, |
363 so.so_rcv.sb_cc, 364 so.so_snd.sb_cc, 365 bdaddrpr(&pcb.src, local, sizeof(local)), 366 pcb.psm, 367 bdaddrpr(&pcb.dst, remote, sizeof(remote)), 368 pcb.cid, 369 (so.so_options & SO_ACCEPTCONN)? 370 "LISTEN" : state2str(pcb.state)); --- 29 unchanged lines hidden (view full) --- 400"Known %sL2CAP routes\n", (addr == nl[N_L2CAP_RAW_RT].n_value)? "raw " : ""); 401 fprintf(stdout, 402"%-8.8s %-8.8s %-17.17s\n", "RTentry", 403 "Hook", 404 "BD_ADDR"); 405 } 406 407 fprintf(stdout, | 363 so.so_rcv.sb_cc, 364 so.so_snd.sb_cc, 365 bdaddrpr(&pcb.src, local, sizeof(local)), 366 pcb.psm, 367 bdaddrpr(&pcb.dst, remote, sizeof(remote)), 368 pcb.cid, 369 (so.so_options & SO_ACCEPTCONN)? 370 "LISTEN" : state2str(pcb.state)); --- 29 unchanged lines hidden (view full) --- 400"Known %sL2CAP routes\n", (addr == nl[N_L2CAP_RAW_RT].n_value)? "raw " : ""); 401 fprintf(stdout, 402"%-8.8s %-8.8s %-17.17s\n", "RTentry", 403 "Hook", 404 "BD_ADDR"); 405 } 406 407 fprintf(stdout, |
408"%-8.8x %-8.8x %-17.17s\n", 409 (int) this, 410 (int) rt.hook, | 408"%-8lx %-8lx %-17.17s\n", 409 (unsigned long) this, 410 (unsigned long) rt.hook, |
411 bdaddrpr(&rt.src, NULL, 0)); 412 } 413} /* l2caprtpr */ 414 415/* 416 * Print RFCOMM sockets 417 */ 418 --- 40 unchanged lines hidden (view full) --- 459 "Local address", 460 "Foreign address", 461 "Chan", 462 "DLCI", 463 "State"); 464 } 465 466 fprintf(stdout, | 411 bdaddrpr(&rt.src, NULL, 0)); 412 } 413} /* l2caprtpr */ 414 415/* 416 * Print RFCOMM sockets 417 */ 418 --- 40 unchanged lines hidden (view full) --- 459 "Local address", 460 "Foreign address", 461 "Chan", 462 "DLCI", 463 "State"); 464 } 465 466 fprintf(stdout, |
467"%-8.8x %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", 468 (int) this, | 467"%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", 468 (unsigned long) this, |
469 so.so_rcv.sb_cc, 470 so.so_snd.sb_cc, 471 bdaddrpr(&pcb.src, local, sizeof(local)), 472 bdaddrpr(&pcb.dst, remote, sizeof(remote)), 473 pcb.channel, 474 pcb.dlci, 475 (so.so_options & SO_ACCEPTCONN)? 476 "LISTEN" : state2str(pcb.state)); --- 45 unchanged lines hidden (view full) --- 522 "Flags", 523 "MTU", 524 "Out-Q", 525 "DLCs", 526 "State"); 527 } 528 529 fprintf(stdout, | 469 so.so_rcv.sb_cc, 470 so.so_snd.sb_cc, 471 bdaddrpr(&pcb.src, local, sizeof(local)), 472 bdaddrpr(&pcb.dst, remote, sizeof(remote)), 473 pcb.channel, 474 pcb.dlci, 475 (so.so_options & SO_ACCEPTCONN)? 476 "LISTEN" : state2str(pcb.state)); --- 45 unchanged lines hidden (view full) --- 522 "Flags", 523 "MTU", 524 "Out-Q", 525 "DLCs", 526 "State"); 527 } 528 529 fprintf(stdout, |
530"%-8.8x %-8.8x %-4x %-5d %-5d %-4s %s\n", 531 (int) so.so_pcb, 532 (int) this, | 530"%-8lx %-8lx %-4x %-5d %-5d %-4s %s\n", 531 (unsigned long) so.so_pcb, 532 (unsigned long) this, |
533 s.flags, 534 s.mtu, 535 s.outq.len, 536 LIST_EMPTY(&s.dlcs)? "No" : "Yes", 537 state2str(s.state)); 538 } 539} /* rfcommpr_s */ 540 --- 104 unchanged lines hidden --- | 533 s.flags, 534 s.mtu, 535 s.outq.len, 536 LIST_EMPTY(&s.dlcs)? "No" : "Yes", 537 state2str(s.state)); 538 } 539} /* rfcommpr_s */ 540 --- 104 unchanged lines hidden --- |