FreeBSD/contrib/ntp/ntpd/ntp_peer.c
/*
 * unpeer - remove peer structure from hash table and free structure
 */
remove peer structure from hash table and free structure
remove peer structure from hash table and free structure
void
unpeer(
	struct peer *peer
	)
{
	mprintf_event(PEVNT_DEMOBIL, peer, "assoc %u", peer->associd);
	restrict_source(&peer->srcadr, 1, 0);
	set_peerdstadr(peer, NULL);
	peer_demobilizations++;
	peer_associations--;
	if (FLAG_PREEMPT & peer->flags)
		peer_preempt--;
#ifdef REFCLOCK
	if (FLAG_REFCLOCK & peer->flags)
		refclock_unpeer(peer);
#endif
	free_peer(peer, TRUE);
}
void unpeer ( struct peer * peer ) { mprintf_event ( PEVNT_DEMOBIL , peer , " " , peer -> associd ) ; restrict_source ( & peer -> srcadr , 1 , 0 ) ; set_peerdstadr ( peer , NULL ) ; peer_demobilizations ++ ; peer_associations -- ; if ( FLAG_PREEMPT & peer -> flags ) peer_preempt -- ; #ifdef REFCLOCK if ( FLAG_REFCLOCK & peer -> flags ) refclock_unpeer ( peer ) ; #endif free_peer ( peer , TRUE ) ; }
unpeer - remove peer structure from hash table and free structure
unpeer - remove peer structure from hash table and free structure
/*
	 * If this peer is actually a clock, shut it down first
	 */