public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v2 1/6] network: add __network_path_append_bss
@ 2024-08-19 15:57 James Prestwood
  2024-08-19 15:57 ` [PATCH v2 2/6] station: move BasicServiceSet DBus management into station James Prestwood
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: James Prestwood @ 2024-08-19 15:57 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

To reduce code duplication and prepare for moving the BSS interface
to station, add a new API so station can create a BSS path without
a network object directly.
---
 src/network.c | 12 +++++++++---
 src/network.h |  3 +++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/network.c b/src/network.c
index 85d2a983..a8e61d48 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1130,17 +1130,23 @@ bool network_update_known_frequencies(struct network *network)
 	return true;
 }
 
-const char *network_bss_get_path(const struct network *network,
-						const struct scan_bss *bss)
+const char *__network_path_append_bss(const char *network_path,
+					const struct scan_bss *bss)
 {
 	static char path[256];
 
 	snprintf(path, sizeof(path), "%s/%02x%02x%02x%02x%02x%02x",
-			network->object_path, MAC_STR(bss->addr));
+			network_path, MAC_STR(bss->addr));
 
 	return path;
 }
 
+const char *network_bss_get_path(const struct network *network,
+						const struct scan_bss *bss)
+{
+	return __network_path_append_bss(network->object_path, bss);
+}
+
 static bool network_unregister_bss(void *a, void *user_data)
 {
 	struct scan_bss *bss = a;
diff --git a/src/network.h b/src/network.h
index 78ced99d..c9f73200 100644
--- a/src/network.h
+++ b/src/network.h
@@ -77,6 +77,9 @@ const char *network_bss_get_path(const struct network *network,
 						const struct scan_bss *bss);
 bool network_bss_list_isempty(struct network *network);
 
+const char *__network_path_append_bss(const char *network_path,
+					const struct scan_bss *bss);
+
 struct scan_bss *network_bss_list_pop(struct network *network);
 struct scan_bss *network_bss_find_by_addr(struct network *network,
 							const uint8_t *addr);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-19 16:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 15:57 [PATCH v2 1/6] network: add __network_path_append_bss James Prestwood
2024-08-19 15:57 ` [PATCH v2 2/6] station: move BasicServiceSet DBus management into station James Prestwood
2024-08-19 15:57 ` [PATCH v2 3/6] network: remove BasicServiceSet DBus registration code James Prestwood
2024-08-19 15:57 ` [PATCH v2 4/6] network: add back network_bss_list_clear James Prestwood
2024-08-19 15:57 ` [PATCH v2 5/6] auto-t: Add ExtendedServiceSet property James Prestwood
2024-08-19 15:57 ` [PATCH v2 6/6] auto-t: Add test for BasicServiceSets James Prestwood
2024-08-19 16:53 ` [PATCH v2 1/6] network: add __network_path_append_bss Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox