WLAN_QUOTA_TEST = test_quota_compliance_wlan \
test_quota_compliance_wlan_asymmetric
endif
+if XBSD
+ WLAN_BIN = gnunet-helper-transport-wlan
+ WLAN_BIN_DUMMY = gnunet-helper-transport-wlan-dummy
+ WLAN_BIN_SENDER = gnunet-transport-wlan-sender
+ WLAN_BIN_RECEIVER = gnunet-transport-wlan-receiver
+ WLAN_PLUGIN_LA = libgnunet_plugin_transport_wlan.la
+ WLAN_PLUGIN_TEST = test_plugin_wlan
+ WLAN_API_TEST = test_transport_api_wlan
+ WLAN_TIMEOUT_TEST = test_transport_api_timeout_wlan
+ WLAN_REL_TEST = test_transport_api_reliability_wlan
+ WLAN_QUOTA_TEST = test_quota_compliance_wlan \
+ test_quota_compliance_wlan_asymmetric
+endif
if LINUX
if HAVE_LIBBLUETOOTH
test_quota_compliance_bluetooth_asymmetric
endif
endif
+if XBSD
+if HAVE_LIBBLUETOOTH
+ BT_BIN = gnunet-helper-transport-bluetooth
+ BT_PLUGIN_LA = libgnunet_plugin_transport_bluetooth.la
+ BT_PLUGIN_TEST = test_plugin_bluetooth
+ BT_API_TEST = test_transport_api_bluetooth
+ BT_TIMEOUT_TEST = test_transport_api_timeout_bluetooth
+ BT_REL_TEST = test_transport_api_reliability_bluetooth
+ BT_QUOTA_TEST = test_quota_compliance_bluetooth \
+ test_quota_compliance_bluetooth_asymmetric
+endif
+endif
# end of HAVE_EXPERIMENTAL
endif
*/
#include "gnunet_config.h"
+#include <sys/param.h>
+#if defined(__linux__)
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
+#endif
+#if defined(BSD) && defined(__NetBSD__)
+#include <netbt/bluetooth.h>
+#include <netbt/hci.h>
+#include <netbt/l2cap.h>
+#include <netbt/rfcomm.h>
+#endif
#include <errno.h>
+#if defined(__linux__)
#include <linux/if.h>
+#endif
+#if defined(BSD)
+#include <net/if.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
static struct SendBuffer write_std;
-/* ****** this are the same functions as the ones used in gnunet-helper-transport-wlan.c ****** */
+/* ****** these are the same functions as the ones used in gnunet-helper-transport-wlan.c ****** */
/**
* To what multiple do we align messages? 8 byte should suffice for everyone
* 5. set the name, provider and description
* 6. register the service record to the local SDP server
* 7. cleanup
- */uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ */
+ uint8_t svc_uuid_int[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
dev->pl_mac.mac[5], dev->pl_mac.mac[4],
dev->pl_mac.mac[3],
dev->pl_mac.mac[2], dev->pl_mac.mac[1],
/*
This file is part of GNUnet.
Copyright (C) 2010, 2011, 2012 GNUnet e.V.
- Copyright (c) 2007, 2008, Andy Green <andy@warmcat.com>
- Copyright Copyright (C) 2009 Thomas d'Otreppe
+ Copyright (C) 2007, 2008, Andy Green <andy@warmcat.com>
+ Copyright (C) 2009 Thomas d'Otreppe
GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
* parts taken from aircrack-ng, parts changend.
*/
#include "gnunet_config.h"
+#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/stat.h>
+#ifdef AF_LINK
+#include <net/if_dl.h>
+#endif
+#ifdef AF_PACKET
#include <netpacket/packet.h>
+#endif
+#if defined(__linux__)
#include <linux/if_ether.h>
#include <linux/if.h>
#include <linux/wireless.h>
+#endif
+#if defined(BSD)
+#include <net/if.h>
+#include <net/if_ether.h>
+#include <net80211/ieee80211_node.h>
+#endif
#include <netinet/in.h>
-#include <linux/if_tun.h>
+#ifdef IF_TUN_HDR
+#include IF_TUN_HDR
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
-#include <sys/param.h>
#include <unistd.h>
#include <stdint.h>
struct ifreq ifr;
struct iwreq wrq;
struct packet_mreq mr;
+#ifdef AF_PACKET
struct sockaddr_ll sll;
+#endif
+#ifdef AF_LINK
+ struct sockaddr_dl sll;
+#endif
/* find the interface index */
memset (&ifr, 0, sizeof(ifr));
/* lookup the hardware type */
memset (&sll, 0, sizeof(sll));
+#if defined(AF_PACKET)
sll.sll_family = AF_PACKET;
sll.sll_ifindex = ifr.ifr_ifindex;
sll.sll_protocol = htons (ETH_P_ALL);
+#endif
+#if defined(AF_LINK)
+ sll.sdl_family = AF_LINK;
+ sll.sdl_index = ifr.ifr_ifindex;
+ sll.sdl_protocol = htons (ETH_P_ALL);
+#endif
if (-1 == ioctl (dev->fd_raw, SIOCGIFHWADDR, &ifr))
{
fprintf (stderr, "ioctl(SIOCGIFHWADDR) on interface `%.*s' failed: %s\n",
/* enable promiscuous mode */
memset (&mr, 0, sizeof(mr));
+#ifdef AF_PACKET
mr.mr_ifindex = sll.sll_ifindex;
+#endif
+#ifdef AF_LINK
+ mr.mr_ifindex = sll.sdl_index;
+#endif
mr.mr_type = PACKET_MR_PROMISC;
if (0 !=
- setsockopt (dev->fd_raw, SOL_PACKET, PACKET_ADD_MEMBERSHIP, &mr,
+ setsockopt (dev->fd_raw, SOL_PACKET,
+#ifdef AF_PACKET
+ PACKET_ADD_MEMBERSHIP,
+#endif
+#ifdef AF_LINK
+ SIOCADDMULTI,
+#endif
+ &mr,
sizeof(mr)))
{
fprintf (stderr,