aboutsummaryrefslogtreecommitdiff
path: root/comms/openobex
diff options
context:
space:
mode:
Diffstat (limited to 'comms/openobex')
-rw-r--r--comms/openobex/files/patch-lib-btobex.c110
-rw-r--r--comms/openobex/files/patch-lib-databuffer.h11
-rw-r--r--comms/openobex/files/patch-lib-obex.c26
-rw-r--r--comms/openobex/files/patch-lib-obex_main.c26
-rw-r--r--comms/openobex/files/patch-lib-obex_transport.h27
5 files changed, 200 insertions, 0 deletions
diff --git a/comms/openobex/files/patch-lib-btobex.c b/comms/openobex/files/patch-lib-btobex.c
new file mode 100644
index 000000000000..48c54bd6e52e
--- /dev/null
+++ b/comms/openobex/files/patch-lib-btobex.c
@@ -0,0 +1,110 @@
+--- lib/btobex.c.orig Tue Jan 3 20:36:15 2006
++++ lib/btobex.c Sat Nov 25 22:00:13 2006
+@@ -46,8 +46,12 @@
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+
+ #endif /* _WIN32 */
+
+@@ -63,6 +67,15 @@
+ void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
+ {
+ #ifndef _WIN32
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
++ bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
++ self->trans.self.rfcomm.rfcomm_channel = 0;
++
++ self->trans.peer.rfcomm.rfcomm_family = AF_BLUETOOTH;
++ bacpy(&self->trans.peer.rfcomm.rfcomm_bdaddr, dst);
++ self->trans.peer.rfcomm.rfcomm_channel = channel;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+ bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+ self->trans.self.rfcomm.rc_channel = 0;
+@@ -70,6 +83,7 @@
+ self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
+ bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
+ self->trans.peer.rfcomm.rc_channel = channel;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /* _WIN32 */
+ }
+
+@@ -83,9 +97,15 @@
+ {
+ #ifndef _WIN32
+ /* Bind local service */
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
++ bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
++ self->trans.self.rfcomm.rfcomm_channel = channel;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
+ bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
+ self->trans.self.rfcomm.rc_channel = channel;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /* _WIN32 */
+ }
+
+@@ -106,9 +126,15 @@
+ return -1;
+ }
+
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm,
++ sizeof(struct sockaddr_rfcomm)))
++ {
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm,
+ sizeof(struct sockaddr_rc)))
+ {
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ DEBUG(0, "Error doing bind\n");
+ goto out_freesock;
+ }
+@@ -140,7 +166,11 @@
+ int btobex_accept(obex_t *self)
+ {
+ #ifndef _WIN32
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ socklen_t addrlen = sizeof(struct sockaddr_rfcomm);
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ socklen_t addrlen = sizeof(struct sockaddr_rc);
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ //int mtu;
+ //int len = sizeof(int);
+
+@@ -178,16 +208,26 @@
+ return -1;
+ }
+
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
++ sizeof(struct sockaddr_rfcomm));
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
+ sizeof(struct sockaddr_rc));
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+
+ if (ret < 0) {
+ DEBUG(4, "ret=%d\n", ret);
+ goto out_freesock;
+ }
+
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
++ sizeof(struct sockaddr_rfcomm));
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
+ sizeof(struct sockaddr_rc));
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ if (ret < 0) {
+ DEBUG(4, "ret=%d\n", ret);
+ goto out_freesock;
diff --git a/comms/openobex/files/patch-lib-databuffer.h b/comms/openobex/files/patch-lib-databuffer.h
new file mode 100644
index 000000000000..748a56b268f9
--- /dev/null
+++ b/comms/openobex/files/patch-lib-databuffer.h
@@ -0,0 +1,11 @@
+--- lib/databuffer.h.orig Thu May 4 13:24:21 2006
++++ lib/databuffer.h Sat Nov 25 22:02:38 2006
+@@ -31,7 +31,7 @@
+ #define DATABUFFER_H
+
+ #define __need_size_t
+-#include <stddef.h>
++#include <sys/types.h>
+ #include <stdint.h>
+
+ /*
diff --git a/comms/openobex/files/patch-lib-obex.c b/comms/openobex/files/patch-lib-obex.c
new file mode 100644
index 000000000000..c52760c8eb56
--- /dev/null
+++ b/comms/openobex/files/patch-lib-obex.c
@@ -0,0 +1,26 @@
+--- lib/obex.c.orig Thu May 25 20:09:41 2006
++++ lib/obex.c Sat Nov 25 22:04:07 2006
+@@ -1031,7 +1031,11 @@
+
+ #ifdef HAVE_BLUETOOTH
+ if(src == NULL)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ src = NG_HCI_BDADDR_ANY;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ src = BDADDR_ANY;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ btobex_prepare_listen(self, src, channel);
+ return obex_transport_listen(self);
+ #else
+@@ -1061,7 +1065,11 @@
+
+ #ifdef HAVE_BLUETOOTH
+ if(src == NULL)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ src = NG_HCI_BDADDR_ANY;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ src = BDADDR_ANY;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ btobex_prepare_connect(self, src, dst, channel);
+ return obex_transport_connect_request(self);
+ #else
diff --git a/comms/openobex/files/patch-lib-obex_main.c b/comms/openobex/files/patch-lib-obex_main.c
new file mode 100644
index 000000000000..763ea35f5cd6
--- /dev/null
+++ b/comms/openobex/files/patch-lib-obex_main.c
@@ -0,0 +1,26 @@
+--- lib/obex_main.c.orig Thu May 4 13:24:21 2006
++++ lib/obex_main.c Sat Nov 25 22:32:59 2006
+@@ -46,7 +46,11 @@
+ #include <stdio.h>
+
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+
+ #endif /* _WIN32 */
+@@ -80,7 +84,11 @@
+
+ #ifdef HAVE_BLUETOOTH
+ if (domain == AF_BLUETOOTH)
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ proto = BLUETOOTH_PROTO_RFCOMM;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ proto = BTPROTO_RFCOMM;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+
+ fd = socket(domain, SOCK_STREAM, proto);
diff --git a/comms/openobex/files/patch-lib-obex_transport.h b/comms/openobex/files/patch-lib-obex_transport.h
new file mode 100644
index 000000000000..a7edc88b1366
--- /dev/null
+++ b/comms/openobex/files/patch-lib-obex_transport.h
@@ -0,0 +1,27 @@
+--- lib/obex_transport.h.orig Thu May 4 13:24:21 2006
++++ lib/obex_transport.h Sat Nov 25 22:34:03 2006
+@@ -40,8 +40,12 @@
+ #include "irda_wrap.h"
+ #endif /*HAVE_IRDA*/
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++#include <bluetooth.h>
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ #ifdef HAVE_USB
+ #include "usbobex.h"
+@@ -55,7 +59,11 @@
+ #endif /*HAVE_IRDA*/
+ struct sockaddr_in inet;
+ #ifdef HAVE_BLUETOOTH
++#ifdef HAVE_BLUETOOTH_NETGRAPH
++ struct sockaddr_rfcomm rfcomm;
++#else /*HAVE_BLUETOOTH_NETGRAPH*/
+ struct sockaddr_rc rfcomm;
++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
+ #endif /*HAVE_BLUETOOTH*/
+ #ifdef HAVE_USB
+ struct obex_usb_intf_transport_t usb;