Changeset 6b82009 in mainline for uspace/lib/c
- Timestamp:
- 2011-06-22T20:41:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ef09a7a
- Parents:
- 55091847
- Location:
- uspace/lib/c
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/measured_strings.c
r55091847 r6b82009 42 42 #include <errno.h> 43 43 #include <async.h> 44 #include <async_obsolete.h>45 44 46 45 /** Creates a new measured string bundled with a copy of the given string … … 298 297 * size has to be negotiated in advance. 299 298 * 300 * @param[in] phone The other module phone.299 * @param[in] exch Exchange. 301 300 * @param[out] strings The returned measured strings array. 302 301 * @param[out] data The measured strings data. This memory block stores the … … 305 304 * @return EOK on success. 306 305 * @return EINVAL if the strings or data parameter is NULL. 307 * @return EINVAL if the phone or count parameter is not positive.306 * @return EINVAL if the exch or count parameter is invalid. 308 307 * @return EINVAL if the sent array differs in size. 309 308 * @return ENOMEM if there is not enough memory left. … … 311 310 * async_data_read_start() function. 312 311 */ 313 int 314 measured_strings_return(int phone, measured_string_t **strings, uint8_t **data, 315 size_t count) 312 int measured_strings_return(async_exch_t *exch, measured_string_t **strings, 313 uint8_t **data, size_t count) 316 314 { 317 315 size_t *lengths; … … 320 318 int rc; 321 319 322 if (( phone < 0) || (!strings) || (!data) || (count <= 0))320 if ((exch == NULL) || (!strings) || (!data) || (count <= 0)) 323 321 return EINVAL; 324 322 … … 327 325 return ENOMEM; 328 326 329 rc = async_ obsolete_data_read_start(phone, lengths,327 rc = async_data_read_start(exch, lengths, 330 328 sizeof(size_t) * (count + 1)); 331 329 if (rc != EOK) { … … 352 350 (*strings)[index].length = lengths[index]; 353 351 if (lengths[index] > 0) { 354 rc = async_ obsolete_data_read_start(phone, next, lengths[index]);352 rc = async_data_read_start(exch, next, lengths[index]); 355 353 if (rc != EOK) { 356 354 free(lengths); … … 376 374 * size has to be negotiated in advance. 377 375 * 378 * @param[in] phone The other module phone.376 * @param[in] exch Exchange. 379 377 * @param[in] strings The measured strings array to be transferred. 380 378 * @param[in] count The measured strings array size. 381 379 * @return EOK on success. 382 380 * @return EINVAL if the strings parameter is NULL. 383 * @return EINVAL if the phone or count parameter is not positive.381 * @return EINVAL if the exch or count parameter is invalid. 384 382 * @return Other error codes as defined for the 385 383 * async_data_write_start() function. 386 384 */ 387 int 388 measured_strings_send(int phone, const measured_string_t *strings, 385 int measured_strings_send(async_exch_t *exch, const measured_string_t *strings, 389 386 size_t count) 390 387 { … … 393 390 int rc; 394 391 395 if (( phone < 0) || (!strings) || (count <= 0))392 if ((exch == NULL) || (!strings) || (count <= 0)) 396 393 return EINVAL; 397 394 … … 400 397 return ENOMEM; 401 398 402 rc = async_ obsolete_data_write_start(phone, lengths,399 rc = async_data_write_start(exch, lengths, 403 400 sizeof(size_t) * (count + 1)); 404 401 if (rc != EOK) { … … 411 408 for (index = 0; index < count; index++) { 412 409 if (strings[index].length > 0) { 413 rc = async_ obsolete_data_write_start(phone, strings[index].value,410 rc = async_data_write_start(exch, strings[index].value, 414 411 strings[index].length); 415 412 if (rc != EOK) … … 423 420 /** @} 424 421 */ 425 -
uspace/lib/c/generic/net/icmp_api.c
r55091847 r6b82009 42 42 #include <net/ip_codes.h> 43 43 #include <async.h> 44 #include <async_obsolete.h>45 44 #include <sys/types.h> 46 45 #include <sys/time.h> … … 55 54 * timeout occurs. 56 55 * 57 * @param[in] icmp_phone The ICMP module phone used for (semi)remote calls.56 * @param[in] sess The ICMP session. 58 57 * @param[in] size The message data length in bytes. 59 58 * @param[in] timeout The timeout in milliseconds. … … 74 73 */ 75 74 int 76 icmp_echo_msg( int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl,75 icmp_echo_msg(async_sess_t *sess, size_t size, mseconds_t timeout, ip_ttl_t ttl, 77 76 ip_tos_t tos, int dont_fragment, const struct sockaddr *addr, 78 77 socklen_t addrlen) … … 83 82 if (addrlen <= 0) 84 83 return EINVAL; 85 86 message_id = async_obsolete_send_5(icmp_phone, NET_ICMP_ECHO, size, timeout, ttl, 84 85 async_exch_t *exch = async_exchange_begin(sess); 86 87 message_id = async_send_5(exch, NET_ICMP_ECHO, size, timeout, ttl, 87 88 tos, (sysarg_t) dont_fragment, NULL); 88 89 89 90 /* Send the address */ 90 async_obsolete_data_write_start(icmp_phone, addr, (size_t) addrlen); 91 async_data_write_start(exch, addr, (size_t) addrlen); 92 93 async_exchange_end(exch); 91 94 92 95 async_wait_for(message_id, &result); -
uspace/lib/c/generic/net/icmp_common.c
r55091847 r6b82009 45 45 /** Connect to the ICMP module. 46 46 * 47 * @return ICMP module phone on success.47 * @return ICMP module session. 48 48 * 49 49 */ 50 inticmp_connect_module(void)50 async_sess_t *icmp_connect_module(void) 51 51 { 52 52 return connect_to_service(SERVICE_ICMP); -
uspace/lib/c/generic/net/modules.c
r55091847 r6b82009 40 40 41 41 #include <async.h> 42 #include <async_obsolete.h>43 42 #include <malloc.h> 44 43 #include <errno.h> … … 47 46 #include <net/modules.h> 48 47 #include <ns.h> 49 #include <ns_obsolete.h>50 51 /** The time between connect requests in microseconds. */52 #define MODULE_WAIT_TIME (10 * 1000)53 48 54 49 /** Answer a call. … … 98 93 } 99 94 100 /** Create bidirectional connection with the needed module service and register s95 /** Create bidirectional connection with the needed module service and register 101 96 * the message receiver. 102 97 * 103 * @param[in] need The needed module service. 104 * @param[in] arg1 The first parameter. 105 * @param[in] arg2 The second parameter. 106 * @param[in] arg3 The third parameter. 107 * @param[in] client_receiver The message receiver. 108 * 109 * @return The phone of the needed service. 110 * @return Other error codes as defined for the ipc_connect_to_me() 111 * function. 112 */ 113 int bind_service(services_t need, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, 114 async_client_conn_t client_receiver) 98 * @param[in] need Needed module service. 99 * @param[in] arg1 First parameter. 100 * @param[in] arg2 Second parameter. 101 * @param[in] arg3 Third parameter. 102 * @param[in] client_receiver Message receiver. 103 * 104 * @return Session to the needed service. 105 * @return Other error codes as defined for the async_connect_to_me() 106 * function. 107 * 108 */ 109 async_sess_t *bind_service(services_t need, sysarg_t arg1, sysarg_t arg2, 110 sysarg_t arg3, async_client_conn_t client_receiver) 115 111 { 116 112 /* Connect to the needed service */ 117 int phone= connect_to_service(need);118 if ( phone >= 0) {113 async_sess_t *sess = connect_to_service(need); 114 if (sess != NULL) { 119 115 /* Request the bidirectional connection */ 120 int rc = async_obsolete_connect_to_me(phone, arg1, arg2, arg3, 116 async_exch_t *exch = async_exchange_begin(sess); 117 int rc = async_connect_to_me(exch, arg1, arg2, arg3, 121 118 client_receiver, NULL); 119 async_exchange_end(exch); 120 122 121 if (rc != EOK) { 123 async_obsolete_hangup(phone); 124 return rc; 122 async_hangup(sess); 123 errno = rc; 124 return NULL; 125 125 } 126 126 } 127 127 128 return phone; 129 } 130 131 /** Connects to the needed module. 132 * 133 * @param[in] need The needed module service. 134 * @return The phone of the needed service. 135 */ 136 int connect_to_service(services_t need) 137 { 138 return service_obsolete_connect_blocking(need, 0, 0); 139 } 140 141 /** Replies the data to the other party. 142 * 143 * @param[in] data The data buffer to be sent. 128 return sess; 129 } 130 131 /** Connect to the needed module. 132 * 133 * @param[in] need Needed module service. 134 * 135 * @return Session to the needed service. 136 * @return NULL if the connection timeouted. 137 * 138 */ 139 async_sess_t *connect_to_service(services_t need) 140 { 141 return service_connect_blocking(EXCHANGE_SERIALIZE, need, 0, 0); 142 } 143 144 /** Reply the data to the other party. 145 * 146 * @param[in] data The data buffer to be sent. 144 147 * @param[in] data_length The buffer length. 145 * @return EOK on success. 146 * @return EINVAL if the client does not expect the data. 147 * @return EOVERFLOW if the client does not expect all the data. 148 * Only partial data are transfered. 149 * @return Other error codes as defined for the 150 * async_data_read_finalize() function. 148 * 149 * @return EOK on success. 150 * @return EINVAL if the client does not expect the data. 151 * @return EOVERFLOW if the client does not expect all the data. 152 * Only partial data are transfered. 153 * @return Other error codes as defined for the 154 * async_data_read_finalize() function. 155 * 151 156 */ 152 157 int data_reply(void *data, size_t data_length) … … 154 159 size_t length; 155 160 ipc_callid_t callid; 156 161 157 162 /* Fetch the request */ 158 163 if (!async_data_read_receive(&callid, &length)) 159 164 return EINVAL; 160 165 161 166 /* Check the requested data size */ 162 167 if (length < data_length) { … … 164 169 return EOVERFLOW; 165 170 } 166 171 167 172 /* Send the data */ 168 173 return async_data_read_finalize(callid, data, data_length); -
uspace/lib/c/generic/net/socket_client.c
r55091847 r6b82009 39 39 #include <assert.h> 40 40 #include <async.h> 41 #include <async_obsolete.h>42 41 #include <fibril_synch.h> 43 42 #include <stdint.h> … … 84 83 /** Socket identifier. */ 85 84 int socket_id; 86 /** Parent module phone. */87 int phone;85 /** Parent module session. */ 86 async_sess_t *sess; 88 87 /** Parent module service. */ 89 88 services_t service; … … 144 143 /** Socket client library global data. */ 145 144 static struct socket_client_globals { 146 /** TCP module phone. */ 147 int tcp_phone; 148 /** UDP module phone. */ 149 int udp_phone; 150 151 // /** The last socket identifier. 152 // */ 153 // int last_id; 145 /** TCP module session. */ 146 async_sess_t *tcp_sess; 147 /** UDP module session. */ 148 async_sess_t *udp_sess; 154 149 155 150 /** Active sockets. */ … … 164 159 fibril_rwlock_t lock; 165 160 } socket_globals = { 166 .tcp_phone = -1, 167 .udp_phone = -1, 168 // .last_id = 0, 161 .tcp_sess = NULL, 162 .udp_sess = NULL, 169 163 .sockets = NULL, 170 164 .lock = FIBRIL_RWLOCK_INITIALIZER(socket_globals.lock) … … 280 274 } 281 275 282 /** Returns the TCP module phone. 283 * 284 * Connects to the TCP module if necessary. 285 * 286 * @return The TCP module phone. 287 * @return Other error codes as defined for the 288 * bind_service() function. 289 */ 290 static int socket_get_tcp_phone(void) 291 { 292 if (socket_globals.tcp_phone < 0) { 293 socket_globals.tcp_phone = bind_service(SERVICE_TCP, 276 /** Return the TCP module session. 277 * 278 * Connect to the TCP module if necessary. 279 * 280 * @return The TCP module session. 281 * 282 */ 283 static async_sess_t *socket_get_tcp_sess(void) 284 { 285 if (socket_globals.tcp_sess == NULL) { 286 socket_globals.tcp_sess = bind_service(SERVICE_TCP, 294 287 0, 0, SERVICE_TCP, socket_connection); 295 288 } 296 289 297 return socket_globals.tcp_phone; 298 } 299 300 /** Returns the UDP module phone. 301 * 302 * Connects to the UDP module if necessary. 303 * 304 * @return The UDP module phone. 305 * @return Other error codes as defined for the 306 * bind_service() function. 307 */ 308 static int socket_get_udp_phone(void) 309 { 310 if (socket_globals.udp_phone < 0) { 311 socket_globals.udp_phone = bind_service(SERVICE_UDP, 290 return socket_globals.tcp_sess; 291 } 292 293 /** Return the UDP module session. 294 * 295 * Connect to the UDP module if necessary. 296 * 297 * @return The UDP module session. 298 * 299 */ 300 static async_sess_t *socket_get_udp_sess(void) 301 { 302 if (socket_globals.udp_sess == NULL) { 303 socket_globals.udp_sess = bind_service(SERVICE_UDP, 312 304 0, 0, SERVICE_UDP, socket_connection); 313 305 } 314 306 315 return socket_globals.udp_ phone;307 return socket_globals.udp_sess; 316 308 } 317 309 … … 329 321 sockets = socket_get_sockets(); 330 322 count = 0; 331 // socket_id = socket_globals.last_id;332 323 333 324 do { … … 342 333 if (socket_id < INT_MAX) { 343 334 ++socket_id; 344 /* } else if(socket_globals.last_id) { 345 * socket_globals.last_id = 0; 346 * socket_id = 1; 347 */ } else { 335 } else { 348 336 return ELIMIT; 349 337 } 350 338 } 351 339 } while (sockets_find(sockets, socket_id)); 352 353 // last_id = socket_id 340 354 341 return socket_id; 355 342 } … … 358 345 * 359 346 * @param[in,out] socket The socket to be initialized. 360 * @param[in] socket_id The new socket identifier. 361 * @param[in] phone The parent module phone. 362 * @param[in] service The parent module service. 363 */ 364 static void 365 socket_initialize(socket_t *socket, int socket_id, int phone, 366 services_t service) 347 * @param[in] socket_id The new socket identifier. 348 * @param[in] sess The parent module session. 349 * @param[in] service The parent module service. 350 */ 351 static void socket_initialize(socket_t *socket, int socket_id, 352 async_sess_t *sess, services_t service) 367 353 { 368 354 socket->socket_id = socket_id; 369 socket-> phone = phone;355 socket->sess = sess; 370 356 socket->service = service; 371 357 dyn_fifo_initialize(&socket->received, SOCKET_INITIAL_RECEIVED_SIZE); … … 397 383 { 398 384 socket_t *socket; 399 int phone;385 async_sess_t *sess; 400 386 int socket_id; 401 387 services_t service; … … 414 400 switch (protocol) { 415 401 case IPPROTO_TCP: 416 phone = socket_get_tcp_phone();402 sess = socket_get_tcp_sess(); 417 403 service = SERVICE_TCP; 418 404 break; … … 429 415 switch (protocol) { 430 416 case IPPROTO_UDP: 431 phone = socket_get_udp_phone();417 sess = socket_get_udp_sess(); 432 418 service = SERVICE_UDP; 433 419 break; … … 450 436 } 451 437 452 if ( phone < 0)453 return phone;438 if (sess == NULL) 439 return ENOENT; 454 440 455 441 /* Create a new socket structure */ … … 468 454 return socket_id; 469 455 } 470 471 rc = (int) async_obsolete_req_3_3(phone, NET_SOCKET, socket_id, 0, service, NULL, 456 457 async_exch_t *exch = async_exchange_begin(sess); 458 rc = (int) async_req_3_3(exch, NET_SOCKET, socket_id, 0, service, NULL, 472 459 &fragment_size, &header_size); 460 async_exchange_end(exch); 461 473 462 if (rc != EOK) { 474 463 fibril_rwlock_write_unlock(&socket_globals.lock); … … 481 470 482 471 /* Finish the new socket initialization */ 483 socket_initialize(socket, socket_id, phone, service);472 socket_initialize(socket, socket_id, sess, service); 484 473 /* Store the new socket */ 485 474 rc = sockets_add(socket_get_sockets(), socket_id, socket); … … 490 479 dyn_fifo_destroy(&socket->accepted); 491 480 free(socket); 492 async_obsolete_msg_3(phone, NET_SOCKET_CLOSE, (sysarg_t) socket_id, 0, 481 482 exch = async_exchange_begin(sess); 483 async_msg_3(exch, NET_SOCKET_CLOSE, (sysarg_t) socket_id, 0, 493 484 service); 485 async_exchange_end(exch); 486 494 487 return rc; 495 488 } … … 535 528 536 529 /* Request the message */ 537 message_id = async_obsolete_send_3(socket->phone, message, 530 async_exch_t *exch = async_exchange_begin(socket->sess); 531 message_id = async_send_3(exch, message, 538 532 (sysarg_t) socket->socket_id, arg2, socket->service, NULL); 539 533 /* Send the address */ 540 async_obsolete_data_write_start(socket->phone, data, datalength); 534 async_data_write_start(exch, data, datalength); 535 async_exchange_end(exch); 541 536 542 537 fibril_rwlock_read_unlock(&socket_globals.lock); … … 595 590 596 591 /* Request listen backlog change */ 597 result = (int) async_obsolete_req_3_0(socket->phone, NET_SOCKET_LISTEN, 592 async_exch_t *exch = async_exchange_begin(socket->sess); 593 result = (int) async_req_3_0(exch, NET_SOCKET_LISTEN, 598 594 (sysarg_t) socket->socket_id, (sysarg_t) backlog, socket->service); 595 async_exchange_end(exch); 599 596 600 597 fibril_rwlock_read_unlock(&socket_globals.lock); … … 666 663 return socket_id; 667 664 } 668 socket_initialize(new_socket, socket_id, socket-> phone,665 socket_initialize(new_socket, socket_id, socket->sess, 669 666 socket->service); 670 667 result = sockets_add(socket_get_sockets(), new_socket->socket_id, … … 678 675 679 676 /* Request accept */ 680 message_id = async_obsolete_send_5(socket->phone, NET_SOCKET_ACCEPT, 677 async_exch_t *exch = async_exchange_begin(socket->sess); 678 message_id = async_send_5(exch, NET_SOCKET_ACCEPT, 681 679 (sysarg_t) socket->socket_id, 0, socket->service, 0, 682 680 new_socket->socket_id, &answer); 683 681 684 682 /* Read address */ 685 async_obsolete_data_read_start(socket->phone, cliaddr, *addrlen); 683 async_data_read_start(exch, cliaddr, *addrlen); 684 async_exchange_end(exch); 685 686 686 fibril_rwlock_write_unlock(&socket_globals.lock); 687 687 async_wait_for(message_id, &ipc_result); … … 777 777 778 778 /* Request close */ 779 rc = (int) async_obsolete_req_3_0(socket->phone, NET_SOCKET_CLOSE, 779 async_exch_t *exch = async_exchange_begin(socket->sess); 780 rc = (int) async_req_3_0(exch, NET_SOCKET_CLOSE, 780 781 (sysarg_t) socket->socket_id, 0, socket->service); 782 async_exchange_end(exch); 783 781 784 if (rc != EOK) { 782 785 fibril_rwlock_write_unlock(&socket_globals.lock); … … 850 853 851 854 /* Request send */ 852 message_id = async_obsolete_send_5(socket->phone, message, 855 async_exch_t *exch = async_exchange_begin(socket->sess); 856 857 message_id = async_send_5(exch, message, 853 858 (sysarg_t) socket->socket_id, 854 859 (fragments == 1 ? datalength : socket->data_fragment_size), … … 857 862 /* Send the address if given */ 858 863 if (!toaddr || 859 (async_ obsolete_data_write_start(socket->phone, toaddr, addrlen) == EOK)) {864 (async_data_write_start(exch, toaddr, addrlen) == EOK)) { 860 865 if (fragments == 1) { 861 866 /* Send all if only one fragment */ 862 async_ obsolete_data_write_start(socket->phone, data, datalength);867 async_data_write_start(exch, data, datalength); 863 868 } else { 864 869 /* Send the first fragment */ 865 async_ obsolete_data_write_start(socket->phone, data,870 async_data_write_start(exch, data, 866 871 socket->data_fragment_size - socket->header_size); 867 872 data = ((const uint8_t *) data) + … … 870 875 /* Send the middle fragments */ 871 876 while (--fragments > 1) { 872 async_ obsolete_data_write_start(socket->phone, data,877 async_data_write_start(exch, data, 873 878 socket->data_fragment_size); 874 879 data = ((const uint8_t *) data) + … … 877 882 878 883 /* Send the last fragment */ 879 async_ obsolete_data_write_start(socket->phone, data,884 async_data_write_start(exch, data, 880 885 (datalength + socket->header_size) % 881 886 socket->data_fragment_size); 882 887 } 883 888 } 889 890 async_exchange_end(exch); 884 891 885 892 async_wait_for(message_id, &result); … … 1023 1030 return 0; 1024 1031 } 1032 1033 async_exch_t *exch = async_exchange_begin(socket->sess); 1025 1034 1026 1035 /* Prepare lengths if more fragments */ … … 1035 1044 1036 1045 /* Request packet data */ 1037 message_id = async_ obsolete_send_4(socket->phone, message,1046 message_id = async_send_4(exch, message, 1038 1047 (sysarg_t) socket->socket_id, 0, socket->service, 1039 1048 (sysarg_t) flags, &answer); … … 1041 1050 /* Read the address if desired */ 1042 1051 if(!fromaddr || 1043 (async_ obsolete_data_read_start(socket->phone, fromaddr,1052 (async_data_read_start(exch, fromaddr, 1044 1053 *addrlen) == EOK)) { 1045 1054 /* Read the fragment lengths */ 1046 if (async_ obsolete_data_read_start(socket->phone, lengths,1055 if (async_data_read_start(exch, lengths, 1047 1056 sizeof(int) * (fragments + 1)) == EOK) { 1048 1057 if (lengths[fragments] <= datalength) { … … 1051 1060 for (index = 0; index < fragments; 1052 1061 ++index) { 1053 async_obsolete_data_read_start( 1054 socket->phone, data, 1062 async_data_read_start(exch, data, 1055 1063 lengths[index]); 1056 1064 data = ((uint8_t *) data) + … … 1064 1072 } else { /* fragments == 1 */ 1065 1073 /* Request packet data */ 1066 message_id = async_ obsolete_send_4(socket->phone, message,1074 message_id = async_send_4(exch, message, 1067 1075 (sysarg_t) socket->socket_id, 0, socket->service, 1068 1076 (sysarg_t) flags, &answer); … … 1070 1078 /* Read the address if desired */ 1071 1079 if (!fromaddr || 1072 (async_obsolete_data_read_start(socket->phone, fromaddr, 1073 *addrlen) == EOK)) { 1080 (async_data_read_start(exch, fromaddr, *addrlen) == EOK)) { 1074 1081 /* Read all if only one fragment */ 1075 async_ obsolete_data_read_start(socket->phone, data, datalength);1082 async_data_read_start(exch, data, datalength); 1076 1083 } 1077 1084 } 1085 1086 async_exchange_end(exch); 1078 1087 1079 1088 async_wait_for(message_id, &ipc_result); … … 1187 1196 1188 1197 /* Request option value */ 1189 message_id = async_obsolete_send_3(socket->phone, NET_SOCKET_GETSOCKOPT, 1198 async_exch_t *exch = async_exchange_begin(socket->sess); 1199 1200 message_id = async_send_3(exch, NET_SOCKET_GETSOCKOPT, 1190 1201 (sysarg_t) socket->socket_id, (sysarg_t) optname, socket->service, 1191 1202 NULL); 1192 1203 1193 1204 /* Read the length */ 1194 if (async_ obsolete_data_read_start(socket->phone, optlen,1205 if (async_data_read_start(exch, optlen, 1195 1206 sizeof(*optlen)) == EOK) { 1196 1207 /* Read the value */ 1197 async_obsolete_data_read_start(socket->phone, value, *optlen); 1198 } 1208 async_data_read_start(exch, value, *optlen); 1209 } 1210 1211 async_exchange_end(exch); 1199 1212 1200 1213 fibril_rwlock_read_unlock(&socket_globals.lock); -
uspace/lib/c/include/adt/measured_strings.h
r55091847 r6b82009 41 41 42 42 #include <sys/types.h> 43 #include <async.h> 43 44 44 45 /** Type definition of the character string with measured length. … … 64 65 extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t); 65 66 extern int measured_strings_reply(const measured_string_t *, size_t); 66 extern int measured_strings_return(int, measured_string_t **, uint8_t **, size_t); 67 extern int measured_strings_send(int, const measured_string_t *, size_t); 67 68 extern int measured_strings_return(async_exch_t *, measured_string_t **, 69 uint8_t **, size_t); 70 extern int measured_strings_send(async_exch_t *, const measured_string_t *, 71 size_t); 68 72 69 73 #endif -
uspace/lib/c/include/ipc/net.h
r55091847 r6b82009 335 335 #define IPC_GET_ERROR(call) ((services_t) IPC_GET_ARG4(call)) 336 336 337 /** Return the phone message argument.338 *339 * @param[in] call Message call structure.340 *341 */342 #define IPC_GET_PHONE(call) ((int) IPC_GET_ARG5(call))343 344 337 /** Set the device identifier in the message answer. 345 338 * -
uspace/lib/c/include/net/icmp_api.h
r55091847 r6b82009 42 42 #include <sys/types.h> 43 43 #include <sys/time.h> 44 45 44 #include <adt/measured_strings.h> 46 45 #include <net/ip_codes.h> 47 46 #include <net/icmp_codes.h> 48 47 #include <net/icmp_common.h> 48 #include <async.h> 49 49 50 50 /** @name ICMP module application interface … … 53 53 /*@{*/ 54 54 55 extern int icmp_echo_msg( int, size_t, mseconds_t, ip_ttl_t, ip_tos_t, int,56 const struct sockaddr *, socklen_t);55 extern int icmp_echo_msg(async_sess_t *, size_t, mseconds_t, ip_ttl_t, ip_tos_t, 56 int, const struct sockaddr *, socklen_t); 57 57 58 58 /*@}*/ -
uspace/lib/c/include/net/icmp_common.h
r55091847 r6b82009 40 40 #include <ipc/services.h> 41 41 #include <sys/time.h> 42 #include <async.h> 42 43 43 extern inticmp_connect_module(void);44 extern async_sess_t *icmp_connect_module(void); 44 45 45 46 #endif -
uspace/lib/c/include/net/modules.h
r55091847 r6b82009 46 46 #include <sys/time.h> 47 47 48 /** Connect to the neededmodule function type definition.48 /** Connect to module function type definition. 49 49 * 50 * @param[in] need The needed module service. 51 * 52 * @return The phone of the needed service. 50 * @return Session to the service. 53 51 * 54 52 */ 55 typedef int connect_module_t(services_t need);53 typedef async_sess_t *connect_module_t(services_t); 56 54 57 55 extern void answer_call(ipc_callid_t, int, ipc_call_t *, size_t); 58 extern intbind_service(services_t, sysarg_t, sysarg_t, sysarg_t,56 extern async_sess_t *bind_service(services_t, sysarg_t, sysarg_t, sysarg_t, 59 57 async_client_conn_t); 60 extern intconnect_to_service(services_t);58 extern async_sess_t *connect_to_service(services_t); 61 59 extern int data_reply(void *, size_t); 62 60 extern void refresh_answer(ipc_call_t *, size_t *);
Note:
See TracChangeset
for help on using the changeset viewer.