diff options
author | guy <guy> | 2005-04-26 07:26:33 +0000 |
---|---|---|
committer | guy <guy> | 2005-04-26 07:26:33 +0000 |
commit | fead98c71dfc12b5de3f2b41582851de736c68fe (patch) | |
tree | f769602140d05cc06aff4eb23bdfb9d2f6b9ac56 /llc.h | |
parent | c0fd6776c1874deb96a1f2edb9320492a0fb396f (diff) | |
download | tcpdump-fead98c71dfc12b5de3f2b41582851de736c68fe.tar.gz |
Make "snap_print()" handle fetching and printing the OUI.
Don't copy the LLC header to a "struct llc", just construct the
individual fields.
Fetch the control field early in the dissection process, and check to
make sure we have at least 4 bytes of LLC header if it's not a U frame.
Fetch both bytes of the control field for I and S frames, and display
all 4 hex digits of it.
Only dissect UI frames as BPDUs, and pass the BPDU dissector a pointer
to the beginning of the BPDU, not the beginning of the LLC header - not
all BPDUs are encapsulated in LLC headers.
Only dissect UI frames as IP packets.
Do bounds checking in "snap_print()".
Diffstat (limited to 'llc.h')
-rw-r--r-- | llc.h | 36 |
1 files changed, 2 insertions, 34 deletions
@@ -18,44 +18,13 @@ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.17 2005-04-06 20:09:07 hannes Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.18 2005-04-26 07:26:33 guy Exp $ (LBL) */ /* - * This stuff should come from a system header file, but there's no - * obviously portable way to do that and it's not really going - * to change from system to system. + * Definitions for information in the LLC header. */ -/* - * A somewhat abstracted view of the LLC header - */ - -struct llc { - u_int8_t dsap; - u_int8_t ssap; - union { - u_int8_t u_ctl; - u_int16_t is_ctl; - struct { - u_int8_t snap_ui; - u_int8_t snap_pi[5]; - } snap; - struct { - u_int8_t snap_ui; - u_int8_t snap_orgcode[3]; - u_int8_t snap_ethertype[2]; - } snap_ether; - } ctl; -}; - -#define llcui ctl.snap.snap_ui -#define llcpi ctl.snap.snap_pi -#define llc_orgcode ctl.snap_ether.snap_orgcode -#define llc_ethertype ctl.snap_ether.snap_ethertype -#define llcis ctl.is_ctl -#define llcu ctl.u_ctl - #define LLC_U_FMT 3 #define LLC_GSAP 1 #define LLC_S_FMT 1 @@ -144,4 +113,3 @@ struct llc { #define PID_RFC2684_802_6_FCS 0x0005 /* 802.6, with FCS */ #define PID_RFC2684_802_6_NOFCS 0x000b /* 802.6, without FCS */ #define PID_RFC2684_BPDU 0x000e /* BPDUs */ - |