/* A transport listener is added by writing it's transport name and a port number.  */
static ssize_t __write_ports_addxprt(char *buf)
/* A transport listener is added by writing it's transport name and a port number.  */
static ssize_t __write_ports_addxprt(char *buf)
{
	char transport[16];
	int port, err;
	if (sscanf(buf, "%15s %4u", transport, &port) != 2)
		return -EINVAL;
	if (port < 1 || port > USHORT_MAX)
		return -EINVAL;
	err = nfsd_create_serv();
	if (err != 0)
		return err;
	err = svc_create_xprt(nfsd_serv, transport,
				PF_INET, port, SVC_SOCK_ANONYMOUS);
	if (err < 0) {
		if (err == -ENOENT)
			err = -EPROTONOSUPPORT;
		return err;
	}
	return 0;
}