Changeset 46d4d9f in mainline for uspace/srv/net/tl
- Timestamp:
- 2010-11-20T17:04:59Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dd5046dd
- Parents:
- fdbc3ff
- Location:
- uspace/srv/net/tl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
rfdbc3ff r46d4d9f 130 130 * @return The result parameter. 131 131 */ 132 static int icmp_release_and_return(packet_t packet, int result)132 static int icmp_release_and_return(packet_t *packet, int result) 133 133 { 134 134 pq_release_remote(icmp_globals.net_phone, packet_get_id(packet)); … … 155 155 * @return EPERM if the error message is not allowed. 156 156 */ 157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t *packet, 158 158 icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos, 159 159 int dont_fragment) … … 189 189 * @return NULL on errors. 190 190 */ 191 static icmp_header_t *icmp_prepare_packet(packet_t packet)191 static icmp_header_t *icmp_prepare_packet(packet_t *packet) 192 192 { 193 193 icmp_header_t *header; … … 248 248 { 249 249 icmp_header_t *header; 250 packet_t packet;250 packet_t *packet; 251 251 size_t length; 252 252 uint8_t *data; … … 340 340 341 341 static int icmp_destination_unreachable_msg_local(int icmp_phone, 342 icmp_code_t code, icmp_param_t mtu, packet_t packet)342 icmp_code_t code, icmp_param_t mtu, packet_t *packet) 343 343 { 344 344 icmp_header_t *header; … … 355 355 } 356 356 357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet)357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t *packet) 358 358 { 359 359 icmp_header_t *header; … … 368 368 369 369 static int icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code, 370 packet_t packet)370 packet_t *packet) 371 371 { 372 372 icmp_header_t *header; … … 381 381 382 382 static int icmp_parameter_problem_msg_local(int icmp_phone, icmp_code_t code, 383 icmp_param_t pointer, packet_t packet)383 icmp_param_t pointer, packet_t *packet) 384 384 { 385 385 icmp_header_t *header; … … 479 479 * @param[in] code The received reply message code. 480 480 */ 481 static void icmp_process_echo_reply(packet_t packet, icmp_header_t *header,481 static void icmp_process_echo_reply(packet_t *packet, icmp_header_t *header, 482 482 icmp_type_t type, icmp_code_t code) 483 483 { … … 518 518 * ip_client_process_packet() function. 519 519 */ 520 static int icmp_process_packet(packet_t packet, services_t error)520 static int icmp_process_packet(packet_t *packet, services_t error) 521 521 { 522 522 size_t length; … … 658 658 * icmp_process_packet() function. 659 659 */ 660 static int icmp_received_msg_local(device_id_t device_id, packet_t packet,660 static int icmp_received_msg_local(device_id_t device_id, packet_t *packet, 661 661 services_t receiver, services_t error) 662 662 { … … 690 690 static int icmp_process_message(ipc_call_t *call) 691 691 { 692 packet_t packet;692 packet_t *packet; 693 693 int rc; 694 694 … … 896 896 ipc_call_t *answer, int *answer_count) 897 897 { 898 packet_t packet;898 packet_t *packet; 899 899 int rc; 900 900 -
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)); -
uspace/srv/net/tl/tcp/tcp.h
rfdbc3ff r46d4d9f 239 239 * Packets metric is set as their data length. 240 240 */ 241 packet_t incoming;241 packet_t *incoming; 242 242 243 243 /** Outgoing packet queue. … … 249 249 * Packets metric is set as their data length. 250 250 */ 251 packet_t outgoing;251 packet_t *outgoing; 252 252 253 253 /** IP pseudo header. */ -
uspace/srv/net/tl/udp/udp.c
rfdbc3ff r46d4d9f 190 190 * @return The result parameter. 191 191 */ 192 static int udp_release_and_return(packet_t packet, int result)192 static int udp_release_and_return(packet_t *packet, int result) 193 193 { 194 194 pq_release_remote(udp_globals.net_phone, packet_get_id(packet)); … … 217 217 * ip_client_process_packet() function. 218 218 */ 219 static int udp_process_packet(device_id_t device_id, packet_t packet,219 static int udp_process_packet(device_id_t device_id, packet_t *packet, 220 220 services_t error) 221 221 { … … 225 225 udp_header_t *header; 226 226 socket_core_t *socket; 227 packet_t next_packet;227 packet_t *next_packet; 228 228 size_t total_length; 229 229 uint32_t checksum; 230 230 int fragments; 231 packet_t tmp_packet;231 packet_t *tmp_packet; 232 232 icmp_type_t type; 233 233 icmp_code_t code; … … 413 413 * udp_process_packet() function. 414 414 */ 415 static int udp_received_msg(device_id_t device_id, packet_t packet,415 static int udp_received_msg(device_id_t device_id, packet_t *packet, 416 416 services_t receiver, services_t error) 417 417 { … … 458 458 { 459 459 socket_core_t *socket; 460 packet_t packet;461 packet_t next_packet;460 packet_t *packet; 461 packet_t *next_packet; 462 462 udp_header_t *header; 463 463 int index; … … 614 614 socket_core_t *socket; 615 615 int packet_id; 616 packet_t packet;616 packet_t *packet; 617 617 udp_header_t *header; 618 618 struct sockaddr *addr; … … 861 861 ipc_call_t *answer, int *answer_count) 862 862 { 863 packet_t packet;863 packet_t *packet; 864 864 int rc; 865 865
Note:
See TracChangeset
for help on using the changeset viewer.
