Lines Matching refs:client_id

47     client_id: u32,  field
56 fn new(client_id: u32, addr: MacAddress, hwsim_addr: MacAddress) -> Self { in new()
57 Self { client_id, addr, hwsim_addr } in new()
104 pub fn add(&self, client_id: u32) { in add()
105 let _ = self.clients.write().unwrap().entry(client_id).or_insert_with(|| { in add()
106 info!("Insert client {}", client_id); in add()
111 pub fn remove(&self, client_id: u32) { in remove()
112 self.stations.write().unwrap().retain(|_, s| s.client_id != client_id); in remove()
113 self.clients.write().unwrap().remove(&client_id); in remove()
116 pub fn reset(&self, client_id: u32) { in reset()
117 if let Some(client) = self.clients.read().unwrap().get(&client_id) { in reset()
124 pub fn get(&self, client_id: u32) -> Option<Client> { in get()
125 self.clients.read().unwrap().get(&client_id).map(|c| c.to_owned()) in get()
128 fn contains_client(&self, client_id: u32) -> bool { in contains_client()
129 self.clients.read().unwrap().contains_key(&client_id) in contains_client()
156 pub fn process(&self, client_id: u32, packet: &Bytes) -> bool { in process()
157 self.process_internal(client_id, packet).unwrap_or_else(move |e| { in process()
164 fn process_internal(&self, client_id: u32, packet: &Bytes) -> anyhow::Result<bool> { in process_internal()
186 client_id, hwsim_addr, flags, cookie, frame.ieee80211 in process_internal()
201 client_id, hwsim_addr, src_addr in process_internal()
203 Arc::new(Station::new(client_id, src_addr, hwsim_addr)) in process_internal()
206 if !self.contains_client(client_id) { in process_internal()
207 warn!("Client {} is missing", client_id); in process_internal()
208 self.add(client_id); in process_internal()
231 for client_id in self.clients.read().unwrap().keys() { in send_response()
232 (self.callback)(*client_id, packet); in send_response()
271 (self.callback)(destination.client_id, packet); in send_from_ds_frame()
277 (self.callback)(destination.client_id, &hwsim_msg.encode_to_vec()?.into()); in send_from_ds_frame()
279 self.incr_rx(destination.client_id)?; in send_from_ds_frame()
289 .map(|v| v.client_id) in send_tx_info_response()
294 for client_id in client_ids { in send_tx_info_response()
295 if self.enabled(client_id)? { in send_tx_info_response()
296 (self.callback)(client_id, packet); in send_tx_info_response()
302 pub fn set_enabled(&self, client_id: u32, enabled: bool) { in set_enabled()
303 if let Some(client) = self.clients.read().unwrap().get(&client_id) { in set_enabled()
308 fn enabled(&self, client_id: u32) -> anyhow::Result<bool> { in enabled()
313 .get(&client_id) in enabled()
321 let client_id = self.get_station(&frame.ieee80211.get_source())?.client_id; in send_tx_info_frame() localVariable
323 (self.callback)(client_id, &hwsim_msg_tx_info.into()); in send_tx_info_frame()
327 fn incr_tx(&self, client_id: u32) -> anyhow::Result<()> { in incr_tx()
331 .get(&client_id) in incr_tx()
338 fn incr_rx(&self, client_id: u32) -> anyhow::Result<()> { in incr_rx()
342 .get(&client_id) in incr_rx()
359 if self.enabled(source.client_id)? && self.enabled(destination.client_id)? { in send_from_sta_frame()
361 self.incr_tx(source.client_id)?; in send_from_sta_frame()
362 self.incr_rx(destination.client_id)?; in send_from_sta_frame()
363 (self.callback)(destination.client_id, &packet.encode_to_vec()?.into()); in send_from_sta_frame()
364 log_hwsim_msg(frame, source.client_id, destination.client_id); in send_from_sta_frame()
398 self.incr_tx(source.client_id)?; in queue_frame()
402 self.incr_tx(source.client_id)?; in queue_frame()
470 fn log_hwsim_msg(frame: &Frame, client_id: u32, dest_client_id: u32) { in log_hwsim_msg()
473 client_id, dest_client_id, frame.flags, frame.ieee80211, in log_hwsim_msg()
549 (addr, Arc::new(Station { client_id: test_client_id, addr, hwsim_addr })), in test_remove()
553 client_id: other_client_id, in test_remove()