Changes in uspace/srv/net/il/ip/ip.c [7880d58:1bfd3d3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/ip/ip.c
r7880d58 r1bfd3d3 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 ( sysarg_t) ip_netif->device_id, SERVICE_IP,432 (ipcarg_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 = sizeof(in_addr_t);444 address.length = CONVERT_SIZE(in_addr_t, char, 1); 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 % zubytes is too small, at "463 printf("Maximum transmission unit %d 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 % zu\n", NAME, device_id, mtu);504 printf("%s: Device %d changed MTU to %d\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 destination->length);641 CONVERT_SIZE(char, uint8_t, 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 destination->length); 689 CONVERT_SIZE(char, uint8_t, 690 destination->length)); 690 691 if (rc != EOK) { 691 692 free(last_header); … … 717 718 rc = packet_set_addr(next, NULL, 718 719 (uint8_t *) destination->value, 719 destination->length);720 CONVERT_SIZE(char, uint8_t, destination->length)); 720 721 if (rc != EOK) { 721 722 free(last_header); … … 753 754 */ 754 755 static int 755 ip_fragment_packet_data(packet_t *packet, packet_t *new_packet,756 ip_fragment_packet_data(packet_t packet, packet_t new_packet, 756 757 ip_header_t *header, ip_header_t *new_header, size_t length, 757 758 const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen) … … 815 816 */ 816 817 static int 817 ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix,818 ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix, 818 819 socklen_t addr_len) 819 820 { 820 packet_t *new_packet;821 packet_t new_packet; 821 822 ip_header_t *header; 822 823 ip_header_t *middle_header; … … 921 922 * @return NULL if there are no packets left. 922 923 */ 923 static packet_t *924 ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix,924 static packet_t 925 ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix, 925 926 socklen_t addr_len, services_t error) 926 927 { 927 928 size_t length; 928 packet_t *next;929 packet_t *new_packet;929 packet_t next; 930 packet_t new_packet; 930 931 int result; 931 932 int phone; … … 992 993 */ 993 994 static int 994 ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route,995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route, 995 996 in_addr_t *src, in_addr_t dest, services_t error) 996 997 { … … 1005 1006 destination.value = route->gateway.s_addr ? 1006 1007 (char *) &route->gateway.s_addr : (char *) &dest.s_addr; 1007 destination.length = sizeof(dest.s_addr);1008 destination.length = CONVERT_SIZE(dest.s_addr, char, 1); 1008 1009 1009 1010 rc = arp_translate_req(netif->arp->phone, netif->device_id, … … 1246 1247 1247 1248 static int 1248 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet,1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet, 1249 1250 services_t sender, services_t error) 1250 1251 { … … 1450 1451 */ 1451 1452 static int 1452 ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header,1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header, 1453 1454 services_t error) 1454 1455 { … … 1552 1553 */ 1553 1554 static int 1554 ip_process_packet(device_id_t device_id, packet_t *packet)1555 ip_process_packet(device_id_t device_id, packet_t packet) 1555 1556 { 1556 1557 ip_header_t *header; … … 1714 1715 static int 1715 1716 ip_received_error_msg_local(int ip_phone, device_id_t device_id, 1716 packet_t *packet, services_t target, services_t error)1717 packet_t packet, services_t target, services_t error) 1717 1718 { 1718 1719 uint8_t *data; … … 1757 1758 // clear the ARP mapping if any 1758 1759 address.value = (char *) &header->destination_address; 1759 address.length = sizeof(header->destination_address); 1760 address.length = CONVERT_SIZE(uint8_t, char, 1761 sizeof(header->destination_address)); 1760 1762 arp_clear_address_req(netif->arp->phone, 1761 1763 netif->device_id, SERVICE_IP, &address); … … 1857 1859 * @return ENOMEM if there is not enough memory left. 1858 1860 */ 1859 static int ip_receive_message(device_id_t device_id, packet_t *packet)1860 { 1861 packet_t *next;1861 static int ip_receive_message(device_id_t device_id, packet_t packet) 1862 { 1863 packet_t next; 1862 1864 1863 1865 do { … … 1888 1890 int *answer_count) 1889 1891 { 1890 packet_t *packet;1892 packet_t packet; 1891 1893 struct sockaddr *addr; 1892 1894 size_t addrlen; … … 1900 1902 1901 1903 *answer_count = 0; 1902 switch (IPC_GET_ IMETHOD(*call)) {1904 switch (IPC_GET_METHOD(*call)) { 1903 1905 case IPC_M_PHONE_HUNGUP: 1904 1906 return EOK; … … 1949 1951 1950 1952 case NET_IP_GET_ROUTE: 1951 rc = async_data_write_accept((void **) &addr, false, 0, 0, 0, 1952 &addrlen); 1953 rc = data_receive((void **) &addr, &addrlen); 1953 1954 if (rc != EOK) 1954 1955 return rc; … … 2024 2025 * result. 2025 2026 */ 2026 if ((IPC_GET_ IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||2027 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || 2027 2028 (res == EHANGUP)) { 2028 2029 return;
Note:
See TracChangeset
for help on using the changeset viewer.