FreeBSD/sys/nlm/nlm_prot_impl.c
/*
 * Unregister this NLM host with the local NSM due to idleness.
 */
Unregister this NLM host with the local NSM due to idleness.
Unregister this NLM host with the local NSM due to idleness .
static void
nlm_host_unmonitor(struct nlm_host *host)
{
	mon_id smmonid;
	sm_stat_res smstat;
	struct timeval timo;
	enum clnt_stat stat;
	NLM_DEBUG(1, "NLM: unmonitoring %s (sysid %d)\n",
	    host->nh_caller_name, host->nh_sysid);
	smmonid.mon_name = host->nh_caller_name;
	smmonid.my_id.my_name = "localhost";
	smmonid.my_id.my_prog = NLM_PROG;
	smmonid.my_id.my_vers = NLM_SM;
	smmonid.my_id.my_proc = NLM_SM_NOTIFY;
	timo.tv_sec = 25;
	timo.tv_usec = 0;
	stat = CLNT_CALL(nlm_nsm, SM_UNMON,
	    (xdrproc_t) xdr_mon, &smmonid,
	    (xdrproc_t) xdr_sm_stat, &smstat, timo);
	if (stat != RPC_SUCCESS) {
		NLM_ERR("Failed to contact local NSM - rpc error %d\n", stat);
		return;
	}
	if (smstat.res_stat == stat_fail) {
		NLM_ERR("Local NSM refuses to unmonitor %s\n",
		    host->nh_caller_name);
		return;
	}
	host->nh_monstate = NLM_UNMONITORED;
}
static void nlm_host_unmonitor ( struct nlm_host * host ) { mon_id smmonid ; sm_stat_res smstat ; struct timeval timo ; enum clnt_stat stat ; NLM_DEBUG ( 1 , " \n " , host -> nh_caller_name , host -> nh_sysid ) ; smmonid . mon_name = host -> nh_caller_name ; smmonid . my_id . my_name = " " ; smmonid . my_id . my_prog = NLM_PROG ; smmonid . my_id . my_vers = NLM_SM ; smmonid . my_id . my_proc = NLM_SM_NOTIFY ; timo . tv_sec = 25 ; timo . tv_usec = 0 ; stat = CLNT_CALL ( nlm_nsm , SM_UNMON , ( xdrproc_t ) xdr_mon , & smmonid , ( xdrproc_t ) xdr_sm_stat , & smstat , timo ) ; if ( stat != RPC_SUCCESS ) { NLM_ERR ( " \n " , stat ) ; return ; } if ( smstat . res_stat == stat_fail ) { NLM_ERR ( " \n " , host -> nh_caller_name ) ; return ; } host -> nh_monstate = NLM_UNMONITORED ; }
Unregister this NLM host with the local NSM due to idleness.
Unregister this NLM host with the local NSM due to idleness .
/*
	 * We put our assigned system ID value in the priv field to
	 * make it simpler to find the host if we are notified of a
	 * host restart.
	 */