blob: 88857d9618d742d7b9bfe1a979fd19d0d65449e0 [file] [log] [blame]
The Android Open Source Project2949f582009-03-03 19:30:46 -08001/*
2 * Copyright (c) 1993, 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 */
21
Elliott Hughese2e3bd12017-05-15 10:59:29 -070022/* \summary: White Board printer */
23
The Android Open Source Project2949f582009-03-03 19:30:46 -080024#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
Elliott Hughese2e3bd12017-05-15 10:59:29 -070028#include <netdissect-stdinc.h>
The Android Open Source Project2949f582009-03-03 19:30:46 -080029
Elliott Hughese2e3bd12017-05-15 10:59:29 -070030#include "netdissect.h"
The Android Open Source Project2949f582009-03-03 19:30:46 -080031#include "addrtoname.h"
32#include "extract.h"
33
Elliott Hughes892a68b2015-10-19 14:43:53 -070034static const char tstr[] = "[|wb]";
35
The Android Open Source Project2949f582009-03-03 19:30:46 -080036/* XXX need to add byte-swapping macros! */
37/* XXX - you mean like the ones in "extract.h"? */
38
39/*
40 * Largest packet size. Everything should fit within this space.
41 * For instance, multiline objects are sent piecewise.
42 */
43#define MAXFRAMESIZE 1024
44
45/*
46 * Multiple drawing ops can be sent in one packet. Each one starts on a
47 * an even multiple of DOP_ALIGN bytes, which must be a power of two.
48 */
49#define DOP_ALIGN 4
50#define DOP_ROUNDUP(x) ((((int)(x)) + (DOP_ALIGN - 1)) & ~(DOP_ALIGN - 1))
51#define DOP_NEXT(d)\
Elliott Hughese2e3bd12017-05-15 10:59:29 -070052 ((const struct dophdr *)((const u_char *)(d) + \
53 DOP_ROUNDUP(EXTRACT_16BITS(&(d)->dh_len) + sizeof(*(d)))))
The Android Open Source Project2949f582009-03-03 19:30:46 -080054
55/*
56 * Format of the whiteboard packet header.
57 * The transport level header.
58 */
59struct pkt_hdr {
Elliott Hughes892a68b2015-10-19 14:43:53 -070060 uint32_t ph_src; /* site id of source */
61 uint32_t ph_ts; /* time stamp (for skew computation) */
62 uint16_t ph_version; /* version number */
The Android Open Source Project2949f582009-03-03 19:30:46 -080063 u_char ph_type; /* message type */
64 u_char ph_flags; /* message flags */
65};
66
67/* Packet types */
68#define PT_DRAWOP 0 /* drawing operation */
69#define PT_ID 1 /* announcement packet */
70#define PT_RREQ 2 /* repair request */
71#define PT_RREP 3 /* repair reply */
72#define PT_KILL 4 /* terminate participation */
73#define PT_PREQ 5 /* page vector request */
74#define PT_PREP 7 /* page vector reply */
75
76#ifdef PF_USER
77#undef PF_USER /* {Digital,Tru64} UNIX define this, alas */
78#endif
79
80/* flags */
81#define PF_USER 0x01 /* hint that packet has interactive data */
82#define PF_VIS 0x02 /* only visible ops wanted */
83
84struct PageID {
Elliott Hughes892a68b2015-10-19 14:43:53 -070085 uint32_t p_sid; /* session id of initiator */
86 uint32_t p_uid; /* page number */
The Android Open Source Project2949f582009-03-03 19:30:46 -080087};
88
89struct dophdr {
Elliott Hughes892a68b2015-10-19 14:43:53 -070090 uint32_t dh_ts; /* sender's timestamp */
91 uint16_t dh_len; /* body length */
The Android Open Source Project2949f582009-03-03 19:30:46 -080092 u_char dh_flags;
93 u_char dh_type; /* body type */
94 /* body follows */
95};
96/*
97 * Drawing op sub-types.
98 */
99#define DT_RECT 2
100#define DT_LINE 3
101#define DT_ML 4
102#define DT_DEL 5
103#define DT_XFORM 6
104#define DT_ELL 7
105#define DT_CHAR 8
106#define DT_STR 9
107#define DT_NOP 10
108#define DT_PSCODE 11
109#define DT_PSCOMP 12
110#define DT_REF 13
111#define DT_SKIP 14
112#define DT_HOLE 15
113#define DT_MAXTYPE 15
114
115/*
116 * A drawing operation.
117 */
118struct pkt_dop {
119 struct PageID pd_page; /* page that operations apply to */
Elliott Hughes892a68b2015-10-19 14:43:53 -0700120 uint32_t pd_sseq; /* start sequence number */
121 uint32_t pd_eseq; /* end sequence number */
The Android Open Source Project2949f582009-03-03 19:30:46 -0800122 /* drawing ops follow */
123};
124
125/*
126 * A repair request.
127 */
128struct pkt_rreq {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700129 uint32_t pr_id; /* source id of drawops to be repaired */
The Android Open Source Project2949f582009-03-03 19:30:46 -0800130 struct PageID pr_page; /* page of drawops */
Elliott Hughes892a68b2015-10-19 14:43:53 -0700131 uint32_t pr_sseq; /* start seqno */
132 uint32_t pr_eseq; /* end seqno */
The Android Open Source Project2949f582009-03-03 19:30:46 -0800133};
134
135/*
136 * A repair reply.
137 */
138struct pkt_rrep {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700139 uint32_t pr_id; /* original site id of ops */
The Android Open Source Project2949f582009-03-03 19:30:46 -0800140 struct pkt_dop pr_dop;
141 /* drawing ops follow */
142};
143
144struct id_off {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700145 uint32_t id;
146 uint32_t off;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800147};
148
149struct pgstate {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700150 uint32_t slot;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800151 struct PageID page;
Elliott Hughes892a68b2015-10-19 14:43:53 -0700152 uint16_t nid;
153 uint16_t rsvd;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800154 /* seqptr's */
155};
156
157/*
158 * An announcement packet.
159 */
160struct pkt_id {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700161 uint32_t pi_mslot;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800162 struct PageID pi_mpage; /* current page */
163 struct pgstate pi_ps;
164 /* seqptr's */
165 /* null-terminated site name */
166};
167
168struct pkt_preq {
169 struct PageID pp_page;
Elliott Hughes892a68b2015-10-19 14:43:53 -0700170 uint32_t pp_low;
171 uint32_t pp_high;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800172};
173
174struct pkt_prep {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700175 uint32_t pp_n; /* size of pageid array */
The Android Open Source Project2949f582009-03-03 19:30:46 -0800176 /* pgstate's follow */
177};
178
179static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700180wb_id(netdissect_options *ndo,
181 const struct pkt_id *id, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800182{
183 int i;
184 const char *cp;
185 const struct id_off *io;
186 char c;
187 int nid;
188
Elliott Hughes892a68b2015-10-19 14:43:53 -0700189 ND_PRINT((ndo, " wb-id:"));
190 if (len < sizeof(*id) || !ND_TTEST(*id))
The Android Open Source Project2949f582009-03-03 19:30:46 -0800191 return (-1);
192 len -= sizeof(*id);
193
Elliott Hughes892a68b2015-10-19 14:43:53 -0700194 ND_PRINT((ndo, " %u/%s:%u (max %u/%s:%u) ",
The Android Open Source Project2949f582009-03-03 19:30:46 -0800195 EXTRACT_32BITS(&id->pi_ps.slot),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700196 ipaddr_string(ndo, &id->pi_ps.page.p_sid),
The Android Open Source Project2949f582009-03-03 19:30:46 -0800197 EXTRACT_32BITS(&id->pi_ps.page.p_uid),
198 EXTRACT_32BITS(&id->pi_mslot),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700199 ipaddr_string(ndo, &id->pi_mpage.p_sid),
200 EXTRACT_32BITS(&id->pi_mpage.p_uid)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800201
202 nid = EXTRACT_16BITS(&id->pi_ps.nid);
203 len -= sizeof(*io) * nid;
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700204 io = (const struct id_off *)(id + 1);
205 cp = (const char *)(io + nid);
Elliott Hughes892a68b2015-10-19 14:43:53 -0700206 if (ND_TTEST2(cp, len)) {
207 ND_PRINT((ndo, "\""));
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700208 fn_print(ndo, (const u_char *)cp, (const u_char *)cp + len);
Elliott Hughes892a68b2015-10-19 14:43:53 -0700209 ND_PRINT((ndo, "\""));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800210 }
211
212 c = '<';
Elliott Hughes892a68b2015-10-19 14:43:53 -0700213 for (i = 0; i < nid && ND_TTEST(*io); ++io, ++i) {
214 ND_PRINT((ndo, "%c%s:%u",
215 c, ipaddr_string(ndo, &io->id), EXTRACT_32BITS(&io->off)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800216 c = ',';
217 }
218 if (i >= nid) {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700219 ND_PRINT((ndo, ">"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800220 return (0);
221 }
222 return (-1);
223}
224
225static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700226wb_rreq(netdissect_options *ndo,
227 const struct pkt_rreq *rreq, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800228{
Elliott Hughes892a68b2015-10-19 14:43:53 -0700229 ND_PRINT((ndo, " wb-rreq:"));
230 if (len < sizeof(*rreq) || !ND_TTEST(*rreq))
The Android Open Source Project2949f582009-03-03 19:30:46 -0800231 return (-1);
232
Elliott Hughes892a68b2015-10-19 14:43:53 -0700233 ND_PRINT((ndo, " please repair %s %s:%u<%u:%u>",
234 ipaddr_string(ndo, &rreq->pr_id),
235 ipaddr_string(ndo, &rreq->pr_page.p_sid),
The Android Open Source Project2949f582009-03-03 19:30:46 -0800236 EXTRACT_32BITS(&rreq->pr_page.p_uid),
237 EXTRACT_32BITS(&rreq->pr_sseq),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700238 EXTRACT_32BITS(&rreq->pr_eseq)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800239 return (0);
240}
241
242static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700243wb_preq(netdissect_options *ndo,
244 const struct pkt_preq *preq, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800245{
Elliott Hughes892a68b2015-10-19 14:43:53 -0700246 ND_PRINT((ndo, " wb-preq:"));
247 if (len < sizeof(*preq) || !ND_TTEST(*preq))
The Android Open Source Project2949f582009-03-03 19:30:46 -0800248 return (-1);
249
Elliott Hughes892a68b2015-10-19 14:43:53 -0700250 ND_PRINT((ndo, " need %u/%s:%u",
The Android Open Source Project2949f582009-03-03 19:30:46 -0800251 EXTRACT_32BITS(&preq->pp_low),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700252 ipaddr_string(ndo, &preq->pp_page.p_sid),
253 EXTRACT_32BITS(&preq->pp_page.p_uid)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800254 return (0);
255}
256
257static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700258wb_prep(netdissect_options *ndo,
259 const struct pkt_prep *prep, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800260{
261 int n;
262 const struct pgstate *ps;
Elliott Hughes892a68b2015-10-19 14:43:53 -0700263 const u_char *ep = ndo->ndo_snapend;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800264
Elliott Hughes892a68b2015-10-19 14:43:53 -0700265 ND_PRINT((ndo, " wb-prep:"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800266 if (len < sizeof(*prep)) {
267 return (-1);
268 }
269 n = EXTRACT_32BITS(&prep->pp_n);
270 ps = (const struct pgstate *)(prep + 1);
Elliott Hughes892a68b2015-10-19 14:43:53 -0700271 while (--n >= 0 && ND_TTEST(*ps)) {
The Android Open Source Project2949f582009-03-03 19:30:46 -0800272 const struct id_off *io, *ie;
273 char c = '<';
274
Elliott Hughes892a68b2015-10-19 14:43:53 -0700275 ND_PRINT((ndo, " %u/%s:%u",
The Android Open Source Project2949f582009-03-03 19:30:46 -0800276 EXTRACT_32BITS(&ps->slot),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700277 ipaddr_string(ndo, &ps->page.p_sid),
278 EXTRACT_32BITS(&ps->page.p_uid)));
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700279 io = (const struct id_off *)(ps + 1);
Elliott Hughes892a68b2015-10-19 14:43:53 -0700280 for (ie = io + ps->nid; io < ie && ND_TTEST(*io); ++io) {
281 ND_PRINT((ndo, "%c%s:%u", c, ipaddr_string(ndo, &io->id),
282 EXTRACT_32BITS(&io->off)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800283 c = ',';
284 }
Elliott Hughes892a68b2015-10-19 14:43:53 -0700285 ND_PRINT((ndo, ">"));
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700286 ps = (const struct pgstate *)io;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800287 }
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700288 return ((const u_char *)ps <= ep? 0 : -1);
The Android Open Source Project2949f582009-03-03 19:30:46 -0800289}
290
291
Elliott Hughes892a68b2015-10-19 14:43:53 -0700292static const char *dopstr[] = {
The Android Open Source Project2949f582009-03-03 19:30:46 -0800293 "dop-0!",
294 "dop-1!",
295 "RECT",
296 "LINE",
297 "ML",
298 "DEL",
299 "XFORM",
300 "ELL",
301 "CHAR",
302 "STR",
303 "NOP",
304 "PSCODE",
305 "PSCOMP",
306 "REF",
307 "SKIP",
308 "HOLE",
309};
310
311static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700312wb_dops(netdissect_options *ndo, const struct pkt_dop *dop,
313 uint32_t ss, uint32_t es)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800314{
Elliott Hughes892a68b2015-10-19 14:43:53 -0700315 const struct dophdr *dh = (const struct dophdr *)((const u_char *)dop + sizeof(*dop));
316
317 ND_PRINT((ndo, " <"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800318 for ( ; ss <= es; ++ss) {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700319 int t;
320
321 if (!ND_TTEST(*dh)) {
322 ND_PRINT((ndo, "%s", tstr));
323 break;
324 }
325 t = dh->dh_type;
The Android Open Source Project2949f582009-03-03 19:30:46 -0800326
327 if (t > DT_MAXTYPE)
Elliott Hughes892a68b2015-10-19 14:43:53 -0700328 ND_PRINT((ndo, " dop-%d!", t));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800329 else {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700330 ND_PRINT((ndo, " %s", dopstr[t]));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800331 if (t == DT_SKIP || t == DT_HOLE) {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700332 uint32_t ts = EXTRACT_32BITS(&dh->dh_ts);
333 ND_PRINT((ndo, "%d", ts - ss + 1));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800334 if (ss > ts || ts > es) {
Elliott Hughes892a68b2015-10-19 14:43:53 -0700335 ND_PRINT((ndo, "[|]"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800336 if (ts < ss)
337 return (0);
338 }
339 ss = ts;
340 }
341 }
342 dh = DOP_NEXT(dh);
The Android Open Source Project2949f582009-03-03 19:30:46 -0800343 }
Elliott Hughes892a68b2015-10-19 14:43:53 -0700344 ND_PRINT((ndo, " >"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800345 return (0);
346}
347
348static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700349wb_rrep(netdissect_options *ndo,
350 const struct pkt_rrep *rrep, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800351{
352 const struct pkt_dop *dop = &rrep->pr_dop;
353
Elliott Hughes892a68b2015-10-19 14:43:53 -0700354 ND_PRINT((ndo, " wb-rrep:"));
355 if (len < sizeof(*rrep) || !ND_TTEST(*rrep))
The Android Open Source Project2949f582009-03-03 19:30:46 -0800356 return (-1);
357 len -= sizeof(*rrep);
358
Elliott Hughes892a68b2015-10-19 14:43:53 -0700359 ND_PRINT((ndo, " for %s %s:%u<%u:%u>",
360 ipaddr_string(ndo, &rrep->pr_id),
361 ipaddr_string(ndo, &dop->pd_page.p_sid),
The Android Open Source Project2949f582009-03-03 19:30:46 -0800362 EXTRACT_32BITS(&dop->pd_page.p_uid),
363 EXTRACT_32BITS(&dop->pd_sseq),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700364 EXTRACT_32BITS(&dop->pd_eseq)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800365
Elliott Hughes892a68b2015-10-19 14:43:53 -0700366 if (ndo->ndo_vflag)
367 return (wb_dops(ndo, dop,
The Android Open Source Project2949f582009-03-03 19:30:46 -0800368 EXTRACT_32BITS(&dop->pd_sseq),
369 EXTRACT_32BITS(&dop->pd_eseq)));
370 return (0);
371}
372
373static int
Elliott Hughes892a68b2015-10-19 14:43:53 -0700374wb_drawop(netdissect_options *ndo,
375 const struct pkt_dop *dop, u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800376{
Elliott Hughes892a68b2015-10-19 14:43:53 -0700377 ND_PRINT((ndo, " wb-dop:"));
378 if (len < sizeof(*dop) || !ND_TTEST(*dop))
The Android Open Source Project2949f582009-03-03 19:30:46 -0800379 return (-1);
380 len -= sizeof(*dop);
381
Elliott Hughes892a68b2015-10-19 14:43:53 -0700382 ND_PRINT((ndo, " %s:%u<%u:%u>",
383 ipaddr_string(ndo, &dop->pd_page.p_sid),
The Android Open Source Project2949f582009-03-03 19:30:46 -0800384 EXTRACT_32BITS(&dop->pd_page.p_uid),
385 EXTRACT_32BITS(&dop->pd_sseq),
Elliott Hughes892a68b2015-10-19 14:43:53 -0700386 EXTRACT_32BITS(&dop->pd_eseq)));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800387
Elliott Hughes892a68b2015-10-19 14:43:53 -0700388 if (ndo->ndo_vflag)
389 return (wb_dops(ndo, dop,
The Android Open Source Project2949f582009-03-03 19:30:46 -0800390 EXTRACT_32BITS(&dop->pd_sseq),
391 EXTRACT_32BITS(&dop->pd_eseq)));
392 return (0);
393}
394
395/*
396 * Print whiteboard multicast packets.
397 */
398void
Elliott Hughes892a68b2015-10-19 14:43:53 -0700399wb_print(netdissect_options *ndo,
400 register const void *hdr, register u_int len)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800401{
402 register const struct pkt_hdr *ph;
403
404 ph = (const struct pkt_hdr *)hdr;
Elliott Hughes892a68b2015-10-19 14:43:53 -0700405 if (len < sizeof(*ph) || !ND_TTEST(*ph)) {
406 ND_PRINT((ndo, "%s", tstr));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800407 return;
408 }
409 len -= sizeof(*ph);
410
411 if (ph->ph_flags)
Elliott Hughes892a68b2015-10-19 14:43:53 -0700412 ND_PRINT((ndo, "*"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800413 switch (ph->ph_type) {
414
415 case PT_KILL:
Elliott Hughes892a68b2015-10-19 14:43:53 -0700416 ND_PRINT((ndo, " wb-kill"));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800417 return;
418
419 case PT_ID:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700420 if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800421 return;
422 break;
423
424 case PT_RREQ:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700425 if (wb_rreq(ndo, (const struct pkt_rreq *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800426 return;
427 break;
428
429 case PT_RREP:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700430 if (wb_rrep(ndo, (const struct pkt_rrep *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800431 return;
432 break;
433
434 case PT_DRAWOP:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700435 if (wb_drawop(ndo, (const struct pkt_dop *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800436 return;
437 break;
438
439 case PT_PREQ:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700440 if (wb_preq(ndo, (const struct pkt_preq *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800441 return;
442 break;
443
444 case PT_PREP:
Elliott Hughese2e3bd12017-05-15 10:59:29 -0700445 if (wb_prep(ndo, (const struct pkt_prep *)(ph + 1), len) >= 0)
The Android Open Source Project2949f582009-03-03 19:30:46 -0800446 return;
447 break;
448
449 default:
Elliott Hughes892a68b2015-10-19 14:43:53 -0700450 ND_PRINT((ndo, " wb-%d!", ph->ph_type));
The Android Open Source Project2949f582009-03-03 19:30:46 -0800451 return;
452 }
453}