log_debug("nbr_new: neighbor ID %s, peerid %lu", inet_ntoa(nbr->id), nbr->peerid);
nbr_new(u_int32_t nbr_id, struct iface *iface, int self){	struct nbr_head	*head;	struct nbr	*nbr;	struct rde_nbr	 rn;	if ((nbr = calloc(1, sizeof(*nbr))) == NULL)		fatal("nbr_new");	nbr->state = NBR_STA_DOWN;	nbr->master = 1;	nbr->dd_seq_num = arc4random();	/* RFC: some unique value */	nbr->id.s_addr = nbr_id;	/* get next unused peerid */	while (nbr_find_peerid(++peercnt))		;	nbr->peerid = peercnt;	head = NBR_HASH(nbr->peerid);	LIST_INSERT_HEAD(head, nbr, hash);	/* add to peer list */	nbr->iface = iface;	LIST_INSERT_HEAD(&iface->nbr_list, nbr, entry);	TAILQ_INIT(&nbr->ls_retrans_list);	TAILQ_INIT(&nbr->db_sum_list);	TAILQ_INIT(&nbr->ls_req_list);	nbr->ls_req = NULL;	if (self) {		nbr->state = NBR_STA_FULL;		nbr->addr.s_addr = iface->addr.s_addr;		nbr->priority = iface->priority;	}	/* set event structures */	evtimer_set(&nbr->inactivity_timer, nbr_itimer, nbr);	evtimer_set(&nbr->db_tx_timer, db_tx_timer, nbr);	evtimer_set(&nbr->lsreq_tx_timer, ls_req_tx_timer, nbr);	evtimer_set(&nbr->ls_retrans_timer, ls_retrans_timer, nbr);	evtimer_set(&nbr->adj_timer, nbr_adj_timer, nbr);	log_debug("nbr_new: neighbor ID %s, peerid %lu",	    inet_ntoa(nbr->id), nbr->peerid);	bzero(&rn, sizeof(rn));	rn.id.s_addr = nbr->id.s_addr;	rn.area_id.s_addr = nbr->iface->area->id.s_addr;	rn.state = nbr->state;	rn.self = self;	ospfe_imsg_compose_rde(IMSG_NEIGHBOR_UP, nbr->peerid, 0, &rn,	    sizeof(rn));	return (nbr);}