aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/p2p/p2p.c6
-rw-r--r--src/p2p/p2p.h8
2 files changed, 14 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 9fcc6ca..a9d5998 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3216,6 +3216,12 @@ int p2p_get_peer_info(struct p2p_data *p2p, const u8 *addr, int next,
}
+int p2p_peer_known(struct p2p_data *p2p, const u8 *addr)
+{
+ return p2p_get_device(p2p, addr) != NULL;
+}
+
+
void p2p_set_client_discoverability(struct p2p_data *p2p, int enabled)
{
if (enabled) {
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 3db0ac5..99934bd 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -1428,6 +1428,14 @@ int p2p_get_peer_info(struct p2p_data *p2p, const u8 *addr, int next,
char *buf, size_t buflen);
/**
+ * p2p_peer_known - Check whether P2P peer is known
+ * @p2p: P2P module context from p2p_init()
+ * @addr: P2P Device Address of the peer
+ * Returns: 1 if the specified device is in the P2P peer table or 0 if not
+ */
+int p2p_peer_known(struct p2p_data *p2p, const u8 *addr);
+
+/**
* p2p_set_client_discoverability - Set client discoverability capability
* @p2p: P2P module context from p2p_init()
* @enabled: Whether client discoverability will be enabled