Lines Matching refs:m

112         let mut m = Message {  in handle_turn_packet()  localVariable
116 m.decode()?; in handle_turn_packet()
118 self.process_message_handler(&m).await in handle_turn_packet()
121 async fn process_message_handler(&mut self, m: &Message) -> Result<()> { in process_message_handler()
122 if m.typ.class == CLASS_INDICATION { in process_message_handler()
123 match m.typ.method { in process_message_handler()
124 METHOD_SEND => self.handle_send_indication(m).await, in process_message_handler()
127 } else if m.typ.class == CLASS_REQUEST { in process_message_handler()
128 match m.typ.method { in process_message_handler()
129 METHOD_ALLOCATE => self.handle_allocate_request(m).await, in process_message_handler()
130 METHOD_REFRESH => self.handle_refresh_request(m).await, in process_message_handler()
131 METHOD_CREATE_PERMISSION => self.handle_create_permission_request(m).await, in process_message_handler()
132 METHOD_CHANNEL_BIND => self.handle_channel_bind_request(m).await, in process_message_handler()
133 METHOD_BINDING => self.handle_binding_request(m).await, in process_message_handler()
143 m: &Message, in authenticate_request()
146 if !m.contains(ATTR_MESSAGE_INTEGRITY) { in authenticate_request()
147 self.respond_with_nonce(m, calling_method, CODE_UNAUTHORIZED) in authenticate_request()
156 m.transaction_id, in authenticate_request()
164 if let Err(err) = nonce_attr.get_from(m) { in authenticate_request()
189 self.respond_with_nonce(m, calling_method, CODE_STALE_NONCE) in authenticate_request()
194 if let Err(err) = realm_attr.get_from(m) { in authenticate_request()
198 if let Err(err) = username_attr.get_from(m) { in authenticate_request()
222 if let Err(err) = mi.check(&mut m.clone()) { in authenticate_request()
232 m: &Message, in respond_with_nonce()
248 m.transaction_id, in respond_with_nonce()
263 pub(crate) async fn handle_binding_request(&mut self, m: &Message) -> Result<()> { in handle_binding_request()
269 m.transaction_id, in handle_binding_request()
281 pub(crate) async fn handle_allocate_request(&mut self, m: &Message) -> Result<()> { in handle_allocate_request()
290 if let Some(mi) = self.authenticate_request(m, METHOD_ALLOCATE).await? { in handle_allocate_request()
315 m.transaction_id, in handle_allocate_request()
338 if let Err(err) = requested_transport.get_from(m) { in handle_allocate_request()
340 m.transaction_id, in handle_allocate_request()
351 m.transaction_id, in handle_allocate_request()
372 if m.contains(ATTR_DONT_FRAGMENT) { in handle_allocate_request()
374 m.transaction_id, in handle_allocate_request()
402 if reservation_token_attr.get_from(m).is_ok() { in handle_allocate_request()
404 if even_port.get_from(m).is_ok() { in handle_allocate_request()
406 m.transaction_id, in handle_allocate_request()
430 if even_port.get_from(m).is_ok() { in handle_allocate_request()
438 m.transaction_id, in handle_allocate_request()
471 let lifetime_duration = allocation_lifetime(m); in handle_allocate_request()
486 m.transaction_id, in handle_allocate_request()
545 m.transaction_id, in handle_allocate_request()
554 pub(crate) async fn handle_refresh_request(&mut self, m: &Message) -> Result<()> { in handle_refresh_request()
558 if let Some(mi) = self.authenticate_request(m, METHOD_REFRESH).await? { in handle_refresh_request()
565 let lifetime_duration = allocation_lifetime(m); in handle_refresh_request()
584 m.transaction_id, in handle_refresh_request()
595 pub(crate) async fn handle_create_permission_request(&mut self, m: &Message) -> Result<()> { in handle_create_permission_request()
609 .authenticate_request(m, METHOD_CREATE_PERMISSION) in handle_create_permission_request()
620 for attr in &m.attributes.0 { in handle_create_permission_request()
626 if peer_address.get_from(m).is_err() { in handle_create_permission_request()
651 m.transaction_id, in handle_create_permission_request()
662 pub(crate) async fn handle_send_indication(&mut self, m: &Message) -> Result<()> { in handle_send_indication()
676 data_attr.get_from(m)?; in handle_send_indication()
679 peer_address.get_from(m)?; in handle_send_indication()
703 pub(crate) async fn handle_channel_bind_request(&mut self, m: &Message) -> Result<()> { in handle_channel_bind_request()
717 m.transaction_id, in handle_channel_bind_request()
726 if let Some(mi) = self.authenticate_request(m, METHOD_CHANNEL_BIND).await? { in handle_channel_bind_request()
733 if let Err(err) = channel.get_from(m) { in handle_channel_bind_request()
739 if let Err(err) = peer_addr.get_from(m) { in handle_channel_bind_request()
762 m.transaction_id, in handle_channel_bind_request()
878 pub(crate) fn allocation_lifetime(m: &Message) -> Duration { in allocation_lifetime()
882 if lifetime.get_from(m).is_ok() && lifetime.0 < MAXIMUM_ALLOCATION_LIFETIME { in allocation_lifetime()