diff options
author | David Brodski <david@brodski.eu> | 2011-03-22 23:23:41 +0000 |
---|---|---|
committer | David Brodski <david@brodski.eu> | 2011-03-22 23:23:41 +0000 |
commit | 8b5c27aee38c09aecf76907813d0ec5917d143b3 (patch) | |
tree | f17a928b77cf5bdb883e9b9038c5d320f43a8785 /src/transport/plugin_transport_wlan.c | |
parent | d74a1b1b52178c35f0f804c34bc63fe2c0203c1a (diff) | |
download | gnunet-8b5c27aee38c09aecf76907813d0ec5917d143b3.tar.gz gnunet-8b5c27aee38c09aecf76907813d0ec5917d143b3.zip |
doxigen and order of mac fields
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 64 |
1 files changed, 9 insertions, 55 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 | |||
1675 | getWlanHeader(struct IeeeHeader * Header, const char * const to_mac_addr, | 1625 | getWlanHeader(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 | ||
2160 | static void | 2111 | static 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 | ||
2192 | static void | 2144 | static 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 | ||