diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/transport | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/transport')
32 files changed, 704 insertions, 659 deletions
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c index 6c2b396dc..95f181835 100644 --- a/src/transport/gnunet-service-transport-new.c +++ b/src/transport/gnunet-service-transport-new.c | |||
@@ -218,8 +218,8 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
218 | ret = | 218 | ret = |
219 | GST_neighbours_calculate_receive_delay (peer, | 219 | GST_neighbours_calculate_receive_delay (peer, |
220 | (message == | 220 | (message == |
221 | NULL) ? 0 : ntohs (message-> | 221 | NULL) ? 0 : |
222 | size), | 222 | ntohs (message->size), |
223 | &do_forward); | 223 | &do_forward); |
224 | if (do_forward == GNUNET_YES) | 224 | if (do_forward == GNUNET_YES) |
225 | GST_clients_broadcast (message, GNUNET_YES); | 225 | GST_clients_broadcast (message, GNUNET_YES); |
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 5b0a58fac..d6b5ac23f 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -953,7 +953,8 @@ struct GNUNET_TIME_Relative ats_regular_interval; | |||
953 | * disconnected or must we ask all plugins to | 953 | * disconnected or must we ask all plugins to |
954 | * disconnect? | 954 | * disconnect? |
955 | */ | 955 | */ |
956 | static void disconnect_neighbour (struct NeighbourMapEntry *n, int check); | 956 | static void |
957 | disconnect_neighbour (struct NeighbourMapEntry *n, int check); | ||
957 | 958 | ||
958 | /** | 959 | /** |
959 | * Check the ready list for the given neighbour and if a plugin is | 960 | * Check the ready list for the given neighbour and if a plugin is |
@@ -961,10 +962,11 @@ static void disconnect_neighbour (struct NeighbourMapEntry *n, int check); | |||
961 | * | 962 | * |
962 | * @param nexi target peer for which to transmit | 963 | * @param nexi target peer for which to transmit |
963 | */ | 964 | */ |
964 | static void try_transmission_to_peer (struct NeighbourMapEntry *n); | 965 | static void |
966 | try_transmission_to_peer (struct NeighbourMapEntry *n); | ||
965 | 967 | ||
966 | struct ForeignAddressList *get_preferred_ats_address (struct NeighbourMapEntry | 968 | struct ForeignAddressList * |
967 | *n); | 969 | get_preferred_ats_address (struct NeighbourMapEntry *n); |
968 | 970 | ||
969 | /** | 971 | /** |
970 | * Find an entry in the neighbour list for a particular peer. | 972 | * Find an entry in the neighbour list for a particular peer. |
@@ -1223,8 +1225,8 @@ read_blacklist_file (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1223 | #endif | 1225 | #endif |
1224 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); | 1226 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); |
1225 | if (!isspace | 1227 | if (!isspace |
1226 | ((unsigned char) enc. | 1228 | ((unsigned char) |
1227 | encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) | 1229 | enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) |
1228 | { | 1230 | { |
1229 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1231 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1230 | _ | 1232 | _ |
@@ -1523,7 +1525,8 @@ transmit_send_ok (struct TransportClient *client, struct NeighbourMapEntry *n, | |||
1523 | * | 1525 | * |
1524 | * @param fal address to set to 'connected' | 1526 | * @param fal address to set to 'connected' |
1525 | */ | 1527 | */ |
1526 | static void mark_address_connected (struct ForeignAddressList *fal); | 1528 | static void |
1529 | mark_address_connected (struct ForeignAddressList *fal); | ||
1527 | 1530 | ||
1528 | 1531 | ||
1529 | 1532 | ||
@@ -1939,8 +1942,8 @@ mark_address_connected (struct ForeignAddressList *fal) | |||
1939 | /* Have an inbound connection to this peer which is valid; our id is lower, ignore outbound connection! */ | 1942 | /* Have an inbound connection to this peer which is valid; our id is lower, ignore outbound connection! */ |
1940 | if ((inbound != NULL) && (0 != fal->addrlen) && | 1943 | if ((inbound != NULL) && (0 != fal->addrlen) && |
1941 | (1 == | 1944 | (1 == |
1942 | GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour-> | 1945 | GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour->id. |
1943 | id.hashPubKey, &my_identity.hashPubKey, | 1946 | hashPubKey, &my_identity.hashPubKey, |
1944 | &null_hash))) | 1947 | &null_hash))) |
1945 | { | 1948 | { |
1946 | #if DEBUG_INBOUND | 1949 | #if DEBUG_INBOUND |
@@ -1951,8 +1954,8 @@ mark_address_connected (struct ForeignAddressList *fal) | |||
1951 | } | 1954 | } |
1952 | else if ((outbound != NULL) && (0 == fal->addrlen) && | 1955 | else if ((outbound != NULL) && (0 == fal->addrlen) && |
1953 | ((-1 == | 1956 | ((-1 == |
1954 | GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour->id. | 1957 | GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour-> |
1955 | hashPubKey, &my_identity.hashPubKey, | 1958 | id.hashPubKey, &my_identity.hashPubKey, |
1956 | &null_hash)))) | 1959 | &null_hash)))) |
1957 | { | 1960 | { |
1958 | #if DEBUG_INBOUND | 1961 | #if DEBUG_INBOUND |
@@ -2056,10 +2059,10 @@ find_ready_address (struct NeighbourMapEntry *neighbour) | |||
2056 | if (((best_address == NULL) || (addresses->connected == GNUNET_YES) || | 2059 | if (((best_address == NULL) || (addresses->connected == GNUNET_YES) || |
2057 | (best_address->connected == GNUNET_NO)) && | 2060 | (best_address->connected == GNUNET_NO)) && |
2058 | (addresses->in_transmit == GNUNET_NO) && ((best_address == NULL) || | 2061 | (addresses->in_transmit == GNUNET_NO) && ((best_address == NULL) || |
2059 | (addresses->latency. | 2062 | (addresses-> |
2060 | rel_value < | 2063 | latency.rel_value < |
2061 | best_address->latency. | 2064 | best_address-> |
2062 | rel_value))) | 2065 | latency.rel_value))) |
2063 | best_address = addresses; | 2066 | best_address = addresses; |
2064 | /* FIXME: also give lower-latency addresses that are not | 2067 | /* FIXME: also give lower-latency addresses that are not |
2065 | * connected a chance some times... */ | 2068 | * connected a chance some times... */ |
@@ -2960,7 +2963,8 @@ neighbour_timeout_task (void *cls, | |||
2960 | * | 2963 | * |
2961 | * @param fal address to PING | 2964 | * @param fal address to PING |
2962 | */ | 2965 | */ |
2963 | static void schedule_next_ping (struct ForeignAddressList *fal); | 2966 | static void |
2967 | schedule_next_ping (struct ForeignAddressList *fal); | ||
2964 | 2968 | ||
2965 | 2969 | ||
2966 | /** | 2970 | /** |
@@ -3295,8 +3299,8 @@ static struct BlacklistCheck *bc_tail; | |||
3295 | * @param cls the 'struct BlacklistCheck*' | 3299 | * @param cls the 'struct BlacklistCheck*' |
3296 | * @param tc unused | 3300 | * @param tc unused |
3297 | */ | 3301 | */ |
3298 | static void do_blacklist_check (void *cls, | 3302 | static void |
3299 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 3303 | do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
3300 | 3304 | ||
3301 | /** | 3305 | /** |
3302 | * Transmit blacklist query to the client. | 3306 | * Transmit blacklist query to the client. |
@@ -3633,9 +3637,8 @@ send_periodic_ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3633 | "Some validation of address `%s' via `%s' for peer `%4s' already in progress.\n", | 3637 | "Some validation of address `%s' via `%s' for peer `%4s' already in progress.\n", |
3634 | (peer_address->addr != NULL) ? a2s (tp->short_name, | 3638 | (peer_address->addr != NULL) ? a2s (tp->short_name, |
3635 | peer_address->addr, | 3639 | peer_address->addr, |
3636 | peer_address-> | 3640 | peer_address->addrlen) : |
3637 | addrlen) : "<inbound>", | 3641 | "<inbound>", tp->short_name, GNUNET_i2s (&neighbour->id)); |
3638 | tp->short_name, GNUNET_i2s (&neighbour->id)); | ||
3639 | #endif | 3642 | #endif |
3640 | schedule_next_ping (peer_address); | 3643 | schedule_next_ping (peer_address); |
3641 | return; | 3644 | return; |
@@ -4065,8 +4068,9 @@ check_pending_validation (void *cls, const GNUNET_HashCode * key, void *value) | |||
4065 | GNUNET_NO); | 4068 | GNUNET_NO); |
4066 | fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time); | 4069 | fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time); |
4067 | update_addr_value (fal, | 4070 | update_addr_value (fal, |
4068 | GNUNET_TIME_absolute_get_duration (ve->send_time). | 4071 | GNUNET_TIME_absolute_get_duration (ve-> |
4069 | rel_value, GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | 4072 | send_time).rel_value, |
4073 | GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | ||
4070 | 4074 | ||
4071 | schedule_next_ping (fal); | 4075 | schedule_next_ping (fal); |
4072 | if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 4076 | if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) |
@@ -4571,8 +4575,8 @@ process_hello (struct TransportPlugin *plugin, | |||
4571 | chvc = chvc_head; | 4575 | chvc = chvc_head; |
4572 | while (NULL != chvc) | 4576 | while (NULL != chvc) |
4573 | { | 4577 | { |
4574 | if (GNUNET_HELLO_equals (hello, chvc->hello, GNUNET_TIME_absolute_get ()). | 4578 | if (GNUNET_HELLO_equals |
4575 | abs_value > 0) | 4579 | (hello, chvc->hello, GNUNET_TIME_absolute_get ()).abs_value > 0) |
4576 | { | 4580 | { |
4577 | #if DEBUG_TRANSPORT_HELLO > 2 | 4581 | #if DEBUG_TRANSPORT_HELLO > 2 |
4578 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4582 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -4889,8 +4893,9 @@ handle_ping (void *cls, const struct GNUNET_MessageHeader *message, | |||
4889 | memcpy (&pong[1], plugin->short_name, slen); | 4893 | memcpy (&pong[1], plugin->short_name, slen); |
4890 | if ((sender_address != NULL) && (sender_address_len > 0)) | 4894 | if ((sender_address != NULL) && (sender_address_len > 0)) |
4891 | memcpy (&((char *) &pong[1])[slen], sender_address, sender_address_len); | 4895 | memcpy (&((char *) &pong[1])[slen], sender_address, sender_address_len); |
4892 | if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires). | 4896 | if (GNUNET_TIME_absolute_get_remaining |
4893 | rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4) | 4897 | (session_header->pong_sig_expires).rel_value < |
4898 | PONG_SIGNATURE_LIFETIME.rel_value / 4) | ||
4894 | { | 4899 | { |
4895 | /* create / update cached sig */ | 4900 | /* create / update cached sig */ |
4896 | #if DEBUG_TRANSPORT | 4901 | #if DEBUG_TRANSPORT |
@@ -5235,8 +5240,8 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
5235 | #if DEBUG_TRANSPORT | 5240 | #if DEBUG_TRANSPORT |
5236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5237 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", | 5242 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", |
5238 | (unsigned long long) n->in_tracker. | 5243 | (unsigned long long) n-> |
5239 | consumption_since_last_update__, | 5244 | in_tracker.consumption_since_last_update__, |
5240 | (unsigned int) n->in_tracker.available_bytes_per_s__, | 5245 | (unsigned int) n->in_tracker.available_bytes_per_s__, |
5241 | (unsigned long long) ret.rel_value); | 5246 | (unsigned long long) ret.rel_value); |
5242 | #endif | 5247 | #endif |
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c index 2e859f1db..87aa34bf4 100644 --- a/src/transport/gnunet-service-transport_ats.c +++ b/src/transport/gnunet-service-transport_ats.c | |||
@@ -473,7 +473,8 @@ _lp_print_sol (glp_prob *P, const char *fname) | |||
473 | * Dummy functions for CFLAGS | 473 | * Dummy functions for CFLAGS |
474 | */ | 474 | */ |
475 | 475 | ||
476 | static void _dummy2 (); | 476 | static void |
477 | _dummy2 (); | ||
477 | static void | 478 | static void |
478 | _dummy () | 479 | _dummy () |
479 | { | 480 | { |
diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h index 88e4b4bbf..550f218a9 100644 --- a/src/transport/gnunet-service-transport_ats.h +++ b/src/transport/gnunet-service-transport_ats.h | |||
@@ -449,40 +449,48 @@ static struct ATS_quality_metric qm[] = { | |||
449 | /* | 449 | /* |
450 | * ATS functions | 450 | * ATS functions |
451 | */ | 451 | */ |
452 | struct ATS_Handle *ats_init (double D, double U, double R, int v_b_min, | 452 | struct ATS_Handle * |
453 | int v_n_min, int max_iterations, | 453 | ats_init (double D, double U, double R, int v_b_min, int v_n_min, |
454 | struct GNUNET_TIME_Relative max_duration, | 454 | int max_iterations, struct GNUNET_TIME_Relative max_duration, |
455 | GNUNET_TRANSPORT_ATS_AddressNotification | 455 | GNUNET_TRANSPORT_ATS_AddressNotification address_not, |
456 | address_not, | 456 | GNUNET_TRANSPORT_ATS_ResultCallback res_cb); |
457 | GNUNET_TRANSPORT_ATS_ResultCallback res_cb); | ||
458 | 457 | ||
459 | void ats_shutdown (struct ATS_Handle *ats); | 458 | void |
459 | ats_shutdown (struct ATS_Handle *ats); | ||
460 | 460 | ||
461 | void ats_delete_problem (struct ATS_Handle *ats); | 461 | void |
462 | ats_delete_problem (struct ATS_Handle *ats); | ||
462 | 463 | ||
463 | int ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat, | 464 | int |
464 | struct ATS_peer *peers, int c_p, | 465 | ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat, |
465 | struct ATS_mechanism *mechanisms, int c_m); | 466 | struct ATS_peer *peers, int c_p, |
467 | struct ATS_mechanism *mechanisms, int c_m); | ||
466 | 468 | ||
467 | void ats_modify_problem_state (struct ATS_Handle *ats, | 469 | void |
468 | enum ATS_problem_state s); | 470 | ats_modify_problem_state (struct ATS_Handle *ats, enum ATS_problem_state s); |
469 | 471 | ||
470 | void ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); | 472 | void |
473 | ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); | ||
471 | 474 | ||
472 | void ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it, | 475 | void |
473 | unsigned int max_dur, unsigned int c_peers, | 476 | ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it, |
474 | unsigned int c_mechs, struct ATS_internals *stat); | 477 | unsigned int max_dur, unsigned int c_peers, |
478 | unsigned int c_mechs, struct ATS_internals *stat); | ||
475 | 479 | ||
476 | int ats_evaluate_results (int result, int solution, char *problem); | 480 | int |
481 | ats_evaluate_results (int result, int solution, char *problem); | ||
477 | 482 | ||
478 | void ats_update_problem_qm (struct ATS_Handle *ats); | 483 | void |
484 | ats_update_problem_qm (struct ATS_Handle *ats); | ||
479 | 485 | ||
480 | void ats_update_problem_cr (struct ATS_Handle *ats); | 486 | void |
487 | ats_update_problem_cr (struct ATS_Handle *ats); | ||
481 | 488 | ||
482 | 489 | ||
483 | void ats_set_logging_options (struct ATS_Handle *ats, | 490 | void |
484 | struct GNUNET_STATISTICS_Handle *stats, | 491 | ats_set_logging_options (struct ATS_Handle *ats, |
485 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 492 | struct GNUNET_STATISTICS_Handle *stats, |
493 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
486 | 494 | ||
487 | #endif | 495 | #endif |
488 | /* end of file gnunet-service-transport_ats.h */ | 496 | /* end of file gnunet-service-transport_ats.h */ |
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c index abb536414..21ad49652 100644 --- a/src/transport/gnunet-service-transport_blacklist.c +++ b/src/transport/gnunet-service-transport_blacklist.c | |||
@@ -161,8 +161,8 @@ static struct GNUNET_CONTAINER_MultiHashMap *blacklist; | |||
161 | * @param cls the 'struct BlacklistCheck*' | 161 | * @param cls the 'struct BlacklistCheck*' |
162 | * @param tc unused | 162 | * @param tc unused |
163 | */ | 163 | */ |
164 | static void do_blacklist_check (void *cls, | 164 | static void |
165 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 165 | do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
166 | 166 | ||
167 | 167 | ||
168 | /** | 168 | /** |
@@ -328,8 +328,8 @@ read_blacklist_file () | |||
328 | #endif | 328 | #endif |
329 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); | 329 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); |
330 | if (!isspace | 330 | if (!isspace |
331 | ((unsigned char) enc. | 331 | ((unsigned char) |
332 | encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) | 332 | enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) |
333 | { | 333 | { |
334 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
335 | _ | 335 | _ |
diff --git a/src/transport/gnunet-service-transport_blacklist.h b/src/transport/gnunet-service-transport_blacklist.h index 7e88b3961..64a800664 100644 --- a/src/transport/gnunet-service-transport_blacklist.h +++ b/src/transport/gnunet-service-transport_blacklist.h | |||
@@ -34,13 +34,15 @@ | |||
34 | * | 34 | * |
35 | * @param server server used to accept clients from | 35 | * @param server server used to accept clients from |
36 | */ | 36 | */ |
37 | void GST_blacklist_start (struct GNUNET_SERVER_Handle *server); | 37 | void |
38 | GST_blacklist_start (struct GNUNET_SERVER_Handle *server); | ||
38 | 39 | ||
39 | 40 | ||
40 | /** | 41 | /** |
41 | * Stop blacklist subsystem. | 42 | * Stop blacklist subsystem. |
42 | */ | 43 | */ |
43 | void GST_blacklist_stop (void); | 44 | void |
45 | GST_blacklist_stop (void); | ||
44 | 46 | ||
45 | 47 | ||
46 | /** | 48 | /** |
@@ -52,8 +54,9 @@ void GST_blacklist_stop (void); | |||
52 | * @param client the client | 54 | * @param client the client |
53 | * @param message the blacklist-init message that was sent | 55 | * @param message the blacklist-init message that was sent |
54 | */ | 56 | */ |
55 | void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, | 57 | void |
56 | const struct GNUNET_MessageHeader *message); | 58 | GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, |
59 | const struct GNUNET_MessageHeader *message); | ||
57 | 60 | ||
58 | /** | 61 | /** |
59 | * A blacklisting client has sent us reply. Process it. | 62 | * A blacklisting client has sent us reply. Process it. |
@@ -62,8 +65,9 @@ void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
62 | * @param client the client | 65 | * @param client the client |
63 | * @param message the blacklist-init message that was sent | 66 | * @param message the blacklist-init message that was sent |
64 | */ | 67 | */ |
65 | void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, | 68 | void |
66 | const struct GNUNET_MessageHeader *message); | 69 | GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, |
70 | const struct GNUNET_MessageHeader *message); | ||
67 | 71 | ||
68 | /** | 72 | /** |
69 | * Add the given peer to the blacklist (for the given transport). | 73 | * Add the given peer to the blacklist (for the given transport). |
@@ -71,8 +75,9 @@ void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, | |||
71 | * @param peer peer to blacklist | 75 | * @param peer peer to blacklist |
72 | * @param transport_name transport to blacklist for this peer, NULL for all | 76 | * @param transport_name transport to blacklist for this peer, NULL for all |
73 | */ | 77 | */ |
74 | void GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, | 78 | void |
75 | const char *transport_name); | 79 | GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, |
80 | const char *transport_name); | ||
76 | 81 | ||
77 | 82 | ||
78 | /** | 83 | /** |
@@ -104,13 +109,10 @@ typedef void (*GST_BlacklistTestContinuation) (void *cls, | |||
104 | * @return handle to the blacklist check, NULL if the decision | 109 | * @return handle to the blacklist check, NULL if the decision |
105 | * was made instantly and 'cont' was already called | 110 | * was made instantly and 'cont' was already called |
106 | */ | 111 | */ |
107 | struct GST_BlacklistCheck *GST_blacklist_test_allowed (const struct | 112 | struct GST_BlacklistCheck * |
108 | GNUNET_PeerIdentity | 113 | GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, |
109 | *peer, | 114 | const char *transport_name, |
110 | const char | 115 | GST_BlacklistTestContinuation cont, void *cont_cls); |
111 | *transport_name, | ||
112 | GST_BlacklistTestContinuation | ||
113 | cont, void *cont_cls); | ||
114 | 116 | ||
115 | 117 | ||
116 | /** | 118 | /** |
@@ -118,7 +120,8 @@ struct GST_BlacklistCheck *GST_blacklist_test_allowed (const struct | |||
118 | * | 120 | * |
119 | * @param bc check to cancel | 121 | * @param bc check to cancel |
120 | */ | 122 | */ |
121 | void GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc); | 123 | void |
124 | GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc); | ||
122 | 125 | ||
123 | #endif | 126 | #endif |
124 | /* end of file gnunet-service-transport_blacklist.h */ | 127 | /* end of file gnunet-service-transport_blacklist.h */ |
diff --git a/src/transport/gnunet-service-transport_clients.h b/src/transport/gnunet-service-transport_clients.h index 6bcc18cd3..aae7ba89f 100644 --- a/src/transport/gnunet-service-transport_clients.h +++ b/src/transport/gnunet-service-transport_clients.h | |||
@@ -35,13 +35,15 @@ | |||
35 | * | 35 | * |
36 | * @param server server used to accept clients from. | 36 | * @param server server used to accept clients from. |
37 | */ | 37 | */ |
38 | void GST_clients_start (struct GNUNET_SERVER_Handle *server); | 38 | void |
39 | GST_clients_start (struct GNUNET_SERVER_Handle *server); | ||
39 | 40 | ||
40 | 41 | ||
41 | /** | 42 | /** |
42 | * Stop processing clients. | 43 | * Stop processing clients. |
43 | */ | 44 | */ |
44 | void GST_clients_stop (void); | 45 | void |
46 | GST_clients_stop (void); | ||
45 | 47 | ||
46 | 48 | ||
47 | /** | 49 | /** |
@@ -50,8 +52,8 @@ void GST_clients_stop (void); | |||
50 | * @param msg message to broadcast | 52 | * @param msg message to broadcast |
51 | * @param may_drop GNUNET_YES if the message can be dropped | 53 | * @param may_drop GNUNET_YES if the message can be dropped |
52 | */ | 54 | */ |
53 | void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, | 55 | void |
54 | int may_drop); | 56 | GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop); |
55 | 57 | ||
56 | 58 | ||
57 | /** | 59 | /** |
@@ -61,8 +63,9 @@ void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, | |||
61 | * @param msg message to transmit | 63 | * @param msg message to transmit |
62 | * @param may_drop GNUNET_YES if the message can be dropped | 64 | * @param may_drop GNUNET_YES if the message can be dropped |
63 | */ | 65 | */ |
64 | void GST_clients_unicast (struct GNUNET_SERVER_Client *client, | 66 | void |
65 | const struct GNUNET_MessageHeader *msg, int may_drop); | 67 | GST_clients_unicast (struct GNUNET_SERVER_Client *client, |
68 | const struct GNUNET_MessageHeader *msg, int may_drop); | ||
66 | 69 | ||
67 | 70 | ||
68 | 71 | ||
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h index ff817814b..153b7447e 100644 --- a/src/transport/gnunet-service-transport_hello.h +++ b/src/transport/gnunet-service-transport_hello.h | |||
@@ -55,13 +55,15 @@ typedef void (*GST_HelloCallback) (void *cls, | |||
55 | * @param cb function to call whenever our HELLO changes | 55 | * @param cb function to call whenever our HELLO changes |
56 | * @param cb_cls closure for cb | 56 | * @param cb_cls closure for cb |
57 | */ | 57 | */ |
58 | void GST_hello_start (GST_HelloCallback cb, void *cb_cls); | 58 | void |
59 | GST_hello_start (GST_HelloCallback cb, void *cb_cls); | ||
59 | 60 | ||
60 | 61 | ||
61 | /** | 62 | /** |
62 | * Shutdown the HELLO module. | 63 | * Shutdown the HELLO module. |
63 | */ | 64 | */ |
64 | void GST_hello_stop (void); | 65 | void |
66 | GST_hello_stop (void); | ||
65 | 67 | ||
66 | 68 | ||
67 | /** | 69 | /** |
@@ -69,7 +71,8 @@ void GST_hello_stop (void); | |||
69 | * | 71 | * |
70 | * @return our HELLO message | 72 | * @return our HELLO message |
71 | */ | 73 | */ |
72 | const struct GNUNET_MessageHeader *GST_hello_get (void); | 74 | const struct GNUNET_MessageHeader * |
75 | GST_hello_get (void); | ||
73 | 76 | ||
74 | 77 | ||
75 | /** | 78 | /** |
@@ -80,9 +83,10 @@ const struct GNUNET_MessageHeader *GST_hello_get (void); | |||
80 | * @param plugin_address address in a plugin-specific format | 83 | * @param plugin_address address in a plugin-specific format |
81 | * @param plugin_address_len number of bytes in plugin_address | 84 | * @param plugin_address_len number of bytes in plugin_address |
82 | */ | 85 | */ |
83 | void GST_hello_modify_addresses (int addremove, const char *plugin_name, | 86 | void |
84 | const void *plugin_address, | 87 | GST_hello_modify_addresses (int addremove, const char *plugin_name, |
85 | size_t plugin_address_len); | 88 | const void *plugin_address, |
89 | size_t plugin_address_len); | ||
86 | 90 | ||
87 | 91 | ||
88 | /** | 92 | /** |
@@ -97,10 +101,11 @@ void GST_hello_modify_addresses (int addremove, const char *plugin_name, | |||
97 | * @return GNUNET_YES if this is one of our addresses, | 101 | * @return GNUNET_YES if this is one of our addresses, |
98 | * GNUNET_NO if not | 102 | * GNUNET_NO if not |
99 | */ | 103 | */ |
100 | int GST_hello_test_address (const char *plugin_name, const void *plugin_address, | 104 | int |
101 | size_t plugin_address_len, | 105 | GST_hello_test_address (const char *plugin_name, const void *plugin_address, |
102 | struct GNUNET_CRYPTO_RsaSignature **sig, | 106 | size_t plugin_address_len, |
103 | struct GNUNET_TIME_Absolute **sig_expiration); | 107 | struct GNUNET_CRYPTO_RsaSignature **sig, |
108 | struct GNUNET_TIME_Absolute **sig_expiration); | ||
104 | 109 | ||
105 | 110 | ||
106 | #endif | 111 | #endif |
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 251b4c356..71539d3de 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -246,8 +246,8 @@ lookup_neighbour (const struct GNUNET_PeerIdentity *pid) | |||
246 | * @param cls the 'struct NeighbourMapEntry' | 246 | * @param cls the 'struct NeighbourMapEntry' |
247 | * @param tc scheduler context | 247 | * @param tc scheduler context |
248 | */ | 248 | */ |
249 | static void transmission_task (void *cls, | 249 | static void |
250 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 250 | transmission_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
251 | 251 | ||
252 | 252 | ||
253 | /** | 253 | /** |
@@ -770,8 +770,8 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | |||
770 | #if DEBUG_TRANSPORT | 770 | #if DEBUG_TRANSPORT |
771 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 771 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
772 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", | 772 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", |
773 | (unsigned long long) n->in_tracker. | 773 | (unsigned long long) n-> |
774 | consumption_since_last_update__, | 774 | in_tracker.consumption_since_last_update__, |
775 | (unsigned int) n->in_tracker.available_bytes_per_s__, | 775 | (unsigned int) n->in_tracker.available_bytes_per_s__, |
776 | (unsigned long long) ret.rel_value); | 776 | (unsigned long long) ret.rel_value); |
777 | #endif | 777 | #endif |
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index c0cee01a6..db29d66aa 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -43,14 +43,16 @@ | |||
43 | * @param connect_cb function to call if we connect to a peer | 43 | * @param connect_cb function to call if we connect to a peer |
44 | * @param disconnect_cb function to call if we disconnect from a peer | 44 | * @param disconnect_cb function to call if we disconnect from a peer |
45 | */ | 45 | */ |
46 | void GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb, | 46 | void |
47 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | 47 | GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb, |
48 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | ||
48 | 49 | ||
49 | 50 | ||
50 | /** | 51 | /** |
51 | * Cleanup the neighbours subsystem. | 52 | * Cleanup the neighbours subsystem. |
52 | */ | 53 | */ |
53 | void GST_neighbours_stop (void); | 54 | void |
55 | GST_neighbours_stop (void); | ||
54 | 56 | ||
55 | 57 | ||
56 | /** | 58 | /** |
@@ -58,7 +60,8 @@ void GST_neighbours_stop (void); | |||
58 | * | 60 | * |
59 | * @param target peer to try to connect to | 61 | * @param target peer to try to connect to |
60 | */ | 62 | */ |
61 | void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | 63 | void |
64 | GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | ||
62 | 65 | ||
63 | 66 | ||
64 | /** | 67 | /** |
@@ -67,7 +70,8 @@ void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | |||
67 | * @param target peer to test | 70 | * @param target peer to test |
68 | * @return GNUNET_YES if we are connected, GNUNET_NO if not | 71 | * @return GNUNET_YES if we are connected, GNUNET_NO if not |
69 | */ | 72 | */ |
70 | int GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | 73 | int |
74 | GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | ||
71 | 75 | ||
72 | 76 | ||
73 | /** | 77 | /** |
@@ -89,10 +93,10 @@ typedef void (*GST_NeighbourSendContinuation) (void *cls, int success); | |||
89 | * @param cont function to call when done | 93 | * @param cont function to call when done |
90 | * @param cont_cls closure for 'cont' | 94 | * @param cont_cls closure for 'cont' |
91 | */ | 95 | */ |
92 | void GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | 96 | void |
93 | const void *msg, size_t msg_size, | 97 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, |
94 | struct GNUNET_TIME_Relative timeout, | 98 | size_t msg_size, struct GNUNET_TIME_Relative timeout, |
95 | GST_NeighbourSendContinuation cont, void *cont_cls); | 99 | GST_NeighbourSendContinuation cont, void *cont_cls); |
96 | 100 | ||
97 | 101 | ||
98 | /** | 102 | /** |
@@ -106,13 +110,9 @@ void GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | |||
106 | * GNUNET_NO if the neighbour is not connected or violates the quota | 110 | * GNUNET_NO if the neighbour is not connected or violates the quota |
107 | * @return how long to wait before reading more from this sender | 111 | * @return how long to wait before reading more from this sender |
108 | */ | 112 | */ |
109 | struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct | 113 | struct GNUNET_TIME_Relative |
110 | GNUNET_PeerIdentity | 114 | GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity |
111 | *sender, | 115 | *sender, ssize_t size, int *do_forward); |
112 | ssize_t | ||
113 | size, | ||
114 | int | ||
115 | *do_forward); | ||
116 | 116 | ||
117 | 117 | ||
118 | /** | 118 | /** |
@@ -121,7 +121,8 @@ struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct | |||
121 | * | 121 | * |
122 | * @param neighbour neighbour to keep alive | 122 | * @param neighbour neighbour to keep alive |
123 | */ | 123 | */ |
124 | void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | 124 | void |
125 | GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | ||
125 | 126 | ||
126 | 127 | ||
127 | /** | 128 | /** |
@@ -130,10 +131,9 @@ void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | |||
130 | * @param neighbour identity of peer to change qutoa for | 131 | * @param neighbour identity of peer to change qutoa for |
131 | * @param quota new quota | 132 | * @param quota new quota |
132 | */ | 133 | */ |
133 | void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity | 134 | void |
134 | *neighbour, | 135 | GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, |
135 | struct GNUNET_BANDWIDTH_Value32NBO | 136 | struct GNUNET_BANDWIDTH_Value32NBO quota); |
136 | quota); | ||
137 | 137 | ||
138 | 138 | ||
139 | /** | 139 | /** |
@@ -141,7 +141,8 @@ void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity | |||
141 | * | 141 | * |
142 | * @param target peer to disconnect from | 142 | * @param target peer to disconnect from |
143 | */ | 143 | */ |
144 | void GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | 144 | void |
145 | GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | ||
145 | 146 | ||
146 | 147 | ||
147 | /** | 148 | /** |
@@ -166,7 +167,8 @@ typedef void (*GST_NeighbourIterator) (void *cls, | |||
166 | * @param cb function to call | 167 | * @param cb function to call |
167 | * @param cb_cls closure for cb | 168 | * @param cb_cls closure for cb |
168 | */ | 169 | */ |
169 | void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | 170 | void |
171 | GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | ||
170 | 172 | ||
171 | 173 | ||
172 | /** | 174 | /** |
@@ -175,8 +177,9 @@ void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | |||
175 | * @param peer identity of the peer where the session died | 177 | * @param peer identity of the peer where the session died |
176 | * @param session session that is gone | 178 | * @param session session that is gone |
177 | */ | 179 | */ |
178 | void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | 180 | void |
179 | struct Session *session); | 181 | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, |
182 | struct Session *session); | ||
180 | 183 | ||
181 | 184 | ||
182 | /** | 185 | /** |
@@ -192,13 +195,12 @@ void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
192 | * @param ats performance data | 195 | * @param ats performance data |
193 | * @param ats_count number of entries in ats (excluding 0-termination) | 196 | * @param ats_count number of entries in ats (excluding 0-termination) |
194 | */ | 197 | */ |
195 | void GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | 198 | void |
196 | const char *plugin_name, | 199 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, |
197 | const void *address, size_t address_len, | 200 | const char *plugin_name, const void *address, |
198 | struct Session *session, | 201 | size_t address_len, struct Session *session, |
199 | const struct | 202 | const struct GNUNET_TRANSPORT_ATS_Information |
200 | GNUNET_TRANSPORT_ATS_Information *ats, | 203 | *ats, uint32_t ats_count); |
201 | uint32_t ats_count); | ||
202 | 204 | ||
203 | 205 | ||
204 | #endif | 206 | #endif |
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h index ebc8fa451..856b594cd 100644 --- a/src/transport/gnunet-service-transport_plugins.h +++ b/src/transport/gnunet-service-transport_plugins.h | |||
@@ -42,15 +42,17 @@ | |||
42 | * @param address_cb function to call when our public addresses changed | 42 | * @param address_cb function to call when our public addresses changed |
43 | * @param session_end_cb function to call when a session was terminated | 43 | * @param session_end_cb function to call when a session was terminated |
44 | */ | 44 | */ |
45 | void GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | 45 | void |
46 | GNUNET_TRANSPORT_AddressNotification address_cb, | 46 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, |
47 | GNUNET_TRANSPORT_SessionEnd session_end_cb); | 47 | GNUNET_TRANSPORT_AddressNotification address_cb, |
48 | GNUNET_TRANSPORT_SessionEnd session_end_cb); | ||
48 | 49 | ||
49 | 50 | ||
50 | /** | 51 | /** |
51 | * Unload all plugins | 52 | * Unload all plugins |
52 | */ | 53 | */ |
53 | void GST_plugins_unload (void); | 54 | void |
55 | GST_plugins_unload (void); | ||
54 | 56 | ||
55 | 57 | ||
56 | /** | 58 | /** |
@@ -59,7 +61,8 @@ void GST_plugins_unload (void); | |||
59 | * @param name name of the plugin | 61 | * @param name name of the plugin |
60 | * @return the plugin's API, NULL if the plugin is not loaded | 62 | * @return the plugin's API, NULL if the plugin is not loaded |
61 | */ | 63 | */ |
62 | struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name); | 64 | struct GNUNET_TRANSPORT_PluginFunctions * |
65 | GST_plugins_find (const char *name); | ||
63 | 66 | ||
64 | 67 | ||
65 | /** | 68 | /** |
@@ -71,8 +74,8 @@ struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name); | |||
71 | * @param addrlen number of bytes in 'addr' | 74 | * @param addrlen number of bytes in 'addr' |
72 | * @return statically allocated (!) human-readable address | 75 | * @return statically allocated (!) human-readable address |
73 | */ | 76 | */ |
74 | const char *GST_plugins_a2s (const char *name, const void *addr, | 77 | const char * |
75 | size_t addrlen); | 78 | GST_plugins_a2s (const char *name, const void *addr, size_t addrlen); |
76 | 79 | ||
77 | 80 | ||
78 | #endif | 81 | #endif |
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 86ede1576..1840c0919 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h | |||
@@ -34,13 +34,15 @@ | |||
34 | /** | 34 | /** |
35 | * Start the validation subsystem. | 35 | * Start the validation subsystem. |
36 | */ | 36 | */ |
37 | void GST_validation_start (void); | 37 | void |
38 | GST_validation_start (void); | ||
38 | 39 | ||
39 | 40 | ||
40 | /** | 41 | /** |
41 | * Stop the validation subsystem. | 42 | * Stop the validation subsystem. |
42 | */ | 43 | */ |
43 | void GST_validation_stop (void); | 44 | void |
45 | GST_validation_stop (void); | ||
44 | 46 | ||
45 | 47 | ||
46 | /** | 48 | /** |
@@ -54,12 +56,12 @@ void GST_validation_stop (void); | |||
54 | * if we did not initiate the connection | 56 | * if we did not initiate the connection |
55 | * @param sender_address_len number of bytes in sender_address | 57 | * @param sender_address_len number of bytes in sender_address |
56 | */ | 58 | */ |
57 | void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | 59 | void |
58 | const struct GNUNET_MessageHeader *hdr, | 60 | GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, |
59 | const char *plugin_name, | 61 | const struct GNUNET_MessageHeader *hdr, |
60 | struct Session *session, | 62 | const char *plugin_name, struct Session *session, |
61 | const void *sender_address, | 63 | const void *sender_address, |
62 | size_t sender_address_len); | 64 | size_t sender_address_len); |
63 | 65 | ||
64 | 66 | ||
65 | /** | 67 | /** |
@@ -69,8 +71,9 @@ void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
69 | * @param sender peer sending the PONG | 71 | * @param sender peer sending the PONG |
70 | * @param hdr the PONG | 72 | * @param hdr the PONG |
71 | */ | 73 | */ |
72 | void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | 74 | void |
73 | const struct GNUNET_MessageHeader *hdr); | 75 | GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, |
76 | const struct GNUNET_MessageHeader *hdr); | ||
74 | 77 | ||
75 | 78 | ||
76 | /** | 79 | /** |
@@ -79,7 +82,8 @@ void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | |||
79 | * | 82 | * |
80 | * @param hello the HELLO we received | 83 | * @param hello the HELLO we received |
81 | */ | 84 | */ |
82 | void GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); | 85 | void |
86 | GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); | ||
83 | 87 | ||
84 | 88 | ||
85 | /** | 89 | /** |
@@ -122,9 +126,9 @@ typedef void (*GST_ValidationAddressCallback) (void *cls, | |||
122 | * @param cb_cls closure for 'cb' | 126 | * @param cb_cls closure for 'cb' |
123 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES | 127 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES |
124 | */ | 128 | */ |
125 | void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, | 129 | void |
126 | GST_ValidationAddressCallback cb, | 130 | GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, |
127 | void *cb_cls); | 131 | GST_ValidationAddressCallback cb, void *cb_cls); |
128 | 132 | ||
129 | 133 | ||
130 | #endif | 134 | #endif |
diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c index b3468791d..3fca1f85f 100644 --- a/src/transport/gnunet-transport-wlan-helper.c +++ b/src/transport/gnunet-transport-wlan-helper.c | |||
@@ -108,7 +108,8 @@ struct Hardware_Infos | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | // FIXME: inline? | 110 | // FIXME: inline? |
111 | int getChannelFromFrequency (int frequency); | 111 | int |
112 | getChannelFromFrequency (int frequency); | ||
112 | 113 | ||
113 | // FIXME: make nice... | 114 | // FIXME: make nice... |
114 | static unsigned long | 115 | static unsigned long |
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index a6b24e73e..5c11f1f32 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -547,24 +547,24 @@ struct PrettyPrinterContext | |||
547 | * @param addrlen length of the address | 547 | * @param addrlen length of the address |
548 | * @return string representing the same address | 548 | * @return string representing the same address |
549 | */ | 549 | */ |
550 | static const char *http_plugin_address_to_string (void *cls, const void *addr, | 550 | static const char * |
551 | size_t addrlen); | 551 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen); |
552 | 552 | ||
553 | 553 | ||
554 | /** | 554 | /** |
555 | * Call MHD to process pending ipv4 requests and then go back | 555 | * Call MHD to process pending ipv4 requests and then go back |
556 | * and schedule the next run. | 556 | * and schedule the next run. |
557 | */ | 557 | */ |
558 | static void http_server_daemon_v4_run (void *cls, | 558 | static void |
559 | const struct GNUNET_SCHEDULER_TaskContext | 559 | http_server_daemon_v4_run (void *cls, |
560 | *tc); | 560 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
561 | /** | 561 | /** |
562 | * Call MHD to process pending ipv6 requests and then go back | 562 | * Call MHD to process pending ipv6 requests and then go back |
563 | * and schedule the next run. | 563 | * and schedule the next run. |
564 | */ | 564 | */ |
565 | static void http_server_daemon_v6_run (void *cls, | 565 | static void |
566 | const struct GNUNET_SCHEDULER_TaskContext | 566 | http_server_daemon_v6_run (void *cls, |
567 | *tc); | 567 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
568 | 568 | ||
569 | /** | 569 | /** |
570 | * Function setting up curl handle and selecting message to send | 570 | * Function setting up curl handle and selecting message to send |
@@ -573,7 +573,8 @@ static void http_server_daemon_v6_run (void *cls, | |||
573 | * @param ps session | 573 | * @param ps session |
574 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok | 574 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok |
575 | */ | 575 | */ |
576 | static int send_check_connections (struct Plugin *plugin, struct Session *ps); | 576 | static int |
577 | send_check_connections (struct Plugin *plugin, struct Session *ps); | ||
577 | 578 | ||
578 | /** | 579 | /** |
579 | * Function setting up file descriptors and scheduling task to run | 580 | * Function setting up file descriptors and scheduling task to run |
@@ -581,7 +582,8 @@ static int send_check_connections (struct Plugin *plugin, struct Session *ps); | |||
581 | * @param plugin plugin as closure | 582 | * @param plugin plugin as closure |
582 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok | 583 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok |
583 | */ | 584 | */ |
584 | static int curl_schedule (struct Plugin *plugin); | 585 | static int |
586 | curl_schedule (struct Plugin *plugin); | ||
585 | 587 | ||
586 | /** | 588 | /** |
587 | * Task scheduled to reset the inbound quota delay for a specific peer | 589 | * Task scheduled to reset the inbound quota delay for a specific peer |
@@ -1785,10 +1787,8 @@ curl_receive_mst_cb (void *cls, void *client, | |||
1785 | "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", | 1787 | "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", |
1786 | ps, ntohs (message->type), ntohs (message->size), | 1788 | ps, ntohs (message->type), ntohs (message->size), |
1787 | GNUNET_i2s (&(pc->identity)), http_plugin_address_to_string (NULL, | 1789 | GNUNET_i2s (&(pc->identity)), http_plugin_address_to_string (NULL, |
1788 | ps-> | 1790 | ps->addr, |
1789 | addr, | 1791 | ps->addrlen)); |
1790 | ps-> | ||
1791 | addrlen)); | ||
1792 | #endif | 1792 | #endif |
1793 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; | 1793 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; |
1794 | 1794 | ||
@@ -3333,8 +3333,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3333 | GNUNET_CONFIGURATION_get_value_string (env->cfg, | 3333 | GNUNET_CONFIGURATION_get_value_string (env->cfg, |
3334 | component_name, | 3334 | component_name, |
3335 | "BINDTO4", | 3335 | "BINDTO4", |
3336 | &plugin-> | 3336 | &plugin->bind_hostname)); |
3337 | bind_hostname)); | ||
3338 | plugin->bind4_address = GNUNET_malloc (sizeof (struct sockaddr_in)); | 3337 | plugin->bind4_address = GNUNET_malloc (sizeof (struct sockaddr_in)); |
3339 | plugin->bind4_address->sin_family = AF_INET; | 3338 | plugin->bind4_address->sin_family = AF_INET; |
3340 | plugin->bind4_address->sin_port = htons (port); | 3339 | plugin->bind4_address->sin_port = htons (port); |
@@ -3494,8 +3493,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3494 | MHD_OPTION_SOCK_ADDR, | 3493 | MHD_OPTION_SOCK_ADDR, |
3495 | tmp, | 3494 | tmp, |
3496 | MHD_OPTION_CONNECTION_LIMIT, | 3495 | MHD_OPTION_CONNECTION_LIMIT, |
3497 | (unsigned int) plugin-> | 3496 | (unsigned int) |
3498 | max_connect_per_transport, | 3497 | plugin->max_connect_per_transport, |
3499 | #if BUILD_HTTPS | 3498 | #if BUILD_HTTPS |
3500 | MHD_OPTION_HTTPS_PRIORITIES, | 3499 | MHD_OPTION_HTTPS_PRIORITIES, |
3501 | plugin->crypto_init, | 3500 | plugin->crypto_init, |
@@ -3534,8 +3533,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3534 | (struct sockaddr_in *) | 3533 | (struct sockaddr_in *) |
3535 | plugin->bind4_address, | 3534 | plugin->bind4_address, |
3536 | MHD_OPTION_CONNECTION_LIMIT, | 3535 | MHD_OPTION_CONNECTION_LIMIT, |
3537 | (unsigned int) plugin-> | 3536 | (unsigned int) |
3538 | max_connect_per_transport, | 3537 | plugin->max_connect_per_transport, |
3539 | #if BUILD_HTTPS | 3538 | #if BUILD_HTTPS |
3540 | MHD_OPTION_HTTPS_PRIORITIES, | 3539 | MHD_OPTION_HTTPS_PRIORITIES, |
3541 | plugin->crypto_init, | 3540 | plugin->crypto_init, |
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c index 1b9f5fb72..260045602 100644 --- a/src/transport/plugin_transport_smtp.c +++ b/src/transport/plugin_transport_smtp.c | |||
@@ -420,9 +420,8 @@ api_verify_hello (const GNUNET_MessageHello * hello) | |||
420 | maddr = (const EmailAddress *) &hello[1]; | 420 | maddr = (const EmailAddress *) &hello[1]; |
421 | if ((ntohs (hello->header.size) != | 421 | if ((ntohs (hello->header.size) != |
422 | sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) || | 422 | sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) || |
423 | (maddr-> | 423 | (maddr->senderAddress |
424 | senderAddress[ntohs (hello->senderAddressSize) - 1 - | 424 | [ntohs (hello->senderAddressSize) - 1 - FILTER_STRING_SIZE] != '\0')) |
425 | FILTER_STRING_SIZE] != '\0')) | ||
426 | { | 425 | { |
427 | GNUNET_GE_BREAK (ectx, 0); | 426 | GNUNET_GE_BREAK (ectx, 0); |
428 | return GNUNET_SYSERR; /* obviously invalid */ | 427 | return GNUNET_SYSERR; /* obviously invalid */ |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 331203471..d6084d9f0 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -605,7 +605,8 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target, | |||
605 | * | 605 | * |
606 | * @param session for which session should we do this | 606 | * @param session for which session should we do this |
607 | */ | 607 | */ |
608 | static void process_pending_messages (struct Session *session); | 608 | static void |
609 | process_pending_messages (struct Session *session); | ||
609 | 610 | ||
610 | 611 | ||
611 | /** | 612 | /** |
@@ -779,8 +780,8 @@ disconnect_session (struct Session *session) | |||
779 | (session->connect_addr != | 780 | (session->connect_addr != |
780 | NULL) ? tcp_address_to_string (session->plugin, | 781 | NULL) ? tcp_address_to_string (session->plugin, |
781 | session->connect_addr, | 782 | session->connect_addr, |
782 | session-> | 783 | session->connect_alen) : |
783 | connect_alen) : "*"); | 784 | "*"); |
784 | #endif | 785 | #endif |
785 | /* remove from session list */ | 786 | /* remove from session list */ |
786 | prev = NULL; | 787 | prev = NULL; |
@@ -1455,8 +1456,8 @@ handle_tcp_nat_probe (void *cls, struct GNUNET_SERVER_Client *client, | |||
1455 | 1456 | ||
1456 | session = | 1457 | session = |
1457 | GNUNET_CONTAINER_multihashmap_get (plugin->nat_wait_conns, | 1458 | GNUNET_CONTAINER_multihashmap_get (plugin->nat_wait_conns, |
1458 | &tcp_nat_probe->clientIdentity. | 1459 | &tcp_nat_probe-> |
1459 | hashPubKey); | 1460 | clientIdentity.hashPubKey); |
1460 | if (session == NULL) | 1461 | if (session == NULL) |
1461 | { | 1462 | { |
1462 | #if DEBUG_TCP_NAT | 1463 | #if DEBUG_TCP_NAT |
@@ -1775,8 +1776,8 @@ disconnect_notify (void *cls, struct GNUNET_SERVER_Client *client) | |||
1775 | (session->connect_addr != | 1776 | (session->connect_addr != |
1776 | NULL) ? tcp_address_to_string (session->plugin, | 1777 | NULL) ? tcp_address_to_string (session->plugin, |
1777 | session->connect_addr, | 1778 | session->connect_addr, |
1778 | session-> | 1779 | session->connect_alen) : |
1779 | connect_alen) : "*"); | 1780 | "*"); |
1780 | #endif | 1781 | #endif |
1781 | GNUNET_STATISTICS_update (session->plugin->env->stats, | 1782 | GNUNET_STATISTICS_update (session->plugin->env->stats, |
1782 | gettext_noop | 1783 | gettext_noop |
@@ -1863,8 +1864,8 @@ try_connection_reversal (void *cls, const struct sockaddr *addr, | |||
1863 | tcp_probe_ctx); | 1864 | tcp_probe_ctx); |
1864 | tcp_probe_ctx->transmit_handle = | 1865 | tcp_probe_ctx->transmit_handle = |
1865 | GNUNET_CONNECTION_notify_transmit_ready (sock, | 1866 | GNUNET_CONNECTION_notify_transmit_ready (sock, |
1866 | ntohs (tcp_probe_ctx->message. | 1867 | ntohs (tcp_probe_ctx-> |
1867 | header.size), | 1868 | message.header.size), |
1868 | GNUNET_TIME_UNIT_FOREVER_REL, | 1869 | GNUNET_TIME_UNIT_FOREVER_REL, |
1869 | ¬ify_send_probe, | 1870 | ¬ify_send_probe, |
1870 | tcp_probe_ctx); | 1871 | tcp_probe_ctx); |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index f9310fb8f..07a3df362 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -852,8 +852,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
852 | return; | 852 | return; |
853 | GNUNET_assert (GNUNET_OK == | 853 | GNUNET_assert (GNUNET_OK == |
854 | GNUNET_CONTAINER_multihashmap_remove (plugin->sessions, | 854 | GNUNET_CONTAINER_multihashmap_remove (plugin->sessions, |
855 | &udp->sender. | 855 | &udp-> |
856 | hashPubKey, | 856 | sender.hashPubKey, |
857 | peer_session)); | 857 | peer_session)); |
858 | plugin->last_expected_delay = | 858 | plugin->last_expected_delay = |
859 | GNUNET_FRAGMENT_context_destroy (peer_session->frag); | 859 | GNUNET_FRAGMENT_context_destroy (peer_session->frag); |
@@ -882,8 +882,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
882 | &fragment_msg_proc, &ack_proc); | 882 | &fragment_msg_proc, &ack_proc); |
883 | rc->hnode = | 883 | rc->hnode = |
884 | GNUNET_CONTAINER_heap_insert (plugin->defrags, rc, | 884 | GNUNET_CONTAINER_heap_insert (plugin->defrags, rc, |
885 | (GNUNET_CONTAINER_HeapCostType) now. | 885 | (GNUNET_CONTAINER_HeapCostType) |
886 | abs_value); | 886 | now.abs_value); |
887 | } | 887 | } |
888 | #if DEBUG_UDP | 888 | #if DEBUG_UDP |
889 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 889 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -896,8 +896,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
896 | { | 896 | { |
897 | /* keep this 'rc' from expiring */ | 897 | /* keep this 'rc' from expiring */ |
898 | GNUNET_CONTAINER_heap_update_cost (plugin->defrags, rc->hnode, | 898 | GNUNET_CONTAINER_heap_update_cost (plugin->defrags, rc->hnode, |
899 | (GNUNET_CONTAINER_HeapCostType) now. | 899 | (GNUNET_CONTAINER_HeapCostType) |
900 | abs_value); | 900 | now.abs_value); |
901 | } | 901 | } |
902 | if (GNUNET_CONTAINER_heap_get_size (plugin->defrags) > | 902 | if (GNUNET_CONTAINER_heap_get_size (plugin->defrags) > |
903 | UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG) | 903 | UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG) |
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 7193e2e8b..59c42e1f6 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -419,16 +419,14 @@ find_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *peer) | |||
419 | } | 419 | } |
420 | 420 | ||
421 | /* Forward Declaration */ | 421 | /* Forward Declaration */ |
422 | static ssize_t unix_real_send (void *cls, | 422 | static ssize_t |
423 | struct RetrySendContext *incoming_retry_context, | 423 | unix_real_send (void *cls, struct RetrySendContext *incoming_retry_context, |
424 | struct GNUNET_NETWORK_Handle *send_handle, | 424 | struct GNUNET_NETWORK_Handle *send_handle, |
425 | const struct GNUNET_PeerIdentity *target, | 425 | const struct GNUNET_PeerIdentity *target, const char *msgbuf, |
426 | const char *msgbuf, size_t msgbuf_size, | 426 | size_t msgbuf_size, unsigned int priority, |
427 | unsigned int priority, | 427 | struct GNUNET_TIME_Relative timeout, const void *addr, |
428 | struct GNUNET_TIME_Relative timeout, | 428 | size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont, |
429 | const void *addr, size_t addrlen, | 429 | void *cont_cls); |
430 | GNUNET_TRANSPORT_TransmitContinuation cont, | ||
431 | void *cont_cls); | ||
432 | 430 | ||
433 | /** | 431 | /** |
434 | * Retry sending a message. | 432 | * Retry sending a message. |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index ad8d9a7a1..d3bd1ef82 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -662,12 +662,13 @@ struct FragmentMessage | |||
662 | struct Radiotap_Send *radioHeader; | 662 | struct Radiotap_Send *radioHeader; |
663 | }; | 663 | }; |
664 | 664 | ||
665 | static void do_transmit (void *cls, | 665 | static void |
666 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 666 | do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
667 | static void free_session (struct Plugin *plugin, struct Sessionqueue *queue, | 667 | static void |
668 | int do_free_macendpoint); | 668 | free_session (struct Plugin *plugin, struct Sessionqueue *queue, |
669 | static struct MacEndpoint *create_macendpoint (struct Plugin *plugin, | 669 | int do_free_macendpoint); |
670 | const struct MacAddress *addr); | 670 | static struct MacEndpoint * |
671 | create_macendpoint (struct Plugin *plugin, const struct MacAddress *addr); | ||
671 | 672 | ||
672 | /** | 673 | /** |
673 | * Generates a nice hexdump of a memory area. | 674 | * Generates a nice hexdump of a memory area. |
@@ -1860,8 +1861,9 @@ wlan_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
1860 | newmsg = session->pending_message_head; | 1861 | newmsg = session->pending_message_head; |
1861 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, | 1862 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, |
1862 | "wlan_plugin_send: a pending message is already in the queue for this client\n remaining time to send this message is %u, queued fragment messages for this mac connection %u\n", | 1863 | "wlan_plugin_send: a pending message is already in the queue for this client\n remaining time to send this message is %u, queued fragment messages for this mac connection %u\n", |
1863 | GNUNET_TIME_absolute_get_remaining (newmsg->timeout). | 1864 | GNUNET_TIME_absolute_get_remaining (newmsg-> |
1864 | rel_value, session->mac->fragment_messages_out_count); | 1865 | timeout).rel_value, |
1866 | session->mac->fragment_messages_out_count); | ||
1865 | } | 1867 | } |
1866 | 1868 | ||
1867 | newmsg = GNUNET_malloc (sizeof (struct PendingMessage)); | 1869 | newmsg = GNUNET_malloc (sizeof (struct PendingMessage)); |
@@ -2263,8 +2265,8 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
2263 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2265 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2264 | "Calling plugin->env->receive for session %p; %s; size: %u\n", | 2266 | "Calling plugin->env->receive for session %p; %s; size: %u\n", |
2265 | session, wlan_plugin_address_to_string (NULL, | 2267 | session, wlan_plugin_address_to_string (NULL, |
2266 | session->mac->addr. | 2268 | session->mac-> |
2267 | mac, 6), | 2269 | addr.mac, 6), |
2268 | htons (hdr->size)); | 2270 | htons (hdr->size)); |
2269 | #endif | 2271 | #endif |
2270 | 2272 | ||
@@ -2303,9 +2305,8 @@ wlan_data_helper (void *cls, struct Session_light *session_light, | |||
2303 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2305 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2304 | "Func wlan_data_helper got GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT size: %u; %s\n", | 2306 | "Func wlan_data_helper got GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT size: %u; %s\n", |
2305 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, | 2307 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, |
2306 | session_light-> | 2308 | session_light->addr. |
2307 | addr.mac, | 2309 | mac, 6)); |
2308 | 6)); | ||
2309 | #endif | 2310 | #endif |
2310 | 2311 | ||
2311 | if (session_light->macendpoint == NULL) | 2312 | if (session_light->macendpoint == NULL) |
@@ -2373,9 +2374,7 @@ wlan_data_helper (void *cls, struct Session_light *session_light, | |||
2373 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2374 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2374 | "Macendpoint does not exist for this GNUNET_MESSAGE_TYPE_FRAGMENT_ACK size: %u; %s\n", | 2375 | "Macendpoint does not exist for this GNUNET_MESSAGE_TYPE_FRAGMENT_ACK size: %u; %s\n", |
2375 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, | 2376 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, |
2376 | session_light-> | 2377 | session_light->addr.mac, |
2377 | addr. | ||
2378 | mac, | ||
2379 | 6)); | 2378 | 6)); |
2380 | #endif | 2379 | #endif |
2381 | return; | 2380 | return; |
@@ -2477,8 +2476,8 @@ macendpoint_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2477 | return; | 2476 | return; |
2478 | } | 2477 | } |
2479 | if (GNUNET_TIME_absolute_get_remaining | 2478 | if (GNUNET_TIME_absolute_get_remaining |
2480 | (GNUNET_TIME_absolute_add (endpoint->last_activity, MACENDPOINT_TIMEOUT)). | 2479 | (GNUNET_TIME_absolute_add |
2481 | rel_value == 0) | 2480 | (endpoint->last_activity, MACENDPOINT_TIMEOUT)).rel_value == 0) |
2482 | { | 2481 | { |
2483 | free_macendpoint (endpoint->plugin, endpoint); | 2482 | free_macendpoint (endpoint->plugin, endpoint); |
2484 | } | 2483 | } |
diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index f59edfb26..778fe4be3 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c | |||
@@ -522,7 +522,8 @@ task_send_cont (void *cls, const struct GNUNET_PeerIdentity *target, int result) | |||
522 | } | 522 | } |
523 | 523 | ||
524 | 524 | ||
525 | static void run_connection_tests (int phase, void *cls); | 525 | static void |
526 | run_connection_tests (int phase, void *cls); | ||
526 | 527 | ||
527 | /** | 528 | /** |
528 | * Recieves messages from plugin, in real world transport | 529 | * Recieves messages from plugin, in real world transport |
@@ -646,7 +647,8 @@ header_function (void *ptr, size_t size, size_t nmemb, void *stream) | |||
646 | } | 647 | } |
647 | 648 | ||
648 | 649 | ||
649 | static size_t send_prepare (struct HTTP_Transfer *result); | 650 | static size_t |
651 | send_prepare (struct HTTP_Transfer *result); | ||
650 | 652 | ||
651 | 653 | ||
652 | static void | 654 | static void |
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 5b78f89b4..962010c42 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c | |||
@@ -551,7 +551,8 @@ task_send_cont (void *cls, const struct GNUNET_PeerIdentity *target, int result) | |||
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | static void run_connection_tests (int phase, void *cls); | 554 | static void |
555 | run_connection_tests (int phase, void *cls); | ||
555 | 556 | ||
556 | /** | 557 | /** |
557 | * Recieves messages from plugin, in real world transport | 558 | * Recieves messages from plugin, in real world transport |
@@ -679,7 +680,8 @@ header_function (void *ptr, size_t size, size_t nmemb, void *stream) | |||
679 | return size * nmemb; | 680 | return size * nmemb; |
680 | } | 681 | } |
681 | 682 | ||
682 | static size_t send_prepare (struct HTTP_Transfer *result); | 683 | static size_t |
684 | send_prepare (struct HTTP_Transfer *result); | ||
683 | 685 | ||
684 | 686 | ||
685 | 687 | ||
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index bc2aca31b..71332bf36 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -315,7 +315,8 @@ notify_ready (void *cls, size_t size, void *buf) | |||
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | static void measure (unsigned long long quota_p1, unsigned long long quota_p2); | 318 | static void |
319 | measure (unsigned long long quota_p1, unsigned long long quota_p2); | ||
319 | 320 | ||
320 | static void | 321 | static void |
321 | measurement_counter (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 322 | measurement_counter (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c index daae553b7..a9cf0b4de 100644 --- a/src/transport/test_transport_api_disconnect.c +++ b/src/transport/test_transport_api_disconnect.c | |||
@@ -80,7 +80,8 @@ struct GNUNET_TRANSPORT_TransmitHandle *th; | |||
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | 82 | ||
83 | static void peers_connect (); | 83 | static void |
84 | peers_connect (); | ||
84 | 85 | ||
85 | static void | 86 | static void |
86 | end () | 87 | end () |
@@ -200,8 +201,8 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
200 | msgs_recv++; | 201 | msgs_recv++; |
201 | } | 202 | } |
202 | 203 | ||
203 | static void peers_disconnect (void *cls, | 204 | static void |
204 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 205 | peers_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
205 | 206 | ||
206 | static size_t | 207 | static size_t |
207 | notify_ready (void *cls, size_t size, void *buf) | 208 | notify_ready (void *cls, size_t size, void *buf) |
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 62544584c..0c628a731 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -41,10 +41,10 @@ struct ConnectingContext | |||
41 | int p2_c; | 41 | int p2_c; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static void exchange_hello_last (void *cb_cls, | 44 | static void |
45 | const struct GNUNET_MessageHeader *message); | 45 | exchange_hello_last (void *cb_cls, const struct GNUNET_MessageHeader *message); |
46 | static void exchange_hello (void *cb_cls, | 46 | static void |
47 | const struct GNUNET_MessageHeader *message); | 47 | exchange_hello (void *cb_cls, const struct GNUNET_MessageHeader *message); |
48 | 48 | ||
49 | static void | 49 | static void |
50 | notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer, | 50 | notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer, |
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h index a21ccc11f..d5a75d143 100644 --- a/src/transport/transport-testing.h +++ b/src/transport/transport-testing.h | |||
@@ -76,13 +76,12 @@ typedef void (*GNUNET_TRANSPORT_TESTING_connect_cb) (struct PeerContext * p1, | |||
76 | * if NULL passed the PeerContext * will be used! | 76 | * if NULL passed the PeerContext * will be used! |
77 | * @return the peer context | 77 | * @return the peer context |
78 | */ | 78 | */ |
79 | struct PeerContext *GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, | 79 | struct PeerContext * |
80 | GNUNET_TRANSPORT_ReceiveCallback | 80 | GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, |
81 | rec, | 81 | GNUNET_TRANSPORT_ReceiveCallback rec, |
82 | GNUNET_TRANSPORT_NotifyConnect | 82 | GNUNET_TRANSPORT_NotifyConnect nc, |
83 | nc, | 83 | GNUNET_TRANSPORT_NotifyDisconnect nd, |
84 | GNUNET_TRANSPORT_NotifyDisconnect | 84 | void *cb_cls); |
85 | nd, void *cb_cls); | ||
86 | 85 | ||
87 | 86 | ||
88 | /** | 87 | /** |
@@ -90,7 +89,8 @@ struct PeerContext *GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, | |||
90 | * @param p the peer | 89 | * @param p the peer |
91 | */ | 90 | */ |
92 | 91 | ||
93 | void GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | 92 | void |
93 | GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | ||
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -102,9 +102,10 @@ void GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | |||
102 | * @param cb the callback to call | 102 | * @param cb the callback to call |
103 | * @param cb_cls callback cls | 103 | * @param cb_cls callback cls |
104 | */ | 104 | */ |
105 | void GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, | 105 | void |
106 | struct PeerContext *p2, | 106 | GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, |
107 | GNUNET_TRANSPORT_TESTING_connect_cb | 107 | struct PeerContext *p2, |
108 | cb, void *cls); | 108 | GNUNET_TRANSPORT_TESTING_connect_cb cb, |
109 | void *cls); | ||
109 | 110 | ||
110 | /* end of transport_testing.h */ | 111 | /* end of transport_testing.h */ |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index b732871ca..fed611e49 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -295,7 +295,8 @@ struct GNUNET_TRANSPORT_Handle | |||
295 | * | 295 | * |
296 | * @param h transport service to schedule a transmission for | 296 | * @param h transport service to schedule a transmission for |
297 | */ | 297 | */ |
298 | static void schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | 298 | static void |
299 | schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | ||
299 | 300 | ||
300 | 301 | ||
301 | /** | 302 | /** |
@@ -304,8 +305,8 @@ static void schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | |||
304 | * | 305 | * |
305 | * @param h transport service to reconnect | 306 | * @param h transport service to reconnect |
306 | */ | 307 | */ |
307 | static void disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle | 308 | static void |
308 | *h); | 309 | disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h); |
309 | 310 | ||
310 | 311 | ||
311 | /** | 312 | /** |
@@ -659,8 +660,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
659 | th = n->th; | 660 | th = n->th; |
660 | if (th->notify_size + sizeof (struct OutboundMessage) > size) | 661 | if (th->notify_size + sizeof (struct OutboundMessage) > size) |
661 | break; /* does not fit */ | 662 | break; /* does not fit */ |
662 | if (GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, th->notify_size). | 663 | if (GNUNET_BANDWIDTH_tracker_get_delay |
663 | rel_value > 0) | 664 | (&n->out_tracker, th->notify_size).rel_value > 0) |
664 | break; /* too early */ | 665 | break; /* too early */ |
665 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); | 666 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); |
666 | n->hn = NULL; | 667 | n->hn = NULL; |
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c index f6852ff01..d6387b144 100644 --- a/src/transport/transport_api_blacklist.c +++ b/src/transport/transport_api_blacklist.c | |||
@@ -78,7 +78,8 @@ struct GNUNET_TRANSPORT_Blacklist | |||
78 | * | 78 | * |
79 | * @param br overall handle | 79 | * @param br overall handle |
80 | */ | 80 | */ |
81 | static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | 81 | static void |
82 | reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | ||
82 | 83 | ||
83 | 84 | ||
84 | /** | 85 | /** |
@@ -86,7 +87,8 @@ static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | |||
86 | * | 87 | * |
87 | * @param br our overall context | 88 | * @param br our overall context |
88 | */ | 89 | */ |
89 | static void reply (struct GNUNET_TRANSPORT_Blacklist *br); | 90 | static void |
91 | reply (struct GNUNET_TRANSPORT_Blacklist *br); | ||
90 | 92 | ||
91 | 93 | ||
92 | /** | 94 | /** |
diff --git a/src/transport/wlan/byteorder.h b/src/transport/wlan/byteorder.h index b09328320..9fc58c8d8 100644 --- a/src/transport/wlan/byteorder.h +++ b/src/transport/wlan/byteorder.h | |||
@@ -1,37 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * Compatibility header | 2 | * Compatibility header |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Thomas d'Otreppe | 4 | * Copyright (C) 2009 Thomas d'Otreppe |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | * | 10 | * |
11 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ | 21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ |
22 | #define _AIRCRACK_NG_BYTEORDER_H_ | 22 | #define _AIRCRACK_NG_BYTEORDER_H_ |
23 | 23 | ||
24 | #define ___my_swab16(x) \ | 24 | #define ___my_swab16(x) \ |
25 | ((u_int16_t) | 25 | ((u_int16_t) |
26 | (\ (((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) | | 26 | (\ (((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) | |
27 | \ (((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) | 27 | \ (((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) |
28 | #define ___my_swab32(x) \ | 28 | #define ___my_swab32(x) \ |
29 | ((u_int32_t) | 29 | ((u_int32_t) |
30 | (\ (((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) | | 30 | (\ (((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) | |
31 | \ (((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) | | 31 | \ (((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) | |
32 | \ (((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) | | 32 | \ (((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) | |
33 | \ (((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) | 33 | \ (((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) |
34 | #define ___my_swab64(x) \ | 34 | #define ___my_swab64(x) \ |
35 | ((u_int64_t) | 35 | ((u_int64_t) |
36 | (\ (u_int64_t) | 36 | (\ (u_int64_t) |
37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | | 37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | |
@@ -44,389 +44,389 @@ | |||
44 | 0x0000ff0000000000ULL) >> 24) | | 44 | 0x0000ff0000000000ULL) >> 24) | |
45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> | 45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> |
46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) |
47 | 0xff00000000000000ULL) >> 56))) | 47 | 0xff00000000000000ULL) >> 56))) |
48 | /* | 48 | /* |
49 | * Linux | 49 | * Linux |
50 | */ | 50 | */ |
51 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) | 51 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) |
52 | #include <endian.h> | 52 | #include <endian.h> |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #include <stdint.h> | 54 | #include <stdint.h> |
55 | 55 | ||
56 | #ifndef __int8_t_defined | 56 | #ifndef __int8_t_defined |
57 | typedef uint64_t u_int64_t; | 57 | typedef uint64_t u_int64_t; |
58 | typedef uint32_t u_int32_t; | 58 | typedef uint32_t u_int32_t; |
59 | typedef uint16_t u_int16_t; | 59 | typedef uint16_t u_int16_t; |
60 | typedef uint8_t u_int8_t; | 60 | typedef uint8_t u_int8_t; |
61 | 61 | ||
62 | 62 | ||
63 | #endif /* */ | 63 | #endif /* */ |
64 | 64 | ||
65 | #ifndef htole16 | 65 | #ifndef htole16 |
66 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 66 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
67 | #define htobe16(x) ___my_swab16 (x) | 67 | #define htobe16(x) ___my_swab16 (x) |
68 | #define htole16(x) (x) | 68 | #define htole16(x) (x) |
69 | #define be16toh(x) ___my_swab16 (x) | 69 | #define be16toh(x) ___my_swab16 (x) |
70 | #define le16toh(x) (x) | 70 | #define le16toh(x) (x) |
71 | 71 | ||
72 | #define htobe32(x) ___my_swab32 (x) | 72 | #define htobe32(x) ___my_swab32 (x) |
73 | #define htole32(x) (x) | 73 | #define htole32(x) (x) |
74 | #define be32toh(x) ___my_swab32 (x) | 74 | #define be32toh(x) ___my_swab32 (x) |
75 | #define le32toh(x) (x) | 75 | #define le32toh(x) (x) |
76 | 76 | ||
77 | #define htobe64(x) ___my_swab64 (x) | 77 | #define htobe64(x) ___my_swab64 (x) |
78 | #define htole64(x) (x) | 78 | #define htole64(x) (x) |
79 | #define be64toh(x) ___my_swab64 (x) | 79 | #define be64toh(x) ___my_swab64 (x) |
80 | #define le64toh(x) (x) | 80 | #define le64toh(x) (x) |
81 | #else /* */ | 81 | #else /* */ |
82 | #define htobe16(x) (x) | 82 | #define htobe16(x) (x) |
83 | #define htole16(x) ___my_swab16 (x) | 83 | #define htole16(x) ___my_swab16 (x) |
84 | #define be16toh(x) (x) | 84 | #define be16toh(x) (x) |
85 | #define le16toh(x) ___my_swab16 (x) | 85 | #define le16toh(x) ___my_swab16 (x) |
86 | 86 | ||
87 | #define htobe32(x) (x) | 87 | #define htobe32(x) (x) |
88 | #define htole32(x) ___my_swab32 (x) | 88 | #define htole32(x) ___my_swab32 (x) |
89 | #define be32toh(x) (x) | 89 | #define be32toh(x) (x) |
90 | #define le32toh(x) ___my_swab32 (x) | 90 | #define le32toh(x) ___my_swab32 (x) |
91 | 91 | ||
92 | #define htobe64(x) (x) | 92 | #define htobe64(x) (x) |
93 | #define htole64(x) ___my_swab64 (x) | 93 | #define htole64(x) ___my_swab64 (x) |
94 | #define be64toh(x) (x) | 94 | #define be64toh(x) (x) |
95 | #define le64toh(x) ___my_swab64 (x) | 95 | #define le64toh(x) ___my_swab64 (x) |
96 | #endif /* */ | 96 | #endif /* */ |
97 | #endif /* */ | 97 | #endif /* */ |
98 | 98 | ||
99 | #endif /* */ | 99 | #endif /* */ |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Cygwin | 102 | * Cygwin |
103 | */ | 103 | */ |
104 | #if defined(__CYGWIN32__) | 104 | #if defined(__CYGWIN32__) |
105 | #include <asm/byteorder.h> | 105 | #include <asm/byteorder.h> |
106 | #include <unistd.h> | 106 | #include <unistd.h> |
107 | 107 | ||
108 | #define __be64_to_cpu(x) ___my_swab64(x) | 108 | #define __be64_to_cpu(x) ___my_swab64(x) |
109 | #define __be32_to_cpu(x) ___my_swab32(x) | 109 | #define __be32_to_cpu(x) ___my_swab32(x) |
110 | #define __be16_to_cpu(x) ___my_swab16(x) | 110 | #define __be16_to_cpu(x) ___my_swab16(x) |
111 | #define __cpu_to_be64(x) ___my_swab64(x) | 111 | #define __cpu_to_be64(x) ___my_swab64(x) |
112 | #define __cpu_to_be32(x) ___my_swab32(x) | 112 | #define __cpu_to_be32(x) ___my_swab32(x) |
113 | #define __cpu_to_be16(x) ___my_swab16(x) | 113 | #define __cpu_to_be16(x) ___my_swab16(x) |
114 | #define __le64_to_cpu(x) (x) | 114 | #define __le64_to_cpu(x) (x) |
115 | #define __le32_to_cpu(x) (x) | 115 | #define __le32_to_cpu(x) (x) |
116 | #define __le16_to_cpu(x) (x) | 116 | #define __le16_to_cpu(x) (x) |
117 | #define __cpu_to_le64(x) (x) | 117 | #define __cpu_to_le64(x) (x) |
118 | #define __cpu_to_le32(x) (x) | 118 | #define __cpu_to_le32(x) (x) |
119 | #define __cpu_to_le16(x) (x) | 119 | #define __cpu_to_le16(x) (x) |
120 | 120 | ||
121 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 121 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
122 | 122 | ||
123 | #endif /* */ | 123 | #endif /* */ |
124 | 124 | ||
125 | /* | 125 | /* |
126 | * Windows (DDK) | 126 | * Windows (DDK) |
127 | */ | 127 | */ |
128 | #if defined(__WIN__) | 128 | #if defined(__WIN__) |
129 | 129 | ||
130 | #include <io.h> | 130 | #include <io.h> |
131 | 131 | ||
132 | #define __be64_to_cpu(x) ___my_swab64(x) | 132 | #define __be64_to_cpu(x) ___my_swab64(x) |
133 | #define __be32_to_cpu(x) ___my_swab32(x) | 133 | #define __be32_to_cpu(x) ___my_swab32(x) |
134 | #define __be16_to_cpu(x) ___my_swab16(x) | 134 | #define __be16_to_cpu(x) ___my_swab16(x) |
135 | #define __cpu_to_be64(x) ___my_swab64(x) | 135 | #define __cpu_to_be64(x) ___my_swab64(x) |
136 | #define __cpu_to_be32(x) ___my_swab32(x) | 136 | #define __cpu_to_be32(x) ___my_swab32(x) |
137 | #define __cpu_to_be16(x) ___my_swab16(x) | 137 | #define __cpu_to_be16(x) ___my_swab16(x) |
138 | #define __le64_to_cpu(x) (x) | 138 | #define __le64_to_cpu(x) (x) |
139 | #define __le32_to_cpu(x) (x) | 139 | #define __le32_to_cpu(x) (x) |
140 | #define __le16_to_cpu(x) (x) | 140 | #define __le16_to_cpu(x) (x) |
141 | #define __cpu_to_le64(x) (x) | 141 | #define __cpu_to_le64(x) (x) |
142 | #define __cpu_to_le32(x) (x) | 142 | #define __cpu_to_le32(x) (x) |
143 | #define __cpu_to_le16(x) (x) | 143 | #define __cpu_to_le16(x) (x) |
144 | 144 | ||
145 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 145 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
146 | 146 | ||
147 | #endif /* */ | 147 | #endif /* */ |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * MAC (Darwin) | 150 | * MAC (Darwin) |
151 | */ | 151 | */ |
152 | #if defined(__APPLE_CC__) | 152 | #if defined(__APPLE_CC__) |
153 | #if defined(__x86_64__) && defined(__APPLE__) | 153 | #if defined(__x86_64__) && defined(__APPLE__) |
154 | 154 | ||
155 | #include <libkern/OSByteOrder.h> | 155 | #include <libkern/OSByteOrder.h> |
156 | 156 | ||
157 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) | 157 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) |
158 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) | 158 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) |
159 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) | 159 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) |
160 | #define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x) | 160 | #define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x) |
161 | #define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x) | 161 | #define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x) |
162 | #define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x) | 162 | #define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x) |
163 | #define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x) | 163 | #define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x) |
164 | #define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x) | 164 | #define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x) |
165 | #define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x) | 165 | #define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x) |
166 | #define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x) | 166 | #define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x) |
167 | #define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x) | 167 | #define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x) |
168 | #define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x) | 168 | #define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x) |
169 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) | 169 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) |
170 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) | 170 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) |
171 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) | 171 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) |
172 | 172 | ||
173 | #else /* */ | 173 | #else /* */ |
174 | 174 | ||
175 | #include <architecture/byte_order.h> | 175 | #include <architecture/byte_order.h> |
176 | 176 | ||
177 | #define __swab64(x) NXSwapLongLong(x) | 177 | #define __swab64(x) NXSwapLongLong(x) |
178 | #define __swab32(x) NXSwapLong(x) | 178 | #define __swab32(x) NXSwapLong(x) |
179 | #define __swab16(x) NXSwapShort(x) | 179 | #define __swab16(x) NXSwapShort(x) |
180 | #define __be64_to_cpu(x) NXSwapBigLongLongToHost(x) | 180 | #define __be64_to_cpu(x) NXSwapBigLongLongToHost(x) |
181 | #define __be32_to_cpu(x) NXSwapBigLongToHost(x) | 181 | #define __be32_to_cpu(x) NXSwapBigLongToHost(x) |
182 | #define __be16_to_cpu(x) NXSwapBigShortToHost(x) | 182 | #define __be16_to_cpu(x) NXSwapBigShortToHost(x) |
183 | #define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x) | 183 | #define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x) |
184 | #define __le32_to_cpu(x) NXSwapLittleLongToHost(x) | 184 | #define __le32_to_cpu(x) NXSwapLittleLongToHost(x) |
185 | #define __le16_to_cpu(x) NXSwapLittleShortToHost(x) | 185 | #define __le16_to_cpu(x) NXSwapLittleShortToHost(x) |
186 | #define __cpu_to_be64(x) NXSwapHostLongLongToBig(x) | 186 | #define __cpu_to_be64(x) NXSwapHostLongLongToBig(x) |
187 | #define __cpu_to_be32(x) NXSwapHostLongToBig(x) | 187 | #define __cpu_to_be32(x) NXSwapHostLongToBig(x) |
188 | #define __cpu_to_be16(x) NXSwapHostShortToBig(x) | 188 | #define __cpu_to_be16(x) NXSwapHostShortToBig(x) |
189 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) | 189 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) |
190 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) | 190 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) |
191 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) | 191 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) |
192 | 192 | ||
193 | #endif /* */ | 193 | #endif /* */ |
194 | 194 | ||
195 | #define __LITTLE_ENDIAN 1234 | 195 | #define __LITTLE_ENDIAN 1234 |
196 | #define __BIG_ENDIAN 4321 | 196 | #define __BIG_ENDIAN 4321 |
197 | #define __PDP_ENDIAN 3412 | 197 | #define __PDP_ENDIAN 3412 |
198 | #define __BYTE_ORDER __BIG_ENDIAN | 198 | #define __BYTE_ORDER __BIG_ENDIAN |
199 | 199 | ||
200 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 200 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
201 | 201 | ||
202 | #endif /* */ | 202 | #endif /* */ |
203 | 203 | ||
204 | /* | 204 | /* |
205 | * Solaris | 205 | * Solaris |
206 | * ------- | 206 | * ------- |
207 | */ | 207 | */ |
208 | #if defined(__sparc__) && defined(__sun__) | 208 | #if defined(__sparc__) && defined(__sun__) |
209 | #include <sys/byteorder.h> | 209 | #include <sys/byteorder.h> |
210 | #include <sys/types.h> | 210 | #include <sys/types.h> |
211 | #include <unistd.h> | 211 | #include <unistd.h> |
212 | 212 | ||
213 | #define __be64_to_cpu(x) (x) | 213 | #define __be64_to_cpu(x) (x) |
214 | #define __be32_to_cpu(x) (x) | 214 | #define __be32_to_cpu(x) (x) |
215 | #define __be16_to_cpu(x) (x) | 215 | #define __be16_to_cpu(x) (x) |
216 | #define __cpu_to_be64(x) (x) | 216 | #define __cpu_to_be64(x) (x) |
217 | #define __cpu_to_be32(x) (x) | 217 | #define __cpu_to_be32(x) (x) |
218 | #define __cpu_to_be16(x) (x) | 218 | #define __cpu_to_be16(x) (x) |
219 | #define __le64_to_cpu(x) ___my_swab64(x) | 219 | #define __le64_to_cpu(x) ___my_swab64(x) |
220 | #define __le32_to_cpu(x) ___my_swab32(x) | 220 | #define __le32_to_cpu(x) ___my_swab32(x) |
221 | #define __le16_to_cpu(x) ___my_swab16(x) | 221 | #define __le16_to_cpu(x) ___my_swab16(x) |
222 | #define __cpu_to_le64(x) ___my_swab64(x) | 222 | #define __cpu_to_le64(x) ___my_swab64(x) |
223 | #define __cpu_to_le32(x) ___my_swab32(x) | 223 | #define __cpu_to_le32(x) ___my_swab32(x) |
224 | #define __cpu_to_le16(x) ___my_swab16(x) | 224 | #define __cpu_to_le16(x) ___my_swab16(x) |
225 | typedef uint64_t u_int64_t; | 225 | typedef uint64_t u_int64_t; |
226 | typedef uint32_t u_int32_t; | 226 | typedef uint32_t u_int32_t; |
227 | typedef uint16_t u_int16_t; | 227 | typedef uint16_t u_int16_t; |
228 | typedef uint8_t u_int8_t; | 228 | typedef uint8_t u_int8_t; |
229 | 229 | ||
230 | 230 | ||
231 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 231 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
232 | 232 | ||
233 | #endif /* */ | 233 | #endif /* */ |
234 | 234 | ||
235 | /* | 235 | /* |
236 | * Custom stuff | 236 | * Custom stuff |
237 | */ | 237 | */ |
238 | #if defined(__MACH__) && !defined(__APPLE_CC__) | 238 | #if defined(__MACH__) && !defined(__APPLE_CC__) |
239 | #include <libkern/OSByteOrder.h> | 239 | #include <libkern/OSByteOrder.h> |
240 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) | 240 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) |
241 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) | 241 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) |
242 | 242 | ||
243 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 243 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
244 | 244 | ||
245 | #endif /* */ | 245 | #endif /* */ |
246 | 246 | ||
247 | // FreeBSD | 247 | // FreeBSD |
248 | #ifdef __FreeBSD__ | 248 | #ifdef __FreeBSD__ |
249 | #include <machine/endian.h> | 249 | #include <machine/endian.h> |
250 | #endif /* */ | 250 | #endif /* */ |
251 | 251 | ||
252 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? | 252 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? |
253 | 253 | ||
254 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h | 254 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h |
255 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html | 255 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html |
256 | // Write to apple to ask what should be used. | 256 | // Write to apple to ask what should be used. |
257 | 257 | ||
258 | #if defined(LITTLE_ENDIAN) | 258 | #if defined(LITTLE_ENDIAN) |
259 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN | 259 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN |
260 | #elif defined(__LITTLE_ENDIAN) | 260 | #elif defined(__LITTLE_ENDIAN) |
261 | #define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN | 261 | #define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN |
262 | #elif defined(_LITTLE_ENDIAN) | 262 | #elif defined(_LITTLE_ENDIAN) |
263 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN | 263 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN |
264 | #endif /* */ | 264 | #endif /* */ |
265 | 265 | ||
266 | #if defined(BIG_ENDIAN) | 266 | #if defined(BIG_ENDIAN) |
267 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN | 267 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN |
268 | #elif defined(__BIG_ENDIAN) | 268 | #elif defined(__BIG_ENDIAN) |
269 | #define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN | 269 | #define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN |
270 | #elif defined(_BIG_ENDIAN) | 270 | #elif defined(_BIG_ENDIAN) |
271 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN | 271 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN |
272 | #endif /* */ | 272 | #endif /* */ |
273 | 273 | ||
274 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) | 274 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) |
275 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 275 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
276 | #endif /* */ | 276 | #endif /* */ |
277 | 277 | ||
278 | #if defined(BYTE_ORDER) | 278 | #if defined(BYTE_ORDER) |
279 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 279 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
280 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 280 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
281 | #elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 281 | #elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
282 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 282 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
283 | #endif /* */ | 283 | #endif /* */ |
284 | #elif defined(__BYTE_ORDER) | 284 | #elif defined(__BYTE_ORDER) |
285 | #if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 285 | #if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
286 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 286 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
287 | #elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 287 | #elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
288 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 288 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
289 | #endif /* */ | 289 | #endif /* */ |
290 | #elif defined(_BYTE_ORDER) | 290 | #elif defined(_BYTE_ORDER) |
291 | #if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 291 | #if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
292 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 292 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
293 | #elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 293 | #elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
294 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 294 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
295 | #endif /* */ | 295 | #endif /* */ |
296 | #endif /* */ | 296 | #endif /* */ |
297 | 297 | ||
298 | #ifndef AIRCRACK_NG_BYTE_ORDER | 298 | #ifndef AIRCRACK_NG_BYTE_ORDER |
299 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 299 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
300 | #endif /* */ | 300 | #endif /* */ |
301 | 301 | ||
302 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 302 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
303 | 303 | ||
304 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 304 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
305 | #define __be64_to_cpu(x) ___my_swab64(x) | 305 | #define __be64_to_cpu(x) ___my_swab64(x) |
306 | #define __be32_to_cpu(x) ___my_swab32(x) | 306 | #define __be32_to_cpu(x) ___my_swab32(x) |
307 | #define __be16_to_cpu(x) ___my_swab16(x) | 307 | #define __be16_to_cpu(x) ___my_swab16(x) |
308 | #define __cpu_to_be64(x) ___my_swab64(x) | 308 | #define __cpu_to_be64(x) ___my_swab64(x) |
309 | #define __cpu_to_be32(x) ___my_swab32(x) | 309 | #define __cpu_to_be32(x) ___my_swab32(x) |
310 | #define __cpu_to_be16(x) ___my_swab16(x) | 310 | #define __cpu_to_be16(x) ___my_swab16(x) |
311 | #define __le64_to_cpu(x) (x) | 311 | #define __le64_to_cpu(x) (x) |
312 | #define __le32_to_cpu(x) (x) | 312 | #define __le32_to_cpu(x) (x) |
313 | #define __le16_to_cpu(x) (x) | 313 | #define __le16_to_cpu(x) (x) |
314 | #define __cpu_to_le64(x) (x) | 314 | #define __cpu_to_le64(x) (x) |
315 | #define __cpu_to_le32(x) (x) | 315 | #define __cpu_to_le32(x) (x) |
316 | #define __cpu_to_le16(x) (x) | 316 | #define __cpu_to_le16(x) (x) |
317 | #endif /* */ | 317 | #endif /* */ |
318 | 318 | ||
319 | #ifndef htobe16 | 319 | #ifndef htobe16 |
320 | #define htobe16 ___my_swab16 | 320 | #define htobe16 ___my_swab16 |
321 | #endif /* */ | 321 | #endif /* */ |
322 | #ifndef htobe32 | 322 | #ifndef htobe32 |
323 | #define htobe32 ___my_swab32 | 323 | #define htobe32 ___my_swab32 |
324 | #endif /* */ | 324 | #endif /* */ |
325 | #ifndef betoh16 | 325 | #ifndef betoh16 |
326 | #define betoh16 ___my_swab16 | 326 | #define betoh16 ___my_swab16 |
327 | #endif /* */ | 327 | #endif /* */ |
328 | #ifndef betoh32 | 328 | #ifndef betoh32 |
329 | #define betoh32 ___my_swab32 | 329 | #define betoh32 ___my_swab32 |
330 | #endif /* */ | 330 | #endif /* */ |
331 | 331 | ||
332 | #ifndef htole16 | 332 | #ifndef htole16 |
333 | #define htole16(x) (x) | 333 | #define htole16(x) (x) |
334 | #endif /* */ | 334 | #endif /* */ |
335 | #ifndef htole32 | 335 | #ifndef htole32 |
336 | #define htole32(x) (x) | 336 | #define htole32(x) (x) |
337 | #endif /* */ | 337 | #endif /* */ |
338 | #ifndef letoh16 | 338 | #ifndef letoh16 |
339 | #define letoh16(x) (x) | 339 | #define letoh16(x) (x) |
340 | #endif /* */ | 340 | #endif /* */ |
341 | #ifndef letoh32 | 341 | #ifndef letoh32 |
342 | #define letoh32(x) (x) | 342 | #define letoh32(x) (x) |
343 | #endif /* */ | 343 | #endif /* */ |
344 | 344 | ||
345 | #endif /* */ | 345 | #endif /* */ |
346 | 346 | ||
347 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 347 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
348 | 348 | ||
349 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 349 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
350 | #define __be64_to_cpu(x) (x) | 350 | #define __be64_to_cpu(x) (x) |
351 | #define __be32_to_cpu(x) (x) | 351 | #define __be32_to_cpu(x) (x) |
352 | #define __be16_to_cpu(x) (x) | 352 | #define __be16_to_cpu(x) (x) |
353 | #define __cpu_to_be64(x) (x) | 353 | #define __cpu_to_be64(x) (x) |
354 | #define __cpu_to_be32(x) (x) | 354 | #define __cpu_to_be32(x) (x) |
355 | #define __cpu_to_be16(x) (x) | 355 | #define __cpu_to_be16(x) (x) |
356 | #define __le64_to_cpu(x) ___my_swab64(x) | 356 | #define __le64_to_cpu(x) ___my_swab64(x) |
357 | #define __le32_to_cpu(x) ___my_swab32(x) | 357 | #define __le32_to_cpu(x) ___my_swab32(x) |
358 | #define __le16_to_cpu(x) ___my_swab16(x) | 358 | #define __le16_to_cpu(x) ___my_swab16(x) |
359 | #define __cpu_to_le64(x) ___my_swab64(x) | 359 | #define __cpu_to_le64(x) ___my_swab64(x) |
360 | #define __cpu_to_le32(x) ___my_swab32(x) | 360 | #define __cpu_to_le32(x) ___my_swab32(x) |
361 | #define __cpu_to_le16(x) ___my_swab16(x) | 361 | #define __cpu_to_le16(x) ___my_swab16(x) |
362 | #endif /* */ | 362 | #endif /* */ |
363 | 363 | ||
364 | #ifndef htobe16 | 364 | #ifndef htobe16 |
365 | #define htobe16(x) (x) | 365 | #define htobe16(x) (x) |
366 | #endif /* */ | 366 | #endif /* */ |
367 | #ifndef htobe32 | 367 | #ifndef htobe32 |
368 | #define htobe32(x) (x) | 368 | #define htobe32(x) (x) |
369 | #endif /* */ | 369 | #endif /* */ |
370 | #ifndef betoh16 | 370 | #ifndef betoh16 |
371 | #define betoh16(x) (x) | 371 | #define betoh16(x) (x) |
372 | #endif /* */ | 372 | #endif /* */ |
373 | #ifndef betoh32 | 373 | #ifndef betoh32 |
374 | #define betoh32(x) (x) | 374 | #define betoh32(x) (x) |
375 | #endif /* */ | 375 | #endif /* */ |
376 | 376 | ||
377 | #ifndef htole16 | 377 | #ifndef htole16 |
378 | #define htole16 ___my_swab16 | 378 | #define htole16 ___my_swab16 |
379 | #endif /* */ | 379 | #endif /* */ |
380 | #ifndef htole32 | 380 | #ifndef htole32 |
381 | #define htole32 ___my_swab32 | 381 | #define htole32 ___my_swab32 |
382 | #endif /* */ | 382 | #endif /* */ |
383 | #ifndef letoh16 | 383 | #ifndef letoh16 |
384 | #define letoh16 ___my_swab16 | 384 | #define letoh16 ___my_swab16 |
385 | #endif /* */ | 385 | #endif /* */ |
386 | #ifndef letoh32 | 386 | #ifndef letoh32 |
387 | #define letoh32 ___my_swab32 | 387 | #define letoh32 ___my_swab32 |
388 | #endif /* */ | 388 | #endif /* */ |
389 | 389 | ||
390 | #endif /* */ | 390 | #endif /* */ |
391 | 391 | ||
392 | // Common defines | 392 | // Common defines |
393 | #define cpu_to_le64 __cpu_to_le64 | 393 | #define cpu_to_le64 __cpu_to_le64 |
394 | #define le64_to_cpu __le64_to_cpu | 394 | #define le64_to_cpu __le64_to_cpu |
395 | #define cpu_to_le32 __cpu_to_le32 | 395 | #define cpu_to_le32 __cpu_to_le32 |
396 | #define le32_to_cpu __le32_to_cpu | 396 | #define le32_to_cpu __le32_to_cpu |
397 | #define cpu_to_le16 __cpu_to_le16 | 397 | #define cpu_to_le16 __cpu_to_le16 |
398 | #define le16_to_cpu __le16_to_cpu | 398 | #define le16_to_cpu __le16_to_cpu |
399 | #define cpu_to_be64 __cpu_to_be64 | 399 | #define cpu_to_be64 __cpu_to_be64 |
400 | #define be64_to_cpu __be64_to_cpu | 400 | #define be64_to_cpu __be64_to_cpu |
401 | #define cpu_to_be32 __cpu_to_be32 | 401 | #define cpu_to_be32 __cpu_to_be32 |
402 | #define be32_to_cpu __be32_to_cpu | 402 | #define be32_to_cpu __be32_to_cpu |
403 | #define cpu_to_be16 __cpu_to_be16 | 403 | #define cpu_to_be16 __cpu_to_be16 |
404 | #define be16_to_cpu __be16_to_cpu | 404 | #define be16_to_cpu __be16_to_cpu |
405 | 405 | ||
406 | #ifndef le16toh | 406 | #ifndef le16toh |
407 | #define le16toh le16_to_cpu | 407 | #define le16toh le16_to_cpu |
408 | #endif /* */ | 408 | #endif /* */ |
409 | #ifndef be16toh | 409 | #ifndef be16toh |
410 | #define be16toh be16_to_cpu | 410 | #define be16toh be16_to_cpu |
411 | #endif /* */ | 411 | #endif /* */ |
412 | #ifndef le32toh | 412 | #ifndef le32toh |
413 | #define le32toh le32_to_cpu | 413 | #define le32toh le32_to_cpu |
414 | #endif /* */ | 414 | #endif /* */ |
415 | #ifndef be32toh | 415 | #ifndef be32toh |
416 | #define be32toh be32_to_cpu | 416 | #define be32toh be32_to_cpu |
417 | #endif /* */ | 417 | #endif /* */ |
418 | 418 | ||
419 | #ifndef htons | 419 | #ifndef htons |
420 | #define htons be16_to_cpu | 420 | #define htons be16_to_cpu |
421 | #endif /* */ | 421 | #endif /* */ |
422 | #ifndef htonl | 422 | #ifndef htonl |
423 | #define htonl cpu_to_be16 | 423 | #define htonl cpu_to_be16 |
424 | #endif /* */ | 424 | #endif /* */ |
425 | #ifndef ntohs | 425 | #ifndef ntohs |
426 | #define ntohs cpu_to_be16 | 426 | #define ntohs cpu_to_be16 |
427 | #endif /* */ | 427 | #endif /* */ |
428 | #ifndef ntohl | 428 | #ifndef ntohl |
429 | #define ntohl cpu_to_be32 | 429 | #define ntohl cpu_to_be32 |
430 | #endif /* */ | 430 | #endif /* */ |
431 | 431 | ||
432 | #endif /* */ | 432 | #endif /* */ |
diff --git a/src/transport/wlan/helper_common.h b/src/transport/wlan/helper_common.h index 550ebda6f..3c33887d1 100644 --- a/src/transport/wlan/helper_common.h +++ b/src/transport/wlan/helper_common.h | |||
@@ -8,8 +8,11 @@ | |||
8 | #ifndef HELPER_COMMON_H_ | 8 | #ifndef HELPER_COMMON_H_ |
9 | #define HELPER_COMMON_H_ | 9 | #define HELPER_COMMON_H_ |
10 | 10 | ||
11 | int getFrequencyFromChannel (int channel); | 11 | int |
12 | int getChannelFromFrequency (int frequency); | 12 | getFrequencyFromChannel (int channel); |
13 | int send_mac_to_plugin (char *buffer, uint8_t * mac); | 13 | int |
14 | getChannelFromFrequency (int frequency); | ||
15 | int | ||
16 | send_mac_to_plugin (char *buffer, uint8_t * mac); | ||
14 | 17 | ||
15 | #endif /* HELPER_COMMON_H_ */ | 18 | #endif /* HELPER_COMMON_H_ */ |
diff --git a/src/transport/wlan/loopback_helper.h b/src/transport/wlan/loopback_helper.h index d6afb1129..81cc66f22 100644 --- a/src/transport/wlan/loopback_helper.h +++ b/src/transport/wlan/loopback_helper.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | //static void file_in_send(void *cls, void *client, const struct GNUNET_MessageHeader *hdr); | 15 | //static void file_in_send(void *cls, void *client, const struct GNUNET_MessageHeader *hdr); |
16 | 16 | ||
17 | int testmode (int argc, char *argv[]); | 17 | int |
18 | testmode (int argc, char *argv[]); | ||
18 | 19 | ||
19 | #endif /* LOOPBACK_HELPER_H_ */ | 20 | #endif /* LOOPBACK_HELPER_H_ */ |
diff --git a/src/transport/wlan/radiotap-parser.c b/src/transport/wlan/radiotap-parser.c index ab75524f2..9cc992728 100644 --- a/src/transport/wlan/radiotap-parser.c +++ b/src/transport/wlan/radiotap-parser.c | |||
@@ -191,13 +191,13 @@ ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator) | |||
191 | */ | 191 | */ |
192 | 192 | ||
193 | if ((((void *) iterator->arg) - | 193 | if ((((void *) iterator->arg) - |
194 | ((void *) iterator-> | 194 | ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) |
195 | rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1)) | 195 | - 1)) |
196 | iterator->arg_index += | 196 | iterator->arg_index += |
197 | (rt_sizes[iterator->arg_index] >> 4) - | 197 | (rt_sizes[iterator->arg_index] >> 4) - |
198 | ((((void *) iterator->arg) - | 198 | ((((void *) iterator->arg) - |
199 | ((void *) iterator-> | 199 | ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >> |
200 | rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1)); | 200 | 4) - 1)); |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * this is what we will return to user, but we need to | 203 | * this is what we will return to user, but we need to |
diff --git a/src/transport/wlan/radiotap-parser.h b/src/transport/wlan/radiotap-parser.h index fb6d8e2af..6c88175ec 100644 --- a/src/transport/wlan/radiotap-parser.h +++ b/src/transport/wlan/radiotap-parser.h | |||
@@ -70,10 +70,10 @@ struct ieee80211_radiotap_iterator | |||
70 | u32 bitmap_shifter; | 70 | u32 bitmap_shifter; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | int ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator | 73 | int |
74 | *iterator, | 74 | ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator *iterator, |
75 | struct ieee80211_radiotap_header | 75 | struct ieee80211_radiotap_header |
76 | *radiotap_header, int max_length); | 76 | *radiotap_header, int max_length); |
77 | 77 | ||
78 | int ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator | 78 | int |
79 | *iterator); | 79 | ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator); |