mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-11-04 00:37:22 +01:00 
			
		
		
		
	scan: Add scan_ssid_security_to_str
This commit is contained in:
		
							parent
							
								
									342ad9c61c
								
							
						
					
					
						commit
						b9402af687
					
				
							
								
								
									
										16
									
								
								src/scan.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/scan.c
									
									
									
									
									
								
							@ -83,6 +83,22 @@ struct scan_results {
 | 
			
		||||
	struct scan_freq_set *freqs;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const char *scan_ssid_security_to_str(enum scan_ssid_security ssid_security)
 | 
			
		||||
{
 | 
			
		||||
	switch (ssid_security) {
 | 
			
		||||
	case SCAN_SSID_SECURITY_NONE:
 | 
			
		||||
		return "open";
 | 
			
		||||
	case SCAN_SSID_SECURITY_WEP:
 | 
			
		||||
		return "wep";
 | 
			
		||||
	case SCAN_SSID_SECURITY_PSK:
 | 
			
		||||
		return "psk";
 | 
			
		||||
	case SCAN_SSID_SECURITY_8021X:
 | 
			
		||||
		return "8021x";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void scan_done(struct l_genl_msg *msg, void *userdata);
 | 
			
		||||
 | 
			
		||||
static bool scan_context_match(const void *a, const void *b)
 | 
			
		||||
 | 
			
		||||
@ -65,6 +65,8 @@ struct scan_bss {
 | 
			
		||||
	uint16_t rank;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const char *scan_ssid_security_to_str(enum scan_ssid_security ssid_security);
 | 
			
		||||
 | 
			
		||||
uint32_t scan_passive(uint32_t ifindex, scan_trigger_func_t trigger,
 | 
			
		||||
			scan_notify_func_t notify, void *userdata,
 | 
			
		||||
			scan_destroy_func_t destroy);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								src/wiphy.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/wiphy.c
									
									
									
									
									
								
							@ -135,22 +135,6 @@ static bool eapol_read(struct l_io *io, void *user_data)
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const char *ssid_security_to_str(enum scan_ssid_security ssid_security)
 | 
			
		||||
{
 | 
			
		||||
	switch (ssid_security) {
 | 
			
		||||
	case SCAN_SSID_SECURITY_NONE:
 | 
			
		||||
		return "open";
 | 
			
		||||
	case SCAN_SSID_SECURITY_WEP:
 | 
			
		||||
		return "wep";
 | 
			
		||||
	case SCAN_SSID_SECURITY_PSK:
 | 
			
		||||
		return "psk";
 | 
			
		||||
	case SCAN_SSID_SECURITY_8021X:
 | 
			
		||||
		return "8021x";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const char *iwd_network_get_path(struct netdev *netdev,
 | 
			
		||||
					const uint8_t *ssid, size_t ssid_len,
 | 
			
		||||
					enum scan_ssid_security ssid_security)
 | 
			
		||||
@ -165,7 +149,7 @@ static const char *iwd_network_get_path(struct netdev *netdev,
 | 
			
		||||
								ssid[i]);
 | 
			
		||||
 | 
			
		||||
	snprintf(path + pos, sizeof(path) - pos, "_%s",
 | 
			
		||||
			ssid_security_to_str(ssid_security));
 | 
			
		||||
			scan_ssid_security_to_str(ssid_security));
 | 
			
		||||
 | 
			
		||||
	return path;
 | 
			
		||||
}
 | 
			
		||||
@ -1730,7 +1714,7 @@ static void process_bss(struct netdev *netdev, struct scan_bss *bss)
 | 
			
		||||
					network->object_path, network);
 | 
			
		||||
 | 
			
		||||
		l_debug("Added new Network \"%s\" security %s", network->ssid,
 | 
			
		||||
			ssid_security_to_str(ssid_security));
 | 
			
		||||
			scan_ssid_security_to_str(ssid_security));
 | 
			
		||||
 | 
			
		||||
		if (!l_dbus_register_interface(dbus_get_bus(),
 | 
			
		||||
					network->object_path,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user