pub fn handle_data_frame<B: ByteSlice>(
        &mut self,
        ctx: &mut Context,
        fixed_fields: mac::FixedDataHdrFields,
        addr4: Option<mac::Addr4>,
        qos_ctrl: Option<mac::QosControl>,
        body: B,
    ) -> Result<(), Rejection> {
        if mac::data_receiver_addr(&fixed_fields) != ctx.bssid.0 {
            // Frame is not for this BSSID.
            return Err(Rejection::OtherBss);
        }

        if !*&{ fixed_fields.frame_ctrl }.to_ds() || *&{ fixed_fields.frame_ctrl }.from_ds() {
            // IEEE Std 802.11-2016, 9.2.4.1.4 and Table 9-3: Frame was not sent to a distribution
            // system (e.g. an AP), or was received from another distribution system.
            return Err(Rejection::BadDsBits);
        }

        let src_addr = mac::data_src_addr(&fixed_fields, addr4).ok_or(Rejection::NoSrcAddr)?;

        // Handle the frame, pretending that the client is an unauthenticated client if we don't
        // know about it.
        let mut maybe_client = None;
        let client = self
            .clients
            .get_mut(&src_addr)
            .unwrap_or_else(|| maybe_client.get_or_insert(RemoteClient::new(src_addr)));
        client
            .handle_data_frame(ctx, fixed_fields, addr4, qos_ctrl, body)
            .map_err(|e| Rejection::Client(client.addr, e))
    }
/// Handles an incoming data frame.
///
///
Handles an incoming data frame.
Handles an incoming data frame .
pub fn handle_data_frame<B: ByteSlice>(
        &mut self,
        ctx: &mut Context,
        fixed_fields: mac::FixedDataHdrFields,
        addr4: Option<mac::Addr4>,
        qos_ctrl: Option<mac::QosControl>,
        body: B,
    ) -> Result<(), Rejection> {
        if mac::data_receiver_addr(&fixed_fields) != ctx.bssid.0 {
            // Frame is not for this BSSID.
            return Err(Rejection::OtherBss);
        }
        if !*&{ fixed_fields.frame_ctrl }.to_ds() || *&{ fixed_fields.frame_ctrl }.from_ds() {
            // IEEE Std 802.11-2016, 9.2.4.1.4 and Table 9-3: Frame was not sent to a distribution
            // system (e.g. an AP), or was received from another distribution system.
            return Err(Rejection::BadDsBits);
        }
        let src_addr = mac::data_src_addr(&fixed_fields, addr4).ok_or(Rejection::NoSrcAddr)?;
        // Handle the frame, pretending that the client is an unauthenticated client if we don't
        // know about it.
        let mut maybe_client = None;
        let client = self
            .clients
            .get_mut(&src_addr)
            .unwrap_or_else(|| maybe_client.get_or_insert(RemoteClient::new(src_addr)));
        client
            .handle_data_frame(ctx, fixed_fields, addr4, qos_ctrl, body)
            .map_err(|e| Rejection::Client(client.addr, e))
    }
pub fn handle_data_frame < B : ByteSlice > ( & mut self , ctx : & mut Context , fixed_fields : mac :: FixedDataHdrFields , addr4 : Option < mac :: Addr4 > , qos_ctrl : Option < mac :: QosControl > , body : B , ) -> Result < ( ) , Rejection > { if mac :: data_receiver_addr ( & fixed_fields ) != ctx . bssid . 0 { // Frame is not for this BSSID. return Err ( Rejection :: OtherBss ) ; } if ! * & { fixed_fields . frame_ctrl } . to_ds ( ) || * & { fixed_fields . frame_ctrl } . from_ds ( ) { // IEEE Std 802.11-2016, 9.2.4.1.4 and Table 9-3: Frame was not sent to a distribution // system (e.g. an AP), or was received from another distribution system. return Err ( Rejection :: BadDsBits ) ; } let src_addr = mac :: data_src_addr ( & fixed_fields , addr4 ) . ok_or ( Rejection :: NoSrcAddr ) ? ; // Handle the frame, pretending that the client is an unauthenticated client if we don't // know about it. let mut maybe_client = None ; let client = self . clients . get_mut ( & src_addr ) . unwrap_or_else ( | | maybe_client . get_or_insert ( RemoteClient :: new ( src_addr ) ) ) ; client . handle_data_frame ( ctx , fixed_fields , addr4 , qos_ctrl , body ) . map_err ( | e | Rejection :: Client ( client . addr , e ) ) }
Handles an incoming data frame.
Handles an incoming data frame .
&mut self
ctx
&mut Context
fixed_fields
mac::FixedDataHdrFields
addr4
Option<mac::Addr4>
qos_ctrl
Option<mac::QosControl>
body
B