/*
* Copyright (c) 1993, 1994, 1995, 1996
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#if 0
/*
* Largest packet size. Everything should fit within this space.
* For instance, multiline objects are sent piecewise.
*/
#define MAXFRAMESIZE 1024
#endif
/*
* Multiple drawing ops can be sent in one packet. Each one starts on a
* an even multiple of DOP_ALIGN bytes, which must be a power of two.
*/
#define DOP_ALIGN 4
#define DOP_ROUNDUP(x) roundup2(x, DOP_ALIGN)
#define DOP_NEXT(d)\
((const struct dophdr *)((const u_char *)(d) + \
DOP_ROUNDUP(GET_BE_U_2((d)->dh_len) + sizeof(*(d)))))
/*
* Format of the whiteboard packet header.
* The transport level header.
*/
struct pkt_hdr {
nd_uint32_t ph_src; /* site id of source */
nd_uint32_t ph_ts; /* time stamp (for skew computation) */
nd_uint16_t ph_version; /* version number */
nd_uint8_t ph_type; /* message type */
nd_uint8_t ph_flags; /* message flags */
};
ND_PRINT(" wb-id:");
if (len < sizeof(*id))
return (-1);
len -= sizeof(*id);
ND_PRINT(" %u/%s:%u (max %u/%s:%u) ",
GET_BE_U_4(id->pi_ps.slot),
GET_IPADDR_STRING(id->pi_ps.page.p_sid),
GET_BE_U_4(id->pi_ps.page.p_uid),
GET_BE_U_4(id->pi_mslot),
GET_IPADDR_STRING(id->pi_mpage.p_sid),
GET_BE_U_4(id->pi_mpage.p_uid));
/* now the rest of the fixed-size part of struct pkt_id */
ND_TCHECK_SIZE(id);
static int
wb_preq(netdissect_options *ndo,
const struct pkt_preq *preq, u_int len)
{
ND_PRINT(" wb-preq:");
if (len < sizeof(*preq))
return (-1);
ND_PRINT(" need %u/%s:%u",
GET_BE_U_4(preq->pp_low),
GET_IPADDR_STRING(preq->pp_page.p_sid),
GET_BE_U_4(preq->pp_page.p_uid));
/* now the rest of the fixed-size part of struct pkt_req */
ND_TCHECK_SIZE(preq);
return (0);
}