Changeset 41811af in mainline for uspace/srv/net/tl/tcp/tcp.c
- Timestamp:
- 2011-06-10T10:14:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab547063
- Parents:
- 9536e6e (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp.c
r9536e6e r41811af 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <async_obsolete.h> 40 41 #include <fibril_synch.h> 41 42 #include <malloc.h> … … 72 73 #include "tcp.h" 73 74 #include "tcp_header.h" 75 76 // FIXME: remove this header 77 #include <kernel/ipc/ipc_methods.h> 74 78 75 79 /** TCP module name. */ … … 476 480 old_incoming = socket_data->next_incoming; 477 481 478 if ( header->finalize) {482 if (GET_TCP_HEADER_FINALIZE(header)) { 479 483 socket_data->fin_incoming = new_sequence_number + 480 484 total_length - TCP_HEADER_LENGTH(header); … … 799 803 800 804 /* Notify the destination socket */ 801 async_ msg_5(socket->phone, NET_SOCKET_RECEIVED,805 async_obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED, 802 806 (sysarg_t) socket->socket_id, 803 807 ((packet_dimension->content < socket_data->data_fragment_size) ? … … 820 824 821 825 /* Notify the destination socket */ 822 async_ msg_5(socket->phone, NET_SOCKET_RECEIVED,826 async_obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED, 823 827 (sysarg_t) socket->socket_id, 824 828 0, 0, 0, … … 838 842 assert(packet); 839 843 840 if (! header->synchronize)844 if (!GET_TCP_HEADER_SYNCHRONIZE(header)) 841 845 return tcp_release_and_return(packet, EINVAL); 842 846 … … 903 907 assert(packet); 904 908 905 if (! header->synchronize)909 if (!GET_TCP_HEADER_SYNCHRONIZE(header)) 906 910 return tcp_release_and_return(packet, EINVAL); 907 911 … … 1057 1061 assert(packet); 1058 1062 1059 if (! header->acknowledge)1063 if (!GET_TCP_HEADER_ACKNOWLEDGE(header)) 1060 1064 return tcp_release_and_return(packet, EINVAL); 1061 1065 … … 1078 1082 if (rc == EOK) { 1079 1083 /* Notify the destination socket */ 1080 async_ msg_5(socket->phone, NET_SOCKET_ACCEPTED,1084 async_obsolete_msg_5(socket->phone, NET_SOCKET_ACCEPTED, 1081 1085 (sysarg_t) listening_socket->socket_id, 1082 1086 socket_data->data_fragment_size, TCP_HEADER_SIZE, … … 1126 1130 assert(header); 1127 1131 1128 if (! header->acknowledge)1132 if (!GET_TCP_HEADER_ACKNOWLEDGE(header)) 1129 1133 return; 1130 1134 … … 1269 1273 { 1270 1274 int res; 1271 bool keep_on_going = true;1272 1275 socket_cores_t local_sockets; 1273 1276 int app_phone = IPC_GET_PHONE(call); … … 1293 1296 fibril_rwlock_initialize(&lock); 1294 1297 1295 while ( keep_on_going) {1298 while (true) { 1296 1299 1297 1300 /* Answer the call */ … … 1301 1304 /* Get the next call */ 1302 1305 callid = async_get_call(&call); 1306 1307 if (!IPC_GET_IMETHOD(call)) { 1308 res = EHANGUP; 1309 break; 1310 } 1303 1311 1304 1312 /* Process the call */ 1305 1313 switch (IPC_GET_IMETHOD(call)) { 1306 case IPC_M_PHONE_HUNGUP:1307 keep_on_going = false;1308 res = EHANGUP;1309 break;1310 1311 1314 case NET_SOCKET: 1312 1315 socket_data = … … 1506 1509 1507 1510 /* Release the application phone */ 1508 async_ hangup(app_phone);1511 async_obsolete_hangup(app_phone); 1509 1512 1510 1513 printf("release\n"); … … 1833 1836 1834 1837 /* Remember the outgoing FIN */ 1835 if ( header->finalize)1838 if (GET_TCP_HEADER_FINALIZE(header)) 1836 1839 socket_data->fin_outgoing = socket_data->next_outgoing; 1837 1840 … … 1952 1955 header->acknowledgement_number = 1953 1956 htonl(socket_data->next_incoming); 1954 header->acknowledge = 1;1957 SET_TCP_HEADER_ACKNOWLEDGE(header, 1); 1955 1958 } 1956 1959 header->window = htons(socket_data->window); … … 2024 2027 header->source_port = htons(socket->port); 2025 2028 header->source_port = htons(socket_data->dest_port); 2026 header->header_length = TCP_COMPUTE_HEADER_LENGTH(sizeof(*header)); 2027 header->synchronize = synchronize; 2028 header->finalize = finalize; 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); 2029 2033 } 2030 2034
Note:
See TracChangeset
for help on using the changeset viewer.