jolly has uploaded this change for review. ( 
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 two mapping (maintenance and normal mapping) exist for the same
bank/slot, only one client/slot can be connected to the bank/slot at the
same time. The other mapping 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/44/43744/1

diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index d8c5155..27391f5 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 8f2fc8e..84bebea 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 1967a61..fbcc356 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: newchange
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I95dff90deb965f8198effdd355d45419bb4c2b02
Gerrit-Change-Number: 43744
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <[email protected]>

Reply via email to