Changeset 46d4d9f in mainline for uspace/srv/net/tl/tcp/tcp.c


Ignore:
Timestamp:
2010-11-20T17:04:59Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd5046dd
Parents:
fdbc3ff
Message:

Redefine packet_t to be just a type alias for struct packet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/tcp/tcp.c

    rfdbc3ff r46d4d9f  
    160160};
    161161
    162 static int tcp_release_and_return(packet_t, int);
     162static int tcp_release_and_return(packet_t *, int);
    163163static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *,
    164164    tcp_header_t *, int synchronize, int);
     
    171171static int tcp_release_after_timeout(void *);
    172172
    173 static int tcp_process_packet(device_id_t, packet_t, services_t);
     173static int tcp_process_packet(device_id_t, packet_t *, services_t);
    174174static int tcp_connect_core(socket_core_t *, socket_cores_t *,
    175175    struct sockaddr *, socklen_t);
    176176static 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);
     178static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t *,
    179179    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);
     180static packet_t *tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *);
     181static void tcp_send_packets(device_id_t, packet_t *);
    182182
    183183static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *,
    184184    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);
     185static packet_t *tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *,
     186    packet_t *, size_t, size_t);
     187static packet_t *tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *,
     188    packet_t *, size_t, size_t);
    189189/* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *,
    190190    size_t);
    191 static int tcp_create_notification_packet(packet_t *, socket_core_t *,
     191static int tcp_create_notification_packet(packet_t **, socket_core_t *,
    192192    tcp_socket_data_t *, int, int);
    193193static void tcp_refresh_socket_data(tcp_socket_data_t *);
     
    196196
    197197static 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);
    199199static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *,
    200     tcp_header_t *, packet_t);
     200    tcp_header_t *, packet_t *);
    201201static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *,
    202     tcp_header_t *, packet_t);
     202    tcp_header_t *, packet_t *);
    203203static 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);
    205205static 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
     208static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t);
    209209static int tcp_process_client_messages(ipc_callid_t, ipc_call_t);
    210210
     
    262262}
    263263
    264 int tcp_received_msg(device_id_t device_id, packet_t packet,
     264int tcp_received_msg(device_id_t device_id, packet_t *packet,
    265265    services_t receiver, services_t error)
    266266{
     
    280280}
    281281
    282 int tcp_process_packet(device_id_t device_id, packet_t packet, services_t error)
     282int tcp_process_packet(device_id_t device_id, packet_t *packet, services_t error)
    283283{
    284284        size_t length;
     
    288288        socket_core_t *socket;
    289289        tcp_socket_data_t *socket_data;
    290         packet_t next_packet;
     290        packet_t *next_packet;
    291291        size_t total_length;
    292292        uint32_t checksum;
     
    493493
    494494int 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,
    496496    size_t total_length)
    497497{
    498         packet_t next_packet;
    499         packet_t tmp_packet;
     498        packet_t *next_packet;
     499        packet_t *tmp_packet;
    500500        uint32_t old_incoming;
    501501        size_t order;
     
    801801
    802802int 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,
    804804    size_t total_length)
    805805{
     
    838838
    839839int 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;
    843843        int rc;
    844844
     
    897897int tcp_process_listen(socket_core_t *listening_socket,
    898898    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,
    900900    size_t addrlen)
    901901{
    902         packet_t next_packet;
     902        packet_t *next_packet;
    903903        socket_core_t *socket;
    904904        tcp_socket_data_t *socket_data;
     
    10561056
    10571057int 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)
    10591059{
    10601060        socket_core_t *listening_socket;
     
    11271127        size_t number;
    11281128        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;
    11321132        uint32_t old;
    11331133
     
    12321232    ipc_call_t *answer, int *answer_count)
    12331233{
    1234         packet_t packet;
     1234        packet_t *packet;
    12351235        int rc;
    12361236
     
    16541654    socket_data, size_t sequence_number)
    16551655{
    1656         packet_t packet;
    1657         packet_t copy;
     1656        packet_t *packet;
     1657        packet_t *copy;
    16581658        size_t data_length;
    16591659
     
    17361736{
    17371737        tcp_socket_data_t *socket_data;
    1738         packet_t packet;
     1738        packet_t *packet;
    17391739        int rc;
    17401740
     
    18241824
    18251825int 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)
    18271827{
    18281828        tcp_header_t *header;
     
    18551855
    18561856int 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)
    18581858{
    18591859        int rc;
     
    18761876}
    18771877
    1878 packet_t tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
     1878packet_t *tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
    18791879    socket_data)
    18801880{
    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;
    18851885        size_t data_length;
    18861886        int rc;
     
    19361936}
    19371937
    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)
     1938packet_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)
    19401940{
    19411941        tcp_header_t *header;
     
    19971997}
    19981998
    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;
     1999packet_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;
    20032003
    20042004        assert(socket);
     
    20152015}
    20162016
    2017 void tcp_send_packets(device_id_t device_id, packet_t packet)
    2018 {
    2019         packet_t next;
     2017void tcp_send_packets(device_id_t device_id, packet_t *packet)
     2018{
     2019        packet_t *next;
    20202020
    20212021        while (packet) {
     
    20972097        tcp_socket_data_t *socket_data;
    20982098        int packet_id;
    2099         packet_t packet;
     2099        packet_t *packet;
    21002100        size_t length;
    21012101        int rc;
     
    21552155        tcp_socket_data_t *socket_data;
    21562156        packet_dimension_t *packet_dimension;
    2157         packet_t packet;
     2157        packet_t *packet;
    21582158        size_t total_length;
    21592159        tcp_header_t *header;
     
    22292229        socket_core_t *socket;
    22302230        tcp_socket_data_t *socket_data;
    2231         packet_t packet;
     2231        packet_t *packet;
    22322232        int rc;
    22332233
     
    22932293}
    22942294
    2295 int tcp_create_notification_packet(packet_t *packet, socket_core_t *socket,
     2295int tcp_create_notification_packet(packet_t **packet, socket_core_t *socket,
    22962296    tcp_socket_data_t *socket_data, int synchronize, int finalize)
    22972297{
     
    24422442 * @return              The result parameter.
    24432443 */
    2444 int tcp_release_and_return(packet_t packet, int result)
     2444int tcp_release_and_return(packet_t *packet, int result)
    24452445{
    24462446        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
Note: See TracChangeset for help on using the changeset viewer.