case IMSG_CTL_SHOW_RIB: if (imsg.hdr.len != IMSG_HEADER_SIZE) { log_warnx("rde_dispatch: wrong imsg len"); break; } pid = imsg.hdr.pid; pt_dump(rde_dump_upcall, &pid); imsg_compose_pid(&ibuf_se, IMSG_CTL_END, pid, NULL, 0); break; case IMSG_CTL_SHOW_RIB_AS: if (imsg.hdr.len - IMSG_HEADER_SIZE != sizeof(struct as_filter)) { log_warnx("rde_dispatch: wrong imsg len"); break; } pid = imsg.hdr.pid; rde_dump_as(imsg.data, pid); imsg_compose_pid(&ibuf_se, IMSG_CTL_END, pid, NULL, 0); break;
rde_dispatch_imsg_session(struct imsgbuf *ibuf){	struct imsg		 imsg;	struct session_up	 sup;	int			 n;	if ((n = imsg_read(ibuf)) == -1)		fatal("rde_dispatch_imsg_session: imsg_read error");	if (n == 0)	/* connection closed */		fatal("rde_dispatch_imsg_session: pipe closed");	for (;;) {		if ((n = imsg_get(ibuf, &imsg)) == -1)			fatal("rde_dispatch_imsg_session: imsg_read error");		if (n == 0)			break;		switch (imsg.hdr.type) {		case IMSG_UPDATE:			rde_update_dispatch(&imsg);			break;		case IMSG_SESSION_UP:			if (imsg.hdr.len - IMSG_HEADER_SIZE != sizeof(sup))				fatalx("incorrect size of session request");			memcpy(&sup, imsg.data, sizeof(sup));			peer_up(imsg.hdr.peerid, &sup);			break;		case IMSG_SESSION_DOWN:			peer_down(imsg.hdr.peerid);			break;		default:			break;		}		imsg_free(&imsg);	}}