mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-11-04 08:57:29 +01:00 
			
		
		
		
	util: add util_is_valid_sta_address
Checks that that address is neither broadcast or group
This commit is contained in:
		
							parent
							
								
									66657a5706
								
							
						
					
					
						commit
						33251ccd20
					
				@ -166,6 +166,11 @@ bool util_is_broadcast_address(const uint8_t *addr)
 | 
			
		||||
	return !memcmp(addr, bcast_addr, 6);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool util_is_valid_sta_address(const uint8_t *addr)
 | 
			
		||||
{
 | 
			
		||||
	return !util_is_broadcast_address(addr) && !util_is_group_address(addr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* This function assumes that identity is not bigger than 253 bytes */
 | 
			
		||||
const char *util_get_domain(const char *identity)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
@ -38,6 +38,7 @@ const char *util_address_to_string(const uint8_t *addr);
 | 
			
		||||
bool util_string_to_address(const char *str, uint8_t *addr);
 | 
			
		||||
bool util_is_group_address(const uint8_t *addr);
 | 
			
		||||
bool util_is_broadcast_address(const uint8_t *addr);
 | 
			
		||||
bool util_is_valid_sta_address(const uint8_t *addr);
 | 
			
		||||
 | 
			
		||||
const char *util_get_domain(const char *identity);
 | 
			
		||||
const char *util_get_username(const char *identity);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user