- ((struct dophdr *)((u_char *)(d) + \
- DOP_ROUNDUP(EXTRACT_16BITS(&(d)->dh_len) + sizeof(*(d)))))
+ ((const struct dophdr *)((const u_char *)(d) + \
+ DOP_ROUNDUP(EXTRACT_16BITS(&(d)->dh_len) + sizeof(*(d)))))
- u_int32_t ph_src; /* site id of source */
- u_int32_t ph_ts; /* time stamp (for skew computation) */
- u_int16_t ph_version; /* version number */
+ uint32_t ph_src; /* site id of source */
+ uint32_t ph_ts; /* time stamp (for skew computation) */
+ uint16_t ph_version; /* version number */
- io = (struct id_off *)(id + 1);
- cp = (char *)(io + nid);
- if ((u_char *)cp + len <= ndo->ndo_snapend) {
+ io = (const struct id_off *)(id + 1);
+ cp = (const char *)(io + nid);
+ if (ND_TTEST2(cp, len)) {
ND_PRINT((ndo, "%c%s:%u",
c, ipaddr_string(ndo, &io->id), EXTRACT_32BITS(&io->off)));
c = ',';
ND_PRINT((ndo, "%c%s:%u",
c, ipaddr_string(ndo, &io->id), EXTRACT_32BITS(&io->off)));
c = ',';
const struct pkt_rreq *rreq, u_int len)
{
ND_PRINT((ndo, " wb-rreq:"));
const struct pkt_rreq *rreq, u_int len)
{
ND_PRINT((ndo, " wb-rreq:"));
const struct pkt_preq *preq, u_int len)
{
ND_PRINT((ndo, " wb-preq:"));
const struct pkt_preq *preq, u_int len)
{
ND_PRINT((ndo, " wb-preq:"));
EXTRACT_32BITS(&ps->slot),
ipaddr_string(ndo, &ps->page.p_sid),
EXTRACT_32BITS(&ps->page.p_uid)));
EXTRACT_32BITS(&ps->slot),
ipaddr_string(ndo, &ps->page.p_sid),
EXTRACT_32BITS(&ps->page.p_uid)));
- io = (struct id_off *)(ps + 1);
- for (ie = io + ps->nid; io < ie && (u_char *)(io + 1) <= ep; ++io) {
+ io = (const struct id_off *)(ps + 1);
+ for (ie = io + ps->nid; io < ie && ND_TTEST(*io); ++io) {
ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id),
EXTRACT_32BITS(&io->off)));
c = ',';
}
ND_PRINT((ndo, ">"));
ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id),
EXTRACT_32BITS(&io->off)));
c = ',';
}
ND_PRINT((ndo, ">"));
-wb_dops(netdissect_options *ndo,
- const struct dophdr *dh, u_int32_t ss, u_int32_t es)
+wb_dops(netdissect_options *ndo, const struct pkt_dop *dop,
+ uint32_t ss, uint32_t es)
if (t > DT_MAXTYPE)
ND_PRINT((ndo, " dop-%d!", t));
else {
ND_PRINT((ndo, " %s", dopstr[t]));
if (t == DT_SKIP || t == DT_HOLE) {
if (t > DT_MAXTYPE)
ND_PRINT((ndo, " dop-%d!", t));
else {
ND_PRINT((ndo, " %s", dopstr[t]));
if (t == DT_SKIP || t == DT_HOLE) {
ND_PRINT((ndo, "%d", ts - ss + 1));
if (ss > ts || ts > es) {
ND_PRINT((ndo, "[|]"));
ND_PRINT((ndo, "%d", ts - ss + 1));
if (ss > ts || ts > es) {
ND_PRINT((ndo, "[|]"));
const struct pkt_dop *dop = &rrep->pr_dop;
ND_PRINT((ndo, " wb-rrep:"));
const struct pkt_dop *dop = &rrep->pr_dop;
ND_PRINT((ndo, " wb-rrep:"));
EXTRACT_32BITS(&dop->pd_sseq),
EXTRACT_32BITS(&dop->pd_eseq)));
return (0);
EXTRACT_32BITS(&dop->pd_sseq),
EXTRACT_32BITS(&dop->pd_eseq)));
return (0);
const struct pkt_dop *dop, u_int len)
{
ND_PRINT((ndo, " wb-dop:"));
const struct pkt_dop *dop, u_int len)
{
ND_PRINT((ndo, " wb-dop:"));
EXTRACT_32BITS(&dop->pd_sseq),
EXTRACT_32BITS(&dop->pd_eseq)));
return (0);
EXTRACT_32BITS(&dop->pd_sseq),
EXTRACT_32BITS(&dop->pd_eseq)));
return (0);