Changes in uspace/srv/net/tl/tcp/tcp.c [79ae36dd:28a3e74] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp.c
r79ae36dd r28a3e74 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <async_obsolete.h>41 40 #include <fibril_synch.h> 42 41 #include <malloc.h> … … 73 72 #include "tcp.h" 74 73 #include "tcp_header.h" 75 76 // FIXME: remove this header77 #include <kernel/ipc/ipc_methods.h>78 74 79 75 /** TCP module name. */ … … 480 476 old_incoming = socket_data->next_incoming; 481 477 482 if ( GET_TCP_HEADER_FINALIZE(header)) {478 if (header->finalize) { 483 479 socket_data->fin_incoming = new_sequence_number + 484 480 total_length - TCP_HEADER_LENGTH(header); … … 803 799 804 800 /* Notify the destination socket */ 805 async_ obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED,801 async_msg_5(socket->phone, NET_SOCKET_RECEIVED, 806 802 (sysarg_t) socket->socket_id, 807 803 ((packet_dimension->content < socket_data->data_fragment_size) ? … … 824 820 825 821 /* Notify the destination socket */ 826 async_ obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED,822 async_msg_5(socket->phone, NET_SOCKET_RECEIVED, 827 823 (sysarg_t) socket->socket_id, 828 824 0, 0, 0, … … 842 838 assert(packet); 843 839 844 if (! GET_TCP_HEADER_SYNCHRONIZE(header))840 if (!header->synchronize) 845 841 return tcp_release_and_return(packet, EINVAL); 846 842 … … 907 903 assert(packet); 908 904 909 if (! GET_TCP_HEADER_SYNCHRONIZE(header))905 if (!header->synchronize) 910 906 return tcp_release_and_return(packet, EINVAL); 911 907 … … 1061 1057 assert(packet); 1062 1058 1063 if (! GET_TCP_HEADER_ACKNOWLEDGE(header))1059 if (!header->acknowledge) 1064 1060 return tcp_release_and_return(packet, EINVAL); 1065 1061 … … 1082 1078 if (rc == EOK) { 1083 1079 /* Notify the destination socket */ 1084 async_ obsolete_msg_5(socket->phone, NET_SOCKET_ACCEPTED,1080 async_msg_5(socket->phone, NET_SOCKET_ACCEPTED, 1085 1081 (sysarg_t) listening_socket->socket_id, 1086 1082 socket_data->data_fragment_size, TCP_HEADER_SIZE, … … 1130 1126 assert(header); 1131 1127 1132 if (! GET_TCP_HEADER_ACKNOWLEDGE(header))1128 if (!header->acknowledge) 1133 1129 return; 1134 1130 … … 1273 1269 { 1274 1270 int res; 1271 bool keep_on_going = true; 1275 1272 socket_cores_t local_sockets; 1276 1273 int app_phone = IPC_GET_PHONE(call); … … 1296 1293 fibril_rwlock_initialize(&lock); 1297 1294 1298 while ( true) {1295 while (keep_on_going) { 1299 1296 1300 1297 /* Answer the call */ … … 1304 1301 /* Get the next call */ 1305 1302 callid = async_get_call(&call); 1306 1307 if (!IPC_GET_IMETHOD(call)) { 1303 1304 /* Process the call */ 1305 switch (IPC_GET_IMETHOD(call)) { 1306 case IPC_M_PHONE_HUNGUP: 1307 keep_on_going = false; 1308 1308 res = EHANGUP; 1309 1309 break; 1310 } 1311 1312 /* Process the call */ 1313 switch (IPC_GET_IMETHOD(call)) { 1310 1314 1311 case NET_SOCKET: 1315 1312 socket_data = … … 1509 1506 1510 1507 /* Release the application phone */ 1511 async_ obsolete_hangup(app_phone);1508 async_hangup(app_phone); 1512 1509 1513 1510 printf("release\n"); … … 1836 1833 1837 1834 /* Remember the outgoing FIN */ 1838 if ( GET_TCP_HEADER_FINALIZE(header))1835 if (header->finalize) 1839 1836 socket_data->fin_outgoing = socket_data->next_outgoing; 1840 1837 … … 1955 1952 header->acknowledgement_number = 1956 1953 htonl(socket_data->next_incoming); 1957 SET_TCP_HEADER_ACKNOWLEDGE(header, 1);1954 header->acknowledge = 1; 1958 1955 } 1959 1956 header->window = htons(socket_data->window); … … 2027 2024 header->source_port = htons(socket->port); 2028 2025 header->source_port = htons(socket_data->dest_port); 2029 SET_TCP_HEADER_LENGTH(header, 2030 TCP_COMPUTE_HEADER_LENGTH(sizeof(*header))); 2031 SET_TCP_HEADER_SYNCHRONIZE(header, synchronize); 2032 SET_TCP_HEADER_FINALIZE(header, finalize); 2026 header->header_length = TCP_COMPUTE_HEADER_LENGTH(sizeof(*header)); 2027 header->synchronize = synchronize; 2028 header->finalize = finalize; 2033 2029 } 2034 2030
Note:
See TracChangeset
for help on using the changeset viewer.