Changeset 1840

Show
Ignore:
Timestamp:
04/22/07 15:47:59 (21 months ago)
Author:
aturner
Message:

use standardized api. refs #103

Location:
trunk/src/tcpedit/plugins/dlt_ieee80211
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/tcpedit/plugins/dlt_ieee80211/ieee80211.c

    r1838 r1840  
    202202    } 
    203203     
    204     if (ieee80211_is_encrypted((ieee80211_hdr_t *)packet)) { 
     204    if (ieee80211_is_encrypted(ctx, packet, pktlen)) { 
    205205        tcpedit_seterr(ctx->tcpedit, "Packet " COUNTER_SPEC " is encrypted.  Unable to decode frame.", 
    206206            ctx->tcpedit->runtime.packetnum); 
  • trunk/src/tcpedit/plugins/dlt_ieee80211/ieee80211_hdr.c

    r1838 r1840  
    5050    assert(ctx); 
    5151    assert(packet); 
     52    assert(pktlen >= (int)sizeof(ieee80211_hdr_t)); 
    5253         
    5354    /*  
     
    101102 */ 
    102103int 
    103 ieee80211_is_encrypted(const ieee80211_hdr_t *hdr) 
     104ieee80211_is_encrypted(tcpeditdlt_t *ctx, const void *packet, const int pktlen) 
    104105{ 
    105106    u_int16_t *frame_control, fc; 
    106     assert(hdr); 
    107107 
    108     frame_control = (u_int16_t *)hdr; 
     108    assert(ctx); 
     109    assert(packet); 
     110    assert(pktlen >= (int)sizeof(ieee80211_hdr_t)); 
     111 
     112    frame_control = (u_int16_t *)packet; 
    109113    fc = ntohs(*frame_control); 
    110114     
  • trunk/src/tcpedit/plugins/dlt_ieee80211/ieee80211_hdr.h

    r1838 r1840  
    3939 
    4040int ieee80211_is_data(tcpeditdlt_t *ctx, const void *packet, const int pktlen); 
     41int ieee80211_is_encrypted(tcpeditdlt_t *ctx, const void *packet, const int pktlen); 
     42 
    4143char *ieee80211_get_src(const void *header); 
    4244char *ieee80211_get_dst(const void *header);