Changeset 46d4d9f in mainline for uspace/srv/net/tl/tcp/tcp.c
- Timestamp:
- 2010-11-20T17:04:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd5046dd
- Parents:
- fdbc3ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp.c
rfdbc3ff r46d4d9f 160 160 }; 161 161 162 static int tcp_release_and_return(packet_t , int);162 static int tcp_release_and_return(packet_t *, int); 163 163 static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *, 164 164 tcp_header_t *, int synchronize, int); … … 171 171 static int tcp_release_after_timeout(void *); 172 172 173 static int tcp_process_packet(device_id_t, packet_t , services_t);173 static int tcp_process_packet(device_id_t, packet_t *, services_t); 174 174 static int tcp_connect_core(socket_core_t *, socket_cores_t *, 175 175 struct sockaddr *, socklen_t); 176 176 static int tcp_queue_prepare_packet(socket_core_t *, tcp_socket_data_t *, 177 packet_t , size_t);178 static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t ,177 packet_t *, size_t); 178 static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t *, 179 179 size_t); 180 static packet_t tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *);181 static void tcp_send_packets(device_id_t, packet_t );180 static packet_t *tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *); 181 static void tcp_send_packets(device_id_t, packet_t *); 182 182 183 183 static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *, 184 184 tcp_header_t *); 185 static packet_t tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *,186 packet_t , size_t, size_t);187 static packet_t tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, packet_t,188 size_t, size_t);185 static packet_t *tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *, 186 packet_t *, size_t, size_t); 187 static packet_t *tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, 188 packet_t *, size_t, size_t); 189 189 /* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *, 190 190 size_t); 191 static int tcp_create_notification_packet(packet_t * , socket_core_t *,191 static int tcp_create_notification_packet(packet_t **, socket_core_t *, 192 192 tcp_socket_data_t *, int, int); 193 193 static void tcp_refresh_socket_data(tcp_socket_data_t *); … … 196 196 197 197 static int tcp_process_listen(socket_core_t *, tcp_socket_data_t *, 198 tcp_header_t *, packet_t , struct sockaddr *, struct sockaddr *, size_t);198 tcp_header_t *, packet_t *, struct sockaddr *, struct sockaddr *, size_t); 199 199 static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *, 200 tcp_header_t *, packet_t );200 tcp_header_t *, packet_t *); 201 201 static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *, 202 tcp_header_t *, packet_t );202 tcp_header_t *, packet_t *); 203 203 static int tcp_process_established(socket_core_t *, tcp_socket_data_t *, 204 tcp_header_t *, packet_t , int, size_t);204 tcp_header_t *, packet_t *, int, size_t); 205 205 static int tcp_queue_received_packet(socket_core_t *, tcp_socket_data_t *, 206 packet_t , int, size_t);207 208 static int tcp_received_msg(device_id_t, packet_t , services_t, services_t);206 packet_t *, int, size_t); 207 208 static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t); 209 209 static int tcp_process_client_messages(ipc_callid_t, ipc_call_t); 210 210 … … 262 262 } 263 263 264 int tcp_received_msg(device_id_t device_id, packet_t packet,264 int tcp_received_msg(device_id_t device_id, packet_t *packet, 265 265 services_t receiver, services_t error) 266 266 { … … 280 280 } 281 281 282 int tcp_process_packet(device_id_t device_id, packet_t packet, services_t error)282 int tcp_process_packet(device_id_t device_id, packet_t *packet, services_t error) 283 283 { 284 284 size_t length; … … 288 288 socket_core_t *socket; 289 289 tcp_socket_data_t *socket_data; 290 packet_t next_packet;290 packet_t *next_packet; 291 291 size_t total_length; 292 292 uint32_t checksum; … … 493 493 494 494 int tcp_process_established(socket_core_t *socket, tcp_socket_data_t * 495 socket_data, tcp_header_t *header, packet_t packet, int fragments,495 socket_data, tcp_header_t *header, packet_t *packet, int fragments, 496 496 size_t total_length) 497 497 { 498 packet_t next_packet;499 packet_t tmp_packet;498 packet_t *next_packet; 499 packet_t *tmp_packet; 500 500 uint32_t old_incoming; 501 501 size_t order; … … 801 801 802 802 int tcp_queue_received_packet(socket_core_t *socket, 803 tcp_socket_data_t *socket_data, packet_t packet, int fragments,803 tcp_socket_data_t *socket_data, packet_t *packet, int fragments, 804 804 size_t total_length) 805 805 { … … 838 838 839 839 int tcp_process_syn_sent(socket_core_t *socket, tcp_socket_data_t * 840 socket_data, tcp_header_t *header, packet_t packet)841 { 842 packet_t next_packet;840 socket_data, tcp_header_t *header, packet_t *packet) 841 { 842 packet_t *next_packet; 843 843 int rc; 844 844 … … 897 897 int tcp_process_listen(socket_core_t *listening_socket, 898 898 tcp_socket_data_t *listening_socket_data, tcp_header_t *header, 899 packet_t packet, struct sockaddr *src, struct sockaddr *dest,899 packet_t *packet, struct sockaddr *src, struct sockaddr *dest, 900 900 size_t addrlen) 901 901 { 902 packet_t next_packet;902 packet_t *next_packet; 903 903 socket_core_t *socket; 904 904 tcp_socket_data_t *socket_data; … … 1056 1056 1057 1057 int tcp_process_syn_received(socket_core_t *socket, 1058 tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t packet)1058 tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t *packet) 1059 1059 { 1060 1060 socket_core_t *listening_socket; … … 1127 1127 size_t number; 1128 1128 size_t length; 1129 packet_t packet;1130 packet_t next;1131 packet_t acknowledged = NULL;1129 packet_t *packet; 1130 packet_t *next; 1131 packet_t *acknowledged = NULL; 1132 1132 uint32_t old; 1133 1133 … … 1232 1232 ipc_call_t *answer, int *answer_count) 1233 1233 { 1234 packet_t packet;1234 packet_t *packet; 1235 1235 int rc; 1236 1236 … … 1654 1654 socket_data, size_t sequence_number) 1655 1655 { 1656 packet_t packet;1657 packet_t copy;1656 packet_t *packet; 1657 packet_t *copy; 1658 1658 size_t data_length; 1659 1659 … … 1736 1736 { 1737 1737 tcp_socket_data_t *socket_data; 1738 packet_t packet;1738 packet_t *packet; 1739 1739 int rc; 1740 1740 … … 1824 1824 1825 1825 int tcp_queue_prepare_packet(socket_core_t *socket, 1826 tcp_socket_data_t *socket_data, packet_t packet, size_t data_length)1826 tcp_socket_data_t *socket_data, packet_t *packet, size_t data_length) 1827 1827 { 1828 1828 tcp_header_t *header; … … 1855 1855 1856 1856 int tcp_queue_packet(socket_core_t *socket, tcp_socket_data_t *socket_data, 1857 packet_t packet, size_t data_length)1857 packet_t *packet, size_t data_length) 1858 1858 { 1859 1859 int rc; … … 1876 1876 } 1877 1877 1878 packet_t tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *1878 packet_t *tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t * 1879 1879 socket_data) 1880 1880 { 1881 packet_t packet;1882 packet_t copy;1883 packet_t sending = NULL;1884 packet_t previous = NULL;1881 packet_t *packet; 1882 packet_t *copy; 1883 packet_t *sending = NULL; 1884 packet_t *previous = NULL; 1885 1885 size_t data_length; 1886 1886 int rc; … … 1936 1936 } 1937 1937 1938 packet_t tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t *1939 socket_data, packet_t packet, size_t data_length, size_t sequence_number)1938 packet_t *tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t * 1939 socket_data, packet_t *packet, size_t data_length, size_t sequence_number) 1940 1940 { 1941 1941 tcp_header_t *header; … … 1997 1997 } 1998 1998 1999 packet_t tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t *2000 socket_data, packet_t packet, size_t data_length, size_t sequence_number)2001 { 2002 packet_t copy;1999 packet_t *tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t * 2000 socket_data, packet_t *packet, size_t data_length, size_t sequence_number) 2001 { 2002 packet_t *copy; 2003 2003 2004 2004 assert(socket); … … 2015 2015 } 2016 2016 2017 void tcp_send_packets(device_id_t device_id, packet_t packet)2018 { 2019 packet_t next;2017 void tcp_send_packets(device_id_t device_id, packet_t *packet) 2018 { 2019 packet_t *next; 2020 2020 2021 2021 while (packet) { … … 2097 2097 tcp_socket_data_t *socket_data; 2098 2098 int packet_id; 2099 packet_t packet;2099 packet_t *packet; 2100 2100 size_t length; 2101 2101 int rc; … … 2155 2155 tcp_socket_data_t *socket_data; 2156 2156 packet_dimension_t *packet_dimension; 2157 packet_t packet;2157 packet_t *packet; 2158 2158 size_t total_length; 2159 2159 tcp_header_t *header; … … 2229 2229 socket_core_t *socket; 2230 2230 tcp_socket_data_t *socket_data; 2231 packet_t packet;2231 packet_t *packet; 2232 2232 int rc; 2233 2233 … … 2293 2293 } 2294 2294 2295 int tcp_create_notification_packet(packet_t * packet, socket_core_t *socket,2295 int tcp_create_notification_packet(packet_t **packet, socket_core_t *socket, 2296 2296 tcp_socket_data_t *socket_data, int synchronize, int finalize) 2297 2297 { … … 2442 2442 * @return The result parameter. 2443 2443 */ 2444 int tcp_release_and_return(packet_t packet, int result)2444 int tcp_release_and_return(packet_t *packet, int result) 2445 2445 { 2446 2446 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
Note:
See TracChangeset
for help on using the changeset viewer.