Changeset 6b82009 in mainline for uspace/srv
- 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/srv
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/ne2000/ne2000.c
r55091847 r6b82009 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <async_obsolete.h>41 40 #include <ddi.h> 42 41 #include <errno.h> … … 44 43 #include <malloc.h> 45 44 #include <sysinfo.h> 45 #include <ns.h> 46 46 #include <ipc/services.h> 47 #include <ns.h>48 #include <ns_obsolete.h>49 47 #include <ipc/irc.h> 50 48 #include <net/modules.h> … … 78 76 79 77 static bool irc_service = false; 80 static int irc_phone = -1;78 static async_sess_t *irc_sess = NULL; 81 79 82 80 /** NE2000 kernel interrupt command sequence. … … 154 152 device_id_t device_id = IRQ_GET_DEVICE(*call); 155 153 netif_device_t *device; 156 int nil_phone;154 async_sess_t *nil_sess; 157 155 ne2k_t *ne2k; 158 156 159 157 fibril_rwlock_read_lock(&netif_globals.lock); 160 158 161 if (find_device(device_id, &device) == EOK) { 162 nil_phone = device->nil_phone; 159 nil_sess = netif_globals.nil_sess; 160 161 if (find_device(device_id, &device) == EOK) 163 162 ne2k = (ne2k_t *) device->specific; 164 }else163 else 165 164 ne2k = NULL; 166 165 … … 177 176 178 177 list_remove(&frame->link); 179 nil_received_msg(nil_ phone, device_id,180 frame->packet,SERVICE_NONE);178 nil_received_msg(nil_sess, device_id, frame->packet, 179 SERVICE_NONE); 181 180 free(frame); 182 181 } … … 278 277 279 278 device->device_id = device_id; 280 device->nil_phone = -1;281 279 device->specific = (void *) ne2k; 282 280 device->state = NETIF_STOPPED; … … 331 329 change_state(device, NETIF_ACTIVE); 332 330 333 if (irc_service) 334 async_obsolete_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, ne2k->irq); 331 if (irc_service) { 332 async_exch_t *exch = async_exchange_begin(irc_sess); 333 async_msg_1(exch, IRC_ENABLE_INTERRUPT, ne2k->irq); 334 async_exchange_end(exch); 335 } 335 336 } 336 337 … … 390 391 391 392 if (irc_service) { 392 while (irc_phone < 0) 393 irc_phone = service_obsolete_connect_blocking(SERVICE_IRC, 0, 0); 393 while (!irc_sess) 394 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, 395 SERVICE_IRC, 0, 0); 394 396 } 395 397 … … 402 404 { 403 405 /* Start the module */ 404 return netif_module_start( );406 return netif_module_start(SERVICE_ETHERNET); 405 407 } 406 408 -
uspace/srv/net/il/arp/arp.c
r55091847 r6b82009 164 164 } 165 165 166 static int arp_clean_cache_req( int arp_phone)166 static int arp_clean_cache_req(void) 167 167 { 168 168 int count; … … 190 190 } 191 191 192 static int arp_clear_address_req( int arp_phone, device_id_t device_id,193 services_t protocol,measured_string_t *address)192 static int arp_clear_address_req(device_id_t device_id, services_t protocol, 193 measured_string_t *address) 194 194 { 195 195 fibril_mutex_lock(&arp_globals.lock); … … 218 218 } 219 219 220 static int arp_clear_device_req( int arp_phone,device_id_t device_id)220 static int arp_clear_device_req(device_id_t device_id) 221 221 { 222 222 fibril_mutex_lock(&arp_globals.lock); … … 375 375 return rc; 376 376 377 nil_send_msg(device-> phone, device_id, packet,377 nil_send_msg(device->sess, device_id, packet, 378 378 SERVICE_ARP); 379 379 return 1; … … 416 416 * @param[in] iid Message identifier. 417 417 * @param[in,out] icall Message parameters. 418 * @param[in] arg Local argument. 418 * @param[in] arg Local argument. 419 * 419 420 */ 420 421 static void arp_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 431 432 432 433 case NET_IL_RECEIVED: 433 rc = packet_translate_remote(arp_globals.net_ phone, &packet,434 rc = packet_translate_remote(arp_globals.net_sess, &packet, 434 435 IPC_GET_PACKET(*icall)); 435 436 if (rc == EOK) { … … 439 440 rc = arp_receive_message(IPC_GET_DEVICE(*icall), packet); 440 441 if (rc != 1) { 441 pq_release_remote(arp_globals.net_ phone,442 pq_release_remote(arp_globals.net_sess, 442 443 packet_get_id(packet)); 443 444 } … … 564 565 565 566 /* Bind */ 566 device-> phone= nil_bind_service(device->service,567 device->sess = nil_bind_service(device->service, 567 568 (sysarg_t) device->device_id, SERVICE_ARP, 568 569 arp_receiver); 569 if (device-> phone < 0) {570 if (device->sess == NULL) { 570 571 fibril_mutex_unlock(&arp_globals.lock); 571 572 arp_protos_destroy(&device->protos, free); … … 575 576 576 577 /* Get packet dimensions */ 577 rc = nil_packet_size_req(device-> phone, device_id,578 rc = nil_packet_size_req(device->sess, device_id, 578 579 &device->packet_dimension); 579 580 if (rc != EOK) { … … 585 586 586 587 /* Get hardware address */ 587 rc = nil_get_addr_req(device-> phone, device_id, &device->addr,588 rc = nil_get_addr_req(device->sess, device_id, &device->addr, 588 589 &device->addr_data); 589 590 if (rc != EOK) { … … 595 596 596 597 /* Get broadcast address */ 597 rc = nil_get_broadcast_addr_req(device-> phone, device_id,598 rc = nil_get_broadcast_addr_req(device->sess, device_id, 598 599 &device->broadcast_addr, &device->broadcast_data); 599 600 if (rc != EOK) { … … 627 628 } 628 629 629 int il_initialize( int net_phone)630 int il_initialize(async_sess_t *net_sess) 630 631 { 631 632 fibril_mutex_initialize(&arp_globals.lock); 632 633 633 634 fibril_mutex_lock(&arp_globals.lock); 634 arp_globals.net_ phone = net_phone;635 arp_globals.net_sess = net_sess; 635 636 int rc = arp_cache_initialize(&arp_globals.cache); 636 637 fibril_mutex_unlock(&arp_globals.lock); … … 647 648 return ELIMIT; 648 649 649 packet_t *packet = packet_get_4_remote(arp_globals.net_ phone,650 packet_t *packet = packet_get_4_remote(arp_globals.net_sess, 650 651 device->packet_dimension.addr_len, device->packet_dimension.prefix, 651 652 length, device->packet_dimension.suffix); … … 655 656 arp_header_t *header = (arp_header_t *) packet_suffix(packet, length); 656 657 if (!header) { 657 pq_release_remote(arp_globals.net_ phone, packet_get_id(packet));658 pq_release_remote(arp_globals.net_sess, packet_get_id(packet)); 658 659 return ENOMEM; 659 660 } … … 680 681 (uint8_t *) device->broadcast_addr->value, device->addr->length); 681 682 if (rc != EOK) { 682 pq_release_remote(arp_globals.net_ phone, packet_get_id(packet));683 pq_release_remote(arp_globals.net_sess, packet_get_id(packet)); 683 684 return rc; 684 685 } 685 686 686 nil_send_msg(device-> phone, device_id, packet, SERVICE_ARP);687 nil_send_msg(device->sess, device_id, packet, SERVICE_ARP); 687 688 return EOK; 688 689 } … … 890 891 891 892 case NET_ARP_CLEAR_DEVICE: 892 return arp_clear_device_req( 0,IPC_GET_DEVICE(*call));893 return arp_clear_device_req(IPC_GET_DEVICE(*call)); 893 894 894 895 case NET_ARP_CLEAR_ADDRESS: … … 897 898 return rc; 898 899 899 arp_clear_address_req( 0,IPC_GET_DEVICE(*call),900 arp_clear_address_req(IPC_GET_DEVICE(*call), 900 901 IPC_GET_SERVICE(*call), address); 901 902 free(address); … … 904 905 905 906 case NET_ARP_CLEAN_CACHE: 906 return arp_clean_cache_req( 0);907 return arp_clean_cache_req(); 907 908 } 908 909 -
uspace/srv/net/il/arp/arp.h
r55091847 r6b82009 38 38 #define NET_ARP_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 #include <ipc/services.h> … … 104 105 /** Packet dimension. */ 105 106 packet_dimension_t packet_dimension; 106 /** Device module phone. */107 int phone;107 /** Device module session. */ 108 async_sess_t *sess; 108 109 109 110 /** … … 122 123 arp_cache_t cache; 123 124 124 /** Networking module phone. */ 125 int net_phone; 125 /** Networking module session. */ 126 async_sess_t *net_sess; 127 126 128 /** Safety lock. */ 127 129 fibril_mutex_t lock; -
uspace/srv/net/il/ip/ip.c
r55091847 r6b82009 77 77 #include <il_skel.h> 78 78 79 // FIXME: remove this header80 #include <kernel/ipc/ipc_methods.h>81 82 79 /** IP module name. */ 83 80 #define NAME "ip" … … 125 122 static void ip_receiver(ipc_callid_t, ipc_call_t *, void *); 126 123 127 /** Releases the packet and returns the result. 128 * 129 * @param[in] packet The packet queue to be released. 130 * @param[in] result The result to be returned. 131 * @return The result parameter. 124 /** Release the packet and returns the result. 125 * 126 * @param[in] packet Packet queue to be released. 127 * @param[in] result Result to be returned. 128 * 129 * @return Result parameter. 130 * 132 131 */ 133 132 static int ip_release_and_return(packet_t *packet, int result) 134 133 { 135 pq_release_remote(ip_globals.net_ phone, packet_get_id(packet));134 pq_release_remote(ip_globals.net_sess, packet_get_id(packet)); 136 135 return result; 137 136 } 138 137 139 /** Returns the ICMP phone. 140 * 141 * Searches the registered protocols. 142 * 143 * @return The found ICMP phone. 144 * @return ENOENT if the ICMP is not registered. 145 */ 146 static int ip_get_icmp_phone(void) 147 { 148 ip_proto_t *proto; 149 int phone; 150 138 /** Return the ICMP session. 139 * 140 * Search the registered protocols. 141 * 142 * @return Found ICMP session. 143 * @return NULL if the ICMP is not registered. 144 * 145 */ 146 static async_sess_t *ip_get_icmp_session(void) 147 { 151 148 fibril_rwlock_read_lock(&ip_globals.protos_lock); 152 proto = ip_protos_find(&ip_globals.protos, IPPROTO_ICMP);153 phone = proto ? proto->phone : ENOENT;149 ip_proto_t *proto = ip_protos_find(&ip_globals.protos, IPPROTO_ICMP); 150 async_sess_t *sess = proto ? proto->sess : NULL; 154 151 fibril_rwlock_read_unlock(&ip_globals.protos_lock); 155 return phone; 152 153 return sess; 156 154 } 157 155 … … 182 180 next = pq_detach(packet); 183 181 if (next) 184 pq_release_remote(ip_globals.net_ phone, packet_get_id(next));182 pq_release_remote(ip_globals.net_sess, packet_get_id(next)); 185 183 186 184 if (!header) { … … 221 219 } 222 220 223 /** Prepare sthe ICMP notification packet.224 * 225 * Release s additional packets and keepsonly the first one.221 /** Prepare the ICMP notification packet. 222 * 223 * Release additional packets and keep only the first one. 226 224 * All packets are released on error. 227 225 * 228 * @param[in] error The packet error service. 229 * @param[in] packet The packet or the packet queue to be reported as faulty. 230 * @param[in] header The first packet IP header. May be NULL. 231 * @return The found ICMP phone. 232 * @return EINVAL if the error parameter is set. 233 * @return EINVAL if the ICMP phone is not found. 234 * @return EINVAL if the ip_prepare_icmp() fails. 235 */ 236 static int 237 ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet, 238 ip_header_t *header) 239 { 240 int phone; 241 242 phone = ip_get_icmp_phone(); 243 if (error || (phone < 0) || ip_prepare_icmp(packet, header)) 244 return ip_release_and_return(packet, EINVAL); 245 return phone; 246 } 247 248 int il_initialize(int net_phone) 226 * @param[in] error Packet error service. 227 * @param[in] packet Packet or the packet queue to be reported as faulty. 228 * @param[in] header First packet IP header. May be NULL. 229 * 230 * @return Found ICMP session. 231 * @return NULL if the error parameter is set. 232 * @return NULL if the ICMP session is not found. 233 * @return NULL if the ip_prepare_icmp() fails. 234 * 235 */ 236 static async_sess_t *ip_prepare_icmp_and_get_session(services_t error, 237 packet_t *packet, ip_header_t *header) 238 { 239 async_sess_t *sess = ip_get_icmp_session(); 240 241 if ((error) || (!sess) || (ip_prepare_icmp(packet, header))) { 242 pq_release_remote(ip_globals.net_sess, packet_get_id(packet)); 243 return NULL; 244 } 245 246 return sess; 247 } 248 249 int il_initialize(async_sess_t *net_sess) 249 250 { 250 251 fibril_rwlock_initialize(&ip_globals.lock); … … 253 254 fibril_rwlock_initialize(&ip_globals.netifs_lock); 254 255 255 ip_globals.net_ phone = net_phone;256 ip_globals.net_sess = net_sess; 256 257 ip_globals.packet_counter = 0; 257 258 ip_globals.gateway.address.s_addr = 0; … … 355 356 356 357 /* Get configuration */ 357 rc = net_get_device_conf_req(ip_globals.net_ phone, ip_netif->device_id,358 rc = net_get_device_conf_req(ip_globals.net_sess, ip_netif->device_id, 358 359 &configuration, count, &data); 359 360 if (rc != EOK) … … 423 424 424 425 /* Bind netif service which also initializes the device */ 425 ip_netif-> phone= nil_bind_service(ip_netif->service,426 ip_netif->sess = nil_bind_service(ip_netif->service, 426 427 (sysarg_t) ip_netif->device_id, SERVICE_IP, 427 428 ip_receiver); 428 if (ip_netif-> phone < 0) {429 if (ip_netif->sess == NULL) { 429 430 printf("Failed to contact the nil service %d\n", 430 431 ip_netif->service); 431 return ip_netif->phone;432 return ENOENT; 432 433 } 433 434 … … 438 439 address.length = sizeof(in_addr_t); 439 440 440 rc = arp_device_req(ip_netif->arp-> phone,441 rc = arp_device_req(ip_netif->arp->sess, 441 442 ip_netif->device_id, SERVICE_IP, ip_netif->service, 442 443 &address); … … 449 450 450 451 /* Get packet dimensions */ 451 rc = nil_packet_size_req(ip_netif-> phone, ip_netif->device_id,452 rc = nil_packet_size_req(ip_netif->sess, ip_netif->device_id, 452 453 &ip_netif->packet_dimension); 453 454 if (rc != EOK) … … 481 482 } 482 483 483 static int ip_device_req_local(int il_phone, device_id_t device_id, 484 services_t netif) 484 static int ip_device_req_local(device_id_t device_id, services_t netif) 485 485 { 486 486 ip_netif_t *ip_netif; … … 516 516 517 517 /* Print the settings */ 518 printf("%s: Device registered (id: %d, phone: %d,ipv: %d, conf: %s)\n",519 NAME, ip_netif->device_id, ip_netif-> phone, ip_netif->ipv,518 printf("%s: Device registered (id: %d, ipv: %d, conf: %s)\n", 519 NAME, ip_netif->device_id, ip_netif->ipv, 520 520 ip_netif->dhcp ? "dhcp" : "static"); 521 521 … … 932 932 933 933 /* Create the last fragment */ 934 new_packet = packet_get_4_remote(ip_globals.net_ phone, prefix, length,934 new_packet = packet_get_4_remote(ip_globals.net_sess, prefix, length, 935 935 suffix, ((addrlen > addr_len) ? addrlen : addr_len)); 936 936 if (!new_packet) … … 969 969 /* Create middle fragments */ 970 970 while (IP_TOTAL_LENGTH(header) > length) { 971 new_packet = packet_get_4_remote(ip_globals.net_ phone, prefix,971 new_packet = packet_get_4_remote(ip_globals.net_sess, prefix, 972 972 length, suffix, 973 973 ((addrlen >= addr_len) ? addrlen : addr_len)); … … 994 994 } 995 995 996 /** Check sthe packet queue lengths and fragments the packets if needed.996 /** Check the packet queue lengths and fragments the packets if needed. 997 997 * 998 998 * The ICMP_FRAG_NEEDED error notification may be sent if the packet needs to 999 999 * be fragmented and the fragmentation is not allowed. 1000 1000 * 1001 * @param[in,out] packet The packet or the packet queue to be checked. 1002 * @param[in] prefix The minimum prefix size. 1003 * @param[in] content The maximum content size. 1004 * @param[in] suffix The minimum suffix size. 1005 * @param[in] addr_len The minimum address length. 1006 * @param[in] error The error module service. 1007 * @return The packet or the packet queue of the allowed length. 1008 * @return NULL if there are no packets left. 1009 */ 1010 static packet_t * 1011 ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix, 1012 socklen_t addr_len, services_t error) 1001 * @param[in,out] packet Packet or the packet queue to be checked. 1002 * @param[in] prefix Minimum prefix size. 1003 * @param[in] content Maximum content size. 1004 * @param[in] suffix Minimum suffix size. 1005 * @param[in] addr_len Minimum address length. 1006 * @param[in] error Error module service. 1007 * 1008 * @return The packet or the packet queue of the allowed length. 1009 * @return NULL if there are no packets left. 1010 * 1011 */ 1012 static packet_t *ip_split_packet(packet_t *packet, size_t prefix, size_t content, 1013 size_t suffix, socklen_t addr_len, services_t error) 1013 1014 { 1014 1015 size_t length; … … 1016 1017 packet_t *new_packet; 1017 1018 int result; 1018 int phone;1019 1019 async_sess_t *sess; 1020 1020 1021 next = packet; 1021 1022 /* Check all packets */ … … 1039 1040 /* Fragmentation needed? */ 1040 1041 if (result == EPERM) { 1041 phone = ip_prepare_icmp_and_get_phone( 1042 error, next, NULL); 1043 if (phone >= 0) { 1042 sess = ip_prepare_icmp_and_get_session(error, next, NULL); 1043 if (sess) { 1044 1044 /* Fragmentation necessary ICMP */ 1045 icmp_destination_unreachable_msg( phone,1045 icmp_destination_unreachable_msg(sess, 1046 1046 ICMP_FRAG_NEEDED, content, next); 1047 1047 } 1048 1048 } else { 1049 pq_release_remote(ip_globals.net_ phone,1049 pq_release_remote(ip_globals.net_sess, 1050 1050 packet_get_id(next)); 1051 1051 } … … 1061 1061 } 1062 1062 1063 /** Send sthe packet or the packet queue via the specified route.1063 /** Send the packet or the packet queue via the specified route. 1064 1064 * 1065 1065 * The ICMP_HOST_UNREACH error notification may be sent if route hardware 1066 1066 * destination address is found. 1067 1067 * 1068 * @param[in,out] packet The packet to be sent.1069 * @param[in] netif The target network interface.1070 * @param[in] route The target route.1071 * @param[in] src The source address.1072 * @param[in] dest The destination address.1073 * @param[in] error The error module service.1074 * @return EOK on success.1075 * @return Other error codes as defined for the arp_translate_req()1076 * function.1077 * @return Other error codes as defined for the ip_prepare_packet()1078 * function.1068 * @param[in,out] packet Packet to be sent. 1069 * @param[in] netif Target network interface. 1070 * @param[in] route Target route. 1071 * @param[in] src Source address. 1072 * @param[in] dest Destination address. 1073 * @param[in] error Error module service. 1074 * 1075 * @return EOK on success. 1076 * @return Other error codes as defined for arp_translate_req(). 1077 * @return Other error codes as defined for ip_prepare_packet(). 1078 * 1079 1079 */ 1080 1080 static int ip_send_route(packet_t *packet, ip_netif_t *netif, … … 1084 1084 measured_string_t *translation; 1085 1085 uint8_t *data; 1086 int phone;1086 async_sess_t *sess; 1087 1087 int rc; 1088 1088 … … 1093 1093 destination.length = sizeof(dest.s_addr); 1094 1094 1095 rc = arp_translate_req(netif->arp-> phone, netif->device_id,1095 rc = arp_translate_req(netif->arp->sess, netif->device_id, 1096 1096 SERVICE_IP, &destination, &translation, &data); 1097 1097 if (rc != EOK) { 1098 pq_release_remote(ip_globals.net_ phone,1098 pq_release_remote(ip_globals.net_sess, 1099 1099 packet_get_id(packet)); 1100 1100 return rc; … … 1106 1106 free(data); 1107 1107 } 1108 phone = ip_prepare_icmp_and_get_phone(error, packet,1108 sess = ip_prepare_icmp_and_get_session(error, packet, 1109 1109 NULL); 1110 if ( phone >= 0) {1110 if (sess) { 1111 1111 /* Unreachable ICMP if no routing */ 1112 icmp_destination_unreachable_msg( phone,1112 icmp_destination_unreachable_msg(sess, 1113 1113 ICMP_HOST_UNREACH, 0, packet); 1114 1114 } … … 1122 1122 rc = ip_prepare_packet(src, dest, packet, translation); 1123 1123 if (rc != EOK) { 1124 pq_release_remote(ip_globals.net_ phone, packet_get_id(packet));1124 pq_release_remote(ip_globals.net_sess, packet_get_id(packet)); 1125 1125 } else { 1126 1126 packet = ip_split_packet(packet, netif->packet_dimension.prefix, … … 1129 1129 netif->packet_dimension.addr_len, error); 1130 1130 if (packet) { 1131 nil_send_msg(netif-> phone, netif->device_id, packet,1131 nil_send_msg(netif->sess, netif->device_id, packet, 1132 1132 SERVICE_IP); 1133 1133 } … … 1142 1142 } 1143 1143 1144 static int ip_send_msg_local( int il_phone, device_id_t device_id,1145 packet_t *packet,services_t sender, services_t error)1144 static int ip_send_msg_local(device_id_t device_id, packet_t *packet, 1145 services_t sender, services_t error) 1146 1146 { 1147 1147 int addrlen; … … 1152 1152 in_addr_t *dest; 1153 1153 in_addr_t *src; 1154 int phone;1154 async_sess_t *sess; 1155 1155 int rc; 1156 1156 … … 1197 1197 if (!netif || !route) { 1198 1198 fibril_rwlock_read_unlock(&ip_globals.netifs_lock); 1199 phone = ip_prepare_icmp_and_get_phone(error, packet, NULL);1200 if ( phone >= 0) {1199 sess = ip_prepare_icmp_and_get_session(error, packet, NULL); 1200 if (sess) { 1201 1201 /* Unreachable ICMP if no routing */ 1202 icmp_destination_unreachable_msg( phone,1202 icmp_destination_unreachable_msg(sess, 1203 1203 ICMP_NET_UNREACH, 0, packet); 1204 1204 } … … 1228 1228 if (!netif || !route) { 1229 1229 fibril_rwlock_read_unlock(&ip_globals.netifs_lock); 1230 phone = ip_prepare_icmp_and_get_phone(error, packet,1230 sess = ip_prepare_icmp_and_get_session(error, packet, 1231 1231 NULL); 1232 if ( phone >= 0) {1232 if (sess) { 1233 1233 /* Unreachable ICMP if no routing */ 1234 icmp_destination_unreachable_msg( phone,1234 icmp_destination_unreachable_msg(sess, 1235 1235 ICMP_HOST_UNREACH, 0, packet); 1236 1236 } … … 1316 1316 { 1317 1317 ip_proto_t *proto; 1318 int phone;1318 async_sess_t *sess; 1319 1319 services_t service; 1320 1320 tl_received_msg_t received_msg; … … 1369 1369 if (!proto) { 1370 1370 fibril_rwlock_read_unlock(&ip_globals.protos_lock); 1371 phone = ip_prepare_icmp_and_get_phone(error, packet, header);1372 if ( phone >= 0) {1371 sess = ip_prepare_icmp_and_get_session(error, packet, header); 1372 if (sess) { 1373 1373 /* Unreachable ICMP */ 1374 icmp_destination_unreachable_msg( phone,1374 icmp_destination_unreachable_msg(sess, 1375 1375 ICMP_PROT_UNREACH, 0, packet); 1376 1376 } … … 1384 1384 rc = received_msg(device_id, packet, service, error); 1385 1385 } else { 1386 rc = tl_received_msg(proto-> phone, device_id, packet,1386 rc = tl_received_msg(proto->sess, device_id, packet, 1387 1387 proto->service, error); 1388 1388 fibril_rwlock_read_unlock(&ip_globals.protos_lock); … … 1418 1418 in_addr_t dest; 1419 1419 ip_route_t *route; 1420 int phone;1420 async_sess_t *sess; 1421 1421 struct sockaddr *addr; 1422 1422 struct sockaddr_in addr_in; … … 1431 1431 if ((header->header_checksum) && 1432 1432 (IP_HEADER_CHECKSUM(header) != IP_CHECKSUM_ZERO)) { 1433 phone = ip_prepare_icmp_and_get_phone(0, packet, header);1434 if ( phone >= 0) {1433 sess = ip_prepare_icmp_and_get_session(0, packet, header); 1434 if (sess) { 1435 1435 /* Checksum error ICMP */ 1436 icmp_parameter_problem_msg( phone, ICMP_PARAM_POINTER,1436 icmp_parameter_problem_msg(sess, ICMP_PARAM_POINTER, 1437 1437 ((size_t) ((void *) &header->header_checksum)) - 1438 1438 ((size_t) ((void *) header)), packet); … … 1442 1442 1443 1443 if (header->ttl <= 1) { 1444 phone = ip_prepare_icmp_and_get_phone(0, packet, header);1445 if ( phone >= 0) {1444 sess = ip_prepare_icmp_and_get_session(0, packet, header); 1445 if (sess) { 1446 1446 /* TTL exceeded ICMP */ 1447 icmp_time_exceeded_msg( phone, ICMP_EXC_TTL, packet);1447 icmp_time_exceeded_msg(sess, ICMP_EXC_TTL, packet); 1448 1448 } 1449 1449 return EINVAL; … … 1473 1473 route = ip_find_route(dest); 1474 1474 if (!route) { 1475 phone = ip_prepare_icmp_and_get_phone(0, packet, header);1476 if ( phone >= 0) {1475 sess = ip_prepare_icmp_and_get_session(0, packet, header); 1476 if (sess) { 1477 1477 /* Unreachable ICMP */ 1478 icmp_destination_unreachable_msg( phone,1478 icmp_destination_unreachable_msg(sess, 1479 1479 ICMP_HOST_UNREACH, 0, packet); 1480 1480 } … … 1493 1493 } 1494 1494 1495 phone = ip_prepare_icmp_and_get_phone(0, packet, header);1496 if ( phone >= 0) {1495 sess = ip_prepare_icmp_and_get_session(0, packet, header); 1496 if (sess) { 1497 1497 /* Unreachable ICMP if no routing */ 1498 icmp_destination_unreachable_msg( phone, ICMP_HOST_UNREACH, 0,1498 icmp_destination_unreachable_msg(sess, ICMP_HOST_UNREACH, 0, 1499 1499 packet); 1500 1500 } … … 1503 1503 } 1504 1504 1505 /** Return sthe device packet dimensions for sending.1506 * 1507 * @param[in] phone The service module phone.1508 * @param[ in] message The service specific message.1509 * @param[ in] device_id The device identifier.1510 * @param[out] addr_len The minimum reserved address length.1511 * @param[out] prefix The minimum reserved prefix size.1512 * @param[out] content The maximum content size.1513 * @ param[out] suffix The minimum reserved suffix size.1514 * @return EOK on success.1505 /** Return the device packet dimensions for sending. 1506 * 1507 * @param[in] device_id Device identifier. 1508 * @param[out] addr_len Minimum reserved address length. 1509 * @param[out] prefix Minimum reserved prefix size. 1510 * @param[out] content Maximum content size. 1511 * @param[out] suffix Minimum reserved suffix size. 1512 * 1513 * @return EOK on success. 1514 * 1515 1515 */ 1516 1516 static int ip_packet_size_message(device_id_t device_id, size_t *addr_len, … … 1595 1595 * @param[in,out] icall Message parameters. 1596 1596 * @param[in] arg Local argument. 1597 * 1597 1598 */ 1598 1599 static void ip_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 1610 1611 1611 1612 case NET_IL_RECEIVED: 1612 rc = packet_translate_remote(ip_globals.net_ phone, &packet,1613 rc = packet_translate_remote(ip_globals.net_sess, &packet, 1613 1614 IPC_GET_PACKET(*icall)); 1614 1615 if (rc == EOK) { … … 1637 1638 } 1638 1639 1639 /** Register sthe transport layer protocol.1640 /** Register the transport layer protocol. 1640 1641 * 1641 1642 * The traffic of this protocol will be supplied using either the receive 1642 1643 * function or IPC message. 1643 1644 * 1644 * @param[in] protocol The transport layer module protocol. 1645 * @param[in] service The transport layer module service. 1646 * @param[in] phone The transport layer module phone. 1647 * @param[in] received_msg The receiving function. 1648 * @return EOK on success. 1649 * @return EINVAL if the protocol parameter and/or the service 1650 * parameter is zero. 1651 * @return EINVAL if the phone parameter is not a positive number 1652 * and the tl_receive_msg is NULL. 1653 * @return ENOMEM if there is not enough memory left. 1654 */ 1655 static int 1656 ip_register(int protocol, services_t service, int phone, 1645 * @param[in] protocol Transport layer module protocol. 1646 * @param[in] service Transport layer module service. 1647 * @param[in] sess Transport layer module session. 1648 * @param[in] received_msg Receiving function. 1649 * 1650 * @return EOK on success. 1651 * @return EINVAL if the protocol parameter and/or the service 1652 * parameter is zero. 1653 * @return EINVAL if the phone parameter is not a positive number 1654 * and the tl_receive_msg is NULL. 1655 * @return ENOMEM if there is not enough memory left. 1656 * 1657 */ 1658 static int ip_register(int protocol, services_t service, async_sess_t *sess, 1657 1659 tl_received_msg_t received_msg) 1658 1660 { … … 1660 1662 int index; 1661 1663 1662 if ( !protocol || !service || ((phone < 0) && !received_msg))1664 if ((!protocol) || (!service) || ((!sess) && (!received_msg))) 1663 1665 return EINVAL; 1664 1666 1665 1667 proto = (ip_proto_t *) malloc(sizeof(ip_protos_t)); 1666 1668 if (!proto) … … 1669 1671 proto->protocol = protocol; 1670 1672 proto->service = service; 1671 proto-> phone = phone;1673 proto->sess = sess; 1672 1674 proto->received_msg = received_msg; 1673 1675 … … 1681 1683 fibril_rwlock_write_unlock(&ip_globals.protos_lock); 1682 1684 1683 printf("%s: Protocol registered (protocol: %d , phone: %d)\n",1684 NAME, proto->protocol , proto->phone);1685 printf("%s: Protocol registered (protocol: %d)\n", 1686 NAME, proto->protocol); 1685 1687 1686 1688 return EOK; 1687 1689 } 1688 1690 1689 1690 static int 1691 ip_add_route_req_local(int ip_phone, device_id_t device_id, in_addr_t address, 1691 static int ip_add_route_req_local(device_id_t device_id, in_addr_t address, 1692 1692 in_addr_t netmask, in_addr_t gateway) 1693 1693 { … … 1723 1723 } 1724 1724 1725 static int 1726 ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway) 1725 static int ip_set_gateway_req_local(device_id_t device_id, in_addr_t gateway) 1727 1726 { 1728 1727 ip_netif_t *netif; … … 1748 1747 /** Notify the IP module about the received error notification packet. 1749 1748 * 1750 * @param[in] ip_phone The IP module phone used for (semi)remote calls. 1751 * @param[in] device_id The device identifier. 1752 * @param[in] packet The received packet or the received packet queue. 1753 * @param[in] target The target internetwork module service to be 1754 * delivered to. 1755 * @param[in] error The packet error reporting service. Prefixes the 1756 * received packet. 1757 * @return EOK on success. 1758 * 1759 */ 1760 static int 1761 ip_received_error_msg_local(int ip_phone, device_id_t device_id, 1749 * @param[in] device_id Device identifier. 1750 * @param[in] packet Received packet or the received packet queue. 1751 * @param[in] target Target internetwork module service to be 1752 * delivered to. 1753 * @param[in] error Packet error reporting service. Prefixes the 1754 * received packet. 1755 * 1756 * @return EOK on success. 1757 * 1758 */ 1759 static int ip_received_error_msg_local(device_id_t device_id, 1762 1760 packet_t *packet, services_t target, services_t error) 1763 1761 { … … 1804 1802 address.value = (uint8_t *) &header->destination_address; 1805 1803 address.length = sizeof(header->destination_address); 1806 arp_clear_address_req(netif->arp-> phone,1804 arp_clear_address_req(netif->arp->sess, 1807 1805 netif->device_id, SERVICE_IP, &address); 1808 1806 } … … 1818 1816 } 1819 1817 1820 static int 1821 ip_get_route_req_local(int ip_phone, ip_protocol_t protocol, 1818 static int ip_get_route_req_local(ip_protocol_t protocol, 1822 1819 const struct sockaddr *destination, socklen_t addrlen, 1823 1820 device_id_t *device_id, void **header, size_t *headerlen) … … 1920 1917 return EOK; 1921 1918 1919 async_sess_t *callback = 1920 async_callback_receive_start(EXCHANGE_SERIALIZE, call); 1921 if (callback) 1922 return ip_register(IL_GET_PROTO(*call), IL_GET_SERVICE(*call), 1923 callback, NULL); 1924 1922 1925 switch (IPC_GET_IMETHOD(*call)) { 1923 case IPC_M_CONNECT_TO_ME:1924 return ip_register(IL_GET_PROTO(*call), IL_GET_SERVICE(*call),1925 IPC_GET_PHONE(*call), NULL);1926 1927 1926 case NET_IP_DEVICE: 1928 return ip_device_req_local( 0,IPC_GET_DEVICE(*call),1927 return ip_device_req_local(IPC_GET_DEVICE(*call), 1929 1928 IPC_GET_SERVICE(*call)); 1930 1929 1931 1930 case NET_IP_RECEIVED_ERROR: 1932 rc = packet_translate_remote(ip_globals.net_ phone, &packet,1931 rc = packet_translate_remote(ip_globals.net_sess, &packet, 1933 1932 IPC_GET_PACKET(*call)); 1934 1933 if (rc != EOK) 1935 1934 return rc; 1936 return ip_received_error_msg_local( 0,IPC_GET_DEVICE(*call),1935 return ip_received_error_msg_local(IPC_GET_DEVICE(*call), 1937 1936 packet, IPC_GET_TARGET(*call), IPC_GET_ERROR(*call)); 1938 1937 1939 1938 case NET_IP_ADD_ROUTE: 1940 return ip_add_route_req_local( 0,IPC_GET_DEVICE(*call),1939 return ip_add_route_req_local(IPC_GET_DEVICE(*call), 1941 1940 IP_GET_ADDRESS(*call), IP_GET_NETMASK(*call), 1942 1941 IP_GET_GATEWAY(*call)); 1943 1942 1944 1943 case NET_IP_SET_GATEWAY: 1945 return ip_set_gateway_req_local( 0,IPC_GET_DEVICE(*call),1944 return ip_set_gateway_req_local(IPC_GET_DEVICE(*call), 1946 1945 IP_GET_GATEWAY(*call)); 1947 1946 … … 1952 1951 return rc; 1953 1952 1954 rc = ip_get_route_req_local( 0,IP_GET_PROTOCOL(*call), addr,1953 rc = ip_get_route_req_local(IP_GET_PROTOCOL(*call), addr, 1955 1954 (socklen_t) addrlen, &device_id, &header, &headerlen); 1956 1955 if (rc != EOK) … … 1983 1982 1984 1983 case NET_IP_SEND: 1985 rc = packet_translate_remote(ip_globals.net_ phone, &packet,1984 rc = packet_translate_remote(ip_globals.net_sess, &packet, 1986 1985 IPC_GET_PACKET(*call)); 1987 1986 if (rc != EOK) 1988 1987 return rc; 1989 1988 1990 return ip_send_msg_local( 0,IPC_GET_DEVICE(*call), packet, 0,1989 return ip_send_msg_local(IPC_GET_DEVICE(*call), packet, 0, 1991 1990 IPC_GET_ERROR(*call)); 1992 1991 } -
uspace/srv/net/il/ip/ip.h
r55091847 r6b82009 38 38 #define NET_IP_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 #include <ipc/services.h> … … 98 99 /** Packet dimension. */ 99 100 packet_dimension_t packet_dimension; 100 /** Netif module phone. */101 int phone;101 /** Netif module session. */ 102 async_sess_t *sess; 102 103 /** Routing table. */ 103 104 ip_routes_t routes; … … 112 113 /** IP protocol specific data. */ 113 114 struct ip_proto { 114 /** Protocol module phone. */115 int phone;115 /** Protocol module session. */ 116 async_sess_t *sess; 116 117 /** Protocol number. */ 117 118 int protocol; … … 142 143 /** Known support modules. */ 143 144 modules_t modules; 144 /** Networking module phone. */145 int net_phone;145 /** Networking module session. */ 146 async_sess_t *net_sess; 146 147 /** Registered network interfaces. */ 147 148 ip_netifs_t netifs; -
uspace/srv/net/net/net.c
r55091847 r6b82009 36 36 */ 37 37 38 #include "net.h"39 40 38 #include <async.h> 41 39 #include <ctype.h> 42 40 #include <ddi.h> 43 #include <ns.h>44 41 #include <errno.h> 45 42 #include <malloc.h> … … 47 44 #include <str.h> 48 45 #include <str_error.h> 49 46 #include <ns.h> 50 47 #include <ipc/services.h> 51 48 #include <ipc/net.h> … … 53 50 #include <ipc/il.h> 54 51 #include <ipc/nil.h> 55 56 52 #include <net/modules.h> 57 53 #include <net/packet.h> 58 54 #include <net/device.h> 59 60 55 #include <adt/char_map.h> 61 56 #include <adt/generic_char_map.h> 62 57 #include <adt/measured_strings.h> 63 58 #include <adt/module_map.h> 64 65 59 #include <netif_remote.h> 66 60 #include <nil_remote.h> 67 61 #include <net_interface.h> 68 62 #include <ip_interface.h> 63 #include "net.h" 69 64 70 65 /** Networking module name. */ … … 394 389 } 395 390 396 int net_get_conf_req(int net_phone,measured_string_t **configuration,391 static int net_get_conf_req_local(measured_string_t **configuration, 397 392 size_t count, uint8_t **data) 398 393 { … … 403 398 } 404 399 405 int net_get_device_conf_req(int net_phone,device_id_t device_id,400 static int net_get_device_conf_req_local(device_id_t device_id, 406 401 measured_string_t **configuration, size_t count, uint8_t **data) 407 402 { … … 479 474 uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0; 480 475 481 rc = netif_probe_req(netif->driver-> phone, netif->id, irq, (void *) io);476 rc = netif_probe_req(netif->driver->sess, netif->id, irq, (void *) io); 482 477 if (rc != EOK) 483 478 return rc; 484 479 485 480 /* Network interface layer startup */ 486 services_t internet_service;487 481 if (netif->nil) { 488 482 setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_MTU, 0); … … 493 487 int mtu = setting ? strtol((char *) setting->value, NULL, 10) : 0; 494 488 495 rc = nil_device_req(netif->nil->phone, netif->id, mtu, 496 netif->driver->service); 489 rc = nil_device_req(netif->nil->sess, netif->id, mtu); 497 490 if (rc != EOK) 498 491 return rc; 499 500 internet_service = netif->nil->service; 501 } else 502 internet_service = netif->driver->service; 492 } 503 493 504 494 /* Inter-network layer startup */ 505 switch (netif->il->service) { 506 case SERVICE_IP: 507 rc = ip_device_req(netif->il->phone, netif->id, 508 internet_service); 509 if (rc != EOK) 510 return rc; 511 break; 512 default: 513 return ENOENT; 514 } 515 516 return netif_start_req(netif->driver->phone, netif->id); 495 rc = ip_device_req(netif->il->sess, netif->id); 496 if (rc != EOK) 497 return rc; 498 499 return netif_start_req(netif->driver->sess, netif->id); 517 500 } 518 501 … … 649 632 if (rc != EOK) 650 633 return rc; 651 net_get_device_conf_req (0,IPC_GET_DEVICE(*call), &strings,634 net_get_device_conf_req_local(IPC_GET_DEVICE(*call), &strings, 652 635 IPC_GET_COUNT(*call), NULL); 653 636 … … 663 646 if (rc != EOK) 664 647 return rc; 665 net_get_conf_req (0,&strings, IPC_GET_COUNT(*call), NULL);648 net_get_conf_req_local(&strings, IPC_GET_COUNT(*call), NULL); 666 649 667 650 /* Strings should not contain received data anymore */ … … 683 666 * @param[in] icall The initial message call structure. 684 667 * @param[in] arg Local argument. 668 * 685 669 */ 686 670 static void net_client_connection(ipc_callid_t iid, ipc_call_t *icall, -
uspace/srv/net/netif/lo/lo.c
r55091847 r6b82009 148 148 null_device_stats((device_stats_t *) (*device)->specific); 149 149 (*device)->device_id = device_id; 150 (*device)->nil_phone = -1;151 150 (*device)->state = NETIF_STOPPED; 152 151 int index = netif_device_map_add(&netif_globals.device_map, … … 202 201 } while (next); 203 202 204 int phone = device->nil_phone;203 async_sess_t *nil_sess = netif_globals.nil_sess; 205 204 fibril_rwlock_write_unlock(&netif_globals.lock); 206 205 207 nil_received_msg( phone, device_id, packet, sender);206 nil_received_msg(nil_sess, device_id, packet, sender); 208 207 209 208 fibril_rwlock_write_lock(&netif_globals.lock); … … 226 225 { 227 226 /* Start the module */ 228 return netif_module_start( );227 return netif_module_start(SERVICE_NILDUMMY); 229 228 } 230 229 -
uspace/srv/net/nil/eth/eth.c
r55091847 r6b82009 59 59 #include <packet_remote.h> 60 60 #include <nil_skel.h> 61 62 // FIXME: remove this header63 #include <kernel/ipc/ipc_methods.h>64 65 61 #include "eth.h" 66 62 … … 171 167 INT_MAP_IMPLEMENT(eth_protos, eth_proto_t); 172 168 173 int nil_device_state_msg_local( int nil_phone, device_id_t device_id, int state)169 int nil_device_state_msg_local(device_id_t device_id, sysarg_t state) 174 170 { 175 171 int index; … … 180 176 index--) { 181 177 proto = eth_protos_get_index(ð_globals.protos, index); 182 if ( proto && proto->phone) {183 il_device_state_msg(proto-> phone, device_id, state,178 if ((proto) && (proto->sess)) { 179 il_device_state_msg(proto->sess, device_id, state, 184 180 proto->service); 185 181 } … … 190 186 } 191 187 192 int nil_initialize( int net_phone)188 int nil_initialize(async_sess_t *sess) 193 189 { 194 190 int rc; … … 199 195 fibril_rwlock_write_lock(ð_globals.devices_lock); 200 196 fibril_rwlock_write_lock(ð_globals.protos_lock); 201 eth_globals.net_ phone = net_phone;197 eth_globals.net_sess = sess; 202 198 203 199 eth_globals.broadcast_addr = … … 226 222 } 227 223 228 /** Process esIPC messages from the registered device driver modules in an224 /** Process IPC messages from the registered device driver modules in an 229 225 * infinite loop. 230 226 * 231 * @param[in] iid The message identifier. 232 * @param[in,out] icall The message parameters. 233 * @param[in] arg Local argument. 227 * @param[in] iid Message identifier. 228 * @param[in,out] icall Message parameters. 229 * @param[in] arg Local argument. 230 * 234 231 */ 235 232 static void eth_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 241 238 switch (IPC_GET_IMETHOD(*icall)) { 242 239 case NET_NIL_DEVICE_STATE: 243 nil_device_state_msg_local( 0,IPC_GET_DEVICE(*icall),240 nil_device_state_msg_local(IPC_GET_DEVICE(*icall), 244 241 IPC_GET_STATE(*icall)); 245 242 async_answer_0(iid, EOK); 246 243 break; 247 244 case NET_NIL_RECEIVED: 248 rc = packet_translate_remote(eth_globals.net_ phone,245 rc = packet_translate_remote(eth_globals.net_sess, 249 246 &packet, IPC_GET_PACKET(*icall)); 250 247 if (rc == EOK) 251 rc = nil_received_msg_local( 0,252 IPC_GET_DEVICE(*icall),packet, 0);248 rc = nil_received_msg_local(IPC_GET_DEVICE(*icall), 249 packet, 0); 253 250 254 251 async_answer_0(iid, (sysarg_t) rc); … … 326 323 proto = eth_protos_get_index(ð_globals.protos, 327 324 index); 328 if (proto-> phone) {329 il_mtu_changed_msg(proto-> phone,325 if (proto->sess) { 326 il_mtu_changed_msg(proto->sess, 330 327 device->device_id, device->mtu, 331 328 proto->service); … … 351 348 352 349 configuration = &names[0]; 353 rc = net_get_device_conf_req(eth_globals.net_ phone, device->device_id,350 rc = net_get_device_conf_req(eth_globals.net_sess, device->device_id, 354 351 &configuration, count, &data); 355 352 if (rc != EOK) { … … 380 377 381 378 /* Bind the device driver */ 382 device-> phone= netif_bind_service(device->service, device->device_id,379 device->sess = netif_bind_service(device->service, device->device_id, 383 380 SERVICE_ETHERNET, eth_receiver); 384 if (device-> phone < 0) {381 if (device->sess == NULL) { 385 382 fibril_rwlock_write_unlock(ð_globals.devices_lock); 386 383 free(device); 387 return device->phone;384 return ENOENT; 388 385 } 389 386 390 387 /* Get hardware address */ 391 rc = netif_get_addr_req(device-> phone, device->device_id, &device->addr,388 rc = netif_get_addr_req(device->sess, device->device_id, &device->addr, 392 389 &device->addr_data); 393 390 if (rc != EOK) { … … 509 506 } 510 507 511 int nil_received_msg_local( int nil_phone, device_id_t device_id,512 packet_t *packet,services_t target)508 int nil_received_msg_local(device_id_t device_id, packet_t *packet, 509 services_t target) 513 510 { 514 511 eth_proto_t *proto; … … 532 529 proto = eth_process_packet(flags, packet); 533 530 if (proto) { 534 il_received_msg(proto-> phone, device_id, packet,531 il_received_msg(proto->sess, device_id, packet, 535 532 proto->service); 536 533 } else { 537 534 /* Drop invalid/unknown */ 538 pq_release_remote(eth_globals.net_ phone,535 pq_release_remote(eth_globals.net_sess, 539 536 packet_get_id(packet)); 540 537 } … … 615 612 } 616 613 617 /** Registers receiving module service. 618 * 619 * Passes received packets for this service. 620 * 621 * @param[in] service The module service. 622 * @param[in] phone The service phone. 623 * @return EOK on success. 624 * @return ENOENT if the service is not known. 625 * @return ENOMEM if there is not enough memory left. 626 */ 627 static int eth_register_message(services_t service, int phone) 614 /** Register receiving module service. 615 * 616 * Pass received packets for this service. 617 * 618 * @param[in] service Module service. 619 * @param[in] sess Service session. 620 * 621 * @return EOK on success. 622 * @return ENOENT if the service is not known. 623 * @return ENOMEM if there is not enough memory left. 624 * 625 */ 626 static int eth_register_message(services_t service, async_sess_t *sess) 628 627 { 629 628 eth_proto_t *proto; … … 638 637 proto = eth_protos_find(ð_globals.protos, protocol); 639 638 if (proto) { 640 proto-> phone = phone;639 proto->sess = sess; 641 640 fibril_rwlock_write_unlock(ð_globals.protos_lock); 642 641 return EOK; … … 650 649 proto->service = service; 651 650 proto->protocol = protocol; 652 proto-> phone = phone;651 proto->sess = sess; 653 652 654 653 index = eth_protos_add(ð_globals.protos, protocol, proto); … … 660 659 } 661 660 662 printf("%s: Protocol registered (protocol: %d, service: %d , phone: "663 "%d)\n", NAME, proto->protocol, proto->service, proto->phone);661 printf("%s: Protocol registered (protocol: %d, service: %d)\n", 662 NAME, proto->protocol, proto->service); 664 663 665 664 fibril_rwlock_write_unlock(ð_globals.protos_lock); … … 799 798 ethertype = htons(protocol_map(SERVICE_ETHERNET, sender)); 800 799 if (!ethertype) { 801 pq_release_remote(eth_globals.net_ phone, packet_get_id(packet));800 pq_release_remote(eth_globals.net_sess, packet_get_id(packet)); 802 801 return EINVAL; 803 802 } … … 820 819 if (next == packet) 821 820 packet = tmp; 822 pq_release_remote(eth_globals.net_ phone,821 pq_release_remote(eth_globals.net_sess, 823 822 packet_get_id(next)); 824 823 next = tmp; … … 830 829 /* Send packet queue */ 831 830 if (packet) { 832 netif_send_msg(device-> phone, device_id, packet,831 netif_send_msg(device->sess, device_id, packet, 833 832 SERVICE_ETHERNET); 834 833 } … … 854 853 return EOK; 855 854 855 async_sess_t *callback = 856 async_callback_receive_start(EXCHANGE_SERIALIZE, call); 857 if (callback) 858 return eth_register_message(NIL_GET_PROTO(*call), callback); 859 856 860 switch (IPC_GET_IMETHOD(*call)) { 857 861 case NET_NIL_DEVICE: … … 859 863 IPC_GET_SERVICE(*call), IPC_GET_MTU(*call)); 860 864 case NET_NIL_SEND: 861 rc = packet_translate_remote(eth_globals.net_ phone, &packet,865 rc = packet_translate_remote(eth_globals.net_sess, &packet, 862 866 IPC_GET_PACKET(*call)); 863 867 if (rc != EOK) … … 888 892 return EOK; 889 893 return measured_strings_reply(address, 1); 890 case IPC_M_CONNECT_TO_ME:891 return eth_register_message(NIL_GET_PROTO(*call),892 IPC_GET_PHONE(*call));893 894 } 894 895 -
uspace/srv/net/nil/eth/eth.h
r55091847 r6b82009 38 38 #define NET_ETH_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 #include <ipc/services.h> 42 43 43 #include <net/device.h> 44 44 #include <adt/measured_strings.h> … … 223 223 /** Device driver service. */ 224 224 services_t service; 225 /** Driver phone. */226 int phone;225 /** Driver session. */ 226 async_sess_t *sess; 227 227 /** Maximal transmission unit. */ 228 228 size_t mtu; … … 248 248 /** Protocol identifier. */ 249 249 int protocol; 250 /** Protocol module phone. */251 int phone;250 /** Protocol module session. */ 251 async_sess_t *sess; 252 252 }; 253 253 254 254 /** Ethernet global data. */ 255 255 struct eth_globals { 256 /** Networking module phone. */257 int net_phone;256 /** Networking module session. */ 257 async_sess_t *net_sess; 258 258 /** Safety lock for devices. */ 259 259 fibril_rwlock_t devices_lock; … … 265 265 /** 266 266 * Protocol map. 267 * Service phonemap for each protocol.267 * Service map for each protocol. 268 268 */ 269 269 eth_protos_t protos; -
uspace/srv/net/nil/nildummy/nildummy.c
r55091847 r6b82009 44 44 #include <ipc/net.h> 45 45 #include <ipc/services.h> 46 47 46 #include <net/modules.h> 48 47 #include <net/device.h> … … 53 52 #include <netif_remote.h> 54 53 #include <nil_skel.h> 55 56 // FIXME: remove this header57 #include <kernel/ipc/ipc_methods.h>58 59 54 #include "nildummy.h" 60 55 … … 70 65 DEVICE_MAP_IMPLEMENT(nildummy_devices, nildummy_device_t); 71 66 72 int nil_device_state_msg_local( int nil_phone, device_id_t device_id, int state)67 int nil_device_state_msg_local(device_id_t device_id, sysarg_t state) 73 68 { 74 69 fibril_rwlock_read_lock(&nildummy_globals.protos_lock); 75 if (nildummy_globals.proto. phone)76 il_device_state_msg(nildummy_globals.proto. phone, device_id,70 if (nildummy_globals.proto.sess) 71 il_device_state_msg(nildummy_globals.proto.sess, device_id, 77 72 state, nildummy_globals.proto.service); 78 73 fibril_rwlock_read_unlock(&nildummy_globals.protos_lock); … … 81 76 } 82 77 83 int nil_initialize( int net_phone)78 int nil_initialize(async_sess_t *sess) 84 79 { 85 80 fibril_rwlock_initialize(&nildummy_globals.devices_lock); … … 88 83 fibril_rwlock_write_lock(&nildummy_globals.protos_lock); 89 84 90 nildummy_globals.net_ phone = net_phone;91 nildummy_globals.proto. phone = 0;85 nildummy_globals.net_sess = sess; 86 nildummy_globals.proto.sess = NULL; 92 87 int rc = nildummy_devices_initialize(&nildummy_globals.devices); 93 88 … … 102 97 * @param[in] iid Message identifier. 103 98 * @param[in,out] icall Message parameters. 104 * @param[in] arg Local argument. 99 * @param[in] arg Local argument. 100 * 105 101 */ 106 102 static void nildummy_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 112 108 switch (IPC_GET_IMETHOD(*icall)) { 113 109 case NET_NIL_DEVICE_STATE: 114 rc = nil_device_state_msg_local( 0,115 IPC_GET_ DEVICE(*icall), IPC_GET_STATE(*icall));110 rc = nil_device_state_msg_local(IPC_GET_DEVICE(*icall), 111 IPC_GET_STATE(*icall)); 116 112 async_answer_0(iid, (sysarg_t) rc); 117 113 break; 118 114 119 115 case NET_NIL_RECEIVED: 120 rc = packet_translate_remote(nildummy_globals.net_ phone,116 rc = packet_translate_remote(nildummy_globals.net_sess, 121 117 &packet, IPC_GET_PACKET(*icall)); 122 118 if (rc == EOK) 123 rc = nil_received_msg_local( 0,124 IPC_GET_DEVICE(*icall),packet, 0);119 rc = nil_received_msg_local(IPC_GET_DEVICE(*icall), 120 packet, 0); 125 121 126 122 async_answer_0(iid, (sysarg_t) rc); … … 180 176 /* Notify the upper layer module */ 181 177 fibril_rwlock_read_lock(&nildummy_globals.protos_lock); 182 if (nildummy_globals.proto. phone) {183 il_mtu_changed_msg(nildummy_globals.proto. phone,178 if (nildummy_globals.proto.sess) { 179 il_mtu_changed_msg(nildummy_globals.proto.sess, 184 180 device->device_id, device->mtu, 185 181 nildummy_globals.proto.service); … … 203 199 204 200 /* Bind the device driver */ 205 device-> phone= netif_bind_service(device->service, device->device_id,201 device->sess = netif_bind_service(device->service, device->device_id, 206 202 SERVICE_ETHERNET, nildummy_receiver); 207 if (device-> phone < 0) {203 if (device->sess == NULL) { 208 204 fibril_rwlock_write_unlock(&nildummy_globals.devices_lock); 209 205 free(device); 210 return device->phone;206 return ENOENT; 211 207 } 212 208 213 209 /* Get hardware address */ 214 int rc = netif_get_addr_req(device-> phone, device->device_id,210 int rc = netif_get_addr_req(device->sess, device->device_id, 215 211 &device->addr, &device->addr_data); 216 212 if (rc != EOK) { … … 307 303 } 308 304 309 int nil_received_msg_local( int nil_phone, device_id_t device_id,310 packet_t *packet,services_t target)305 int nil_received_msg_local(device_id_t device_id, packet_t *packet, 306 services_t target) 311 307 { 312 308 fibril_rwlock_read_lock(&nildummy_globals.protos_lock); 313 309 314 if (nildummy_globals.proto. phone) {310 if (nildummy_globals.proto.sess) { 315 311 do { 316 312 packet_t *next = pq_detach(packet); 317 il_received_msg(nildummy_globals.proto. phone, device_id,313 il_received_msg(nildummy_globals.proto.sess, device_id, 318 314 packet, nildummy_globals.proto.service); 319 315 packet = next; … … 331 327 * 332 328 * @param[in] service Module service. 333 * @param[in] phone Service phone.329 * @param[in] sess Service session. 334 330 * 335 331 * @return EOK on success. … … 338 334 * 339 335 */ 340 static int nildummy_register_message(services_t service, int phone)336 static int nildummy_register_message(services_t service, async_sess_t *sess) 341 337 { 342 338 fibril_rwlock_write_lock(&nildummy_globals.protos_lock); 343 339 nildummy_globals.proto.service = service; 344 nildummy_globals.proto. phone = phone;345 346 printf("%s: Protocol registered (service: %d , phone: %d)\n",347 NAME, nildummy_globals.proto.service , nildummy_globals.proto.phone);340 nildummy_globals.proto.sess = sess; 341 342 printf("%s: Protocol registered (service: %d)\n", 343 NAME, nildummy_globals.proto.service); 348 344 349 345 fibril_rwlock_write_unlock(&nildummy_globals.protos_lock); … … 376 372 /* Send packet queue */ 377 373 if (packet) 378 netif_send_msg(device-> phone, device_id, packet,374 netif_send_msg(device->sess, device_id, packet, 379 375 SERVICE_NILDUMMY); 380 376 … … 400 396 return EOK; 401 397 398 async_sess_t *callback = 399 async_callback_receive_start(EXCHANGE_SERIALIZE, call); 400 if (callback) 401 return nildummy_register_message(NIL_GET_PROTO(*call), callback); 402 402 403 switch (IPC_GET_IMETHOD(*call)) { 403 404 case NET_NIL_DEVICE: … … 406 407 407 408 case NET_NIL_SEND: 408 rc = packet_translate_remote(nildummy_globals.net_ phone,409 rc = packet_translate_remote(nildummy_globals.net_sess, 409 410 &packet, IPC_GET_PACKET(*call)); 410 411 if (rc != EOK) … … 436 437 return rc; 437 438 return measured_strings_reply(address, 1); 438 439 case IPC_M_CONNECT_TO_ME:440 return nildummy_register_message(NIL_GET_PROTO(*call),441 IPC_GET_PHONE(*call));442 439 } 443 440 -
uspace/srv/net/nil/nildummy/nildummy.h
r55091847 r6b82009 38 38 #define NET_NILDUMMY_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 #include <ipc/services.h> 42 43 43 #include <net/device.h> 44 44 #include <adt/measured_strings.h> … … 81 81 services_t service; 82 82 83 /** Driver phone. */84 int phone;83 /** Driver session. */ 84 async_sess_t *sess; 85 85 86 86 /** Maximal transmission unit. */ … … 99 99 services_t service; 100 100 101 /** Protocol module phone. */102 int phone;101 /** Protocol module session. */ 102 async_sess_t *sess; 103 103 }; 104 104 105 105 /** Dummy nil global data. */ 106 106 struct nildummy_globals { 107 /** Networking module phone. */108 int net_phone;107 /** Networking module session. */ 108 async_sess_t *net_sess; 109 109 110 110 /** Lock for devices. */ -
uspace/srv/net/tl/icmp/icmp.c
r55091847 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) -
uspace/srv/net/tl/tcp/tcp.c
r55091847 r6b82009 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> … … 74 73 #include "tcp_header.h" 75 74 76 // FIXME: remove this header77 #include <kernel/ipc/ipc_methods.h>78 79 75 /** TCP module name. */ 80 76 #define NAME "tcp" … … 210 206 211 207 static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t); 212 static int tcp_process_client_messages(ipc_callid_t, ipc_call_t); 208 static int tcp_process_client_messages(async_sess_t *, ipc_callid_t, 209 ipc_call_t); 213 210 214 211 static int tcp_listen_message(socket_cores_t *, int, int); … … 328 325 329 326 if (!socket) { 330 if (tl_prepare_icmp_packet(tcp_globals.net_ phone,331 tcp_globals.icmp_ phone, packet, error) == EOK) {332 icmp_destination_unreachable_msg(tcp_globals.icmp_ phone,327 if (tl_prepare_icmp_packet(tcp_globals.net_sess, 328 tcp_globals.icmp_sess, packet, error) == EOK) { 329 icmp_destination_unreachable_msg(tcp_globals.icmp_sess, 333 330 ICMP_PORT_UNREACH, 0, packet); 334 331 } … … 401 398 fibril_rwlock_write_unlock(socket_data->local_lock); 402 399 403 rc = tl_prepare_icmp_packet(tcp_globals.net_ phone,404 tcp_globals.icmp_ phone, packet, error);400 rc = tl_prepare_icmp_packet(tcp_globals.net_sess, 401 tcp_globals.icmp_sess, packet, error); 405 402 if (rc == EOK) { 406 403 /* Checksum error ICMP */ 407 icmp_parameter_problem_msg(tcp_globals.icmp_ phone,404 icmp_parameter_problem_msg(tcp_globals.icmp_sess, 408 405 ICMP_PARAM_POINTER, 409 406 ((size_t) ((void *) &header->checksum)) - … … 443 440 break; 444 441 default: 445 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));442 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 446 443 } 447 444 … … 506 503 /* Release the acknowledged packets */ 507 504 next_packet = pq_next(packet); 508 pq_release_remote(tcp_globals.net_ phone,505 pq_release_remote(tcp_globals.net_sess, 509 506 packet_get_id(packet)); 510 507 packet = next_packet; … … 565 562 next_packet = pq_next(next_packet); 566 563 pq_insert_after(tmp_packet, next_packet); 567 pq_release_remote(tcp_globals.net_ phone,564 pq_release_remote(tcp_globals.net_sess, 568 565 packet_get_id(tmp_packet)); 569 566 } … … 602 599 if (packet == socket_data->incoming) 603 600 socket_data->incoming = next_packet; 604 pq_release_remote(tcp_globals.net_ phone,601 pq_release_remote(tcp_globals.net_sess, 605 602 packet_get_id(packet)); 606 603 packet = next_packet; … … 625 622 if (length <= 0) { 626 623 /* Remove the empty packet */ 627 pq_release_remote(tcp_globals.net_ phone,624 pq_release_remote(tcp_globals.net_sess, 628 625 packet_get_id(packet)); 629 626 packet = next_packet; … … 672 669 } 673 670 /* Remove the duplicit or corrupted packet */ 674 pq_release_remote(tcp_globals.net_ phone,671 pq_release_remote(tcp_globals.net_sess, 675 672 packet_get_id(packet)); 676 673 packet = next_packet; … … 699 696 if (rc != EOK) { 700 697 /* Remove the corrupted packets */ 701 pq_release_remote(tcp_globals.net_ phone,698 pq_release_remote(tcp_globals.net_sess, 702 699 packet_get_id(packet)); 703 pq_release_remote(tcp_globals.net_ phone,700 pq_release_remote(tcp_globals.net_sess, 704 701 packet_get_id(next_packet)); 705 702 } else { … … 712 709 new_sequence_number, length); 713 710 if (rc != EOK) { 714 pq_release_remote(tcp_globals.net_ phone,711 pq_release_remote(tcp_globals.net_sess, 715 712 packet_get_id(next_packet)); 716 713 } 717 714 rc = pq_insert_after(packet, next_packet); 718 715 if (rc != EOK) { 719 pq_release_remote(tcp_globals.net_ phone,716 pq_release_remote(tcp_globals.net_sess, 720 717 packet_get_id(next_packet)); 721 718 } … … 726 723 printf("unexpected\n"); 727 724 /* Release duplicite or restricted */ 728 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));725 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 729 726 forced_ack = true; 730 727 } … … 794 791 if (rc != EOK) 795 792 return tcp_release_and_return(packet, rc); 796 rc = tl_get_ip_packet_dimension(tcp_globals.ip_ phone,793 rc = tl_get_ip_packet_dimension(tcp_globals.ip_sess, 797 794 &tcp_globals.dimensions, socket_data->device_id, &packet_dimension); 798 795 if (rc != EOK) … … 803 800 804 801 /* Notify the destination socket */ 805 async_ obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED,806 802 async_exch_t *exch = async_exchange_begin(socket->sess); 803 async_msg_5(exch, NET_SOCKET_RECEIVED, (sysarg_t) socket->socket_id, 807 804 ((packet_dimension->content < socket_data->data_fragment_size) ? 808 805 packet_dimension->content : socket_data->data_fragment_size), 0, 0, 809 806 (sysarg_t) fragments); 807 async_exchange_end(exch); 810 808 811 809 return EOK; … … 824 822 825 823 /* Notify the destination socket */ 826 async_ obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED,827 828 0, 0, 0, 829 (sysarg_t) 0 /* 0 fragments == no more data */);824 async_exch_t *exch = async_exchange_begin(socket->sess); 825 async_msg_5(exch, NET_SOCKET_RECEIVED, (sysarg_t) socket->socket_id, 826 0, 0, 0, (sysarg_t) 0 /* 0 fragments == no more data */); 827 async_exchange_end(exch); 830 828 } 831 829 … … 853 851 next_packet = pq_detach(packet); 854 852 if (next_packet) { 855 pq_release_remote(tcp_globals.net_ phone,853 pq_release_remote(tcp_globals.net_sess, 856 854 packet_get_id(next_packet)); 857 855 } … … 940 938 /* Create a socket */ 941 939 socket_id = -1; 942 rc = socket_create(socket_data->local_sockets, listening_socket-> phone,940 rc = socket_create(socket_data->local_sockets, listening_socket->sess, 943 941 socket_data, &socket_id); 944 942 if (rc != EOK) { … … 993 991 fibril_rwlock_write_unlock(&tcp_globals.lock); 994 992 if (rc != EOK) { 995 socket_destroy(tcp_globals.net_ phone, socket->socket_id,993 socket_destroy(tcp_globals.net_sess, socket->socket_id, 996 994 socket_data->local_sockets, &tcp_globals.sockets, 997 995 tcp_free_socket_data); … … 1005 1003 next_packet = pq_detach(packet); 1006 1004 if (next_packet) { 1007 pq_release_remote(tcp_globals.net_ phone,1005 pq_release_remote(tcp_globals.net_sess, 1008 1006 packet_get_id(next_packet)); 1009 1007 } … … 1014 1012 packet_get_data_length(packet) - sizeof(*header)); 1015 1013 if (rc != EOK) { 1016 socket_destroy(tcp_globals.net_ phone, socket->socket_id,1014 socket_destroy(tcp_globals.net_sess, socket->socket_id, 1017 1015 socket_data->local_sockets, &tcp_globals.sockets, 1018 1016 tcp_free_socket_data); … … 1025 1023 rc = tcp_queue_packet(socket, socket_data, packet, 1); 1026 1024 if (rc != EOK) { 1027 socket_destroy(tcp_globals.net_ phone, socket->socket_id,1025 socket_destroy(tcp_globals.net_sess, socket->socket_id, 1028 1026 socket_data->local_sockets, &tcp_globals.sockets, 1029 1027 tcp_free_socket_data); … … 1033 1031 packet = tcp_get_packets_to_send(socket, socket_data); 1034 1032 if (!packet) { 1035 socket_destroy(tcp_globals.net_ phone, socket->socket_id,1033 socket_destroy(tcp_globals.net_sess, socket->socket_id, 1036 1034 socket_data->local_sockets, &tcp_globals.sockets, 1037 1035 tcp_free_socket_data); … … 1068 1066 1069 1067 socket_data->next_incoming = ntohl(header->sequence_number); /* + 1; */ 1070 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));1068 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 1071 1069 socket_data->state = TCP_SOCKET_ESTABLISHED; 1072 1070 listening_socket = socket_cores_find(socket_data->local_sockets, … … 1082 1080 if (rc == EOK) { 1083 1081 /* Notify the destination socket */ 1084 async_obsolete_msg_5(socket->phone, NET_SOCKET_ACCEPTED, 1082 async_exch_t *exch = async_exchange_begin(socket->sess); 1083 async_msg_5(exch, NET_SOCKET_ACCEPTED, 1085 1084 (sysarg_t) listening_socket->socket_id, 1086 1085 socket_data->data_fragment_size, TCP_HEADER_SIZE, 1087 1086 0, (sysarg_t) socket->socket_id); 1087 async_exchange_end(exch); 1088 1088 1089 1089 fibril_rwlock_write_unlock(socket_data->local_lock); … … 1181 1181 /* Add to acknowledged or release */ 1182 1182 if (pq_add(&acknowledged, packet, 0, 0) != EOK) 1183 pq_release_remote(tcp_globals.net_ phone,1183 pq_release_remote(tcp_globals.net_sess, 1184 1184 packet_get_id(packet)); 1185 1185 packet = next; … … 1190 1190 /* Release acknowledged */ 1191 1191 if (acknowledged) { 1192 pq_release_remote(tcp_globals.net_ phone,1192 pq_release_remote(tcp_globals.net_sess, 1193 1193 packet_get_id(acknowledged)); 1194 1194 } … … 1234 1234 assert(answer); 1235 1235 assert(answer_count); 1236 1236 1237 1237 *answer_count = 0; 1238 switch (IPC_GET_IMETHOD(*call)) { 1239 case IPC_M_CONNECT_TO_ME: 1240 return tcp_process_client_messages(callid, *call); 1241 } 1242 1238 1239 async_sess_t *callback = 1240 async_callback_receive_start(EXCHANGE_SERIALIZE, call); 1241 if (callback) 1242 return tcp_process_client_messages(callback, callid, *call); 1243 1243 1244 return ENOTSUP; 1244 1245 } … … 1270 1271 } 1271 1272 1272 int tcp_process_client_messages(ipc_callid_t callid, ipc_call_t call) 1273 int tcp_process_client_messages(async_sess_t *sess, ipc_callid_t callid, 1274 ipc_call_t call) 1273 1275 { 1274 1276 int res; 1275 1277 socket_cores_t local_sockets; 1276 int app_phone = IPC_GET_PHONE(call);1277 1278 struct sockaddr *addr; 1278 1279 int socket_id; … … 1325 1326 fibril_rwlock_write_lock(&lock); 1326 1327 socket_id = SOCKET_GET_SOCKET_ID(call); 1327 res = socket_create(&local_sockets, app_phone,1328 res = socket_create(&local_sockets, sess, 1328 1329 socket_data, &socket_id); 1329 1330 SOCKET_SET_SOCKET_ID(answer, socket_id); … … 1333 1334 break; 1334 1335 } 1335 if (tl_get_ip_packet_dimension(tcp_globals.ip_ phone,1336 if (tl_get_ip_packet_dimension(tcp_globals.ip_sess, 1336 1337 &tcp_globals.dimensions, DEVICE_INVALID_ID, 1337 1338 &packet_dimension) == EOK) { … … 1508 1509 } 1509 1510 1510 /* Release the application phone*/1511 async_ obsolete_hangup(app_phone);1511 /* Release the application session */ 1512 async_hangup(sess); 1512 1513 1513 1514 printf("release\n"); 1514 1515 /* Release all local sockets */ 1515 socket_cores_release(tcp_globals.net_ phone, &local_sockets,1516 socket_cores_release(tcp_globals.net_sess, &local_sockets, 1516 1517 &tcp_globals.sockets, tcp_free_socket_data); 1517 1518 … … 1621 1622 local_lock = socket_data->local_lock; 1622 1623 fibril_rwlock_write_lock(local_lock); 1623 socket_destroy(tcp_globals.net_ phone,1624 socket_destroy(tcp_globals.net_sess, 1624 1625 timeout->socket_id, timeout->local_sockets, 1625 1626 &tcp_globals.sockets, tcp_free_socket_data); … … 1754 1755 } 1755 1756 1756 rc = ip_get_route_req(tcp_globals.ip_ phone, IPPROTO_TCP,1757 rc = ip_get_route_req(tcp_globals.ip_sess, IPPROTO_TCP, 1757 1758 addr, addrlen, &socket_data->device_id, 1758 1759 &socket_data->pseudo_header, &socket_data->headerlen); … … 1902 1903 rc = pq_insert_after(previous, copy); 1903 1904 if (rc != EOK) { 1904 pq_release_remote(tcp_globals.net_ phone,1905 pq_release_remote(tcp_globals.net_sess, 1905 1906 packet_get_id(copy)); 1906 1907 return sending; … … 1939 1940 socket_data->headerlen, packet_get_data_length(packet)); 1940 1941 if (rc != EOK) { 1941 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));1942 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 1942 1943 return NULL; 1943 1944 } … … 1946 1947 header = (tcp_header_t *) packet_get_data(packet); 1947 1948 if (!header) { 1948 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));1949 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 1949 1950 return NULL; 1950 1951 } … … 1971 1972 rc = ip_client_prepare_packet(packet, IPPROTO_TCP, 0, 0, 0, 0); 1972 1973 if (rc != EOK) { 1973 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));1974 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 1974 1975 return NULL; 1975 1976 } … … 1978 1979 sequence_number, socket_data->state, socket_data->timeout, true); 1979 1980 if (rc != EOK) { 1980 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));1981 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 1981 1982 return NULL; 1982 1983 } … … 1995 1996 1996 1997 /* Make a copy of the packet */ 1997 copy = packet_get_copy(tcp_globals.net_ phone, packet);1998 copy = packet_get_copy(tcp_globals.net_sess, packet); 1998 1999 if (!copy) 1999 2000 return NULL; … … 2009 2010 while (packet) { 2010 2011 next = pq_detach(packet); 2011 ip_send_msg(tcp_globals.ip_ phone, device_id, packet,2012 ip_send_msg(tcp_globals.ip_sess, device_id, packet, 2012 2013 SERVICE_TCP, 0); 2013 2014 packet = next; … … 2122 2123 return NO_DATA; 2123 2124 2124 rc = packet_translate_remote(tcp_globals.net_ phone, &packet, packet_id);2125 rc = packet_translate_remote(tcp_globals.net_sess, &packet, packet_id); 2125 2126 if (rc != EOK) 2126 2127 return rc; … … 2133 2134 /* Release the packet */ 2134 2135 dyn_fifo_pop(&socket->received); 2135 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));2136 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 2136 2137 2137 2138 /* Return the total length */ … … 2171 2172 return ENOTCONN; 2172 2173 2173 rc = tl_get_ip_packet_dimension(tcp_globals.ip_ phone,2174 rc = tl_get_ip_packet_dimension(tcp_globals.ip_sess, 2174 2175 &tcp_globals.dimensions, socket_data->device_id, &packet_dimension); 2175 2176 if (rc != EOK) … … 2182 2183 for (index = 0; index < fragments; index++) { 2183 2184 /* Read the data fragment */ 2184 result = tl_socket_read_packet_data(tcp_globals.net_ phone,2185 result = tl_socket_read_packet_data(tcp_globals.net_sess, 2185 2186 &packet, TCP_HEADER_SIZE, packet_dimension, 2186 2187 socket_data->addr, socket_data->addrlen); … … 2245 2246 default: 2246 2247 /* Just destroy */ 2247 rc = socket_destroy(tcp_globals.net_ phone, socket_id,2248 rc = socket_destroy(tcp_globals.net_sess, socket_id, 2248 2249 local_sockets, &tcp_globals.sockets, 2249 2250 tcp_free_socket_data); … … 2293 2294 2294 2295 /* Get the device packet dimension */ 2295 rc = tl_get_ip_packet_dimension(tcp_globals.ip_ phone,2296 rc = tl_get_ip_packet_dimension(tcp_globals.ip_sess, 2296 2297 &tcp_globals.dimensions, socket_data->device_id, &packet_dimension); 2297 2298 if (rc != EOK) … … 2299 2300 2300 2301 /* Get a new packet */ 2301 *packet = packet_get_4_remote(tcp_globals.net_ phone, TCP_HEADER_SIZE,2302 *packet = packet_get_4_remote(tcp_globals.net_sess, TCP_HEADER_SIZE, 2302 2303 packet_dimension->addr_len, packet_dimension->prefix, 2303 2304 packet_dimension->suffix); … … 2362 2363 if (rc != EOK) 2363 2364 return rc; 2364 rc = tl_get_ip_packet_dimension(tcp_globals.ip_ phone,2365 rc = tl_get_ip_packet_dimension(tcp_globals.ip_sess, 2365 2366 &tcp_globals.dimensions, socket_data->device_id, 2366 2367 &packet_dimension); … … 2434 2435 int tcp_release_and_return(packet_t *packet, int result) 2435 2436 { 2436 pq_release_remote(tcp_globals.net_ phone, packet_get_id(packet));2437 pq_release_remote(tcp_globals.net_sess, packet_get_id(packet)); 2437 2438 return result; 2438 2439 } … … 2443 2444 * @param[in,out] icall Message parameters. 2444 2445 * @param[in] arg Local argument. 2446 * 2445 2447 */ 2446 2448 static void tcp_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 2452 2454 switch (IPC_GET_IMETHOD(*icall)) { 2453 2455 case NET_TL_RECEIVED: 2454 rc = packet_translate_remote(tcp_globals.net_ phone, &packet,2456 rc = packet_translate_remote(tcp_globals.net_sess, &packet, 2455 2457 IPC_GET_PACKET(*icall)); 2456 2458 if (rc == EOK) … … 2470 2472 /** Initialize the TCP module. 2471 2473 * 2472 * @param[in] net_phone Network module phone.2474 * @param[in] sess Network module session. 2473 2475 * 2474 2476 * @return EOK on success. … … 2476 2478 * 2477 2479 */ 2478 int tl_initialize( int net_phone)2480 int tl_initialize(async_sess_t *sess) 2479 2481 { 2480 2482 fibril_rwlock_initialize(&tcp_globals.lock); 2481 2483 fibril_rwlock_write_lock(&tcp_globals.lock); 2482 2484 2483 tcp_globals.net_ phone = net_phone;2485 tcp_globals.net_sess = sess; 2484 2486 2485 tcp_globals.icmp_ phone= icmp_connect_module();2486 tcp_globals.ip_ phone= ip_bind_service(SERVICE_IP, IPPROTO_TCP,2487 tcp_globals.icmp_sess = icmp_connect_module(); 2488 tcp_globals.ip_sess = ip_bind_service(SERVICE_IP, IPPROTO_TCP, 2487 2489 SERVICE_TCP, tcp_receiver); 2488 if (tcp_globals.ip_ phone < 0) {2490 if (tcp_globals.ip_sess == NULL) { 2489 2491 fibril_rwlock_write_unlock(&tcp_globals.lock); 2490 return tcp_globals.ip_phone;2492 return ENOENT; 2491 2493 } 2492 2494 -
uspace/srv/net/tl/tcp/tcp.h
r55091847 r6b82009 38 38 #define NET_TCP_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 42 #include <net/packet.h> 43 43 #include <net/device.h> … … 284 284 /** TCP global data. */ 285 285 struct tcp_globals { 286 /** Networking module phone. */287 int net_phone;288 /** IP module phone. */289 int ip_phone;290 /** ICMP module phone. */291 int icmp_phone;286 /** Networking module session. */ 287 async_sess_t *net_sess; 288 /** IP module session. */ 289 async_sess_t *ip_sess; 290 /** ICMP module session. */ 291 async_sess_t *icmp_sess; 292 292 /** Last used free port. */ 293 293 int last_used_port; -
uspace/srv/net/tl/udp/udp.c
r55091847 r6b82009 37 37 38 38 #include <async.h> 39 #include <async_obsolete.h>40 39 #include <fibril_synch.h> 41 40 #include <malloc.h> … … 71 70 #include "udp_header.h" 72 71 73 // FIXME: remove this header74 #include <kernel/ipc/ipc_methods.h>75 76 72 /** UDP module name. */ 77 73 #define NAME "udp" … … 103 99 static int udp_release_and_return(packet_t *packet, int result) 104 100 { 105 pq_release_remote(udp_globals.net_ phone, packet_get_id(packet));101 pq_release_remote(udp_globals.net_sess, packet_get_id(packet)); 106 102 return result; 107 103 } … … 196 192 ntohs(header->destination_port), (uint8_t *) SOCKET_MAP_KEY_LISTENING, 0); 197 193 if (!socket) { 198 if (tl_prepare_icmp_packet(udp_globals.net_ phone,199 udp_globals.icmp_ phone, packet, error) == EOK) {200 icmp_destination_unreachable_msg(udp_globals.icmp_ phone,194 if (tl_prepare_icmp_packet(udp_globals.net_sess, 195 udp_globals.icmp_sess, packet, error) == EOK) { 196 icmp_destination_unreachable_msg(udp_globals.icmp_sess, 201 197 ICMP_PORT_UNREACH, 0, packet); 202 198 } … … 255 251 while (tmp_packet) { 256 252 next_packet = pq_detach(tmp_packet); 257 pq_release_remote(udp_globals.net_ phone,253 pq_release_remote(udp_globals.net_sess, 258 254 packet_get_id(tmp_packet)); 259 255 tmp_packet = next_packet; … … 278 274 if (flip_checksum(compact_checksum(checksum)) != 279 275 IP_CHECKSUM_ZERO) { 280 if (tl_prepare_icmp_packet(udp_globals.net_ phone,281 udp_globals.icmp_ phone, packet, error) == EOK) {276 if (tl_prepare_icmp_packet(udp_globals.net_sess, 277 udp_globals.icmp_sess, packet, error) == EOK) { 282 278 /* Checksum error ICMP */ 283 279 icmp_parameter_problem_msg( 284 udp_globals.icmp_ phone, ICMP_PARAM_POINTER,280 udp_globals.icmp_sess, ICMP_PARAM_POINTER, 285 281 ((size_t) ((void *) &header->checksum)) - 286 282 ((size_t) ((void *) header)), packet); … … 296 292 return udp_release_and_return(packet, rc); 297 293 298 rc = tl_get_ip_packet_dimension(udp_globals.ip_ phone,294 rc = tl_get_ip_packet_dimension(udp_globals.ip_sess, 299 295 &udp_globals.dimensions, device_id, &packet_dimension); 300 296 if (rc != EOK) … … 303 299 /* Notify the destination socket */ 304 300 fibril_rwlock_write_unlock(&udp_globals.lock); 305 async_obsolete_msg_5(socket->phone, NET_SOCKET_RECEIVED, 306 (sysarg_t) socket->socket_id, packet_dimension->content, 0, 0, 307 (sysarg_t) fragments); 301 302 async_exch_t *exch = async_exchange_begin(socket->sess); 303 async_msg_5(exch, NET_SOCKET_RECEIVED, (sysarg_t) socket->socket_id, 304 packet_dimension->content, 0, 0, (sysarg_t) fragments); 305 async_exchange_end(exch); 308 306 309 307 return EOK; … … 342 340 * @param[in,out] icall Message parameters. 343 341 * @param[in] arg Local argument. 342 * 344 343 */ 345 344 static void udp_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 351 350 switch (IPC_GET_IMETHOD(*icall)) { 352 351 case NET_TL_RECEIVED: 353 rc = packet_translate_remote(udp_globals.net_ phone, &packet,352 rc = packet_translate_remote(udp_globals.net_sess, &packet, 354 353 IPC_GET_PACKET(*icall)); 355 354 if (rc == EOK) … … 369 368 /** Initialize the UDP module. 370 369 * 371 * @param[in] net_phone Network module phone.370 * @param[in] sess Network module session. 372 371 * 373 372 * @return EOK on success. … … 375 374 * 376 375 */ 377 int tl_initialize( int net_phone)376 int tl_initialize(async_sess_t *sess) 378 377 { 379 378 measured_string_t names[] = { … … 394 393 fibril_rwlock_write_lock(&udp_globals.lock); 395 394 396 udp_globals.net_phone = net_phone; 397 398 udp_globals.icmp_phone = icmp_connect_module(); 399 400 udp_globals.ip_phone = ip_bind_service(SERVICE_IP, IPPROTO_UDP, 401 SERVICE_UDP, udp_receiver); 402 if (udp_globals.ip_phone < 0) { 403 fibril_rwlock_write_unlock(&udp_globals.lock); 404 return udp_globals.ip_phone; 395 udp_globals.net_sess = sess; 396 udp_globals.icmp_sess = icmp_connect_module(); 397 398 udp_globals.ip_sess = ip_bind_service(SERVICE_IP, IPPROTO_UDP, 399 SERVICE_UDP, udp_receiver); 400 if (udp_globals.ip_sess == NULL) { 401 fibril_rwlock_write_unlock(&udp_globals.lock); 402 return ENOENT; 405 403 } 406 404 407 405 /* Read default packet dimensions */ 408 int rc = ip_packet_size_req(udp_globals.ip_ phone, -1,406 int rc = ip_packet_size_req(udp_globals.ip_sess, -1, 409 407 &udp_globals.packet_dimension); 410 408 if (rc != EOK) { … … 435 433 /* Get configuration */ 436 434 configuration = &names[0]; 437 rc = net_get_conf_req(udp_globals.net_ phone, &configuration, count,435 rc = net_get_conf_req(udp_globals.net_sess, &configuration, count, 438 436 &data); 439 437 if (rc != EOK) { … … 529 527 530 528 if (udp_globals.checksum_computing) { 531 rc = ip_get_route_req(udp_globals.ip_ phone, IPPROTO_UDP, addr,529 rc = ip_get_route_req(udp_globals.ip_sess, IPPROTO_UDP, addr, 532 530 addrlen, &device_id, &ip_header, &headerlen); 533 531 if (rc != EOK) 534 532 return rc; 535 533 /* Get the device packet dimension */ 536 // rc = tl_get_ip_packet_dimension(udp_globals.ip_ phone,534 // rc = tl_get_ip_packet_dimension(udp_globals.ip_sess, 537 535 // &udp_globals.dimensions, device_id, &packet_dimension); 538 536 // if (rc != EOK) … … 541 539 // } else { 542 540 /* Do not ask all the time */ 543 rc = ip_packet_size_req(udp_globals.ip_ phone, -1,541 rc = ip_packet_size_req(udp_globals.ip_sess, -1, 544 542 &udp_globals.packet_dimension); 545 543 if (rc != EOK) … … 559 557 560 558 /* Read the first packet fragment */ 561 result = tl_socket_read_packet_data(udp_globals.net_ phone, &packet,559 result = tl_socket_read_packet_data(udp_globals.net_sess, &packet, 562 560 UDP_HEADER_SIZE, packet_dimension, addr, addrlen); 563 561 if (result < 0) … … 580 578 /* Read the rest of the packet fragments */ 581 579 for (index = 1; index < fragments; index++) { 582 result = tl_socket_read_packet_data(udp_globals.net_ phone,580 result = tl_socket_read_packet_data(udp_globals.net_sess, 583 581 &next_packet, 0, packet_dimension, addr, addrlen); 584 582 if (result < 0) … … 632 630 633 631 /* Send the packet */ 634 ip_send_msg(udp_globals.ip_ phone, device_id, packet, SERVICE_UDP, 0);632 ip_send_msg(udp_globals.ip_sess, device_id, packet, SERVICE_UDP, 0); 635 633 636 634 return EOK; … … 679 677 return NO_DATA; 680 678 681 rc = packet_translate_remote(udp_globals.net_ phone, &packet, packet_id);679 rc = packet_translate_remote(udp_globals.net_sess, &packet, packet_id); 682 680 if (rc != EOK) { 683 681 (void) dyn_fifo_pop(&socket->received); … … 739 737 } 740 738 741 /** Processes the socket client messages. 742 * 743 * Runs until the client module disconnects. 744 * 745 * @param[in] callid The message identifier. 746 * @param[in] call The message parameters. 747 * @return EOK on success. 748 * 749 * @see socket.h 750 */ 751 static int udp_process_client_messages(ipc_callid_t callid, ipc_call_t call) 739 /** Process the socket client messages. 740 * 741 * Run until the client module disconnects. 742 * 743 * @see socket.h 744 * 745 * @param[in] sess Callback session. 746 * @param[in] callid Message identifier. 747 * @param[in] call Message parameters. 748 * 749 * @return EOK on success. 750 * 751 */ 752 static int udp_process_client_messages(async_sess_t *sess, ipc_callid_t callid, 753 ipc_call_t call) 752 754 { 753 755 int res; 754 756 socket_cores_t local_sockets; 755 int app_phone = IPC_GET_PHONE(call);756 757 struct sockaddr *addr; 757 758 int socket_id; … … 786 787 /* Get the next call */ 787 788 callid = async_get_call(&call); 788 789 790 /* Process the call */ 789 791 if (!IPC_GET_IMETHOD(call)) { 790 792 res = EHANGUP; 791 793 break; 792 794 } 793 794 /* Process the call */ 795 795 796 switch (IPC_GET_IMETHOD(call)) { 796 797 case NET_SOCKET: 797 798 socket_id = SOCKET_GET_SOCKET_ID(call); 798 res = socket_create(&local_sockets, app_phone, NULL,799 res = socket_create(&local_sockets, sess, NULL, 799 800 &socket_id); 800 801 SOCKET_SET_SOCKET_ID(answer, socket_id); … … 804 805 805 806 size = MAX_UDP_FRAGMENT_SIZE; 806 if (tl_get_ip_packet_dimension(udp_globals.ip_ phone,807 if (tl_get_ip_packet_dimension(udp_globals.ip_sess, 807 808 &udp_globals.dimensions, DEVICE_INVALID_ID, 808 809 &packet_dimension) == EOK) { … … 868 869 case NET_SOCKET_CLOSE: 869 870 fibril_rwlock_write_lock(&udp_globals.lock); 870 res = socket_destroy(udp_globals.net_ phone,871 res = socket_destroy(udp_globals.net_sess, 871 872 SOCKET_GET_SOCKET_ID(call), &local_sockets, 872 873 &udp_globals.sockets, NULL); … … 882 883 } 883 884 884 /* Release the application phone*/885 async_ obsolete_hangup(app_phone);885 /* Release the application session */ 886 async_hangup(sess); 886 887 887 888 /* Release all local sockets */ 888 socket_cores_release(udp_globals.net_ phone, &local_sockets,889 socket_cores_release(udp_globals.net_sess, &local_sockets, 889 890 &udp_globals.sockets, NULL); 890 891 … … 916 917 { 917 918 *answer_count = 0; 918 919 switch (IPC_GET_IMETHOD(*call)) {920 case IPC_M_CONNECT_TO_ME:921 return udp_process_client_messages(callid, *call);922 }923 919 920 async_sess_t *callback = 921 async_callback_receive_start(EXCHANGE_SERIALIZE, call); 922 if (callback) 923 return udp_process_client_messages(callback, callid, *call); 924 924 925 return ENOTSUP; 925 926 } -
uspace/srv/net/tl/udp/udp.h
r55091847 r6b82009 38 38 #define NET_UDP_H_ 39 39 40 #include <async.h> 40 41 #include <fibril_synch.h> 41 42 #include <socket_core.h> … … 49 50 /** UDP global data. */ 50 51 struct udp_globals { 51 /** Networking module phone. */52 int net_phone;53 /** IP module phone. */54 int ip_phone;55 /** ICMP module phone. */56 int icmp_phone;52 /** Networking module session. */ 53 async_sess_t *net_sess; 54 /** IP module session. */ 55 async_sess_t *ip_sess; 56 /** ICMP module session. */ 57 async_sess_t *icmp_sess; 57 58 /** Packet dimension. */ 58 59 packet_dimension_t packet_dimension;
Note:
See TracChangeset
for help on using the changeset viewer.