MCPcopy Create free account
hub / github.com/F-Stack/f-stack / X_mrt_ioctl

Function X_mrt_ioctl

freebsd/netinet/ip_mroute.c:532–559  ·  view source on GitHub ↗

* Handle ioctl commands to obtain information from the cache */

Source from the content-addressed store, hash-verified

530 * Handle ioctl commands to obtain information from the cache
531 */
532static int
533X_mrt_ioctl(u_long cmd, caddr_t data, int fibnum __unused)
534{
535 int error = 0;
536
537 /*
538 * Currently the only function calling this ioctl routine is rtioctl_fib().
539 * Typically, only root can create the raw socket in order to execute
540 * this ioctl method, however the request might be coming from a prison
541 */
542 error = priv_check(curthread, PRIV_NETINET_MROUTE);
543 if (error)
544 return (error);
545 switch (cmd) {
546 case (SIOCGETVIFCNT):
547 error = get_vif_cnt((struct sioc_vif_req *)data);
548 break;
549
550 case (SIOCGETSGCNT):
551 error = get_sg_cnt((struct sioc_sg_req *)data);
552 break;
553
554 default:
555 error = EINVAL;
556 break;
557 }
558 return error;
559}
560
561/*
562 * returns the packet, byte, rpf-failure count for the source group provided

Callers

nothing calls this directly

Calls 3

get_vif_cntFunction · 0.85
get_sg_cntFunction · 0.70
priv_checkFunction · 0.50

Tested by

no test coverage detected