Changes in uspace/srv/net/tl/icmp/icmp.c [6b82009:9934f7d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/icmp/icmp.c
r6b82009 r9934f7d 118 118 119 119 /** Global data */ 120 static async_sess_t *net_sess = NULL;121 static async_sess_t *ip_sess = NULL;120 static int phone_net = -1; 121 static int phone_ip = -1; 122 122 static bool error_reporting = true; 123 123 static bool echo_replying = true; … … 173 173 static void icmp_release(packet_t *packet) 174 174 { 175 pq_release_remote( net_sess, packet_get_id(packet));175 pq_release_remote(phone_net, packet_get_id(packet)); 176 176 } 177 177 … … 225 225 } 226 226 227 return ip_send_msg( ip_sess, -1, packet, SERVICE_ICMP, error);227 return ip_send_msg(phone_ip, -1, packet, SERVICE_ICMP, error); 228 228 } 229 229 … … 297 297 size_t length = (size_t) addrlen; 298 298 299 packet_t *packet = packet_get_4_remote( net_sess, size,299 packet_t *packet = packet_get_4_remote(phone_net, size, 300 300 icmp_dimension.addr_len, ICMP_HEADER_SIZE + icmp_dimension.prefix, 301 301 icmp_dimension.suffix); … … 595 595 case ICMP_SKIP: 596 596 case ICMP_PHOTURIS: 597 ip_received_error_msg( ip_sess, -1, packet,597 ip_received_error_msg(phone_ip, -1, packet, 598 598 SERVICE_IP, SERVICE_ICMP); 599 599 return EOK; … … 609 609 * @param[in,out] icall Message parameters. 610 610 * @param[in] arg Local argument. 611 *612 611 */ 613 612 static void icmp_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 622 621 switch (IPC_GET_IMETHOD(*icall)) { 623 622 case NET_TL_RECEIVED: 624 rc = packet_translate_remote( net_sess, &packet,623 rc = packet_translate_remote(phone_net, &packet, 625 624 IPC_GET_PACKET(*icall)); 626 625 if (rc == EOK) { … … 642 641 /** Initialize the ICMP module. 643 642 * 644 * @param[in] sess Network module session.643 * @param[in] net_phone Network module phone. 645 644 * 646 645 * @return EOK on success. … … 648 647 * 649 648 */ 650 int tl_initialize( async_sess_t *sess)649 int tl_initialize(int net_phone) 651 650 { 652 651 measured_string_t names[] = { … … 670 669 atomic_set(&icmp_client, 0); 671 670 672 net_sess = sess;673 ip_sess= ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP,671 phone_net = net_phone; 672 phone_ip = ip_bind_service(SERVICE_IP, IPPROTO_ICMP, SERVICE_ICMP, 674 673 icmp_receiver); 675 if ( ip_sess == NULL)676 return ENOENT;677 678 int rc = ip_packet_size_req( ip_sess, -1, &icmp_dimension);674 if (phone_ip < 0) 675 return phone_ip; 676 677 int rc = ip_packet_size_req(phone_ip, -1, &icmp_dimension); 679 678 if (rc != EOK) 680 679 return rc; … … 685 684 /* Get configuration */ 686 685 configuration = &names[0]; 687 rc = net_get_conf_req( net_sess, &configuration, count, &data);686 rc = net_get_conf_req(phone_net, &configuration, count, &data); 688 687 if (rc != EOK) 689 688 return rc; … … 763 762 764 763 case NET_ICMP_DEST_UNREACH: 765 rc = packet_translate_remote( net_sess, &packet,764 rc = packet_translate_remote(phone_net, &packet, 766 765 IPC_GET_PACKET(*call)); 767 766 if (rc != EOK) … … 772 771 773 772 case NET_ICMP_SOURCE_QUENCH: 774 rc = packet_translate_remote( net_sess, &packet,773 rc = packet_translate_remote(phone_net, &packet, 775 774 IPC_GET_PACKET(*call)); 776 775 if (rc != EOK) … … 780 779 781 780 case NET_ICMP_TIME_EXCEEDED: 782 rc = packet_translate_remote( net_sess, &packet,781 rc = packet_translate_remote(phone_net, &packet, 783 782 IPC_GET_PACKET(*call)); 784 783 if (rc != EOK) … … 788 787 789 788 case NET_ICMP_PARAMETERPROB: 790 rc = packet_translate_remote( net_sess, &packet,789 rc = packet_translate_remote(phone_net, &packet, 791 790 IPC_GET_PACKET(*call)); 792 791 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.