Phase 1: register iwd Agent for passphrase prompts

Export net.connman.iwd.Agent at /net/eiwd/agent and register it via
AgentManager. RequestPassphrase replies are deferred so the UI can
prompt asynchronously; the manager exposes
iwd_manager_set_passphrase_handler for the UI layer to plug in.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-04-08 22:42:38 +07:00
commit 6ea19e2252
6 changed files with 211 additions and 3 deletions

23
src/iwd/iwd_agent.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef IWD_AGENT_H
#define IWD_AGENT_H
#include <Eldbus.h>
typedef struct _Iwd_Agent Iwd_Agent;
typedef struct _Iwd_Agent_Request Iwd_Agent_Request;
/* The UI registers a single handler that is called whenever iwd asks for
* a passphrase. The handler must eventually call iwd_agent_reply() or
* iwd_agent_cancel() with the request token. */
typedef void (*Iwd_Agent_Passphrase_Cb)(void *data,
Iwd_Agent_Request *req,
const char *network_path);
Iwd_Agent *iwd_agent_new (Eldbus_Connection *conn,
Iwd_Agent_Passphrase_Cb cb, void *data);
void iwd_agent_free(Iwd_Agent *a);
void iwd_agent_reply (Iwd_Agent_Request *req, const char *passphrase);
void iwd_agent_cancel(Iwd_Agent_Request *req);
#endif