예제 #1
0
/* ARGSUSED */
int
nfs_dump(vnode_t *dumpvp, caddr_t addr, offset_t bn, offset_t count,
    caller_context_t *ct)
{
	static TIUSER	*tiptr;
	XDR		xdrs;
	int		reply;
	int		badmsg;
	uint32_t	call_xid;
	int		retry = 0;
	int		error;
	int		i;

	nd_log("nfs_dump: addr=%p bn=%lld count=%lld\n",
	    (void *)addr, bn, count);

	if (error = nd_init(dumpvp, &tiptr))
		return (error);

	for (i = 0; i < count; i += ptod(1), addr += ptob(1)) {
		do {
			error = nd_send_data(tiptr, addr, (int)dbtob(bn + i),
			    &xdrs, &call_xid);
			if (error)
				return (error);

			do {
				if (error = nd_poll(tiptr, retry, &reply))
					return (error);

				if (!reply) {
					retry++;
					break;
				}
				retry = 0;

				error = nd_get_reply(tiptr, &xdrs, call_xid,
				    &badmsg);
				if (error)
					return (error);
			} while (badmsg);
		} while (retry);
	}

	return (0);
}
예제 #2
0
void 
prepare_ipc() 
{
    nd_init();
#ifndef NO_IP_DEMON
    if (!no_ip_demon)
	hname = hname_init(receive_hname, shutdown_hname);
#endif
    telnet_init((u_short)port_number);
#ifdef SERVICE_PORT
    tcpsvc_init((u_short)service_port);
#endif /* SERVICE_PORT */
#ifdef CATCH_UDP_PORT
    udpsvc = udpsvc_init(udp_port);
#endif /* CATCH_UDP_PORT */

    (void)signal(SIGPIPE, SIG_IGN);
}