Beispiel #1
0
static int
wb_drawop(const struct pkt_dop *dop, u_int len)
{
	printf(" wb-dop:");
	if (len < sizeof(*dop) || (u_char *)(dop + 1) > snapend)
		return (-1);
	len -= sizeof(*dop);

	printf(" %s:%u<%u:%u>",
	    ipaddr_string(&dop->pd_page.p_sid),
	    (u_int32_t)ntohl(dop->pd_page.p_uid),
	    (u_int32_t)ntohl(dop->pd_sseq),
	    (u_int32_t)ntohl(dop->pd_eseq));

	if (vflag)
		return (wb_dops((const struct dophdr *)(dop + 1),
				ntohl(dop->pd_sseq), ntohl(dop->pd_eseq)));
	return (0);
}
Beispiel #2
0
static int
wb_drawop(netdissect_options *ndo,
          const struct pkt_dop *dop, u_int len)
{
	ND_PRINT((ndo, " wb-dop:"));
	if (len < sizeof(*dop) || !ND_TTEST(*dop))
		return (-1);
	len -= sizeof(*dop);

	ND_PRINT((ndo, " %s:%u<%u:%u>",
	    ipaddr_string(ndo, &dop->pd_page.p_sid),
	    EXTRACT_32BITS(&dop->pd_page.p_uid),
	    EXTRACT_32BITS(&dop->pd_sseq),
	    EXTRACT_32BITS(&dop->pd_eseq)));

	if (ndo->ndo_vflag)
		return (wb_dops(ndo, dop,
				EXTRACT_32BITS(&dop->pd_sseq),
				EXTRACT_32BITS(&dop->pd_eseq)));
	return (0);
}
Beispiel #3
0
static int
wb_rrep(const struct pkt_rrep *rrep, u_int len)
{
	const struct pkt_dop *dop = &rrep->pr_dop;

	printf(" wb-rrep:");
	if (len < sizeof(*rrep) || (u_char *)(rrep + 1) > snapend)
		return (-1);
	len -= sizeof(*rrep);

	printf(" for %s %s:%u<%u:%u>",
	    ipaddr_string(&rrep->pr_id),
	    ipaddr_string(&dop->pd_page.p_sid),
	    (u_int32_t)ntohl(dop->pd_page.p_uid),
	    (u_int32_t)ntohl(dop->pd_sseq),
	    (u_int32_t)ntohl(dop->pd_eseq));

	if (vflag)
		return (wb_dops((const struct dophdr *)(dop + 1),
		    ntohl(dop->pd_sseq), ntohl(dop->pd_eseq)));
	return (0);
}
Beispiel #4
0
static int
wb_rrep(netdissect_options *ndo,
        const struct pkt_rrep *rrep, u_int len)
{
	const struct pkt_dop *dop = &rrep->pr_dop;

	ND_PRINT((ndo, " wb-rrep:"));
	if (len < sizeof(*rrep) || (u_char *)(rrep + 1) > ndo->ndo_snapend)
		return (-1);
	len -= sizeof(*rrep);

	ND_PRINT((ndo, " for %s %s:%u<%u:%u>",
	    ipaddr_string(ndo, &rrep->pr_id),
	    ipaddr_string(ndo, &dop->pd_page.p_sid),
	    EXTRACT_32BITS(&dop->pd_page.p_uid),
	    EXTRACT_32BITS(&dop->pd_sseq),
	    EXTRACT_32BITS(&dop->pd_eseq)));

	if (ndo->ndo_vflag)
		return (wb_dops(ndo, (const struct dophdr *)(dop + 1),
		    EXTRACT_32BITS(&dop->pd_sseq),
		    EXTRACT_32BITS(&dop->pd_eseq)));
	return (0);
}