Change in osmo-remsim[master]: slotmap: Add slotmap_get_id() function to get numeric ID of slot map

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Mar 7 20:37:48 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13182 )

Change subject: slotmap: Add slotmap_get_id() function to get numeric ID of slot map
......................................................................

slotmap: Add slotmap_get_id() function to get numeric ID of slot map

Change-Id: Ie476244d9ade30eed9215923275aa82a5d10176f
---
M src/slotmap.c
M src/slotmap.h
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/slotmap.c b/src/slotmap.c
index a8874fb..703dd02 100644
--- a/src/slotmap.c
+++ b/src/slotmap.c
@@ -29,6 +29,10 @@
 	return buf;
 }
 
+uint32_t slotmap_get_id(const struct slot_mapping *map)
+{
+	return (map->bank.bank_id << 16) | map->bank.slot_nr;
+}
 
 /* thread-safe lookup of map by client:slot */
 struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client)
diff --git a/src/slotmap.h b/src/slotmap.h
index 5d3d891..a26de6d 100644
--- a/src/slotmap.h
+++ b/src/slotmap.h
@@ -68,6 +68,8 @@
 	pthread_rwlock_t rwlock;
 };
 
+uint32_t slotmap_get_id(const struct slot_mapping *map);
+
 /* thread-safe lookup of map by client:slot */
 struct slot_mapping *slotmap_by_client(struct slotmaps *maps, const struct client_slot *client);
 

-- 
To view, visit https://gerrit.osmocom.org/13182
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie476244d9ade30eed9215923275aa82a5d10176f
Gerrit-Change-Number: 13182
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190307/867ac2c1/attachment.html>


More information about the gerrit-log mailing list