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