eiwd/src/iwd/iwd_agent.h
Pierre-Olivier Mercier d570560d3b feat: Phase 4 - Connection Management
Implemented complete Wi-Fi connection flow with authentication.

Phase 4: Connection Management
- Created passphrase authentication dialog (ui/wifi_auth.c)
- Network selection handler in popup
- Integrated agent with passphrase dialog
- Complete connection flow: select network → auth dialog → agent → iwd
- Support for open and secured (WPA2/WPA3) networks
- Proper async D-Bus message handling in agent

Features:
- Passphrase dialog with password entry widget
- Minimum 8-character passphrase validation
- Network selection from popup (click to connect)
- Open networks connect directly without dialog
- Secured networks (psk, 8021x) show auth dialog
- Agent stores pending D-Bus message for async reply
- Passphrase sent securely to iwd via D-Bus
- Memory cleared after passphrase transmission
- Cancel button sends proper error reply to iwd
- Network type detection (open/psk/8021x)

Connection Flow:
1. User clicks network in popup
2. Check security type
3. If open: connect directly
4. If secured: show passphrase dialog
5. User enters passphrase
6. Agent receives RequestPassphrase from iwd
7. Dialog shows for network
8. User clicks Connect
9. Agent sends passphrase to iwd
10. iwd handles connection

Agent Improvements:
- Stores pending D-Bus message for async reply
- Properly returns NULL to indicate async handling
- Sends passphrase via eldbus_message_method_return_new
- Cancellation sends error reply to iwd
- Integrates with UI dialog system

Module size: 191KB (increased from 152KB)
Total lines: ~2,900 across 20 files

Next phase: Advanced Features (hidden networks, multiple adapters, error handling)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 18:42:30 +07:00

31 lines
679 B
C

#ifndef IWD_AGENT_H
#define IWD_AGENT_H
#include <Eina.h>
#include <Eldbus.h>
#define IWD_AGENT_PATH "/org/enlightenment/eiwd/agent"
/* Agent structure */
typedef struct _IWD_Agent
{
Eldbus_Service_Interface *iface;
const char *pending_network_path;
const char *pending_passphrase;
const Eldbus_Message *pending_msg; /* Stored message to reply to */
} IWD_Agent;
/* Global agent */
extern IWD_Agent *iwd_agent;
/* Agent management */
Eina_Bool iwd_agent_init(void);
void iwd_agent_shutdown(void);
/* Set passphrase for pending request */
void iwd_agent_set_passphrase(const char *passphrase);
/* Cancel pending request */
void iwd_agent_cancel(void);
#endif