aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorDavid Brodski <david@brodski.eu>2011-03-22 23:23:41 +0000
committerDavid Brodski <david@brodski.eu>2011-03-22 23:23:41 +0000
commit8b5c27aee38c09aecf76907813d0ec5917d143b3 (patch)
treef17a928b77cf5bdb883e9b9038c5d320f43a8785 /src/transport
parentd74a1b1b52178c35f0f804c34bc63fe2c0203c1a (diff)
downloadgnunet-8b5c27aee38c09aecf76907813d0ec5917d143b3.tar.gz
gnunet-8b5c27aee38c09aecf76907813d0ec5917d143b3.zip
doxigen and order of mac fields
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/plugin_transport_wlan.c64
-rw-r--r--src/transport/plugin_transport_wlan.h12
2 files changed, 16 insertions, 60 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index c23377a0c..988ffed13 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -728,56 +728,6 @@ testBit(char *bitArray, unsigned int bitIdx)
728} 728}
729 729
730/** 730/**
731 * Sets a bit active in the bitArray.
732 *
733 * @param bitArray memory area to set the bit in
734 * @param bitIdx which bit to set
735 */
736/*static uint64_t
737 setBit (uint64_t bitArray, unsigned int bitIdx)
738 {
739 uint64_t targetBit;
740
741 targetBit = (1ULL << bitIdx);
742 return bitArray | targetBit;
743 }
744 */
745/**
746 * Clears a bit from bitArray.
747 *
748 * @param bitArray memory area to set the bit in
749 * @param bitIdx which bit to unset
750 */
751/*static uint64_t
752 clearBit (uint64_t bitArray, unsigned int bitIdx)
753 {
754 uint64_t targetBit;
755
756 targetBit = (1ULL << bitIdx);
757 return bitArray & (~targetBit);
758 }
759 */
760/**
761 * Checks if a bit is active in the bitArray
762 *
763 * @param bitArray memory area to set the bit in
764 * @param bitIdx which bit to test
765 * @return GNUNET_YES if the bit is set, GNUNET_NO if not.
766 */
767/*static int
768 testBit (uint64_t bitArray, unsigned int bitIdx)
769 {
770 uint64_t targetBit;
771
772
773 targetBit = (1ULL << bitIdx);
774 if (bitArray & targetBit)
775 return GNUNET_YES;
776 else
777 return GNUNET_NO;
778 }
779 */
780/**
781 * get the next message number, at the moment just a random one 731 * get the next message number, at the moment just a random one
782 * @return returns the next valid message-number for sending packets 732 * @return returns the next valid message-number for sending packets
783 */ 733 */
@@ -1675,8 +1625,8 @@ int
1675getWlanHeader(struct IeeeHeader * Header, const char * const to_mac_addr, 1625getWlanHeader(struct IeeeHeader * Header, const char * const to_mac_addr,
1676 struct Plugin * plugin) 1626 struct Plugin * plugin)
1677{ 1627{
1678 memcpy(&Header->mac2, macbc, sizeof(macbc)); 1628 memcpy(&Header->mac3, mac_bssid, sizeof(mac_bssid));
1679 memcpy(&Header->mac3, plugin->mac_address.mac, sizeof(plugin->mac_address)); 1629 memcpy(&Header->mac2, plugin->mac_address.mac, sizeof(plugin->mac_address));
1680 memcpy(&Header->mac1, to_mac_addr, sizeof(plugin->mac_address)); 1630 memcpy(&Header->mac1, to_mac_addr, sizeof(plugin->mac_address));
1681 return GNUNET_YES; 1631 return GNUNET_YES;
1682} 1632}
@@ -2154,7 +2104,8 @@ insert_fragment_in_queue(struct Receive_Message_Queue * rec_message,
2154 2104
2155/** 2105/**
2156 * Function to dispose the fragments received for a message and the message 2106 * Function to dispose the fragments received for a message and the message
2157 * @param session session to free the fragments from 2107 * @param plugin pointer to the plugin struct
2108 * @param rec_message pointer to the struct holding the message which should be freed
2158 */ 2109 */
2159 2110
2160static void 2111static void
@@ -2187,6 +2138,7 @@ free_receive_message(struct Plugin* plugin,
2187 * @param plugin the plugin handle 2138 * @param plugin the plugin handle
2188 * @param session_light information of the message sender 2139 * @param session_light information of the message sender
2189 * @param session session the message belongs to 2140 * @param session session the message belongs to
2141 * @param rec_message pointer to the message that should be checked
2190 */ 2142 */
2191 2143
2192static void 2144static void
@@ -2398,6 +2350,7 @@ wlan_data_massage_handler(struct Plugin * plugin,
2398 * function to add an ack to send it for a received fragment 2350 * function to add an ack to send it for a received fragment
2399 * @param plugin pointer to the global plugin structure 2351 * @param plugin pointer to the global plugin structure
2400 * @param session pointer to the session this ack belongs to 2352 * @param session pointer to the session this ack belongs to
2353 * @param bitfield bitfield to send
2401 * @param fh pointer to the fragmentation header which we would like to acknolage 2354 * @param fh pointer to the fragmentation header which we would like to acknolage
2402 */ 2355 */
2403 2356
@@ -2470,6 +2423,7 @@ get_receive_message_from_session(struct Plugin * plugin,
2470/** 2423/**
2471 * function to insert a received fragment into the right fragment queue of the right message 2424 * function to insert a received fragment into the right fragment queue of the right message
2472 * @param plugin pointer to the plugin struct 2425 * @param plugin pointer to the plugin struct
2426 * @param session_light pointer to the session_light struct of this message
2473 * @param session session this fragment belongs to 2427 * @param session session this fragment belongs to
2474 * @param fh pointer to the header of the fragment 2428 * @param fh pointer to the header of the fragment
2475 * @return new fragment bitfield for the message 2429 * @return new fragment bitfield for the message
@@ -2770,7 +2724,7 @@ wlan_process_helper(void *cls, void *client,
2770 //process only if it is an broadcast or for this computer both with the gnunet bssid 2724 //process only if it is an broadcast or for this computer both with the gnunet bssid
2771 2725
2772 //check for bssid 2726 //check for bssid
2773 if (memcmp(&(wlanIeeeHeader->mac2), macbc, sizeof(struct MacAddress)) 2727 if (memcmp(&(wlanIeeeHeader->mac3), mac_bssid, sizeof(struct MacAddress))
2774 == 0) 2728 == 0)
2775 { 2729 {
2776 //check for broadcast or mac 2730 //check for broadcast or mac
@@ -2787,7 +2741,7 @@ wlan_process_helper(void *cls, void *client,
2787 - sizeof(struct GNUNET_MessageHeader); 2741 - sizeof(struct GNUNET_MessageHeader);
2788 2742
2789 session_light = GNUNET_malloc(sizeof(struct Session_light)); 2743 session_light = GNUNET_malloc(sizeof(struct Session_light));
2790 memcpy(session_light->addr, &(wlanIeeeHeader->mac3), 2744 memcpy(session_light->addr, &(wlanIeeeHeader->mac2),
2791 sizeof(struct MacAddress)); 2745 sizeof(struct MacAddress));
2792 //session_light->session = search_session(plugin,session_light->addr); 2746 //session_light->session = search_session(plugin,session_light->addr);
2793 2747
diff --git a/src/transport/plugin_transport_wlan.h b/src/transport/plugin_transport_wlan.h
index fb1a7ff57..ac214a07c 100644
--- a/src/transport/plugin_transport_wlan.h
+++ b/src/transport/plugin_transport_wlan.h
@@ -54,13 +54,13 @@ static const uint8_t u8aIeeeHeader[] =
54 // 0x01 = 00000001 -> | b1 = 1 to DS; b2 = 0 not from DS; 54 // 0x01 = 00000001 -> | b1 = 1 to DS; b2 = 0 not from DS;
55 0x00, 0x00, // Duration/ID 55 0x00, 0x00, // Duration/ID
56 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // mac1 - in this case receiver 56 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // mac1 - in this case receiver
57 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac2 - in this case bssid 57 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac2 - in this case sender
58 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac3 - in this case sender 58 0x13, 0x22, 0x33, 0x44, 0x55, 0x66, // mac3 - in this case bssid
59 0x10, 0x86, //Sequence Control 59 0x10, 0x86, //Sequence Control
60 }; 60 };
61 61
62// gnunet bssid 62// gnunet bssid
63static const char macbc[] = 63static const char mac_bssid[] =
64 { 0x13, 0x22, 0x33, 0x44, 0x55, 0x66 }; 64 { 0x13, 0x22, 0x33, 0x44, 0x55, 0x66 };
65 65
66// broadcast mac 66// broadcast mac
@@ -129,7 +129,9 @@ struct RadiotapHeader
129 /** 129 /**
130 * radiotap version 130 * radiotap version
131 */ 131 */
132 uint16_t version GNUNET_PACKED; 132 u_int8_t version;
133
134 u_int8_t pad_version;
133 135
134 /** 136 /**
135 * radiotap header length 137 * radiotap header length
@@ -137,7 +139,7 @@ struct RadiotapHeader
137 uint16_t length GNUNET_PACKED; 139 uint16_t length GNUNET_PACKED;
138 140
139 /** 141 /**
140 * bitmap 142 * bitmap, fields present
141 */ 143 */
142 uint32_t bitmap GNUNET_PACKED; 144 uint32_t bitmap GNUNET_PACKED;
143 145