Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if.c
Context not available. | |||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/smp.h> | |||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/socketvar.h> | #include <sys/socketvar.h> | ||||
#include <sys/protosw.h> | #include <sys/protosw.h> | ||||
Context not available. | |||||
} | } | ||||
/* | /* | ||||
* Copy data from ifring to userland API structure if_ring_data. | |||||
*/ | |||||
void | |||||
if_ring_data_copy(struct ifnet *ifp, struct if_ring_data *ifrd) | |||||
{ | |||||
struct ifrstat *ifrs; | |||||
struct xifrstat *xifrs; | |||||
int ri, cpu; | |||||
ifrd->ifrd_epoch = ifp->if_epoch; | |||||
ifrd->ifrd_lastchange = ifp->if_lastchange; | |||||
ifrd->ifrd_ncpus = mp_ncpus; | |||||
ifrd->ifrd_nrings = ifp->if_nrings; | |||||
for (ri = 0; ri < ifp->if_nrings; ri++) { | |||||
for (cpu = 0; cpu < mp_ncpus; cpu++) { | |||||
ifrs = &ifp->if_rings[ri]->ifr_stats[cpu]; | |||||
xifrs = &ifrd->ifrd_stats[ri * mp_ncpus + cpu]; | |||||
xifrs->ifrs_ifinput = ifrs->ifrs_ifinput; | |||||
xifrs->ifrs_netisr = ifrs->ifrs_netisr; | |||||
xifrs->ifrs_ether = ifrs->ifrs_ether; | |||||
xifrs->ifrs_ip = ifrs->ifrs_ip; | |||||
xifrs->ifrs_ip6 = ifrs->ifrs_ip6; | |||||
xifrs->ifrs_udp = ifrs->ifrs_udp; | |||||
xifrs->ifrs_tcp = ifrs->ifrs_tcp; | |||||
} | |||||
} | |||||
} | |||||
/* | |||||
* Initialization, destruction and refcounting functions for ifaddrs. | * Initialization, destruction and refcounting functions for ifaddrs. | ||||
*/ | */ | ||||
struct ifaddr * | struct ifaddr * | ||||
Context not available. |