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