Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.c

    r1bfd3d3 r7880d58  
    129129 * @return              The result parameter.
    130130 */
    131 static int ip_release_and_return(packet_t packet, int result)
     131static int ip_release_and_return(packet_t *packet, int result)
    132132{
    133133        pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
     
    170170 * @return              Other error codes as defined for the packet_set_addr().
    171171 */
    172 static int ip_prepare_icmp(packet_t packet, ip_header_t *header)
    173 {
    174         packet_t next;
     172static int ip_prepare_icmp(packet_t *packet, ip_header_t *header)
     173{
     174        packet_t *next;
    175175        struct sockaddr *dest;
    176176        struct sockaddr_in dest_in;
     
    233233 */
    234234static int
    235 ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,
     235ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet,
    236236    ip_header_t *header)
    237237{
     
    430430        // binds the netif service which also initializes the device
    431431        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,
    433433            ip_globals.client_connection);
    434434        if (ip_netif->phone < 0) {
     
    442442                if (route) {
    443443                        address.value = (char *) &route->address.s_addr;
    444                         address.length = CONVERT_SIZE(in_addr_t, char, 1);
     444                        address.length = sizeof(in_addr_t);
    445445                       
    446446                        rc = arp_device_req(ip_netif->arp->phone,
     
    461461       
    462462        if (ip_netif->packet_dimension.content < IP_MIN_CONTENT) {
    463                 printf("Maximum transmission unit %d bytes is too small, at "
     463                printf("Maximum transmission unit %zu bytes is too small, at "
    464464                    "least %d bytes are needed\n",
    465465                    ip_netif->packet_dimension.content, IP_MIN_CONTENT);
     
    502502        fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
    503503
    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);
    505505
    506506        return EOK;
     
    543543 */
    544544static ip_header_t *
    545 ip_create_middle_header(packet_t packet, ip_header_t *last)
     545ip_create_middle_header(packet_t *packet, ip_header_t *last)
    546546{
    547547        ip_header_t *middle;
     
    622622 */
    623623static int
    624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,
     624ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t *packet,
    625625    measured_string_t *destination)
    626626{
     
    629629        ip_header_t *last_header;
    630630        ip_header_t *middle_header;
    631         packet_t next;
     631        packet_t *next;
    632632        int rc;
    633633
     
    639639        if (destination) {
    640640                rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value,
    641                     CONVERT_SIZE(char, uint8_t, destination->length));
     641                    destination->length);
    642642        } else {
    643643                rc = packet_set_addr(packet, NULL, NULL, 0);
     
    687687                                rc = packet_set_addr(next, NULL,
    688688                                    (uint8_t *) destination->value,
    689                                     CONVERT_SIZE(char, uint8_t,
    690                                     destination->length));
     689                                    destination->length);
    691690                                if (rc != EOK) {
    692691                                        free(last_header);
     
    718717                        rc = packet_set_addr(next, NULL,
    719718                            (uint8_t *) destination->value,
    720                             CONVERT_SIZE(char, uint8_t, destination->length));
     719                            destination->length);
    721720                        if (rc != EOK) {
    722721                                free(last_header);
     
    754753 */
    755754static int
    756 ip_fragment_packet_data(packet_t packet, packet_t new_packet,
     755ip_fragment_packet_data(packet_t *packet, packet_t *new_packet,
    757756    ip_header_t *header, ip_header_t *new_header, size_t length,
    758757    const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen)
     
    816815 */
    817816static int
    818 ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,
     817ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix,
    819818    socklen_t addr_len)
    820819{
    821         packet_t new_packet;
     820        packet_t *new_packet;
    822821        ip_header_t *header;
    823822        ip_header_t *middle_header;
     
    922921 * @return              NULL if there are no packets left.
    923922 */
    924 static packet_t
    925 ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,
     923static packet_t *
     924ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix,
    926925    socklen_t addr_len, services_t error)
    927926{
    928927        size_t length;
    929         packet_t next;
    930         packet_t new_packet;
     928        packet_t *next;
     929        packet_t *new_packet;
    931930        int result;
    932931        int phone;
     
    993992 */
    994993static int
    995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route,
     994ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route,
    996995    in_addr_t *src, in_addr_t dest, services_t error)
    997996{
     
    10061005                destination.value = route->gateway.s_addr ?
    10071006                    (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);
    10091008
    10101009                rc = arp_translate_req(netif->arp->phone, netif->device_id,
     
    12471246
    12481247static int
    1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,
     1248ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet,
    12501249    services_t sender, services_t error)
    12511250{
     
    14511450 */
    14521451static int
    1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,
     1452ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header,
    14541453    services_t error)
    14551454{
     
    15531552 */
    15541553static int
    1555 ip_process_packet(device_id_t device_id, packet_t packet)
     1554ip_process_packet(device_id_t device_id, packet_t *packet)
    15561555{
    15571556        ip_header_t *header;
     
    17151714static int
    17161715ip_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)
    17181717{
    17191718        uint8_t *data;
     
    17581757                        // clear the ARP mapping if any
    17591758                        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);
    17621760                        arp_clear_address_req(netif->arp->phone,
    17631761                            netif->device_id, SERVICE_IP, &address);
     
    18591857 * @return              ENOMEM if there is not enough memory left.
    18601858 */
    1861 static int ip_receive_message(device_id_t device_id, packet_t packet)
    1862 {
    1863         packet_t next;
     1859static int ip_receive_message(device_id_t device_id, packet_t *packet)
     1860{
     1861        packet_t *next;
    18641862
    18651863        do {
     
    18901888    int *answer_count)
    18911889{
    1892         packet_t packet;
     1890        packet_t *packet;
    18931891        struct sockaddr *addr;
    18941892        size_t addrlen;
     
    19021900       
    19031901        *answer_count = 0;
    1904         switch (IPC_GET_METHOD(*call)) {
     1902        switch (IPC_GET_IMETHOD(*call)) {
    19051903        case IPC_M_PHONE_HUNGUP:
    19061904                return EOK;
     
    19511949
    19521950        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);
    19541953                if (rc != EOK)
    19551954                        return rc;
     
    20252024                 * result.
    20262025                 */
    2027                 if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
     2026                if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
    20282027                    (res == EHANGUP)) {
    20292028                        return;
Note: See TracChangeset for help on using the changeset viewer.