* Handle ioctl commands to obtain information from the cache */
| 530 | * Handle ioctl commands to obtain information from the cache |
| 531 | */ |
| 532 | static int |
| 533 | X_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 |
nothing calls this directly
no test coverage detected