Changes in uspace/srv/net/il/ip/ip.c [6b82009:00d7e1b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/ip/ip.c
r6b82009 r00d7e1b 354 354 ip_netif->routing = NET_DEFAULT_IP_ROUTING; 355 355 configuration = &names[0]; 356 356 357 357 /* Get configuration */ 358 358 rc = net_get_device_conf_req(ip_globals.net_sess, ip_netif->device_id, … … 406 406 return ENOTSUP; 407 407 } 408 408 409 409 if (configuration[6].value) { 410 410 ip_netif->arp = get_running_module(&ip_globals.modules, … … 417 417 } 418 418 } 419 419 420 if (configuration[7].value) 420 421 ip_netif->routing = (configuration[7].value[0] == 'y'); 421 422 422 423 net_free_settings(configuration, data); 423 424 } 424 425 425 426 /* Bind netif service which also initializes the device */ 426 427 ip_netif->sess = nil_bind_service(ip_netif->service, … … 432 433 return ENOENT; 433 434 } 434 435 435 436 /* Has to be after the device netif module initialization */ 436 437 if (ip_netif->arp) { … … 448 449 } 449 450 } 450 451 451 452 /* Get packet dimensions */ 452 453 rc = nil_packet_size_req(ip_netif->sess, ip_netif->device_id, … … 461 462 ip_netif->packet_dimension.content = IP_MIN_CONTENT; 462 463 } 463 464 464 465 index = ip_netifs_add(&ip_globals.netifs, ip_netif->device_id, ip_netif); 465 466 if (index < 0) … … 478 479 printf("%s: Default gateway (%s)\n", NAME, defgateway); 479 480 } 480 481 481 482 return EOK; 482 483 } 483 484 484 static int ip_device_req_local( device_id_t device_id, services_t netif)485 static int ip_device_req_local(nic_device_id_t device_id, services_t netif) 485 486 { 486 487 ip_netif_t *ip_netif; … … 498 499 return rc; 499 500 } 500 501 501 502 ip_netif->device_id = device_id; 502 503 ip_netif->service = netif; 503 ip_netif->state = N ETIF_STOPPED;504 504 ip_netif->state = NIC_STATE_STOPPED; 505 505 506 fibril_rwlock_write_lock(&ip_globals.netifs_lock); 506 507 … … 594 595 while (index >= 0) { 595 596 netif = ip_netifs_get_index(&ip_globals.netifs, index); 596 if (netif && (netif->state == N ETIF_ACTIVE)) {597 if (netif && (netif->state == NIC_STATE_ACTIVE)) { 597 598 route = ip_netif_find_route(netif, destination); 598 599 if (route) … … 1142 1143 } 1143 1144 1144 static int ip_send_msg_local( device_id_t device_id, packet_t *packet,1145 static int ip_send_msg_local(nic_device_id_t device_id, packet_t *packet, 1145 1146 services_t sender, services_t error) 1146 1147 { … … 1258 1259 * @return ENOENT if device is not found. 1259 1260 */ 1260 static int ip_device_state_message(device_id_t device_id, device_state_t state) 1261 static int ip_device_state_message(nic_device_id_t device_id, 1262 nic_device_state_t state) 1261 1263 { 1262 1264 ip_netif_t *netif; … … 1272 1274 fibril_rwlock_write_unlock(&ip_globals.netifs_lock); 1273 1275 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)); 1275 1278 1276 1279 return EOK; … … 1312 1315 * tl_received_msg() function. 1313 1316 */ 1314 static int ip_deliver_local( device_id_t device_id, packet_t *packet,1317 static int ip_deliver_local(nic_device_id_t device_id, packet_t *packet, 1315 1318 ip_header_t *header, services_t error) 1316 1319 { … … 1413 1416 * is disabled. 1414 1417 */ 1415 static int ip_process_packet( device_id_t device_id, packet_t *packet)1418 static int ip_process_packet(nic_device_id_t device_id, packet_t *packet) 1416 1419 { 1417 1420 ip_header_t *header; … … 1514 1517 * 1515 1518 */ 1516 static int ip_packet_size_message( device_id_t device_id, size_t *addr_len,1519 static int ip_packet_size_message(nic_device_id_t device_id, size_t *addr_len, 1517 1520 size_t *prefix, size_t *content, size_t *suffix) 1518 1521 { … … 1572 1575 * @return ENOENT if device is not found. 1573 1576 */ 1574 static int ip_mtu_changed_message( device_id_t device_id, size_t mtu)1577 static int ip_mtu_changed_message(nic_device_id_t device_id, size_t mtu) 1575 1578 { 1576 1579 ip_netif_t *netif; … … 1629 1632 async_answer_0(iid, (sysarg_t) rc); 1630 1633 break; 1631 1634 case NET_IL_ADDR_CHANGED: 1635 async_answer_0(iid, (sysarg_t) EOK); 1636 break; 1637 1632 1638 default: 1633 1639 async_answer_0(iid, (sysarg_t) ENOTSUP); … … 1689 1695 } 1690 1696 1691 static int ip_add_route_req_local( device_id_t device_id, in_addr_t address,1697 static int ip_add_route_req_local(nic_device_id_t device_id, in_addr_t address, 1692 1698 in_addr_t netmask, in_addr_t gateway) 1693 1699 { … … 1723 1729 } 1724 1730 1725 static int ip_set_gateway_req_local(device_id_t device_id, in_addr_t gateway) 1731 static int ip_set_gateway_req_local(nic_device_id_t device_id, 1732 in_addr_t gateway) 1726 1733 { 1727 1734 ip_netif_t *netif; … … 1757 1764 * 1758 1765 */ 1759 static int ip_received_error_msg_local( device_id_t device_id,1766 static int ip_received_error_msg_local(nic_device_id_t device_id, 1760 1767 packet_t *packet, services_t target, services_t error) 1761 1768 { … … 1818 1825 static int ip_get_route_req_local(ip_protocol_t protocol, 1819 1826 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) 1821 1828 { 1822 1829 struct sockaddr_in *address_in; … … 1909 1916 size_t suffix; 1910 1917 size_t content; 1911 device_id_t device_id;1918 nic_device_id_t device_id; 1912 1919 int rc; 1913 1920
Note:
See TracChangeset
for help on using the changeset viewer.