Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED

This will fix build.
This commit is contained in:
Takanori Watanabe 2015-04-07 16:48:23 +00:00
parent 212236608c
commit 8d6f425ddd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281210
69 changed files with 84 additions and 10 deletions

View file

@ -30,7 +30,7 @@
* $Id: bluetooth.c,v 1.3 2003/05/20 23:04:30 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -30,6 +30,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>

View file

@ -31,6 +31,7 @@
*/
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <inttypes.h>
#include <stdio.h>

View file

@ -32,6 +32,7 @@
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -32,6 +32,7 @@
#include <sys/uio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <string.h>

View file

@ -28,7 +28,7 @@
* $Id: session.c,v 1.2 2003/09/04 22:12:13 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdlib.h>
@ -62,6 +62,9 @@ sdp_open(bdaddr_t const *l, bdaddr_t const *r)
sa.l2cap_len = sizeof(sa);
sa.l2cap_family = AF_BLUETOOTH;
sa.l2cap_psm = 0;
sa.l2cap_cid = 0;
sa.l2cap_bdaddr_type = BDADDR_BREDR;
memcpy(&sa.l2cap_bdaddr, l, sizeof(sa.l2cap_bdaddr));
if (bind(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
ss->error = errno;

View file

@ -30,6 +30,7 @@
*/
#include <netinet/in.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <sdp.h>

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -39,6 +39,7 @@
#include <net/if.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <fcntl.h>

View file

@ -28,7 +28,7 @@
* $Id: rfcomm_sdp.c,v 1.1 2003/09/07 18:15:55 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -33,6 +33,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <ctype.h>
#include <err.h>

View file

@ -31,6 +31,7 @@
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

View file

@ -34,6 +34,7 @@
#include <sys/time.h>
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -33,6 +33,7 @@
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <fcntl.h>
@ -236,7 +237,9 @@ client_socket(bdaddr_p bdaddr, uint16_t psm)
l2addr.l2cap_family = AF_BLUETOOTH;
memset(&l2addr.l2cap_bdaddr, 0, sizeof(l2addr.l2cap_bdaddr));
l2addr.l2cap_psm = 0;
l2addr.l2cap_bdaddr_type = BDADDR_BREDR;
l2addr.l2cap_cid = 0;
if (bind(s, (struct sockaddr *) &l2addr, sizeof(l2addr)) < 0) {
close(s);
return (-1);

View file

@ -35,6 +35,7 @@
#include <sys/mouse.h>
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

View file

@ -37,6 +37,7 @@
#include <sys/queue.h>
#include <sys/wait.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

View file

@ -31,7 +31,7 @@
* $Id: lexer.l,v 1.3 2006/09/07 21:06:53 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdlib.h>
#include "parser.h"

View file

@ -33,6 +33,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>

View file

@ -33,6 +33,7 @@
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <dev/vkbd/vkbd_var.h>
#include <errno.h>
@ -90,7 +91,9 @@ server_init(bthid_server_p srv)
l2addr.l2cap_family = AF_BLUETOOTH;
memcpy(&l2addr.l2cap_bdaddr, &srv->bdaddr, sizeof(l2addr.l2cap_bdaddr));
l2addr.l2cap_psm = htole16(0x11);
l2addr.l2cap_bdaddr_type = BDADDR_BREDR;
l2addr.l2cap_cid = 0;
if (bind(srv->ctrl, (struct sockaddr *) &l2addr, sizeof(l2addr)) < 0) {
syslog(LOG_ERR, "Could not bind control L2CAP socket. " \
"%s (%d)", strerror(errno), errno);

View file

@ -33,6 +33,7 @@
#include <sys/queue.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <fcntl.h>

View file

@ -31,6 +31,7 @@
__RCSID("$NetBSD: bnep.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <sys/uio.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <stdarg.h>

View file

@ -33,6 +33,7 @@ __RCSID("$NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <sys/wait.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <fcntl.h>

View file

@ -35,7 +35,7 @@ __RCSID("$NetBSD: channel.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <libutil.h>
#include <unistd.h>
#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
static struct chlist channel_list;

View file

@ -30,6 +30,7 @@
#include <sys/cdefs.h>
__RCSID("$NetBSD: client.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>
@ -65,6 +66,9 @@ client_init(void)
memset(&sa, 0, sizeof(sa));
sa.l2cap_family = AF_BLUETOOTH;
sa.l2cap_len = sizeof(sa);
sa.l2cap_bdaddr_type = BDADDR_BREDR;
sa.l2cap_cid = 0;
bdaddr_copy(&sa.l2cap_bdaddr, &local_bdaddr);
if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
log_err("Could not bind client socket: %m");

View file

@ -45,6 +45,7 @@
#include <syslog.h>
#include "event.h"
#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
#define __event_link(ev) \

View file

@ -30,6 +30,7 @@
#include <sys/cdefs.h>
__RCSID("$NetBSD: packet.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
packet_t *

View file

@ -32,6 +32,7 @@ __RCSID("$NetBSD: sdp.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
#include <string.h>
#define L2CAP_SOCKET_CHECKED
#include "sdp.h"
/*

View file

@ -32,6 +32,7 @@ __RCSID("$NetBSD: server.c,v 1.2 2009/01/24 17:29:28 plunky Exp $");
#include <sys/ioctl.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <inttypes.h>
#include <errno.h>
@ -103,6 +104,9 @@ server_open(void)
sa.l2cap_family = AF_BLUETOOTH;
sa.l2cap_len = sizeof(sa);
sa.l2cap_psm = htole16(l2cap_psm);
sa.l2cap_bdaddr_type = BDADDR_BREDR;
sa.l2cap_cid = 0;
bdaddr_copy(&sa.l2cap_bdaddr, &local_bdaddr);
if (bind(server_fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
log_err("Could not bind server socket: %m");

View file

@ -43,6 +43,7 @@ __RCSID("$NetBSD: tap.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <stdio.h>
#include <unistd.h>
#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
static bool tap_send(channel_t *, packet_t *);

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -29,6 +29,7 @@
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/ioctl.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <netgraph/ng_message.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/param.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -32,6 +32,7 @@
#include <sys/fcntl.h>
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <limits.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/ioctl.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>

View file

@ -30,6 +30,7 @@
*/
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -34,6 +34,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -30,7 +30,7 @@
* $Id: rfcomm_pppd.c,v 1.5 2003/09/07 18:32:11 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <ctype.h>
#include <err.h>

View file

@ -30,6 +30,7 @@
*/
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>

View file

@ -30,6 +30,7 @@
*/
#include <netinet/in.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <ctype.h>
#include <sdp.h>

View file

@ -28,7 +28,7 @@
* $Id: bgd.c,v 1.4 2004/01/13 01:54:39 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -31,6 +31,7 @@
#include <arpa/inet.h>
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <stdio.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/select.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <grp.h>

View file

@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <string.h>
#include <stdlib.h>

View file

@ -34,6 +34,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -38,6 +38,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <pwd.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -34,6 +34,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>

View file

@ -34,6 +34,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <assert.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>

View file

@ -28,7 +28,7 @@
* $Id: uuid.c,v 1.1 2004/12/09 18:20:26 max Exp $
* $FreeBSD$
*/
#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <uuid.h>