print-arcnet.c (127668) | print-arcnet.c (146773) |
---|---|
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 --- 8 unchanged lines hidden (view full) --- 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 * From: NetBSD: print-arcnet.c,v 1.2 2000/04/24 13:02:28 itojun Exp 22 */ 23#ifndef lint 24static const char rcsid[] _U_ = | 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 --- 8 unchanged lines hidden (view full) --- 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 * From: NetBSD: print-arcnet.c,v 1.2 2000/04/24 13:02:28 itojun Exp 22 */ 23#ifndef lint 24static const char rcsid[] _U_ = |
25 "@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.15.2.2 2003/11/16 08:51:09 guy Exp $ (LBL)"; | 25 "@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.20 2005/04/06 21:32:38 mcr Exp $ (LBL)"; |
26#endif 27 28#ifdef HAVE_CONFIG_H 29#include "config.h" 30#endif 31 32#include <tcpdump-stdinc.h> 33 --- 64 unchanged lines hidden (view full) --- 98 "(fragment %d) %d: ", 99 ap->arc_shost, ap->arc_dhost, arctypename, seqid, 100 flag/2 + 1, length); 101} 102 103/* 104 * This is the top level routine of the printer. 'p' points 105 * to the ARCNET header of the packet, 'h->ts' is the timestamp, | 26#endif 27 28#ifdef HAVE_CONFIG_H 29#include "config.h" 30#endif 31 32#include <tcpdump-stdinc.h> 33 --- 64 unchanged lines hidden (view full) --- 98 "(fragment %d) %d: ", 99 ap->arc_shost, ap->arc_dhost, arctypename, seqid, 100 flag/2 + 1, length); 101} 102 103/* 104 * This is the top level routine of the printer. 'p' points 105 * to the ARCNET header of the packet, 'h->ts' is the timestamp, |
106 * 'h->length' is the length of the packet off the wire, and 'h->caplen' | 106 * 'h->len' is the length of the packet off the wire, and 'h->caplen' |
107 * is the number of bytes actually captured. 108 */ 109u_int 110arcnet_if_print(const struct pcap_pkthdr *h, const u_char *p) 111{ 112 u_int caplen = h->caplen; 113 u_int length = h->len; 114 const struct arc_header *ap; --- 67 unchanged lines hidden (view full) --- 182 default_print(p, caplen); 183 184 return (archdrlen); 185} 186 187/* 188 * This is the top level routine of the printer. 'p' points 189 * to the ARCNET header of the packet, 'h->ts' is the timestamp, | 107 * is the number of bytes actually captured. 108 */ 109u_int 110arcnet_if_print(const struct pcap_pkthdr *h, const u_char *p) 111{ 112 u_int caplen = h->caplen; 113 u_int length = h->len; 114 const struct arc_header *ap; --- 67 unchanged lines hidden (view full) --- 182 default_print(p, caplen); 183 184 return (archdrlen); 185} 186 187/* 188 * This is the top level routine of the printer. 'p' points 189 * to the ARCNET header of the packet, 'h->ts' is the timestamp, |
190 * 'h->length' is the length of the packet off the wire, and 'h->caplen' | 190 * 'h->len' is the length of the packet off the wire, and 'h->caplen' |
191 * is the number of bytes actually captured. It is quite similar 192 * to the non-Linux style printer except that Linux doesn't ever 193 * supply packets that look like exception frames, it always supplies 194 * reassembled packets rather than raw frames, and headers have an 195 * extra "offset" field between the src/dest and packet type. 196 */ 197u_int 198arcnet_linux_if_print(const struct pcap_pkthdr *h, const u_char *p) --- 55 unchanged lines hidden (view full) --- 254static int 255arcnet_encap_print(u_char arctype, const u_char *p, 256 u_int length, u_int caplen) 257{ 258 switch (arctype) { 259 260 case ARCTYPE_IP_OLD: 261 case ARCTYPE_IP: | 191 * is the number of bytes actually captured. It is quite similar 192 * to the non-Linux style printer except that Linux doesn't ever 193 * supply packets that look like exception frames, it always supplies 194 * reassembled packets rather than raw frames, and headers have an 195 * extra "offset" field between the src/dest and packet type. 196 */ 197u_int 198arcnet_linux_if_print(const struct pcap_pkthdr *h, const u_char *p) --- 55 unchanged lines hidden (view full) --- 254static int 255arcnet_encap_print(u_char arctype, const u_char *p, 256 u_int length, u_int caplen) 257{ 258 switch (arctype) { 259 260 case ARCTYPE_IP_OLD: 261 case ARCTYPE_IP: |
262 ip_print(p, length); | 262 ip_print(gndo, p, length); |
263 return (1); 264 265#ifdef INET6 266 case ARCTYPE_INET6: 267 ip6_print(p, length); 268 return (1); 269#endif /*INET6*/ 270 271 case ARCTYPE_ARP_OLD: 272 case ARCTYPE_ARP: 273 case ARCTYPE_REVARP: | 263 return (1); 264 265#ifdef INET6 266 case ARCTYPE_INET6: 267 ip6_print(p, length); 268 return (1); 269#endif /*INET6*/ 270 271 case ARCTYPE_ARP_OLD: 272 case ARCTYPE_ARP: 273 case ARCTYPE_REVARP: |
274 arp_print(p, length, caplen); | 274 arp_print(gndo, p, length, caplen); |
275 return (1); 276 277 case ARCTYPE_ATALK: /* XXX was this ever used? */ 278 if (vflag) 279 fputs("et1 ", stdout); 280 atalk_print(p, length); 281 return (1); 282 283 case ARCTYPE_IPX: 284 ipx_print(p, length); 285 return (1); 286 287 default: 288 return (0); 289 } 290} | 275 return (1); 276 277 case ARCTYPE_ATALK: /* XXX was this ever used? */ 278 if (vflag) 279 fputs("et1 ", stdout); 280 atalk_print(p, length); 281 return (1); 282 283 case ARCTYPE_IPX: 284 ipx_print(p, length); 285 return (1); 286 287 default: 288 return (0); 289 } 290} |
291 292/* 293 * Local Variables: 294 * c-style: bsd 295 * End: 296 */ 297 |
|