Esempio n. 1
0
int
ncp_rq_alloc_subfn(u_int8_t fn, u_int8_t subfn, struct ncp_conn *ncp,
	struct thread *td, struct ucred *cred, struct ncp_rq **rqpp)
{
	struct ncp_rq *rqp;
	int error;

	error = ncp_rq_alloc_any(NCP_REQUEST, fn, ncp, td, cred, &rqp);
	if (error)
		return error;
	mb_reserve(&rqp->rq, 2);
	mb_put_uint8(&rqp->rq, subfn);
	*rqpp = rqp;
	return 0;
}
Esempio n. 2
0
/*
 * Process initial NCP handshake (attach)
 * NOTE: Since all functions below may change conn attributes, they
 * should be called with LOCKED connection, also they use procp & ucred
 */
int
ncp_ncp_connect(struct ncp_conn *conn)
{
	struct ncp_rq *rqp;
	struct ncp_rphdr *rp;
	int error;

	error = ncp_rq_alloc_any(NCP_ALLOC_SLOT, 0, conn, conn->td, conn->ucred, &rqp);
	if (error)
		return error;

	conn->flags &= ~(NCPFL_SIGNACTIVE | NCPFL_SIGNWANTED |
	    NCPFL_ATTACHED | NCPFL_LOGGED | NCPFL_INVALID);
	conn->seq = 0;
	error = ncp_request_int(rqp);
	if (!error) {
		rp = mtod(rqp->rp.md_top, struct ncp_rphdr*);
		conn->connid = rp->conn_low + (rp->conn_high << 8);
	}
Esempio n. 3
0
int
ncp_rq_alloc(u_int8_t fn, struct ncp_conn *ncp,
	struct thread *td, struct ucred *cred, struct ncp_rq **rqpp)
{
	return ncp_rq_alloc_any(NCP_REQUEST, fn, ncp, td, cred, rqpp);
}