* Copy data from ifnet to userland API structure if_data. */
| 1784 | * Copy data from ifnet to userland API structure if_data. |
| 1785 | */ |
| 1786 | void |
| 1787 | if_data_copy(struct ifnet *ifp, struct if_data *ifd) |
| 1788 | { |
| 1789 | |
| 1790 | ifd->ifi_type = ifp->if_type; |
| 1791 | ifd->ifi_physical = 0; |
| 1792 | ifd->ifi_addrlen = ifp->if_addrlen; |
| 1793 | ifd->ifi_hdrlen = ifp->if_hdrlen; |
| 1794 | ifd->ifi_link_state = ifp->if_link_state; |
| 1795 | ifd->ifi_vhid = 0; |
| 1796 | ifd->ifi_datalen = sizeof(struct if_data); |
| 1797 | ifd->ifi_mtu = ifp->if_mtu; |
| 1798 | ifd->ifi_metric = ifp->if_metric; |
| 1799 | ifd->ifi_baudrate = ifp->if_baudrate; |
| 1800 | ifd->ifi_hwassist = ifp->if_hwassist; |
| 1801 | ifd->ifi_epoch = ifp->if_epoch; |
| 1802 | ifd->ifi_lastchange = ifp->if_lastchange; |
| 1803 | |
| 1804 | ifd->ifi_ipackets = ifp->if_get_counter(ifp, IFCOUNTER_IPACKETS); |
| 1805 | ifd->ifi_ierrors = ifp->if_get_counter(ifp, IFCOUNTER_IERRORS); |
| 1806 | ifd->ifi_opackets = ifp->if_get_counter(ifp, IFCOUNTER_OPACKETS); |
| 1807 | ifd->ifi_oerrors = ifp->if_get_counter(ifp, IFCOUNTER_OERRORS); |
| 1808 | ifd->ifi_collisions = ifp->if_get_counter(ifp, IFCOUNTER_COLLISIONS); |
| 1809 | ifd->ifi_ibytes = ifp->if_get_counter(ifp, IFCOUNTER_IBYTES); |
| 1810 | ifd->ifi_obytes = ifp->if_get_counter(ifp, IFCOUNTER_OBYTES); |
| 1811 | ifd->ifi_imcasts = ifp->if_get_counter(ifp, IFCOUNTER_IMCASTS); |
| 1812 | ifd->ifi_omcasts = ifp->if_get_counter(ifp, IFCOUNTER_OMCASTS); |
| 1813 | ifd->ifi_iqdrops = ifp->if_get_counter(ifp, IFCOUNTER_IQDROPS); |
| 1814 | ifd->ifi_oqdrops = ifp->if_get_counter(ifp, IFCOUNTER_OQDROPS); |
| 1815 | ifd->ifi_noproto = ifp->if_get_counter(ifp, IFCOUNTER_NOPROTO); |
| 1816 | } |
| 1817 | |
| 1818 | /* |
| 1819 | * Initialization, destruction and refcounting functions for ifaddrs. |
no outgoing calls
no test coverage detected