mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-10-30 20:37:26 +01:00 
			
		
		
		
	dbus: Add dbus_iftype_to_string
This commit is contained in:
		
							parent
							
								
									9c6f3ef5c0
								
							
						
					
					
						commit
						6e6797cbde
					
				
							
								
								
									
										21
									
								
								src/dbus.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								src/dbus.c
									
									
									
									
									
								
							| @ -30,9 +30,12 @@ | ||||
| 
 | ||||
| #include <ell/ell.h> | ||||
| #include <ell/dbus-private.h> | ||||
| #include "src/dbus.h" | ||||
| 
 | ||||
| #include "linux/nl80211.h" | ||||
| 
 | ||||
| #include "src/agent.h" | ||||
| #include "src/iwd.h" | ||||
| #include "src/dbus.h" | ||||
| 
 | ||||
| struct l_dbus *g_dbus = 0; | ||||
| 
 | ||||
| @ -43,6 +46,22 @@ static void do_debug(const char *str, void *user_data) | ||||
| 	l_info("%s%s", prefix, str); | ||||
| } | ||||
| 
 | ||||
| const char *dbus_iftype_to_string(uint32_t iftype) | ||||
| { | ||||
| 	switch (iftype) { | ||||
| 	case NL80211_IFTYPE_ADHOC: | ||||
| 		return "ad-hoc"; | ||||
| 	case NL80211_IFTYPE_STATION: | ||||
| 		return "station"; | ||||
| 	case NL80211_IFTYPE_AP: | ||||
| 		return "ap"; | ||||
| 	default: | ||||
| 		break; | ||||
| 	} | ||||
| 
 | ||||
| 	return NULL; | ||||
| } | ||||
| 
 | ||||
| struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg) | ||||
| { | ||||
| 	return l_dbus_message_new_error(msg, IWD_SERVICE ".InProgress", | ||||
|  | ||||
| @ -44,6 +44,8 @@ struct l_dbus *dbus_get_bus(void); | ||||
| void dbus_pending_reply(struct l_dbus_message **msg, | ||||
| 				struct l_dbus_message *reply); | ||||
| 
 | ||||
| const char *dbus_iftype_to_string(unsigned int iftype); | ||||
| 
 | ||||
| struct l_dbus_message *dbus_error_busy(struct l_dbus_message *msg); | ||||
| struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg); | ||||
| struct l_dbus_message *dbus_error_aborted(struct l_dbus_message *msg); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Denis Kenzior
						Denis Kenzior