print-atalk.c (127675) | print-atalk.c (146778) |
---|---|
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 127675 2004-03-31 14:57:24Z bms $ | 23 * $FreeBSD: head/contrib/tcpdump/print-atalk.c 146778 2005-05-29 19:09:28Z sam $ |
24 */ 25 26#ifndef lint 27static const char rcsid[] _U_ = | 24 */ 25 26#ifndef lint 27static const char rcsid[] _U_ = |
28 "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.78.2.2 2003/11/16 08:51:11 guy Exp $ (LBL)"; | 28 "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.81 2004/05/01 09:41:50 hannes Exp $ (LBL)"; |
29#endif 30 31#ifdef HAVE_CONFIG_H 32#include "config.h" 33#endif 34 35#include <tcpdump-stdinc.h> 36 --- 139 unchanged lines hidden (view full) --- 176 * packets in them). 177 */ 178void 179atalk_print(register const u_char *bp, u_int length) 180{ 181 register const struct atDDP *dp; 182 u_short snet; 183 | 29#endif 30 31#ifdef HAVE_CONFIG_H 32#include "config.h" 33#endif 34 35#include <tcpdump-stdinc.h> 36 --- 139 unchanged lines hidden (view full) --- 176 * packets in them). 177 */ 178void 179atalk_print(register const u_char *bp, u_int length) 180{ 181 register const struct atDDP *dp; 182 u_short snet; 183 |
184 if(!eflag) 185 printf("AT "); 186 |
|
184 if (length < ddpSize) { 185 (void)printf(" [|ddp %d]", length); 186 return; 187 } 188 dp = (const struct atDDP *)bp; 189 snet = EXTRACT_16BITS(&dp->srcNet); 190 printf("%s.%s", ataddr_string(snet, dp->srcNode), 191 ddpskt_string(dp->srcSkt)); | 187 if (length < ddpSize) { 188 (void)printf(" [|ddp %d]", length); 189 return; 190 } 191 dp = (const struct atDDP *)bp; 192 snet = EXTRACT_16BITS(&dp->srcNet); 193 printf("%s.%s", ataddr_string(snet, dp->srcNode), 194 ddpskt_string(dp->srcSkt)); |
192 printf(" > %s.%s:", | 195 printf(" > %s.%s: ", |
193 ataddr_string(EXTRACT_16BITS(&dp->dstNet), dp->dstNode), 194 ddpskt_string(dp->dstSkt)); 195 bp += ddpSize; 196 length -= ddpSize; 197 ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt); 198} 199 200/* XXX should probably pass in the snap header and do checks like arp_print() */ --- 44 unchanged lines hidden (view full) --- 245 case ddpNBP: 246 nbp_print((const struct atNBP *)bp, length, snet, snode, skt); 247 break; 248 249 case ddpATP: 250 atp_print((const struct atATP *)bp, length); 251 break; 252 | 196 ataddr_string(EXTRACT_16BITS(&dp->dstNet), dp->dstNode), 197 ddpskt_string(dp->dstSkt)); 198 bp += ddpSize; 199 length -= ddpSize; 200 ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt); 201} 202 203/* XXX should probably pass in the snap header and do checks like arp_print() */ --- 44 unchanged lines hidden (view full) --- 248 case ddpNBP: 249 nbp_print((const struct atNBP *)bp, length, snet, snode, skt); 250 break; 251 252 case ddpATP: 253 atp_print((const struct atATP *)bp, length); 254 break; 255 |
256 case ddpEIGRP: 257 eigrp_print(bp, length); 258 break; 259 |
|
253 default: 254 (void)printf(" at-%s %d", tok2str(type2str, NULL, t), length); 255 break; 256 } 257} 258 259static void 260atp_print(register const struct atATP *ap, u_int length) --- 369 unchanged lines hidden --- | 260 default: 261 (void)printf(" at-%s %d", tok2str(type2str, NULL, t), length); 262 break; 263 } 264} 265 266static void 267atp_print(register const struct atATP *ap, u_int length) --- 369 unchanged lines hidden --- |