diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
commit | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (patch) | |
tree | edbc42f37889069033e57da201fef242939a6e0f /src/transport | |
parent | 502af2167f7c218366666ca4944bd7cc54b5b19a (diff) | |
download | gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.tar.gz gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.zip |
indentation
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_ats.h | 40 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_blacklist.h | 17 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_clients.h | 9 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_hello.h | 18 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.h | 53 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.h | 11 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.h | 24 | ||||
-rw-r--r-- | src/transport/transport-testing.h | 9 | ||||
-rw-r--r-- | src/transport/wlan/byteorder.h | 46 |
9 files changed, 100 insertions, 127 deletions
diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h index d1d789b5f..88e4b4bbf 100644 --- a/src/transport/gnunet-service-transport_ats.h +++ b/src/transport/gnunet-service-transport_ats.h | |||
@@ -67,9 +67,11 @@ | |||
67 | struct ATS_mechanism; | 67 | struct ATS_mechanism; |
68 | struct ATS_peer; | 68 | struct ATS_peer; |
69 | 69 | ||
70 | typedef void (*GNUNET_TRANSPORT_ATS_AddressNotification) | 70 | typedef void (*GNUNET_TRANSPORT_ATS_AddressNotification) (struct ATS_peer ** |
71 | (struct ATS_peer ** peers, | 71 | peers, int *c_p, |
72 | int *c_p, struct ATS_mechanism ** mechanisms, int *c_m); | 72 | struct ATS_mechanism |
73 | ** mechanisms, | ||
74 | int *c_m); | ||
73 | 75 | ||
74 | typedef void (*GNUNET_TRANSPORT_ATS_ResultCallback) (void); | 76 | typedef void (*GNUNET_TRANSPORT_ATS_ResultCallback) (void); |
75 | 77 | ||
@@ -447,12 +449,8 @@ static struct ATS_quality_metric qm[] = { | |||
447 | /* | 449 | /* |
448 | * ATS functions | 450 | * ATS functions |
449 | */ | 451 | */ |
450 | struct ATS_Handle *ats_init (double D, | 452 | struct ATS_Handle *ats_init (double D, double U, double R, int v_b_min, |
451 | double U, | 453 | int v_n_min, int max_iterations, |
452 | double R, | ||
453 | int v_b_min, | ||
454 | int v_n_min, | ||
455 | int max_iterations, | ||
456 | struct GNUNET_TIME_Relative max_duration, | 454 | struct GNUNET_TIME_Relative max_duration, |
457 | GNUNET_TRANSPORT_ATS_AddressNotification | 455 | GNUNET_TRANSPORT_ATS_AddressNotification |
458 | address_not, | 456 | address_not, |
@@ -462,23 +460,18 @@ void ats_shutdown (struct ATS_Handle *ats); | |||
462 | 460 | ||
463 | void ats_delete_problem (struct ATS_Handle *ats); | 461 | void ats_delete_problem (struct ATS_Handle *ats); |
464 | 462 | ||
465 | int | 463 | int ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat, |
466 | ats_create_problem (struct ATS_Handle *ats, | 464 | struct ATS_peer *peers, int c_p, |
467 | struct ATS_internals *stat, | 465 | struct ATS_mechanism *mechanisms, int c_m); |
468 | struct ATS_peer *peers, | ||
469 | int c_p, struct ATS_mechanism *mechanisms, int c_m); | ||
470 | 466 | ||
471 | void ats_modify_problem_state (struct ATS_Handle *ats, | 467 | void ats_modify_problem_state (struct ATS_Handle *ats, |
472 | enum ATS_problem_state s); | 468 | enum ATS_problem_state s); |
473 | 469 | ||
474 | void ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); | 470 | void ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); |
475 | 471 | ||
476 | void | 472 | void ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it, |
477 | ats_solve_problem (struct ATS_Handle *ats, | 473 | unsigned int max_dur, unsigned int c_peers, |
478 | unsigned int max_it, | 474 | unsigned int c_mechs, struct ATS_internals *stat); |
479 | unsigned int max_dur, | ||
480 | unsigned int c_peers, | ||
481 | unsigned int c_mechs, struct ATS_internals *stat); | ||
482 | 475 | ||
483 | int ats_evaluate_results (int result, int solution, char *problem); | 476 | int ats_evaluate_results (int result, int solution, char *problem); |
484 | 477 | ||
@@ -487,10 +480,9 @@ void ats_update_problem_qm (struct ATS_Handle *ats); | |||
487 | void ats_update_problem_cr (struct ATS_Handle *ats); | 480 | void ats_update_problem_cr (struct ATS_Handle *ats); |
488 | 481 | ||
489 | 482 | ||
490 | void | 483 | void ats_set_logging_options (struct ATS_Handle *ats, |
491 | ats_set_logging_options (struct ATS_Handle *ats, | 484 | struct GNUNET_STATISTICS_Handle *stats, |
492 | struct GNUNET_STATISTICS_Handle *stats, | 485 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
493 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
494 | 486 | ||
495 | #endif | 487 | #endif |
496 | /* end of file gnunet-service-transport_ats.h */ | 488 | /* end of file gnunet-service-transport_ats.h */ |
diff --git a/src/transport/gnunet-service-transport_blacklist.h b/src/transport/gnunet-service-transport_blacklist.h index 4823d055d..7e88b3961 100644 --- a/src/transport/gnunet-service-transport_blacklist.h +++ b/src/transport/gnunet-service-transport_blacklist.h | |||
@@ -52,10 +52,8 @@ void GST_blacklist_stop (void); | |||
52 | * @param client the client | 52 | * @param client the client |
53 | * @param message the blacklist-init message that was sent | 53 | * @param message the blacklist-init message that was sent |
54 | */ | 54 | */ |
55 | void | 55 | void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, |
56 | GST_blacklist_handle_init (void *cls, | 56 | const struct GNUNET_MessageHeader *message); |
57 | struct GNUNET_SERVER_Client *client, | ||
58 | const struct GNUNET_MessageHeader *message); | ||
59 | 57 | ||
60 | /** | 58 | /** |
61 | * A blacklisting client has sent us reply. Process it. | 59 | * A blacklisting client has sent us reply. Process it. |
@@ -64,10 +62,8 @@ GST_blacklist_handle_init (void *cls, | |||
64 | * @param client the client | 62 | * @param client the client |
65 | * @param message the blacklist-init message that was sent | 63 | * @param message the blacklist-init message that was sent |
66 | */ | 64 | */ |
67 | void | 65 | void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, |
68 | GST_blacklist_handle_reply (void *cls, | 66 | const struct GNUNET_MessageHeader *message); |
69 | struct GNUNET_SERVER_Client *client, | ||
70 | const struct GNUNET_MessageHeader *message); | ||
71 | 67 | ||
72 | /** | 68 | /** |
73 | * Add the given peer to the blacklist (for the given transport). | 69 | * Add the given peer to the blacklist (for the given transport). |
@@ -75,9 +71,8 @@ GST_blacklist_handle_reply (void *cls, | |||
75 | * @param peer peer to blacklist | 71 | * @param peer peer to blacklist |
76 | * @param transport_name transport to blacklist for this peer, NULL for all | 72 | * @param transport_name transport to blacklist for this peer, NULL for all |
77 | */ | 73 | */ |
78 | void | 74 | void GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, |
79 | GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, | 75 | const char *transport_name); |
80 | const char *transport_name); | ||
81 | 76 | ||
82 | 77 | ||
83 | /** | 78 | /** |
diff --git a/src/transport/gnunet-service-transport_clients.h b/src/transport/gnunet-service-transport_clients.h index 7c79eec15..6bcc18cd3 100644 --- a/src/transport/gnunet-service-transport_clients.h +++ b/src/transport/gnunet-service-transport_clients.h | |||
@@ -50,8 +50,8 @@ void GST_clients_stop (void); | |||
50 | * @param msg message to broadcast | 50 | * @param msg message to broadcast |
51 | * @param may_drop GNUNET_YES if the message can be dropped | 51 | * @param may_drop GNUNET_YES if the message can be dropped |
52 | */ | 52 | */ |
53 | void | 53 | void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, |
54 | GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop); | 54 | int may_drop); |
55 | 55 | ||
56 | 56 | ||
57 | /** | 57 | /** |
@@ -61,9 +61,8 @@ GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop); | |||
61 | * @param msg message to transmit | 61 | * @param msg message to transmit |
62 | * @param may_drop GNUNET_YES if the message can be dropped | 62 | * @param may_drop GNUNET_YES if the message can be dropped |
63 | */ | 63 | */ |
64 | void | 64 | void GST_clients_unicast (struct GNUNET_SERVER_Client *client, |
65 | GST_clients_unicast (struct GNUNET_SERVER_Client *client, | 65 | const struct GNUNET_MessageHeader *msg, int may_drop); |
66 | const struct GNUNET_MessageHeader *msg, int may_drop); | ||
67 | 66 | ||
68 | 67 | ||
69 | 68 | ||
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h index 8aac2838a..ff817814b 100644 --- a/src/transport/gnunet-service-transport_hello.h +++ b/src/transport/gnunet-service-transport_hello.h | |||
@@ -80,11 +80,9 @@ const struct GNUNET_MessageHeader *GST_hello_get (void); | |||
80 | * @param plugin_address address in a plugin-specific format | 80 | * @param plugin_address address in a plugin-specific format |
81 | * @param plugin_address_len number of bytes in plugin_address | 81 | * @param plugin_address_len number of bytes in plugin_address |
82 | */ | 82 | */ |
83 | void | 83 | void GST_hello_modify_addresses (int addremove, const char *plugin_name, |
84 | GST_hello_modify_addresses (int addremove, | 84 | const void *plugin_address, |
85 | const char *plugin_name, | 85 | size_t plugin_address_len); |
86 | const void *plugin_address, | ||
87 | size_t plugin_address_len); | ||
88 | 86 | ||
89 | 87 | ||
90 | /** | 88 | /** |
@@ -99,12 +97,10 @@ GST_hello_modify_addresses (int addremove, | |||
99 | * @return GNUNET_YES if this is one of our addresses, | 97 | * @return GNUNET_YES if this is one of our addresses, |
100 | * GNUNET_NO if not | 98 | * GNUNET_NO if not |
101 | */ | 99 | */ |
102 | int | 100 | int GST_hello_test_address (const char *plugin_name, const void *plugin_address, |
103 | GST_hello_test_address (const char *plugin_name, | 101 | size_t plugin_address_len, |
104 | const void *plugin_address, | 102 | struct GNUNET_CRYPTO_RsaSignature **sig, |
105 | size_t plugin_address_len, | 103 | struct GNUNET_TIME_Absolute **sig_expiration); |
106 | struct GNUNET_CRYPTO_RsaSignature **sig, | ||
107 | struct GNUNET_TIME_Absolute **sig_expiration); | ||
108 | 104 | ||
109 | 105 | ||
110 | #endif | 106 | #endif |
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index c263c33d9..c0cee01a6 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -43,10 +43,8 @@ | |||
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 | 46 | void GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb, |
47 | GST_neighbours_start (void *cls, | 47 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); |
48 | GNUNET_TRANSPORT_NotifyConnect connect_cb, | ||
49 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | ||
50 | 48 | ||
51 | 49 | ||
52 | /** | 50 | /** |
@@ -91,12 +89,10 @@ typedef void (*GST_NeighbourSendContinuation) (void *cls, int success); | |||
91 | * @param cont function to call when done | 89 | * @param cont function to call when done |
92 | * @param cont_cls closure for 'cont' | 90 | * @param cont_cls closure for 'cont' |
93 | */ | 91 | */ |
94 | void | 92 | void GST_neighbours_send (const struct GNUNET_PeerIdentity *target, |
95 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | 93 | const void *msg, size_t msg_size, |
96 | const void *msg, | 94 | struct GNUNET_TIME_Relative timeout, |
97 | size_t msg_size, | 95 | GST_NeighbourSendContinuation cont, void *cont_cls); |
98 | struct GNUNET_TIME_Relative timeout, | ||
99 | GST_NeighbourSendContinuation cont, void *cont_cls); | ||
100 | 96 | ||
101 | 97 | ||
102 | /** | 98 | /** |
@@ -110,9 +106,13 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | |||
110 | * GNUNET_NO if the neighbour is not connected or violates the quota | 106 | * GNUNET_NO if the neighbour is not connected or violates the quota |
111 | * @return how long to wait before reading more from this sender | 107 | * @return how long to wait before reading more from this sender |
112 | */ | 108 | */ |
113 | struct GNUNET_TIME_Relative | 109 | struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct |
114 | GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | 110 | GNUNET_PeerIdentity |
115 | *sender, ssize_t size, int *do_forward); | 111 | *sender, |
112 | ssize_t | ||
113 | size, | ||
114 | int | ||
115 | *do_forward); | ||
116 | 116 | ||
117 | 117 | ||
118 | /** | 118 | /** |
@@ -130,9 +130,10 @@ void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | |||
130 | * @param neighbour identity of peer to change qutoa for | 130 | * @param neighbour identity of peer to change qutoa for |
131 | * @param quota new quota | 131 | * @param quota new quota |
132 | */ | 132 | */ |
133 | void | 133 | void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity |
134 | GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, | 134 | *neighbour, |
135 | struct GNUNET_BANDWIDTH_Value32NBO quota); | 135 | struct GNUNET_BANDWIDTH_Value32NBO |
136 | quota); | ||
136 | 137 | ||
137 | 138 | ||
138 | /** | 139 | /** |
@@ -174,9 +175,8 @@ void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | |||
174 | * @param peer identity of the peer where the session died | 175 | * @param peer identity of the peer where the session died |
175 | * @param session session that is gone | 176 | * @param session session that is gone |
176 | */ | 177 | */ |
177 | void | 178 | void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, |
178 | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | 179 | struct Session *session); |
179 | struct Session *session); | ||
180 | 180 | ||
181 | 181 | ||
182 | /** | 182 | /** |
@@ -192,14 +192,13 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
192 | * @param ats performance data | 192 | * @param ats performance data |
193 | * @param ats_count number of entries in ats (excluding 0-termination) | 193 | * @param ats_count number of entries in ats (excluding 0-termination) |
194 | */ | 194 | */ |
195 | void | 195 | void GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, |
196 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | 196 | const char *plugin_name, |
197 | const char *plugin_name, | 197 | const void *address, size_t address_len, |
198 | const void *address, | 198 | struct Session *session, |
199 | size_t address_len, | 199 | const struct |
200 | struct Session *session, | 200 | GNUNET_TRANSPORT_ATS_Information *ats, |
201 | const struct GNUNET_TRANSPORT_ATS_Information | 201 | uint32_t ats_count); |
202 | *ats, uint32_t ats_count); | ||
203 | 202 | ||
204 | 203 | ||
205 | #endif | 204 | #endif |
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h index f3f46e342..ebc8fa451 100644 --- a/src/transport/gnunet-service-transport_plugins.h +++ b/src/transport/gnunet-service-transport_plugins.h | |||
@@ -42,10 +42,9 @@ | |||
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 | 45 | void GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, |
46 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | 46 | GNUNET_TRANSPORT_AddressNotification address_cb, |
47 | GNUNET_TRANSPORT_AddressNotification address_cb, | 47 | GNUNET_TRANSPORT_SessionEnd session_end_cb); |
48 | GNUNET_TRANSPORT_SessionEnd session_end_cb); | ||
49 | 48 | ||
50 | 49 | ||
51 | /** | 50 | /** |
@@ -72,8 +71,8 @@ struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name); | |||
72 | * @param addrlen number of bytes in 'addr' | 71 | * @param addrlen number of bytes in 'addr' |
73 | * @return statically allocated (!) human-readable address | 72 | * @return statically allocated (!) human-readable address |
74 | */ | 73 | */ |
75 | const char *GST_plugins_a2s (const char *name, | 74 | const char *GST_plugins_a2s (const char *name, const void *addr, |
76 | const void *addr, size_t addrlen); | 75 | size_t addrlen); |
77 | 76 | ||
78 | 77 | ||
79 | #endif | 78 | #endif |
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index bdf8bd9ed..86ede1576 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h | |||
@@ -54,13 +54,12 @@ void GST_validation_stop (void); | |||
54 | * if we did not initiate the connection | 54 | * if we did not initiate the connection |
55 | * @param sender_address_len number of bytes in sender_address | 55 | * @param sender_address_len number of bytes in sender_address |
56 | */ | 56 | */ |
57 | void | 57 | void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, |
58 | GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | 58 | const struct GNUNET_MessageHeader *hdr, |
59 | const struct GNUNET_MessageHeader *hdr, | 59 | const char *plugin_name, |
60 | const char *plugin_name, | 60 | struct Session *session, |
61 | struct Session *session, | 61 | const void *sender_address, |
62 | const void *sender_address, | 62 | size_t sender_address_len); |
63 | size_t sender_address_len); | ||
64 | 63 | ||
65 | 64 | ||
66 | /** | 65 | /** |
@@ -70,9 +69,8 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
70 | * @param sender peer sending the PONG | 69 | * @param sender peer sending the PONG |
71 | * @param hdr the PONG | 70 | * @param hdr the PONG |
72 | */ | 71 | */ |
73 | void | 72 | void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, |
74 | GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | 73 | const struct GNUNET_MessageHeader *hdr); |
75 | const struct GNUNET_MessageHeader *hdr); | ||
76 | 74 | ||
77 | 75 | ||
78 | /** | 76 | /** |
@@ -124,9 +122,9 @@ typedef void (*GST_ValidationAddressCallback) (void *cls, | |||
124 | * @param cb_cls closure for 'cb' | 122 | * @param cb_cls closure for 'cb' |
125 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES | 123 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES |
126 | */ | 124 | */ |
127 | void | 125 | void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, |
128 | GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, | 126 | GST_ValidationAddressCallback cb, |
129 | GST_ValidationAddressCallback cb, void *cb_cls); | 127 | void *cb_cls); |
130 | 128 | ||
131 | 129 | ||
132 | #endif | 130 | #endif |
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h index a867df4c1..a21ccc11f 100644 --- a/src/transport/transport-testing.h +++ b/src/transport/transport-testing.h | |||
@@ -102,10 +102,9 @@ 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 | 105 | void GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, |
106 | GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, | 106 | struct PeerContext *p2, |
107 | struct PeerContext *p2, | 107 | GNUNET_TRANSPORT_TESTING_connect_cb |
108 | GNUNET_TRANSPORT_TESTING_connect_cb cb, | 108 | cb, void *cls); |
109 | void *cls); | ||
110 | 109 | ||
111 | /* end of transport_testing.h */ | 110 | /* end of transport_testing.h */ |
diff --git a/src/transport/wlan/byteorder.h b/src/transport/wlan/byteorder.h index e065e24d6..b09328320 100644 --- a/src/transport/wlan/byteorder.h +++ b/src/transport/wlan/byteorder.h | |||
@@ -22,33 +22,29 @@ | |||
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) (((u_int64_t) (x) & (u_int64_t) | 36 | (\ (u_int64_t) |
37 | 0x00000000000000ffULL) << 56) | | 37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | |
38 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 38 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x000000000000ff00ULL) << |
39 | 0x000000000000ff00ULL) << 40) | | 39 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) |
40 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 40 | 0x0000000000ff0000ULL) << 24) | |
41 | 0x0000000000ff0000ULL) << 24) | | 41 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00000000ff000000ULL) << 8) |
42 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 42 | | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x000000ff00000000ULL) >> |
43 | 0x00000000ff000000ULL) << 8) | | 43 | 8) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) |
44 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 44 | 0x0000ff0000000000ULL) >> 24) | |
45 | 0x000000ff00000000ULL) >> 8) | | 45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> |
46 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) |
47 | 0x0000ff0000000000ULL) >> 24) | | 47 | 0xff00000000000000ULL) >> 56))) |
48 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | ||
49 | 0x00ff000000000000ULL) >> 40) | | ||
50 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | ||
51 | 0xff00000000000000ULL) >> 56))) | ||
52 | /* | 48 | /* |
53 | * Linux | 49 | * Linux |
54 | */ | 50 | */ |