Ignore:
File:
1 edited

Legend:

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

    r7880d58 r1bfd3d3  
    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             (sysarg_t) ip_netif->device_id, SERVICE_IP,
     432            (ipcarg_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 = sizeof(in_addr_t);
     444                        address.length = CONVERT_SIZE(in_addr_t, char, 1);
    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 %zu bytes is too small, at "
     463                printf("Maximum transmission unit %d 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 %zu\n", NAME, device_id, mtu);
     504        printf("%s: Device %d changed MTU to %d\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                     destination->length);
     641                    CONVERT_SIZE(char, uint8_t, 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                                     destination->length);
     689                                    CONVERT_SIZE(char, uint8_t,
     690                                    destination->length));
    690691                                if (rc != EOK) {
    691692                                        free(last_header);
     
    717718                        rc = packet_set_addr(next, NULL,
    718719                            (uint8_t *) destination->value,
    719                             destination->length);
     720                            CONVERT_SIZE(char, uint8_t, destination->length));
    720721                        if (rc != EOK) {
    721722                                free(last_header);
     
    753754 */
    754755static int
    755 ip_fragment_packet_data(packet_t *packet, packet_t *new_packet,
     756ip_fragment_packet_data(packet_t packet, packet_t new_packet,
    756757    ip_header_t *header, ip_header_t *new_header, size_t length,
    757758    const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen)
     
    815816 */
    816817static int
    817 ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix,
     818ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,
    818819    socklen_t addr_len)
    819820{
    820         packet_t *new_packet;
     821        packet_t new_packet;
    821822        ip_header_t *header;
    822823        ip_header_t *middle_header;
     
    921922 * @return              NULL if there are no packets left.
    922923 */
    923 static packet_t *
    924 ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix,
     924static packet_t
     925ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,
    925926    socklen_t addr_len, services_t error)
    926927{
    927928        size_t length;
    928         packet_t *next;
    929         packet_t *new_packet;
     929        packet_t next;
     930        packet_t new_packet;
    930931        int result;
    931932        int phone;
     
    992993 */
    993994static int
    994 ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route,
     995ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route,
    995996    in_addr_t *src, in_addr_t dest, services_t error)
    996997{
     
    10051006                destination.value = route->gateway.s_addr ?
    10061007                    (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);
    10081009
    10091010                rc = arp_translate_req(netif->arp->phone, netif->device_id,
     
    12461247
    12471248static int
    1248 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet,
     1249ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,
    12491250    services_t sender, services_t error)
    12501251{
     
    14501451 */
    14511452static int
    1452 ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header,
     1453ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,
    14531454    services_t error)
    14541455{
     
    15521553 */
    15531554static int
    1554 ip_process_packet(device_id_t device_id, packet_t *packet)
     1555ip_process_packet(device_id_t device_id, packet_t packet)
    15551556{
    15561557        ip_header_t *header;
     
    17141715static int
    17151716ip_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)
    17171718{
    17181719        uint8_t *data;
     
    17571758                        // clear the ARP mapping if any
    17581759                        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));
    17601762                        arp_clear_address_req(netif->arp->phone,
    17611763                            netif->device_id, SERVICE_IP, &address);
     
    18571859 * @return              ENOMEM if there is not enough memory left.
    18581860 */
    1859 static int ip_receive_message(device_id_t device_id, packet_t *packet)
    1860 {
    1861         packet_t *next;
     1861static int ip_receive_message(device_id_t device_id, packet_t packet)
     1862{
     1863        packet_t next;
    18621864
    18631865        do {
     
    18881890    int *answer_count)
    18891891{
    1890         packet_t *packet;
     1892        packet_t packet;
    18911893        struct sockaddr *addr;
    18921894        size_t addrlen;
     
    19001902       
    19011903        *answer_count = 0;
    1902         switch (IPC_GET_IMETHOD(*call)) {
     1904        switch (IPC_GET_METHOD(*call)) {
    19031905        case IPC_M_PHONE_HUNGUP:
    19041906                return EOK;
     
    19491951
    19501952        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);
    19531954                if (rc != EOK)
    19541955                        return rc;
     
    20242025                 * result.
    20252026                 */
    2026                 if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
     2027                if ((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) ||
    20272028                    (res == EHANGUP)) {
    20282029                        return;
Note: See TracChangeset for help on using the changeset viewer.