aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-helper-transport-bluetooth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/gnunet-helper-transport-bluetooth.c')
-rw-r--r--src/transport/gnunet-helper-transport-bluetooth.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/transport/gnunet-helper-transport-bluetooth.c b/src/transport/gnunet-helper-transport-bluetooth.c
index fd7ebed69..28855c31e 100644
--- a/src/transport/gnunet-helper-transport-bluetooth.c
+++ b/src/transport/gnunet-helper-transport-bluetooth.c
@@ -356,7 +356,7 @@ do_align:
356 delta = 356 delta =
357 GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) - 357 GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) -
358 (mst->pos - mst->off), size); 358 (mst->pos - mst->off), size);
359 memcpy (&ibuf[mst->pos], buf, delta); 359 GNUNET_memcpy (&ibuf[mst->pos], buf, delta);
360 mst->pos += delta; 360 mst->pos += delta;
361 buf += delta; 361 buf += delta;
362 size -= delta; 362 size -= delta;
@@ -409,7 +409,7 @@ do_align:
409 fprintf (stderr, "The size of the buffer will be exceeded!\n"); 409 fprintf (stderr, "The size of the buffer will be exceeded!\n");
410 return GNUNET_SYSERR; 410 return GNUNET_SYSERR;
411 } 411 }
412 memcpy (&ibuf[mst->pos], buf, delta); 412 GNUNET_memcpy (&ibuf[mst->pos], buf, delta);
413 mst->pos += delta; 413 mst->pos += delta;
414 buf += delta; 414 buf += delta;
415 size -= delta; 415 size -= delta;
@@ -486,7 +486,7 @@ do_align:
486 "Assertion failed\n"); 486 "Assertion failed\n");
487 exit (1); 487 exit (1);
488 } 488 }
489 memcpy (&ibuf[mst->pos], buf, size); 489 GNUNET_memcpy (&ibuf[mst->pos], buf, size);
490 mst->pos += size; 490 mst->pos += size;
491 } 491 }
492 return ret; 492 return ret;
@@ -727,7 +727,7 @@ check_crc_buf_osdep (const unsigned char *buf, size_t len)
727 } 727 }
728 728
729 /* save the device address */ 729 /* save the device address */
730 memcpy (&dev->pl_mac, &addr.btAddr, sizeof (BTH_ADDR)); 730 GNUNET_memcpy (&dev->pl_mac, &addr.btAddr, sizeof (BTH_ADDR));
731 731
732 /* set the address information */ 732 /* set the address information */
733 memset (&addr_info, 0, sizeof (CSADDR_INFO)); 733 memset (&addr_info, 0, sizeof (CSADDR_INFO));
@@ -1073,7 +1073,7 @@ read_from_the_socket (void *sock,
1073 count -= sizeof(uint32_t); 1073 count -= sizeof(uint32_t);
1074 } 1074 }
1075 1075
1076 memcpy (buf, tmpbuf, count); 1076 GNUNET_memcpy (buf, tmpbuf, count);
1077 1077
1078 return count; 1078 return count;
1079} 1079}
@@ -1190,7 +1190,7 @@ open_device (struct HardwareInfos *dev)
1190 /** 1190 /**
1191 * Copy the MAC address to the device structure 1191 * Copy the MAC address to the device structure
1192 */ 1192 */
1193 memcpy (&dev->pl_mac, &dev_info.bdaddr, sizeof (bdaddr_t)); 1193 GNUNET_memcpy (&dev->pl_mac, &dev_info.bdaddr, sizeof (bdaddr_t));
1194 1194
1195 /* Check if the interface is up */ 1195 /* Check if the interface is up */
1196 if (hci_test_bit (HCI_UP, (void *) &dev_info.flags) == 0) 1196 if (hci_test_bit (HCI_UP, (void *) &dev_info.flags) == 0)
@@ -1306,7 +1306,7 @@ mac_set (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *taIeeeHeader,
1306 taIeeeHeader->addr3 = mac_bssid_gnunet; 1306 taIeeeHeader->addr3 = mac_bssid_gnunet;
1307 1307
1308 #ifdef MINGW 1308 #ifdef MINGW
1309 memcpy (&taIeeeHeader->addr2, &dev->pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); 1309 GNUNET_memcpy (&taIeeeHeader->addr2, &dev->pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
1310 #else 1310 #else
1311 taIeeeHeader->addr2 = dev->pl_mac; 1311 taIeeeHeader->addr2 = dev->pl_mac;
1312 #endif 1312 #endif
@@ -1403,13 +1403,13 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1403 exit (1); 1403 exit (1);
1404 } 1404 }
1405 header = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr; 1405 header = (const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *) hdr;
1406 memcpy (&write_pout.buf, &header->frame, sendsize); 1406 GNUNET_memcpy (&write_pout.buf, &header->frame, sendsize);
1407 blueheader = (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *) &write_pout.buf; 1407 blueheader = (struct GNUNET_TRANSPORT_WLAN_Ieee80211Frame *) &write_pout.buf;
1408 1408
1409 /* payload contains MAC address, but we don't trust it, so we'll 1409 /* payload contains MAC address, but we don't trust it, so we'll
1410 * overwrite it with OUR MAC address to prevent mischief */ 1410 * overwrite it with OUR MAC address to prevent mischief */
1411 mac_set (blueheader, dev); 1411 mac_set (blueheader, dev);
1412 memcpy (&blueheader->addr1, &header->frame.addr1, 1412 GNUNET_memcpy (&blueheader->addr1, &header->frame.addr1,
1413 sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); 1413 sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
1414 write_pout.size = sendsize; 1414 write_pout.size = sendsize;
1415} 1415}
@@ -1515,7 +1515,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1515 1515
1516 ba2str (&(devices +i)->bdaddr, addr); 1516 ba2str (&(devices +i)->bdaddr, addr);
1517 fprintf (stderr, "LOG : %s was added to the list\n", addr); //FIXME debugging message 1517 fprintf (stderr, "LOG : %s was added to the list\n", addr); //FIXME debugging message
1518 memcpy (&(neighbours.devices[neighbours.size++]), &(devices + i)->bdaddr, sizeof (bdaddr_t)); 1518 GNUNET_memcpy (&(neighbours.devices[neighbours.size++]), &(devices + i)->bdaddr, sizeof (bdaddr_t));
1519 } 1519 }
1520 } 1520 }
1521 1521
@@ -1536,7 +1536,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1536 { 1536 {
1537 1537
1538 memset (&addr_rc.rc_bdaddr, 0, sizeof (addr_rc.rc_bdaddr)); 1538 memset (&addr_rc.rc_bdaddr, 0, sizeof (addr_rc.rc_bdaddr));
1539 memcpy (&addr_rc.rc_bdaddr, &(neighbours.devices[neighbours.pos]), sizeof (addr_rc.rc_bdaddr)); 1539 GNUNET_memcpy (&addr_rc.rc_bdaddr, &(neighbours.devices[neighbours.pos]), sizeof (addr_rc.rc_bdaddr));
1540 1540
1541 addr_rc.rc_channel = get_channel (dev, addr_rc.rc_bdaddr); 1541 addr_rc.rc_channel = get_channel (dev, addr_rc.rc_bdaddr);
1542 1542
@@ -1572,7 +1572,7 @@ stdin_send_hw (void *cls, const struct GNUNET_MessageHeader *hdr)
1572 { 1572 {
1573 fprintf (stderr, "LOG : Removes %d device from the list\n", neighbours.pos); 1573 fprintf (stderr, "LOG : Removes %d device from the list\n", neighbours.pos);
1574 /* Remove the device from the list */ 1574 /* Remove the device from the list */
1575 memcpy (&neighbours.devices[neighbours.pos], &neighbours.devices[neighbours.size - 1], sizeof (bdaddr_t)); 1575 GNUNET_memcpy (&neighbours.devices[neighbours.pos], &neighbours.devices[neighbours.size - 1], sizeof (bdaddr_t));
1576 memset (&neighbours.devices[neighbours.size - 1], 0, sizeof (bdaddr_t)); 1576 memset (&neighbours.devices[neighbours.size - 1], 0, sizeof (bdaddr_t));
1577 neighbours.fds[neighbours.pos] = neighbours.fds[neighbours.size - 1]; 1577 neighbours.fds[neighbours.pos] = neighbours.fds[neighbours.size - 1];
1578 neighbours.fds[neighbours.size - 1] = -1; 1578 neighbours.fds[neighbours.size - 1] = -1;
@@ -1759,8 +1759,8 @@ main (int argc, char *argv[])
1759 1759
1760 macmsg.hdr.size = htons (sizeof (macmsg)); 1760 macmsg.hdr.size = htons (sizeof (macmsg));
1761 macmsg.hdr.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL); 1761 macmsg.hdr.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL);
1762 memcpy (&macmsg.mac, &dev.pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress)); 1762 GNUNET_memcpy (&macmsg.mac, &dev.pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress));
1763 memcpy (write_std.buf, &macmsg, sizeof (macmsg)); 1763 GNUNET_memcpy (write_std.buf, &macmsg, sizeof (macmsg));
1764 write_std.size = sizeof (macmsg); 1764 write_std.size = sizeof (macmsg);
1765 } 1765 }
1766 1766
@@ -1869,7 +1869,7 @@ main (int argc, char *argv[])
1869 return -1; 1869 return -1;
1870 } 1870 }
1871 1871
1872 memcpy (&addr.rc_bdaddr, &frame->addr1, sizeof (bdaddr_t)); 1872 GNUNET_memcpy (&addr.rc_bdaddr, &frame->addr1, sizeof (bdaddr_t));
1873 addr.rc_family = AF_BLUETOOTH; 1873 addr.rc_family = AF_BLUETOOTH;
1874 addr.rc_channel = get_channel (&dev, addr.rc_bdaddr); 1874 addr.rc_channel = get_channel (&dev, addr.rc_bdaddr);
1875 1875
@@ -1913,7 +1913,7 @@ main (int argc, char *argv[])
1913 if (neighbours.size < MAX_PORTS) 1913 if (neighbours.size < MAX_PORTS)
1914 { 1914 {
1915 neighbours.fds[neighbours.size] = sendsocket; 1915 neighbours.fds[neighbours.size] = sendsocket;
1916 memcpy (&(neighbours.devices[neighbours.size++]), &addr.rc_bdaddr, sizeof (bdaddr_t)); 1916 GNUNET_memcpy (&(neighbours.devices[neighbours.size++]), &addr.rc_bdaddr, sizeof (bdaddr_t));
1917 } 1917 }
1918 else 1918 else
1919 { 1919 {
@@ -2196,8 +2196,8 @@ main (int argc, char *argv[])
2196 2196
2197 macmsg.hdr.size = htons (sizeof (macmsg)); 2197 macmsg.hdr.size = htons (sizeof (macmsg));
2198 macmsg.hdr.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL); 2198 macmsg.hdr.type = htons (GNUNET_MESSAGE_TYPE_WLAN_HELPER_CONTROL);
2199 memcpy (&macmsg.mac, &dev.pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress_Copy)); 2199 GNUNET_memcpy (&macmsg.mac, &dev.pl_mac, sizeof (struct GNUNET_TRANSPORT_WLAN_MacAddress_Copy));
2200 memcpy (write_std.buf, &macmsg, sizeof (macmsg)); 2200 GNUNET_memcpy (write_std.buf, &macmsg, sizeof (macmsg));
2201 write_std.size = sizeof (macmsg); 2201 write_std.size = sizeof (macmsg);
2202 } 2202 }
2203 2203