print-atalk.c (98527) | print-atalk.c (111729) |
---|---|
1/* 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 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 --- 6 unchanged lines hidden (view full) --- 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 * Format and print AppleTalk packets. 22 * | 1/* 2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 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 --- 6 unchanged lines hidden (view full) --- 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 * Format and print AppleTalk packets. 22 * |
23 * $FreeBSD: head/contrib/tcpdump/print-atalk.c 98527 2002-06-21 00:49:02Z fenner $ | 23 * $FreeBSD: head/contrib/tcpdump/print-atalk.c 111729 2003-03-02 08:25:48Z fenner $ |
24 */ 25 26#ifndef lint 27static const char rcsid[] = | 24 */ 25 26#ifndef lint 27static const char rcsid[] = |
28 "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.70 2001/11/15 08:23:12 itojun Exp $ (LBL)"; | 28 "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.70.2.1 2002/02/05 10:04:18 guy Exp $ (LBL)"; |
29#endif 30 31#ifdef HAVE_CONFIG_H 32#include "config.h" 33#endif 34 35#include <sys/param.h> 36#include <sys/time.h> --- 73 unchanged lines hidden (view full) --- 110llap_print(register const u_char *bp, u_int length) 111{ 112 register const struct LAP *lp; 113 register const struct atDDP *dp; 114 register const struct atShortDDP *sdp; 115 u_short snet; 116 117#if 0 | 29#endif 30 31#ifdef HAVE_CONFIG_H 32#include "config.h" 33#endif 34 35#include <sys/param.h> 36#include <sys/time.h> --- 73 unchanged lines hidden (view full) --- 110llap_print(register const u_char *bp, u_int length) 111{ 112 register const struct LAP *lp; 113 register const struct atDDP *dp; 114 register const struct atShortDDP *sdp; 115 u_short snet; 116 117#if 0 |
118 /* 119 * Our packet is on a 4-byte boundary, as we're either called 120 * directly from a top-level link-layer printer (ltalk_if_print) 121 * or from the UDP printer. The LLAP+DDP header is a multiple 122 * of 4 bytes in length, so the DDP payload is also on a 4-byte 123 * boundary, and we don't need to align it before calling 124 * "ddp_print()". 125 */ |
|
118 lp = (const struct LAP *)bp; 119 bp += sizeof(*lp); 120 length -= sizeof(*lp); 121#else 122 { 123 static struct LAP lp_ = {0, 0, lapDDP}; 124 lp = &lp_; 125 } --- 272 unchanged lines hidden (view full) --- 398nbp_print(register const struct atNBP *np, u_int length, register u_short snet, 399 register u_char snode, register u_char skt) 400{ 401 register const struct atNBPtuple *tp = 402 (const struct atNBPtuple *)((u_char *)np + nbpHeaderSize); 403 int i; 404 const u_char *ep; 405 | 126 lp = (const struct LAP *)bp; 127 bp += sizeof(*lp); 128 length -= sizeof(*lp); 129#else 130 { 131 static struct LAP lp_ = {0, 0, lapDDP}; 132 lp = &lp_; 133 } --- 272 unchanged lines hidden (view full) --- 406nbp_print(register const struct atNBP *np, u_int length, register u_short snet, 407 register u_char snode, register u_char skt) 408{ 409 register const struct atNBPtuple *tp = 410 (const struct atNBPtuple *)((u_char *)np + nbpHeaderSize); 411 int i; 412 const u_char *ep; 413 |
414 if (length < nbpHeaderSize) { 415 (void)printf(" truncated-nbp %d", length); 416 return; 417 } 418 |
|
406 length -= nbpHeaderSize; 407 if (length < 8) { 408 /* must be room for at least one tuple */ 409 (void)printf(" truncated-nbp %d", length + nbpHeaderSize); 410 return; 411 } 412 /* ep points to end of available data */ 413 ep = snapend; --- 226 unchanged lines hidden --- | 419 length -= nbpHeaderSize; 420 if (length < 8) { 421 /* must be room for at least one tuple */ 422 (void)printf(" truncated-nbp %d", length + nbpHeaderSize); 423 return; 424 } 425 /* ep points to end of available data */ 426 ep = snapend; --- 226 unchanged lines hidden --- |