gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14693 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r14693 - gnunet/src/transport
Date: Wed, 23 Mar 2011 00:23:41 +0100

Author: brodski
Date: 2011-03-23 00:23:41 +0100 (Wed, 23 Mar 2011)
New Revision: 14693

Modified:
   gnunet/src/transport/plugin_transport_wlan.c
   gnunet/src/transport/plugin_transport_wlan.h
Log:
doxigen and order of mac fields

Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c        2011-03-22 18:36:57 UTC 
(rev 14692)
+++ gnunet/src/transport/plugin_transport_wlan.c        2011-03-22 23:23:41 UTC 
(rev 14693)
@@ -728,56 +728,6 @@
 }
 
 /**
- * Sets a bit active in the bitArray.
- *
- * @param bitArray memory area to set the bit in
- * @param bitIdx which bit to set
- */
-/*static uint64_t
- setBit (uint64_t bitArray, unsigned int bitIdx)
- {
- uint64_t targetBit;
-
- targetBit = (1ULL << bitIdx);
- return bitArray | targetBit;
- }
- */
-/**
- * Clears a bit from bitArray.
- *
- * @param bitArray memory area to set the bit in
- * @param bitIdx which bit to unset
- */
-/*static uint64_t
- clearBit (uint64_t bitArray, unsigned int bitIdx)
- {
- uint64_t targetBit;
-
- targetBit = (1ULL << bitIdx);
- return bitArray & (~targetBit);
- }
- */
-/**
- * Checks if a bit is active in the bitArray
- *
- * @param bitArray memory area to set the bit in
- * @param bitIdx which bit to test
- * @return GNUNET_YES if the bit is set, GNUNET_NO if not.
- */
-/*static int
- testBit (uint64_t bitArray, unsigned int bitIdx)
- {
- uint64_t targetBit;
-
-
- targetBit = (1ULL << bitIdx);
- if (bitArray & targetBit)
- return GNUNET_YES;
- else
- return GNUNET_NO;
- }
- */
-/**
  * get the next message number, at the moment just a random one
  * @return returns the next valid message-number for sending packets
  */
@@ -1675,8 +1625,8 @@
 getWlanHeader(struct IeeeHeader * Header, const char * const to_mac_addr,
     struct Plugin * plugin)
 {
-  memcpy(&Header->mac2, macbc, sizeof(macbc));
-  memcpy(&Header->mac3, plugin->mac_address.mac, sizeof(plugin->mac_address));
+  memcpy(&Header->mac3, mac_bssid, sizeof(mac_bssid));
+  memcpy(&Header->mac2, plugin->mac_address.mac, sizeof(plugin->mac_address));
   memcpy(&Header->mac1, to_mac_addr, sizeof(plugin->mac_address));
   return GNUNET_YES;
 }
@@ -2154,7 +2104,8 @@
 
 /**
  * Function to dispose the fragments received for a message and the message
- * @param session session to free the fragments from
+ * @param plugin pointer to the plugin struct
+ * @param rec_message pointer to the struct holding the message which should 
be freed
  */
 
 static void
@@ -2187,6 +2138,7 @@
  * @param plugin the plugin handle
  * @param session_light information of the message sender
  * @param session session the message belongs to
+ * @param rec_message pointer to the message that should be checked
  */
 
 static void
@@ -2398,6 +2350,7 @@
  * function to add an ack to send it for a received fragment
  * @param plugin pointer to the global plugin structure
  * @param session pointer to the session this ack belongs to
+ * @param bitfield bitfield to send
  * @param fh pointer to the fragmentation header which we would like to 
acknolage
  */
 
@@ -2470,6 +2423,7 @@
 /**
  * function to insert a received fragment into the right fragment queue of the 
right message
  * @param plugin pointer to the plugin struct
+ * @param session_light pointer to the session_light struct of this message
  * @param session session this fragment belongs to
  * @param fh pointer to the header of the fragment
  * @return new fragment bitfield for the message
@@ -2770,7 +2724,7 @@
       //process only if it is an broadcast or for this computer both with the 
gnunet bssid
 
       //check for bssid
-      if (memcmp(&(wlanIeeeHeader->mac2), macbc, sizeof(struct MacAddress))
+      if (memcmp(&(wlanIeeeHeader->mac3), mac_bssid, sizeof(struct MacAddress))
           == 0)
         {
           //check for broadcast or mac
@@ -2787,7 +2741,7 @@
                   - sizeof(struct GNUNET_MessageHeader);
 
               session_light = GNUNET_malloc(sizeof(struct Session_light));
-              memcpy(session_light->addr, &(wlanIeeeHeader->mac3),
+              memcpy(session_light->addr, &(wlanIeeeHeader->mac2),
                   sizeof(struct MacAddress));
               //session_light->session = 
search_session(plugin,session_light->addr);
 

Modified: gnunet/src/transport/plugin_transport_wlan.h
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.h        2011-03-22 18:36:57 UTC 
(rev 14692)
+++ gnunet/src/transport/plugin_transport_wlan.h        2011-03-22 23:23:41 UTC 
(rev 14693)
@@ -54,13 +54,13 @@
                //      0x01 = 00000001 -> | b1 = 1 to DS; b2 = 0 not from DS;
     0x00, 0x00, // Duration/ID
     0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // mac1 - in this case receiver
-    0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac2 - in this case bssid
-    0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac3 - in this case sender
+    0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac2 - in this case sender
+    0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac3 - in this case bssid
     0x10, 0x86, //Sequence Control
   };
 
 // gnunet bssid
-static const char macbc[] =
+static const char mac_bssid[] =
   { 0x13, 0x22, 0x33, 0x44, 0x55, 0x66 };
 
 // broadcast mac
@@ -129,7 +129,9 @@
   /**
    * radiotap version
    */
-  uint16_t version GNUNET_PACKED;
+  u_int8_t version;
+
+  u_int8_t pad_version;
   
   /**
    * radiotap header length
@@ -137,7 +139,7 @@
   uint16_t length GNUNET_PACKED;
   
   /**
-   * bitmap
+   * bitmap, fields present
    */
   uint32_t bitmap GNUNET_PACKED;
   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]