laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-remsim/+/43744?usp=email )

Change subject: Add INACTIVE state to slot mapping
......................................................................

Add INACTIVE state to slot mapping

If multiple mapping (with different priorities) exist for the same
bank/slot, only one client/slot can be connected to the bank/slot at the
same time. The other mapping(s) will be in INACTIVE state.

Related: SYS#8159
Change-Id: I95dff90deb965f8198effdd355d45419bb4c2b02
---
M src/server/rest_api.c
M src/slotmap.c
M src/slotmap.h
3 files changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve




diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index 2dc54a2..99c3238 100644
--- a/src/server/rest_api.c
+++ b/src/server/rest_api.c
@@ -368,7 +368,8 @@

        switch (map->state) {
        case SLMAP_S_NEW:
-               /* new map, not yet sent to bank: we can remove it immediately 
*/
+       case SLMAP_S_INACTIVE:
+               /* new or inactive map, not yet sent to bank: we can remove it 
immediately */
                /* delete from bank list (if any) */
                llist_del(&map->bank_list);
                /* safely initialize list head to avoid trouble when 
del_slotmap() does another llist_del() */
diff --git a/src/slotmap.c b/src/slotmap.c
index 57cb5b4..9f53ff7 100644
--- a/src/slotmap.c
+++ b/src/slotmap.c
@@ -38,6 +38,7 @@
        { SLMAP_S_ACTIVE,               "ACTIVE" },
        { SLMAP_S_DELETE_REQ,           "DELETE_REQ" },
        { SLMAP_S_DELETING,             "DELETING" },
+       { SLMAP_S_INACTIVE,             "INACTIVE" },
        { 0, NULL }
 };

diff --git a/src/slotmap.h b/src/slotmap.h
index 9128e70..b1180b4 100644
--- a/src/slotmap.h
+++ b/src/slotmap.h
@@ -38,6 +38,7 @@
        SLMAP_S_ACTIVE,         /* fully active map; acknowledged by bankd */
        SLMAP_S_DELETE_REQ,     /* fully active map; REST has requested 
deletion */
        SLMAP_S_DELETING,       /* RSPRO has issued Remove to bankd, but bankd 
hasn't confirmed yet */
+       SLMAP_S_INACTIVE,       /* suspended mapping is inactive */
 };
 extern const struct value_string slot_map_state_name[];
 static inline const char *slotmap_state_name(enum slot_mapping_state st)

--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/43744?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I95dff90deb965f8198effdd355d45419bb4c2b02
Gerrit-Change-Number: 43744
Gerrit-PatchSet: 9
Gerrit-Owner: jolly <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to