diff mbox series

[58/90] connection: Document 'gateway_config_state' finite state machine.

Message ID 20231206235056.322578-62-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Add Gateway Low-priority Default Routes for Non-default Services | expand

Commit Message

Grant Erickson Dec. 6, 2023, 11:50 p.m. UTC
From: Grant Erickson <erick205@umn.edu>

This documents the finite state machine (FSM) implied by
'gateway_config_state' and the implementation leveraging it.
---
 src/connection.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/connection.c b/src/connection.c
index 68c919049f20..2022a64727d6 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -88,7 +88,30 @@  enum gateway_config_flags {
  *  Netlink (rtnl) to confirm and "activate" those routes. Likewise,
  *  Connection Manager removes/clears/deletes gateway routes an then
  *  uses notifications from the kernel Routing Netlink (rtnl) to
- *  confirm and "inactivate" those routes.
+ *  confirm and "inactivate" those routes. The following is the state
+ *  machine for that lifecycle:
+ *
+ *                              .----------.    SIOCADDRT /
+ *                              |          |    RTM_NEWROUTE
+ *           .------------------| Inactive |--------------------.
+ *           |                  |          |                    |
+ *           |                  '----------'                    |
+ *           | connman_rtnl                                     |
+ *           | .delgateway                                      |
+ *           |                                                  V
+ *      .---------.         SIOCADDRT / RTM_NEWROUTE        .-------.
+ *      |         |---------------------------------------->|       |
+ *      | Removed |                                         | Added |
+ *      |         |<----------------------------------------|       |
+ *      '---------'         SIOCDELRT / RTM_DELROUTE        '-------'
+ *           ^                                                  |
+ *           | SIOCDELRT /                                      |
+ *           | RTM_DELROUTE                                     |
+ *           |                   .--------.     connman_rtnl    |
+ *           |                   |        |     .newgateway     |
+ *           '-------------------| Active |<--------------------'
+ *                               |        |
+ *                               '--------'
  *
  */
 enum gateway_config_state {