vcc = ATM_SD(sock); switch (cmd) { case SIOCOUTQ: if (sock->state != SS_CONNECTED ||
!test_bit(ATM_VF_READY, &vcc->flags)) {
error = -EINVAL; goto done;
}
error = put_user(sk->sk_sndbuf - sk_wmem_alloc_get(sk),
(int __user *)argp); goto done; case SIOCINQ:
{ struct sk_buff *skb; int amount;
if (sock->state != SS_CONNECTED) {
error = -EINVAL; goto done;
}
spin_lock_irq(&sk->sk_receive_queue.lock);
skb = skb_peek(&sk->sk_receive_queue);
amount = skb ? skb->len : 0;
spin_unlock_irq(&sk->sk_receive_queue.lock);
error = put_user(amount, (int __user *)argp); goto done;
} case ATM_SETSC:
net_warn_ratelimited("ATM_SETSC is obsolete; used by %s:%d\n",
current->comm, task_pid_nr(current));
error = 0; goto done; case ATMSIGD_CTRL: if (!capable(CAP_NET_ADMIN)) {
error = -EPERM; goto done;
} /* * The user/kernel protocol for exchanging signalling * info uses kernel pointers as opaque references, * so the holder of the file descriptor can scribble * on the kernel... so we should make sure that we * have the same privileges that /proc/kcore needs
*/ if (!capable(CAP_SYS_RAWIO)) {
error = -EPERM; goto done;
} #ifdef CONFIG_COMPAT /* WTF? I don't even want to _think_ about making this work for 32-bit userspace. TBH I don't really want
to think about it at all. dwmw2. */ if (compat) {
net_warn_ratelimited("32-bit task cannot be atmsigd\n");
error = -EINVAL; goto done;
} #endif
error = sigd_attach(vcc); if (!error)
sock->state = SS_CONNECTED; goto done; case ATM_SETBACKEND: case ATM_NEWBACKENDIF:
{
atm_backend_t backend;
error = get_user(backend, (atm_backend_t __user *)argp); if (error) goto done; switch (backend) { case ATM_BACKEND_PPP:
request_module("pppoatm"); break; case ATM_BACKEND_BR2684:
request_module("br2684"); break;
} break;
} case ATMMPC_CTRL: case ATMMPC_DATA:
request_module("mpoa"); break; case ATMARPD_CTRL:
request_module("clip"); break; case ATMLEC_CTRL:
request_module("lec"); break;
}
switch (cmd32) { case SONET_GETSTAT: case SONET_GETSTATZ: case SONET_GETDIAG: case SONET_SETDIAG: case SONET_CLRDIAG: case SONET_SETFRAMING: case SONET_GETFRAMING: case SONET_GETFRSENSE: return do_atmif_sioc(sock, cmd32, arg);
}
for (i = 0; i < NR_ATM_IOCTL; i++) { if (cmd32 == atm_ioctl_map[i].cmd32) {
cmd = atm_ioctl_map[i].cmd; break;
}
} if (i == NR_ATM_IOCTL) return -EINVAL;
switch (cmd) { case ATM_GETNAMES: return do_atm_iobuf(sock, cmd, arg);
case ATM_GETLINKRATE: case ATM_GETTYPE: case ATM_GETESI: case ATM_GETADDR: case ATM_RSTADDR: case ATM_ADDADDR: case ATM_DELADDR: case ATM_GETCIRANGE: case ATM_SETCIRANGE: case ATM_SETESI: case ATM_SETESIF: case ATM_GETSTAT: case ATM_GETSTATZ: case ATM_GETLOOP: case ATM_SETLOOP: case ATM_QUERYLOOP: return do_atmif_sioc(sock, cmd, arg);
}
return -EINVAL;
}
int vcc_compat_ioctl(struct socket *sock, unsignedint cmd, unsignedlong arg)
{ int ret;
ret = do_vcc_ioctl(sock, cmd, arg, 1); if (ret != -ENOIOCTLCMD) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.