diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-02-16 03:36:49 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-02-16 03:36:49 +0000 |
commit | edb9220dee122afe2ee17cd9762591f571f3840d (patch) | |
tree | 5d9cbd1948eaada0f6ef21689187aa8b4f97e488 /epan/dissectors/packet-fddi.c | |
parent | 45f7c0541125a30ba2f673fef09a821699f640e8 (diff) |
Make swap_mac_addr() take a pointer to a TVB and an offset rather than
(generally) a pointer into the TVB.
svn path=/trunk/; revision=35964
Diffstat (limited to 'epan/dissectors/packet-fddi.c')
-rw-r--r-- | epan/dissectors/packet-fddi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index 26b960dc8f..cc41ee3f5c 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -137,12 +137,12 @@ static dissector_handle_t llc_handle; static dissector_handle_t data_handle; static void -swap_mac_addr(guint8 *swapped_addr, const guint8 *orig_addr) +swap_mac_addr(guint8 *swapped_addr, tvbuff_t *tvb, gint offset) { int i; for (i = 0; i < 6; i++) { - swapped_addr[i] = BIT_SWAP(orig_addr[i]); + swapped_addr[i] = BIT_SWAP(tvb_get_guint8(tvb, offset+i)); } } @@ -318,10 +318,10 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Extract the destination address, possibly bit-swapping it. */ if (bitswapped) - swap_mac_addr(dst, tvb_get_ptr(tvb, FDDI_P_DHOST + FDDI_PADDING, 6)); + swap_mac_addr(dst, tvb, FDDI_P_DHOST + FDDI_PADDING); else tvb_memcpy(tvb, dst, FDDI_P_DHOST + FDDI_PADDING, sizeof(dst)); - swap_mac_addr(dst_swapped, tvb_get_ptr(tvb, FDDI_P_DHOST + FDDI_PADDING, 6)); + swap_mac_addr(dst_swapped, tvb, FDDI_P_DHOST + FDDI_PADDING); /* XXX - copy them to some buffer associated with "pi", rather than just making "dst" static? */ @@ -343,10 +343,10 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Extract the source address, possibly bit-swapping it. */ if (bitswapped) - swap_mac_addr(src, tvb_get_ptr(tvb, FDDI_P_SHOST + FDDI_PADDING, 6)); + swap_mac_addr(src, tvb, FDDI_P_SHOST + FDDI_PADDING); else tvb_memcpy(tvb, src, FDDI_P_SHOST + FDDI_PADDING, sizeof(src)); - swap_mac_addr(src_swapped, tvb_get_ptr(tvb, FDDI_P_SHOST + FDDI_PADDING, 6)); + swap_mac_addr(src_swapped, tvb, FDDI_P_SHOST + FDDI_PADDING); /* XXX - copy them to some buffer associated with "pi", rather than just making "src" static? */ |