Changeset d7ff048 in mainline for uspace/srv/net/il/ip/ip.c


Ignore:
Timestamp:
2011-10-08T13:08:53Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf08ff0
Parents:
8367d1d (diff), 80099c19 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r8367d1d rd7ff048  
    354354        ip_netif->routing = NET_DEFAULT_IP_ROUTING;
    355355        configuration = &names[0];
    356 
     356       
    357357        /* Get configuration */
    358358        rc = net_get_device_conf_req(ip_globals.net_sess, ip_netif->device_id,
     
    406406                        return ENOTSUP;
    407407                }
    408 
     408               
    409409                if (configuration[6].value) {
    410410                        ip_netif->arp = get_running_module(&ip_globals.modules,
     
    417417                        }
    418418                }
     419               
    419420                if (configuration[7].value)
    420421                        ip_netif->routing = (configuration[7].value[0] == 'y');
    421 
     422               
    422423                net_free_settings(configuration, data);
    423424        }
    424 
     425       
    425426        /* Bind netif service which also initializes the device */
    426427        ip_netif->sess = nil_bind_service(ip_netif->service,
     
    432433                return ENOENT;
    433434        }
    434 
     435       
    435436        /* Has to be after the device netif module initialization */
    436437        if (ip_netif->arp) {
     
    448449                }
    449450        }
    450 
     451       
    451452        /* Get packet dimensions */
    452453        rc = nil_packet_size_req(ip_netif->sess, ip_netif->device_id,
     
    461462                ip_netif->packet_dimension.content = IP_MIN_CONTENT;
    462463        }
    463 
     464       
    464465        index = ip_netifs_add(&ip_globals.netifs, ip_netif->device_id, ip_netif);
    465466        if (index < 0)
     
    478479                printf("%s: Default gateway (%s)\n", NAME, defgateway);
    479480        }
    480 
     481       
    481482        return EOK;
    482483}
    483484
    484 static int ip_device_req_local(device_id_t device_id, services_t netif)
     485static int ip_device_req_local(nic_device_id_t device_id, services_t netif)
    485486{
    486487        ip_netif_t *ip_netif;
     
    498499                return rc;
    499500        }
    500 
     501       
    501502        ip_netif->device_id = device_id;
    502503        ip_netif->service = netif;
    503         ip_netif->state = NETIF_STOPPED;
    504 
     504        ip_netif->state = NIC_STATE_STOPPED;
     505       
    505506        fibril_rwlock_write_lock(&ip_globals.netifs_lock);
    506507
     
    594595        while (index >= 0) {
    595596                netif = ip_netifs_get_index(&ip_globals.netifs, index);
    596                 if (netif && (netif->state == NETIF_ACTIVE)) {
     597                if (netif && (netif->state == NIC_STATE_ACTIVE)) {
    597598                        route = ip_netif_find_route(netif, destination);
    598599                        if (route)
     
    11421143}
    11431144
    1144 static int ip_send_msg_local(device_id_t device_id, packet_t *packet,
     1145static int ip_send_msg_local(nic_device_id_t device_id, packet_t *packet,
    11451146    services_t sender, services_t error)
    11461147{
     
    12581259 * @return              ENOENT if device is not found.
    12591260 */
    1260 static int ip_device_state_message(device_id_t device_id, device_state_t state)
     1261static int ip_device_state_message(nic_device_id_t device_id,
     1262    nic_device_state_t state)
    12611263{
    12621264        ip_netif_t *netif;
     
    12721274        fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
    12731275
    1274         printf("%s: Device %d changed state to %d\n", NAME, device_id, state);
     1276        printf("%s: Device %d changed state to '%s'\n", NAME, device_id,
     1277            nic_device_state_to_string(state));
    12751278
    12761279        return EOK;
     
    13121315 *                      tl_received_msg() function.
    13131316 */
    1314 static int ip_deliver_local(device_id_t device_id, packet_t *packet,
     1317static int ip_deliver_local(nic_device_id_t device_id, packet_t *packet,
    13151318    ip_header_t *header, services_t error)
    13161319{
     
    14131416 *                      is disabled.
    14141417 */
    1415 static int ip_process_packet(device_id_t device_id, packet_t *packet)
     1418static int ip_process_packet(nic_device_id_t device_id, packet_t *packet)
    14161419{
    14171420        ip_header_t *header;
     
    15141517 *
    15151518 */
    1516 static int ip_packet_size_message(device_id_t device_id, size_t *addr_len,
     1519static int ip_packet_size_message(nic_device_id_t device_id, size_t *addr_len,
    15171520    size_t *prefix, size_t *content, size_t *suffix)
    15181521{
     
    15721575 * @return              ENOENT if device is not found.
    15731576 */
    1574 static int ip_mtu_changed_message(device_id_t device_id, size_t mtu)
     1577static int ip_mtu_changed_message(nic_device_id_t device_id, size_t mtu)
    15751578{
    15761579        ip_netif_t *netif;
     
    16291632                        async_answer_0(iid, (sysarg_t) rc);
    16301633                        break;
    1631                
     1634                case NET_IL_ADDR_CHANGED:
     1635                        async_answer_0(iid, (sysarg_t) EOK);
     1636                        break;
     1637
    16321638                default:
    16331639                        async_answer_0(iid, (sysarg_t) ENOTSUP);
     
    16891695}
    16901696
    1691 static int ip_add_route_req_local(device_id_t device_id, in_addr_t address,
     1697static int ip_add_route_req_local(nic_device_id_t device_id, in_addr_t address,
    16921698    in_addr_t netmask, in_addr_t gateway)
    16931699{
     
    17231729}
    17241730
    1725 static int ip_set_gateway_req_local(device_id_t device_id, in_addr_t gateway)
     1731static int ip_set_gateway_req_local(nic_device_id_t device_id,
     1732    in_addr_t gateway)
    17261733{
    17271734        ip_netif_t *netif;
     
    17571764 *
    17581765 */
    1759 static int ip_received_error_msg_local(device_id_t device_id,
     1766static int ip_received_error_msg_local(nic_device_id_t device_id,
    17601767    packet_t *packet, services_t target, services_t error)
    17611768{
     
    18181825static int ip_get_route_req_local(ip_protocol_t protocol,
    18191826    const struct sockaddr *destination, socklen_t addrlen,
    1820     device_id_t *device_id, void **header, size_t *headerlen)
     1827    nic_device_id_t *device_id, void **header, size_t *headerlen)
    18211828{
    18221829        struct sockaddr_in *address_in;
     
    19091916        size_t suffix;
    19101917        size_t content;
    1911         device_id_t device_id;
     1918        nic_device_id_t device_id;
    19121919        int rc;
    19131920       
Note: See TracChangeset for help on using the changeset viewer.