Changes in uspace/srv/net/il/ip/ip.c [1bfd3d3:7880d58] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/ip/ip.c
r1bfd3d3 r7880d58 129 129 * @return The result parameter. 130 130 */ 131 static int ip_release_and_return(packet_t packet, int result)131 static int ip_release_and_return(packet_t *packet, int result) 132 132 { 133 133 pq_release_remote(ip_globals.net_phone, packet_get_id(packet)); … … 170 170 * @return Other error codes as defined for the packet_set_addr(). 171 171 */ 172 static int ip_prepare_icmp(packet_t packet, ip_header_t *header)173 { 174 packet_t next;172 static int ip_prepare_icmp(packet_t *packet, ip_header_t *header) 173 { 174 packet_t *next; 175 175 struct sockaddr *dest; 176 176 struct sockaddr_in dest_in; … … 233 233 */ 234 234 static int 235 ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,235 ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet, 236 236 ip_header_t *header) 237 237 { … … 430 430 // binds the netif service which also initializes the device 431 431 ip_netif->phone = nil_bind_service(ip_netif->service, 432 ( ipcarg_t) ip_netif->device_id, SERVICE_IP,432 (sysarg_t) ip_netif->device_id, SERVICE_IP, 433 433 ip_globals.client_connection); 434 434 if (ip_netif->phone < 0) { … … 442 442 if (route) { 443 443 address.value = (char *) &route->address.s_addr; 444 address.length = CONVERT_SIZE(in_addr_t, char, 1);444 address.length = sizeof(in_addr_t); 445 445 446 446 rc = arp_device_req(ip_netif->arp->phone, … … 461 461 462 462 if (ip_netif->packet_dimension.content < IP_MIN_CONTENT) { 463 printf("Maximum transmission unit % dbytes is too small, at "463 printf("Maximum transmission unit %zu bytes is too small, at " 464 464 "least %d bytes are needed\n", 465 465 ip_netif->packet_dimension.content, IP_MIN_CONTENT); … … 502 502 fibril_rwlock_write_unlock(&ip_globals.netifs_lock); 503 503 504 printf("%s: Device %d changed MTU to % d\n", NAME, device_id, mtu);504 printf("%s: Device %d changed MTU to %zu\n", NAME, device_id, mtu); 505 505 506 506 return EOK; … … 543 543 */ 544 544 static ip_header_t * 545 ip_create_middle_header(packet_t packet, ip_header_t *last)545 ip_create_middle_header(packet_t *packet, ip_header_t *last) 546 546 { 547 547 ip_header_t *middle; … … 622 622 */ 623 623 static int 624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t *packet, 625 625 measured_string_t *destination) 626 626 { … … 629 629 ip_header_t *last_header; 630 630 ip_header_t *middle_header; 631 packet_t next;631 packet_t *next; 632 632 int rc; 633 633 … … 639 639 if (destination) { 640 640 rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value, 641 CONVERT_SIZE(char, uint8_t, destination->length));641 destination->length); 642 642 } else { 643 643 rc = packet_set_addr(packet, NULL, NULL, 0); … … 687 687 rc = packet_set_addr(next, NULL, 688 688 (uint8_t *) destination->value, 689 CONVERT_SIZE(char, uint8_t, 690 destination->length)); 689 destination->length); 691 690 if (rc != EOK) { 692 691 free(last_header); … … 718 717 rc = packet_set_addr(next, NULL, 719 718 (uint8_t *) destination->value, 720 CONVERT_SIZE(char, uint8_t, destination->length));719 destination->length); 721 720 if (rc != EOK) { 722 721 free(last_header); … … 754 753 */ 755 754 static int 756 ip_fragment_packet_data(packet_t packet, packet_tnew_packet,755 ip_fragment_packet_data(packet_t *packet, packet_t *new_packet, 757 756 ip_header_t *header, ip_header_t *new_header, size_t length, 758 757 const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen) … … 816 815 */ 817 816 static int 818 ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,817 ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix, 819 818 socklen_t addr_len) 820 819 { 821 packet_t new_packet;820 packet_t *new_packet; 822 821 ip_header_t *header; 823 822 ip_header_t *middle_header; … … 922 921 * @return NULL if there are no packets left. 923 922 */ 924 static packet_t 925 ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,923 static packet_t * 924 ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix, 926 925 socklen_t addr_len, services_t error) 927 926 { 928 927 size_t length; 929 packet_t next;930 packet_t new_packet;928 packet_t *next; 929 packet_t *new_packet; 931 930 int result; 932 931 int phone; … … 993 992 */ 994 993 static int 995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route,994 ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route, 996 995 in_addr_t *src, in_addr_t dest, services_t error) 997 996 { … … 1006 1005 destination.value = route->gateway.s_addr ? 1007 1006 (char *) &route->gateway.s_addr : (char *) &dest.s_addr; 1008 destination.length = CONVERT_SIZE(dest.s_addr, char, 1);1007 destination.length = sizeof(dest.s_addr); 1009 1008 1010 1009 rc = arp_translate_req(netif->arp->phone, netif->device_id, … … 1247 1246 1248 1247 static int 1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,1248 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet, 1250 1249 services_t sender, services_t error) 1251 1250 { … … 1451 1450 */ 1452 1451 static int 1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,1452 ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header, 1454 1453 services_t error) 1455 1454 { … … 1553 1552 */ 1554 1553 static int 1555 ip_process_packet(device_id_t device_id, packet_t packet)1554 ip_process_packet(device_id_t device_id, packet_t *packet) 1556 1555 { 1557 1556 ip_header_t *header; … … 1715 1714 static int 1716 1715 ip_received_error_msg_local(int ip_phone, device_id_t device_id, 1717 packet_t packet, services_t target, services_t error)1716 packet_t *packet, services_t target, services_t error) 1718 1717 { 1719 1718 uint8_t *data; … … 1758 1757 // clear the ARP mapping if any 1759 1758 address.value = (char *) &header->destination_address; 1760 address.length = CONVERT_SIZE(uint8_t, char, 1761 sizeof(header->destination_address)); 1759 address.length = sizeof(header->destination_address); 1762 1760 arp_clear_address_req(netif->arp->phone, 1763 1761 netif->device_id, SERVICE_IP, &address); … … 1859 1857 * @return ENOMEM if there is not enough memory left. 1860 1858 */ 1861 static int ip_receive_message(device_id_t device_id, packet_t packet)1862 { 1863 packet_t next;1859 static int ip_receive_message(device_id_t device_id, packet_t *packet) 1860 { 1861 packet_t *next; 1864 1862 1865 1863 do { … … 1890 1888 int *answer_count) 1891 1889 { 1892 packet_t packet;1890 packet_t *packet; 1893 1891 struct sockaddr *addr; 1894 1892 size_t addrlen; … … 1902 1900 1903 1901 *answer_count = 0; 1904 switch (IPC_GET_ METHOD(*call)) {1902 switch (IPC_GET_IMETHOD(*call)) { 1905 1903 case IPC_M_PHONE_HUNGUP: 1906 1904 return EOK; … … 1951 1949 1952 1950 case NET_IP_GET_ROUTE: 1953 rc = data_receive((void **) &addr, &addrlen); 1951 rc = async_data_write_accept((void **) &addr, false, 0, 0, 0, 1952 &addrlen); 1954 1953 if (rc != EOK) 1955 1954 return rc; … … 2025 2024 * result. 2026 2025 */ 2027 if ((IPC_GET_ METHOD(call) == IPC_M_PHONE_HUNGUP) ||2026 if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) || 2028 2027 (res == EHANGUP)) { 2029 2028 return;
Note:
See TracChangeset
for help on using the changeset viewer.