head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.26 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.24 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.22 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.20 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.18 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.16 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.14 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.12 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.10 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.8 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.6 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.4 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.2 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.4.0.2 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.2.0.4 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.2 pkgsrc-2006Q3-base:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.5 date 2007.05.22.18.53.56; author plunky; state dead; branches; next 1.4; 1.4 date 2007.03.01.21.39.09; author plunky; state Exp; branches; next 1.3; 1.3 date 2007.02.20.19.05.51; author plunky; state Exp; branches; next 1.2; 1.2 date 2006.07.09.16.35.31; author xtraeme; state Exp; branches; next 1.1; 1.1 date 2006.07.02.18.18.34; author xtraeme; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2006.07.02.18.18.34; author xtraeme; state Exp; branches; next ; desc @@ 1.5 log @update obexapp to version 1.4.7, which contains compiler warning fixes and NetBSD compatibility in the source. ok by xtraeme@@ @ text @$NetBSD: patch-ad,v 1.4 2007/03/01 21:39:09 plunky Exp $ --- main.c.orig 2007-01-30 00:35:23.000000000 +0000 +++ main.c 2007-02-26 10:31:55.000000000 +0000 @@@@ -138,6 +138,10 @@@@ break; case 'A': +#ifdef __NetBSD__ + if (!bt_devaddr(optarg, &context.saddr)) + err(1, "%s", optarg); +#else if (!bt_aton(optarg, &context.saddr)) { struct hostent *he = bt_gethostbyname(optarg); @@@@ -148,6 +152,7 @@@@ memcpy(&context.saddr, he->h_addr, sizeof(context.saddr)); } +#endif break; case 'c': /* client */ @@@@ -251,7 +256,7 @@@@ if (rfcomm_channel_lookup(NULL, &context.addr.rfcomm_bdaddr, service, &channel, &n) != 0) - errc(1, n, "Could not obtain RFCOMM channel"); + errx(1, "Could not obtain RFCOMM channel: %s", strerror(n)); context.addr.rfcomm_channel = (u_int8_t) channel; } @ 1.4 log @tweaks and additions: 1. obexapp rc.d script so you can start server mode automatically 2. new patch-ae to make the sdp registration happen before obexapp drops privileges as NetBSD uses LOCAL_CREDS so sdpd can't check the credentials until the client does something. 3. slight tweak to the -A option for NetBSD (in patch-ad) as we have a function to fetch the local device address. 4. use NetBSD-[4-9].*-* instead of checking for @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.3 2007/02/20 19:05:51 plunky Exp $ @ 1.3 log @correct fix for FreeBSDism @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.2 2006/07/09 16:35:31 xtraeme Exp $ d3 22 a24 3 --- main.c.orig 2006-07-09 18:28:27.000000000 +0200 +++ main.c 2006-07-09 18:28:37.000000000 +0200 @@@@ -265,7 +265,7 @@@@ @ 1.2 log @Clean up previous patches for NetBSD bluetooth support. IMHO I can send them to the author now. @ text @d1 1 a1 1 $NetBSD$ d10 1 a10 1 + errx(1, "Could not obtain RFCOMM channel"); @ 1.1 log @Initial revision @ text @d3 8 a10 12 --- transport.c.orig 2006-07-02 19:52:50.000000000 +0200 +++ transport.c 2006-07-02 19:59:19.000000000 +0200 @@@@ -53,7 +53,11 @@@@ obexapp_transport_connect(obex_t *handle, void *userdata) { context_p context = (context_p) userdata; - struct sockaddr_rfcomm addr; +#ifdef __NetBSD__ + struct sockaddr_bt addr; +#else + struct sockaddr_rfcomm addr +#endif d12 2 a13 101 syslog(LOG_DEBUG, "%s()", __func__); @@@@ -63,21 +67,36 @@@@ return (-1); } +#ifdef __NetBSD__ + syslog(LOG_INFO, "%s(): Connecting to %s/%d, pid=%d", + __func__, bt_ntoa(&context->addr.bt_bdaddr, NULL), + context->addr.bt_channel, getpid()); + + context->tfd = socket(PF_BLUETOOTH,SOCK_STREAM,BTPROTO_RFCOMM); +#else syslog(LOG_INFO, "%s(): Connecting to %s/%d, pid=%d", __func__, bt_ntoa(&context->addr.rfcomm_bdaddr, NULL), context->addr.rfcomm_channel, getpid()); context->tfd = socket(PF_BLUETOOTH,SOCK_STREAM,BLUETOOTH_PROTO_RFCOMM); +#endif if (context->tfd < 0) { syslog(LOG_ERR, "%s(): Could not create socket. %s (%d)", __func__, strerror(errno), errno); return (-1); } +#ifdef __NetBSD__ + addr.bt_len = sizeof(addr); + addr.bt_family = AF_BLUETOOTH; + memcpy(&addr.bt_bdaddr, &context->saddr, sizeof(addr.bt_bdaddr)); + addr.bt_channel = 0; +#else addr.rfcomm_len = sizeof(addr); addr.rfcomm_family = AF_BLUETOOTH; memcpy(&addr.rfcomm_bdaddr, &context->saddr, sizeof(addr.rfcomm_bdaddr)); addr.rfcomm_channel = 0; +#endif if (bind(context->tfd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { syslog(LOG_ERR, "%s(): Could not bind socket. %s (%d)", @@@@ -157,7 +176,11 @@@@ obexapp_transport_listen(obex_t *handle, void *userdata) { context_p context = (context_p) userdata; +#ifdef __NetBSD__ + struct sockaddr_bt addr; +#else struct sockaddr_rfcomm addr; +#endif socklen_t addrlen; pid_t pid; int s; @@@@ -171,7 +194,11 @@@@ return (1); } +#ifdef __NetBSD__ + s = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); +#else s = socket(PF_BLUETOOTH, SOCK_STREAM, BLUETOOTH_PROTO_RFCOMM); +#endif if (s < 0) { syslog(LOG_ERR, "%s(): Could not create socket. %s (%d)", __func__, strerror(errno), errno); @@@@ -192,7 +219,11 @@@@ } memset(&opush, 0, sizeof(opush)); +#ifdef __NetBSD__ + opush.server_channel = context->addr.bt_channel; +#else opush.server_channel = context->addr.rfcomm_channel; +#endif opush.supported_formats_size = 7; opush.supported_formats[0] = 0x1; opush.supported_formats[1] = 0x2; @@@@ -204,7 +235,11 @@@@ if (sdp_register_service(context->ss, SDP_SERVICE_CLASS_OBEX_OBJECT_PUSH, +#ifdef __NetBSD__ + &context->addr.bt_bdaddr, +#else &context->addr.rfcomm_bdaddr, +#endif (void *) &opush, sizeof(opush), NULL) != 0) { syslog(LOG_ERR, "%s(): Could to register OPUSH service with " \ "local SDP daemon. %s (%d)", @@@@ -239,8 +274,13 @@@@ syslog(LOG_INFO, "%s(): Accepted new connection from " \ "%s/%d, pid=%d", __func__, +#ifdef __NetBSD__ + bt_ntoa(&addr.bt_bdaddr, NULL), + addr.bt_channel, getpid()); +#else bt_ntoa(&addr.rfcomm_bdaddr, NULL), addr.rfcomm_channel, getpid()); +#endif if (daemon(1, 0) < 0) { syslog(LOG_ERR, "%s(): Could not daemon. %s (%d)", @ 1.1.1.1 log @Initial import of obexapp-1.4.4. An obex application to transfer objects (address book items, images, movies, anything the target can handle) to mobile devices via IrDA, Bluetooth and other protocol via the OBEX format. xtraeme: now it should be possible to transfer files from/to my cellular phone from NetBSD. @ text @@