diff options
author | Dominique Martinet <dominique.martinet@atmark-techno.com> | 2025-05-01 14:32:17 +0900 |
---|---|---|
committer | Dominique Martinet <dominique.martinet@atmark-techno.com> | 2025-05-16 22:06:10 +0900 |
commit | 2d29832f89fe6bffe52b6e4eb27d80f49eb7430a (patch) | |
tree | 3f272c9f470d9ce9d05dbca983ff04c5bffccc72 /src/mm-dispatcher-connection.h | |
parent | f3aaa113e02f5b18550e0ebecd8de08fb2eb9cdb (diff) |
dispatcher-connection: add new 'disconnect-request' event
When bearer gets an event that should trigger a disconnection but we
cannot disconnect (for example because we're waiting for pppd to close),
we now trigger a new 'disconnect-request' event instead
This was tested with the following hook:
```
$ cat /etc/ModemManager/connection.d/handle-disconnect-request.sh
#!/bin/sh
if [ "$4" != disconnect-request ]; then
exit 0
fi
iface=$(mmcli -b "$2" -K | awk '/bearer.status.interface/ { print $3 }')
if pkill -f "pppd\>.*\<$iface\>"; then
logger -t mm-disconnect-request "Killed $iface pppd"
else
logger -t mm-disconnect-request "No pppd found for $iface"
fi
```
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Diffstat (limited to 'src/mm-dispatcher-connection.h')
-rw-r--r-- | src/mm-dispatcher-connection.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mm-dispatcher-connection.h b/src/mm-dispatcher-connection.h index 95a10c24..1f8911c1 100644 --- a/src/mm-dispatcher-connection.h +++ b/src/mm-dispatcher-connection.h @@ -35,6 +35,7 @@ typedef struct _MMDispatcherConnectionPrivate MMDispatcherConnectionPrivate; typedef enum { /*< underscore_name=mm_dispatcher_connection_event >*/ MM_DISPATCHER_CONNECTION_EVENT_CONNECTED, MM_DISPATCHER_CONNECTION_EVENT_DISCONNECTED, + MM_DISPATCHER_CONNECTION_EVENT_DISCONNECT_REQUEST, } MMDispatcherConnectionEvent; GType mm_dispatcher_connection_get_type (void); |