diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-23 18:16:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-23 18:16:10 +0000 |
commit | 85e0c60ee5c4bb74c0025f6f594687641a1dad93 (patch) | |
tree | 4dfb054ad17b02fec3c19cf8d94cf9d1a355d2b5 | |
parent | 3e82863a722f3eabcbef960bcceb924049b35f81 (diff) | |
download | gnunet-85e0c60ee5c4bb74c0025f6f594687641a1dad93.tar.gz gnunet-85e0c60ee5c4bb74c0025f6f594687641a1dad93.zip |
-indentation, doxygen
-rw-r--r-- | src/transport/plugin_transport_bluetooth.c | 154 | ||||
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 11 |
2 files changed, 91 insertions, 74 deletions
diff --git a/src/transport/plugin_transport_bluetooth.c b/src/transport/plugin_transport_bluetooth.c index 8ab64b15c..e5f80e466 100644 --- a/src/transport/plugin_transport_bluetooth.c +++ b/src/transport/plugin_transport_bluetooth.c | |||
@@ -88,7 +88,7 @@ struct WlanHeader | |||
88 | { | 88 | { |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Message type is GNUNET_MESSAGE_TYPE_WLAN_DATA. | 91 | * Message type is #GNUNET_MESSAGE_TYPE_WLAN_DATA. |
92 | */ | 92 | */ |
93 | struct GNUNET_MessageHeader header; | 93 | struct GNUNET_MessageHeader header; |
94 | 94 | ||
@@ -177,13 +177,8 @@ struct Session | |||
177 | struct GNUNET_PeerIdentity target; | 177 | struct GNUNET_PeerIdentity target; |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * API requirement (must be first). | ||
181 | */ | ||
182 | struct SessionHeader header; | ||
183 | |||
184 | /** | ||
185 | * We keep all sessions in a DLL at their respective | 180 | * We keep all sessions in a DLL at their respective |
186 | * 'struct MACEndpoint'. | 181 | * `struct MACEndpoint *`. |
187 | */ | 182 | */ |
188 | struct Session *next; | 183 | struct Session *next; |
189 | 184 | ||
@@ -279,7 +274,7 @@ struct FragmentMessage | |||
279 | GNUNET_TRANSPORT_TransmitContinuation cont; | 274 | GNUNET_TRANSPORT_TransmitContinuation cont; |
280 | 275 | ||
281 | /** | 276 | /** |
282 | * Closure for 'cont' | 277 | * Closure for @e cont. |
283 | */ | 278 | */ |
284 | void *cont_cls; | 279 | void *cont_cls; |
285 | 280 | ||
@@ -353,11 +348,6 @@ struct MacEndpoint | |||
353 | GNUNET_SCHEDULER_TaskIdentifier timeout_task; | 348 | GNUNET_SCHEDULER_TaskIdentifier timeout_task; |
354 | 349 | ||
355 | /** | 350 | /** |
356 | * count of messages in the fragment out queue for this mac endpoint | ||
357 | */ | ||
358 | unsigned int fragment_messages_out_count; | ||
359 | |||
360 | /** | ||
361 | * peer mac address | 351 | * peer mac address |
362 | */ | 352 | */ |
363 | struct WlanAddress addr; | 353 | struct WlanAddress addr; |
@@ -373,6 +363,11 @@ struct MacEndpoint | |||
373 | struct GNUNET_TIME_Relative ack_delay; | 363 | struct GNUNET_TIME_Relative ack_delay; |
374 | 364 | ||
375 | /** | 365 | /** |
366 | * count of messages in the fragment out queue for this mac endpoint | ||
367 | */ | ||
368 | unsigned int fragment_messages_out_count; | ||
369 | |||
370 | /** | ||
376 | * Desired transmission power for this MAC | 371 | * Desired transmission power for this MAC |
377 | */ | 372 | */ |
378 | uint16_t tx_power; | 373 | uint16_t tx_power; |
@@ -409,7 +404,7 @@ struct Plugin | |||
409 | * ARGV-vector for the helper (all helpers take only the binary | 404 | * ARGV-vector for the helper (all helpers take only the binary |
410 | * name, one actual argument, plus the NULL terminator for 'argv'). | 405 | * name, one actual argument, plus the NULL terminator for 'argv'). |
411 | */ | 406 | */ |
412 | char * helper_argv[3]; | 407 | char *helper_argv[3]; |
413 | 408 | ||
414 | /** | 409 | /** |
415 | * The interface of the wlan card given to us by the user. | 410 | * The interface of the wlan card given to us by the user. |
@@ -500,7 +495,7 @@ struct MacAndSession | |||
500 | * | 495 | * |
501 | * @param cls closure | 496 | * @param cls closure |
502 | * @param addr binary address | 497 | * @param addr binary address |
503 | * @param addrlen length of the address | 498 | * @param addrlen length of the @a addr |
504 | * @return string representing the same address | 499 | * @return string representing the same address |
505 | */ | 500 | */ |
506 | static const char * | 501 | static const char * |
@@ -512,16 +507,21 @@ bluetooth_plugin_address_to_string (void *cls, | |||
512 | * Print MAC addresses nicely. | 507 | * Print MAC addresses nicely. |
513 | * | 508 | * |
514 | * @param mac the mac address | 509 | * @param mac the mac address |
515 | * @return string to a static buffer with the human-readable mac, will be overwritten during the next call to this function | 510 | * @return string to a static buffer with |
511 | * the human-readable mac, will be overwritten during the next call to | ||
512 | * this function | ||
516 | */ | 513 | */ |
517 | static const char * | 514 | static const char * |
518 | mac_to_string (const struct GNUNET_TRANSPORT_WLAN_MacAddress * mac) | 515 | mac_to_string (const struct GNUNET_TRANSPORT_WLAN_MacAddress * mac) |
519 | { | 516 | { |
520 | static char macstr[20]; | 517 | static char macstr[20]; |
521 | 518 | ||
522 | GNUNET_snprintf (macstr, sizeof (macstr), "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", | 519 | GNUNET_snprintf (macstr, |
523 | mac->mac[0], mac->mac[1], | 520 | sizeof (macstr), |
524 | mac->mac[2], mac->mac[3], mac->mac[4], mac->mac[5]); | 521 | "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", |
522 | mac->mac[0], mac->mac[1], | ||
523 | mac->mac[2], mac->mac[3], | ||
524 | mac->mac[4], mac->mac[5]); | ||
525 | return macstr; | 525 | return macstr; |
526 | } | 526 | } |
527 | 527 | ||
@@ -620,7 +620,8 @@ send_ack (void *cls, uint32_t msg_id, | |||
620 | &radio_header->header, | 620 | &radio_header->header, |
621 | GNUNET_NO /* dropping ACKs is bad */, | 621 | GNUNET_NO /* dropping ACKs is bad */, |
622 | NULL, NULL)) | 622 | NULL, NULL)) |
623 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Bluetooth ACKs sent"), | 623 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, |
624 | _("# Bluetooth ACKs sent"), | ||
624 | 1, GNUNET_NO); | 625 | 1, GNUNET_NO); |
625 | } | 626 | } |
626 | 627 | ||
@@ -632,7 +633,8 @@ send_ack (void *cls, uint32_t msg_id, | |||
632 | * @param hdr pointer to the data | 633 | * @param hdr pointer to the data |
633 | */ | 634 | */ |
634 | static void | 635 | static void |
635 | bluetooth_data_message_handler (void *cls, const struct GNUNET_MessageHeader *hdr) | 636 | bluetooth_data_message_handler (void *cls, |
637 | const struct GNUNET_MessageHeader *hdr) | ||
636 | { | 638 | { |
637 | struct MacEndpoint *endpoint = cls; | 639 | struct MacEndpoint *endpoint = cls; |
638 | struct Plugin *plugin = endpoint->plugin; | 640 | struct Plugin *plugin = endpoint->plugin; |
@@ -696,10 +698,11 @@ free_session (struct Session *session) | |||
696 | * A session is timing out. Clean up. | 698 | * A session is timing out. Clean up. |
697 | * | 699 | * |
698 | * @param cls pointer to the Session | 700 | * @param cls pointer to the Session |
699 | * @param tc pointer to the GNUNET_SCHEDULER_TaskContext | 701 | * @param tc unused |
700 | */ | 702 | */ |
701 | static void | 703 | static void |
702 | session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 704 | session_timeout (void *cls, |
705 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
703 | { | 706 | { |
704 | struct Session * session = cls; | 707 | struct Session * session = cls; |
705 | struct GNUNET_TIME_Relative timeout; | 708 | struct GNUNET_TIME_Relative timeout; |
@@ -795,7 +798,6 @@ fragment_transmission_done (void *cls, | |||
795 | { | 798 | { |
796 | struct FragmentMessage *fm = cls; | 799 | struct FragmentMessage *fm = cls; |
797 | 800 | ||
798 | |||
799 | fm->sh = NULL; | 801 | fm->sh = NULL; |
800 | GNUNET_FRAGMENT_context_transmission_done (fm->fragcontext); | 802 | GNUNET_FRAGMENT_context_transmission_done (fm->fragcontext); |
801 | } | 803 | } |
@@ -804,7 +806,7 @@ fragment_transmission_done (void *cls, | |||
804 | /** | 806 | /** |
805 | * Transmit a fragment of a message. | 807 | * Transmit a fragment of a message. |
806 | * | 808 | * |
807 | * @param cls 'struct FragmentMessage' this fragment message belongs to | 809 | * @param cls `struct FragmentMessage *` this fragment message belongs to |
808 | * @param hdr pointer to the start of the fragment message | 810 | * @param hdr pointer to the start of the fragment message |
809 | */ | 811 | */ |
810 | static void | 812 | static void |
@@ -836,7 +838,8 @@ transmit_fragment (void *cls, | |||
836 | &fragment_transmission_done, fm); | 838 | &fragment_transmission_done, fm); |
837 | fm->size_on_wire += size; | 839 | fm->size_on_wire += size; |
838 | if (NULL != fm->sh) | 840 | if (NULL != fm->sh) |
839 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Bluetooth message fragments sent"), | 841 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, |
842 | _("# Bluetooth message fragments sent"), | ||
840 | 1, GNUNET_NO); | 843 | 1, GNUNET_NO); |
841 | else | 844 | else |
842 | GNUNET_FRAGMENT_context_transmission_done (fm->fragcontext); | 845 | GNUNET_FRAGMENT_context_transmission_done (fm->fragcontext); |
@@ -860,7 +863,8 @@ free_fragment_message (struct FragmentMessage *fm) | |||
860 | { | 863 | { |
861 | struct MacEndpoint *endpoint = fm->macendpoint; | 864 | struct MacEndpoint *endpoint = fm->macendpoint; |
862 | 865 | ||
863 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Bluetooth messages pending (with fragmentation)"), | 866 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, |
867 | _("# Bluetooth messages pending (with fragmentation)"), | ||
864 | -1, GNUNET_NO); | 868 | -1, GNUNET_NO); |
865 | GNUNET_CONTAINER_DLL_remove (endpoint->sending_messages_head, | 869 | GNUNET_CONTAINER_DLL_remove (endpoint->sending_messages_head, |
866 | endpoint->sending_messages_tail, fm); | 870 | endpoint->sending_messages_tail, fm); |
@@ -870,8 +874,8 @@ free_fragment_message (struct FragmentMessage *fm) | |||
870 | fm->sh = NULL; | 874 | fm->sh = NULL; |
871 | } | 875 | } |
872 | GNUNET_FRAGMENT_context_destroy (fm->fragcontext, | 876 | GNUNET_FRAGMENT_context_destroy (fm->fragcontext, |
873 | &endpoint->msg_delay, | 877 | &endpoint->msg_delay, |
874 | &endpoint->ack_delay); | 878 | &endpoint->ack_delay); |
875 | if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) | 879 | if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) |
876 | { | 880 | { |
877 | GNUNET_SCHEDULER_cancel (fm->timeout_task); | 881 | GNUNET_SCHEDULER_cancel (fm->timeout_task); |
@@ -896,7 +900,11 @@ fragmentmessage_timeout (void *cls, | |||
896 | fm->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 900 | fm->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
897 | if (NULL != fm->cont) | 901 | if (NULL != fm->cont) |
898 | { | 902 | { |
899 | fm->cont (fm->cont_cls, &fm->target, GNUNET_SYSERR, fm->size_payload, fm->size_on_wire); | 903 | fm->cont (fm->cont_cls, |
904 | &fm->target, | ||
905 | GNUNET_SYSERR, | ||
906 | fm->size_payload, | ||
907 | fm->size_on_wire); | ||
900 | fm->cont = NULL; | 908 | fm->cont = NULL; |
901 | } | 909 | } |
902 | free_fragment_message (fm); | 910 | free_fragment_message (fm); |
@@ -915,7 +923,7 @@ fragmentmessage_timeout (void *cls, | |||
915 | * been transmitted (or if the transport is ready | 923 | * been transmitted (or if the transport is ready |
916 | * for the next transmission call; or if the | 924 | * for the next transmission call; or if the |
917 | * peer disconnected...); can be NULL | 925 | * peer disconnected...); can be NULL |
918 | * @param cont_cls closure for cont | 926 | * @param cont_cls closure for @a cont |
919 | */ | 927 | */ |
920 | static void | 928 | static void |
921 | send_with_fragmentation (struct MacEndpoint *endpoint, | 929 | send_with_fragmentation (struct MacEndpoint *endpoint, |
@@ -923,7 +931,8 @@ send_with_fragmentation (struct MacEndpoint *endpoint, | |||
923 | const struct GNUNET_PeerIdentity *target, | 931 | const struct GNUNET_PeerIdentity *target, |
924 | const struct GNUNET_MessageHeader *msg, | 932 | const struct GNUNET_MessageHeader *msg, |
925 | size_t payload_size, | 933 | size_t payload_size, |
926 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls) | 934 | GNUNET_TRANSPORT_TransmitContinuation cont, |
935 | void *cont_cls) | ||
927 | 936 | ||
928 | { | 937 | { |
929 | struct FragmentMessage *fm; | 938 | struct FragmentMessage *fm; |
@@ -1046,14 +1055,15 @@ create_macendpoint (struct Plugin *plugin, | |||
1046 | 1055 | ||
1047 | pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; | 1056 | pos->msg_delay = GNUNET_TIME_UNIT_MILLISECONDS; |
1048 | pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 1057 | pos->ack_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, |
1049 | 100); | 1058 | 100); |
1050 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); | 1059 | pos->timeout = GNUNET_TIME_relative_to_absolute (MACENDPOINT_TIMEOUT); |
1051 | pos->timeout_task = | 1060 | pos->timeout_task = |
1052 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, | 1061 | GNUNET_SCHEDULER_add_delayed (MACENDPOINT_TIMEOUT, &macendpoint_timeout, |
1053 | pos); | 1062 | pos); |
1054 | GNUNET_CONTAINER_DLL_insert (plugin->mac_head, plugin->mac_tail, pos); | 1063 | GNUNET_CONTAINER_DLL_insert (plugin->mac_head, plugin->mac_tail, pos); |
1055 | plugin->mac_count++; | 1064 | plugin->mac_count++; |
1056 | GNUNET_STATISTICS_update (plugin->env->stats, _("# Bluetooth MAC endpoints allocated"), | 1065 | GNUNET_STATISTICS_update (plugin->env->stats, |
1066 | _("# Bluetooth MAC endpoints allocated"), | ||
1057 | 1, GNUNET_NO); | 1067 | 1, GNUNET_NO); |
1058 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1068 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1059 | "New MAC endpoint `%s'\n", | 1069 | "New MAC endpoint `%s'\n", |
@@ -1108,7 +1118,7 @@ get_session (struct MacEndpoint *endpoint, | |||
1108 | */ | 1118 | */ |
1109 | static struct Session * | 1119 | static struct Session * |
1110 | bluetooth_plugin_get_session (void *cls, | 1120 | bluetooth_plugin_get_session (void *cls, |
1111 | const struct GNUNET_HELLO_Address *address) | 1121 | const struct GNUNET_HELLO_Address *address) |
1112 | { | 1122 | { |
1113 | struct Plugin *plugin = cls; | 1123 | struct Plugin *plugin = cls; |
1114 | struct MacEndpoint *endpoint; | 1124 | struct MacEndpoint *endpoint; |
@@ -1177,7 +1187,7 @@ bluetooth_plugin_disconnect_session (void *cls, | |||
1177 | 1187 | ||
1178 | /** | 1188 | /** |
1179 | * Function that is called to get the keepalive factor. | 1189 | * Function that is called to get the keepalive factor. |
1180 | * GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to | 1190 | * #GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT is divided by this number to |
1181 | * calculate the interval between keepalive packets. | 1191 | * calculate the interval between keepalive packets. |
1182 | * | 1192 | * |
1183 | * @param cls closure with the `struct Plugin` | 1193 | * @param cls closure with the `struct Plugin` |
@@ -1219,11 +1229,13 @@ bluetooth_query_keepalive_factor (void *cls) | |||
1219 | */ | 1229 | */ |
1220 | static ssize_t | 1230 | static ssize_t |
1221 | bluetooth_plugin_send (void *cls, | 1231 | bluetooth_plugin_send (void *cls, |
1222 | struct Session *session, | 1232 | struct Session *session, |
1223 | const char *msgbuf, size_t msgbuf_size, | 1233 | const char *msgbuf, |
1224 | unsigned int priority, | 1234 | size_t msgbuf_size, |
1225 | struct GNUNET_TIME_Relative to, | 1235 | unsigned int priority, |
1226 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls) | 1236 | struct GNUNET_TIME_Relative to, |
1237 | GNUNET_TRANSPORT_TransmitContinuation cont, | ||
1238 | void *cont_cls) | ||
1227 | { | 1239 | { |
1228 | struct Plugin *plugin = cls; | 1240 | struct Plugin *plugin = cls; |
1229 | struct WlanHeader *wlanheader; | 1241 | struct WlanHeader *wlanheader; |
@@ -1621,7 +1633,8 @@ send_hello_beacon (void *cls, | |||
1621 | &radioHeader->header, | 1633 | &radioHeader->header, |
1622 | GNUNET_YES /* can drop */, | 1634 | GNUNET_YES /* can drop */, |
1623 | NULL, NULL)) | 1635 | NULL, NULL)) |
1624 | GNUNET_STATISTICS_update (plugin->env->stats, _("# HELLO beacons sent via Bluetooth"), | 1636 | GNUNET_STATISTICS_update (plugin->env->stats, |
1637 | _("# HELLO beacons sent via Bluetooth"), | ||
1625 | 1, GNUNET_NO); | 1638 | 1, GNUNET_NO); |
1626 | } | 1639 | } |
1627 | plugin->beacon_task = | 1640 | plugin->beacon_task = |
@@ -1642,12 +1655,14 @@ send_hello_beacon (void *cls, | |||
1642 | * | 1655 | * |
1643 | * @param cls closure | 1656 | * @param cls closure |
1644 | * @param addr pointer to the address | 1657 | * @param addr pointer to the address |
1645 | * @param addrlen length of addr | 1658 | * @param addrlen length of @a addr |
1646 | * @return GNUNET_OK if this is a plausible address for this peer | 1659 | * @return #GNUNET_OK if this is a plausible address for this peer |
1647 | * and transport | 1660 | * and transport |
1648 | */ | 1661 | */ |
1649 | static int | 1662 | static int |
1650 | bluetooth_plugin_address_suggested (void *cls, const void *addr, size_t addrlen) | 1663 | bluetooth_plugin_address_suggested (void *cls, |
1664 | const void *addr, | ||
1665 | size_t addrlen) | ||
1651 | { | 1666 | { |
1652 | struct Plugin *plugin = cls; | 1667 | struct Plugin *plugin = cls; |
1653 | struct WlanAddress *wa = (struct WlanAddress *) addr; | 1668 | struct WlanAddress *wa = (struct WlanAddress *) addr; |
@@ -1685,7 +1700,7 @@ bluetooth_plugin_address_suggested (void *cls, const void *addr, size_t addrlen) | |||
1685 | * | 1700 | * |
1686 | * @param cls closure | 1701 | * @param cls closure |
1687 | * @param addr binary address | 1702 | * @param addr binary address |
1688 | * @param addrlen length of the address | 1703 | * @param addrlen length of the @a addr |
1689 | * @return string representing the same address | 1704 | * @return string representing the same address |
1690 | */ | 1705 | */ |
1691 | static const char * | 1706 | static const char * |
@@ -1719,19 +1734,21 @@ bluetooth_plugin_address_to_string (void *cls, | |||
1719 | * @param type name of the transport that generated the address | 1734 | * @param type name of the transport that generated the address |
1720 | * @param addr one of the addresses of the host, NULL for the last address | 1735 | * @param addr one of the addresses of the host, NULL for the last address |
1721 | * the specific address format depends on the transport | 1736 | * the specific address format depends on the transport |
1722 | * @param addrlen length of the address | 1737 | * @param addrlen length of the @a addr |
1723 | * @param numeric should (IP) addresses be displayed in numeric form? | 1738 | * @param numeric should (IP) addresses be displayed in numeric form? |
1724 | * @param timeout after how long should we give up? | 1739 | * @param timeout after how long should we give up? |
1725 | * @param asc function to call on each string | 1740 | * @param asc function to call on each string |
1726 | * @param asc_cls closure for @a asc | 1741 | * @param asc_cls closure for @a asc |
1727 | */ | 1742 | */ |
1728 | static void | 1743 | static void |
1729 | bluetooth_plugin_address_pretty_printer (void *cls, const char *type, | 1744 | bluetooth_plugin_address_pretty_printer (void *cls, |
1730 | const void *addr, size_t addrlen, | 1745 | const char *type, |
1731 | int numeric, | 1746 | const void *addr, |
1732 | struct GNUNET_TIME_Relative timeout, | 1747 | size_t addrlen, |
1733 | GNUNET_TRANSPORT_AddressStringCallback asc, | 1748 | int numeric, |
1734 | void *asc_cls) | 1749 | struct GNUNET_TIME_Relative timeout, |
1750 | GNUNET_TRANSPORT_AddressStringCallback asc, | ||
1751 | void *asc_cls) | ||
1735 | { | 1752 | { |
1736 | const char *ret; | 1753 | const char *ret; |
1737 | 1754 | ||
@@ -1824,17 +1841,20 @@ libgnunet_plugin_transport_bluetooth_done (void *cls) | |||
1824 | * Function called to convert a string address to | 1841 | * Function called to convert a string address to |
1825 | * a binary address. | 1842 | * a binary address. |
1826 | * | 1843 | * |
1827 | * @param cls closure ('struct Plugin*') | 1844 | * @param cls closure (`struct Plugin *`) |
1828 | * @param addr string address | 1845 | * @param addr string address |
1829 | * @param addrlen length of the address | 1846 | * @param addrlen length of the @a addr |
1830 | * @param buf location to store the buffer | 1847 | * @param buf location to store the buffer |
1831 | * @param added location to store the number of bytes in the buffer. | 1848 | * @param added location to store the number of bytes in the buffer. |
1832 | * If the function returns GNUNET_SYSERR, its contents are undefined. | 1849 | * If the function returns #GNUNET_SYSERR, its contents are undefined. |
1833 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 1850 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
1834 | */ | 1851 | */ |
1835 | static int | 1852 | static int |
1836 | bluetooth_string_to_address (void *cls, const char *addr, uint16_t addrlen, | 1853 | bluetooth_string_to_address (void *cls, |
1837 | void **buf, size_t *added) | 1854 | const char *addr, |
1855 | uint16_t addrlen, | ||
1856 | void **buf, | ||
1857 | size_t *added) | ||
1838 | { | 1858 | { |
1839 | struct WlanAddress *wa; | 1859 | struct WlanAddress *wa; |
1840 | unsigned int a[6]; | 1860 | unsigned int a[6]; |
@@ -1875,24 +1895,26 @@ bluetooth_string_to_address (void *cls, const char *addr, uint16_t addrlen, | |||
1875 | return GNUNET_OK; | 1895 | return GNUNET_OK; |
1876 | } | 1896 | } |
1877 | 1897 | ||
1898 | |||
1878 | static void | 1899 | static void |
1879 | bluetooth_plugin_update_session_timeout (void *cls, | 1900 | bluetooth_plugin_update_session_timeout (void *cls, |
1880 | const struct GNUNET_PeerIdentity *peer, | 1901 | const struct GNUNET_PeerIdentity *peer, |
1881 | struct Session *session) | 1902 | struct Session *session) |
1882 | { | 1903 | { |
1883 | if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task) | 1904 | if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task) |
1884 | GNUNET_SCHEDULER_cancel (session->timeout_task); | 1905 | GNUNET_SCHEDULER_cancel (session->timeout_task); |
1885 | session->timeout_task = GNUNET_SCHEDULER_add_delayed ( | 1906 | session->timeout_task |
1886 | GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, &session_timeout, session); | 1907 | = GNUNET_SCHEDULER_add_delayed (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT, |
1908 | &session_timeout, | ||
1909 | session); | ||
1887 | } | 1910 | } |
1888 | 1911 | ||
1889 | 1912 | ||
1890 | |||
1891 | /** | 1913 | /** |
1892 | * Entry point for the plugin. | 1914 | * Entry point for the plugin. |
1893 | * | 1915 | * |
1894 | * @param cls closure, the 'struct GNUNET_TRANSPORT_PluginEnvironment*' | 1916 | * @param cls closure, the `struct GNUNET_TRANSPORT_PluginEnvironment *` |
1895 | * @return the 'struct GNUNET_TRANSPORT_PluginFunctions*' or NULL on error | 1917 | * @return the `struct GNUNET_TRANSPORT_PluginFunctions *` or NULL on error |
1896 | */ | 1918 | */ |
1897 | void * | 1919 | void * |
1898 | libgnunet_plugin_transport_bluetooth_init (void *cls) | 1920 | libgnunet_plugin_transport_bluetooth_init (void *cls) |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 49dfee816..3647f1ea9 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -82,7 +82,7 @@ struct WlanHeader | |||
82 | { | 82 | { |
83 | 83 | ||
84 | /** | 84 | /** |
85 | * Message type is GNUNET_MESSAGE_TYPE_WLAN_DATA. | 85 | * Message type is #GNUNET_MESSAGE_TYPE_WLAN_DATA. |
86 | */ | 86 | */ |
87 | struct GNUNET_MessageHeader header; | 87 | struct GNUNET_MessageHeader header; |
88 | 88 | ||
@@ -171,13 +171,8 @@ struct Session | |||
171 | struct GNUNET_PeerIdentity target; | 171 | struct GNUNET_PeerIdentity target; |
172 | 172 | ||
173 | /** | 173 | /** |
174 | * API requirement (must be first). | ||
175 | */ | ||
176 | struct SessionHeader header; | ||
177 | |||
178 | /** | ||
179 | * We keep all sessions in a DLL at their respective | 174 | * We keep all sessions in a DLL at their respective |
180 | * 'struct MACEndpoint'. | 175 | * `struct MACEndpoint *`. |
181 | */ | 176 | */ |
182 | struct Session *next; | 177 | struct Session *next; |
183 | 178 | ||
@@ -272,7 +267,7 @@ struct FragmentMessage | |||
272 | GNUNET_TRANSPORT_TransmitContinuation cont; | 267 | GNUNET_TRANSPORT_TransmitContinuation cont; |
273 | 268 | ||
274 | /** | 269 | /** |
275 | * Closure for 'cont' | 270 | * Closure for @e cont |
276 | */ | 271 | */ |
277 | void *cont_cls; | 272 | void *cont_cls; |
278 | 273 | ||