diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-08-02 19:42:59 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-08-02 19:42:59 +0000 |
commit | bb78da2687309a9c11733b9ad20266ec147cf8cc (patch) | |
tree | 5557f3ad3ac1baf915727ad1de6364e5a9355151 /epan/dissectors | |
parent | 33ec97e5c33bf96fb0c3ad6e32422ee937409589 (diff) |
Clean up indentation.
Get rid of capture_XXX routines that just bump ld->other.
*Do* bump ld->arp for AX.25 ARP packets.
Note that, as there's IP-over-NetROM, capture_netrom() should check for
it.
svn path=/trunk/; revision=44225
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/Makefile.common | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-ax25.c | 60 | ||||
-rw-r--r-- | epan/dissectors/packet-flexnet.c | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-flexnet.h | 32 | ||||
-rw-r--r-- | epan/dissectors/packet-netrom.c | 2 |
5 files changed, 26 insertions, 85 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index 74fee985fb..ae11763580 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -1284,7 +1284,6 @@ DISSECTOR_INCLUDES = \ packet-fddi.h \ packet-ff.h \ packet-fix.h \ - packet-flexnet.h \ packet-fmp.h \ packet-fr.h \ packet-frame.h \ diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c index 5f2a1efc64..c9e4c35d9b 100644 --- a/epan/dissectors/packet-ax25.c +++ b/epan/dissectors/packet-ax25.c @@ -60,7 +60,6 @@ #include "packet-ax25.h" #include "packet-netrom.h" -#include "packet-flexnet.h" #define STRLEN 80 @@ -571,44 +570,33 @@ capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld) guint8 pid; int l_offset; -if ( ! BYTES_ARE_IN_FRAME( offset, len, AX25_HEADER_SIZE ) ) - { - ld->other++; - return; - } - -l_offset = offset; -l_offset += AX25_ADDR_LEN; /* step over dst addr point at src addr */ -l_offset += AX25_ADDR_LEN; /* step over src addr point at either 1st via addr or control byte */ -while ( ( pd[ l_offset - 1 ] & 0x01 ) == 0 ) - l_offset += AX25_ADDR_LEN; /* step over a via addr */ + if ( ! BYTES_ARE_IN_FRAME( offset, len, AX25_HEADER_SIZE ) ) + { + ld->other++; + return; + } -control = pd[ l_offset ]; + l_offset = offset; + l_offset += AX25_ADDR_LEN; /* step over dst addr point at src addr */ + l_offset += AX25_ADDR_LEN; /* step over src addr point at either 1st via addr or control byte */ + while ( ( pd[ l_offset - 1 ] & 0x01 ) == 0 ) + l_offset += AX25_ADDR_LEN; /* step over a via addr */ -/* decode the pid field (if appropriate) */ -if ( I_FRAME( control ) || UI_FRAME( control ) ) - { - l_offset += 1; /* step over control byte point at pid */ - pid = pd[ l_offset ]; + control = pd[ l_offset ]; - l_offset += 1; /* step over the pid and point to the first byte of the payload */ - switch ( pid & 0x0ff ) + /* decode the pid field (if appropriate) */ + if ( I_FRAME( control ) || UI_FRAME( control ) ) { - case AX25_P_ROSE : break; - case AX25_P_RFC1144C : break; - case AX25_P_RFC1144 : break; - case AX25_P_SEGMENT : break; - case AX25_P_TEXNET : break; - case AX25_P_LCP : break; - case AX25_P_ATALK : break; - case AX25_P_ATALKARP : break; - case AX25_P_IP : capture_ip( pd, l_offset, len, ld ); break; - case AX25_P_ARP : break; - case AX25_P_FLEXNET : capture_flexnet( pd, l_offset, len, ld ); break; - case AX25_P_NETROM : capture_netrom( pd, l_offset, len, ld ); break; - case AX25_P_NO_L3 : break; - case AX25_P_L3_ESC : break; - default : break; + l_offset += 1; /* step over control byte point at pid */ + pid = pd[ l_offset ]; + + l_offset += 1; /* step over the pid and point to the first byte of the payload */ + switch ( pid & 0x0ff ) + { + case AX25_P_NETROM : capture_netrom( pd, l_offset, len, ld ); break; + case AX25_P_IP : capture_ip( pd, l_offset, len, ld ); break; + case AX25_P_ARP : ld->arp++; break; + default : ld->other++; break; + } } - } } diff --git a/epan/dissectors/packet-flexnet.c b/epan/dissectors/packet-flexnet.c index c5cdeb5ded..5e8d1ccc93 100644 --- a/epan/dissectors/packet-flexnet.c +++ b/epan/dissectors/packet-flexnet.c @@ -52,8 +52,6 @@ #include <epan/xdlc.h> #include <packet-ip.h> -#include "packet-flexnet.h" - #define FLEXNET_ADRLEN 15 #define FLEXNET_CTLLEN 15 #define FLEXNET_HDRLEN (FLEXNET_ADRLEN + FLEXNET_ADRLEN + FLEXNET_CTLLEN) @@ -171,17 +169,3 @@ proto_reg_handoff_flexnet(void) inited = TRUE; } } - -void -capture_flexnet( const guchar *pd, int offset, int len, packet_counts *ld) -{ - const guchar *l_pd; - - if ( ! BYTES_ARE_IN_FRAME( offset, len, FLEXNET_HDRLEN ) ) - { - ld->other++; - return; - } - l_pd = pd; - -} diff --git a/epan/dissectors/packet-flexnet.h b/epan/dissectors/packet-flexnet.h deleted file mode 100644 index b15f36d577..0000000000 --- a/epan/dissectors/packet-flexnet.h +++ /dev/null @@ -1,32 +0,0 @@ -/* packet-flexnet.h - * - * Routines for Amateur Packet Radio protocol dissection - * Copyright 2005,2006,2007,2008,2009,2010,2012 R.W. Stearn <richard@rns-stearn.demon.co.uk> - * - * $Id$ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@ethereal.com> - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __PACKET_FLEXNET_H__ -#define __PACKET_FLEXNET_H__ - -void capture_flexnet(const guchar *, int, int, packet_counts *); - -#endif diff --git a/epan/dissectors/packet-netrom.c b/epan/dissectors/packet-netrom.c index eba79e4fc2..2e39ebacd9 100644 --- a/epan/dissectors/packet-netrom.c +++ b/epan/dissectors/packet-netrom.c @@ -686,4 +686,6 @@ capture_netrom( const guchar *pd _U_, int offset, int len, packet_counts *ld) ld->other++; return; } + /* XXX - check fr IP-over-NetROM here! */ + ld->other++; } |