| 116 | } |
| 117 | |
| 118 | int |
| 119 | scope6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) |
| 120 | { |
| 121 | struct in6_ifreq *ifr; |
| 122 | |
| 123 | if (ifp->if_afdata[AF_INET6] == NULL) |
| 124 | return (EPFNOSUPPORT); |
| 125 | |
| 126 | ifr = (struct in6_ifreq *)data; |
| 127 | switch (cmd) { |
| 128 | case SIOCSSCOPE6: |
| 129 | return (scope6_set(ifp, |
| 130 | (struct scope6_id *)ifr->ifr_ifru.ifru_scope_id)); |
| 131 | case SIOCGSCOPE6: |
| 132 | return (scope6_get(ifp, |
| 133 | (struct scope6_id *)ifr->ifr_ifru.ifru_scope_id)); |
| 134 | case SIOCGSCOPE6DEF: |
| 135 | return (scope6_get_default( |
| 136 | (struct scope6_id *)ifr->ifr_ifru.ifru_scope_id)); |
| 137 | default: |
| 138 | return (EOPNOTSUPP); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | static int |
| 143 | scope6_set(struct ifnet *ifp, struct scope6_id *idlist) |
no test coverage detected