pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-cbc/+/28805 )
Change subject: Move sbcap_as_find_ie() to libsbcap
......................................................................
Move sbcap_as_find_ie() to libsbcap
This function is generic and can be (will be) used in more places.
Change-Id: Ib0c7fa12a8f6faa4271e4132ca5a5c656e717400
---
M include/osmocom/sbcap/sbcap_common.h
M src/sbcap/sbcap_common.c
M src/sbcap_link_fsm.c
3 files changed, 16 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-cbc refs/changes/05/28805/1
diff --git a/include/osmocom/sbcap/sbcap_common.h b/include/osmocom/sbcap/sbcap_common.h
index 303cf6d..91a95eb 100644
--- a/include/osmocom/sbcap/sbcap_common.h
+++ b/include/osmocom/sbcap/sbcap_common.h
@@ -144,6 +144,8 @@
SBcAP_ProcedureCode_t sbcap_pdu_get_procedure_code(const SBcAP_SBC_AP_PDU_t *pdu);
SBcAP_Criticality_t sbcap_pdu_get_criticality(const SBcAP_SBC_AP_PDU_t *pdu);
+void *sbcap_as_find_ie(void *void_list, SBcAP_ProtocolIE_ID_t ie_id);
+
SBcAP_Write_Replace_Warning_Request_IEs_t *sbcap_alloc_Write_Replace_Warning_Request_IE(
long id, SBcAP_Criticality_t criticality,
SBcAP_Write_Replace_Warning_Request_IEs__value_PR present);
diff --git a/src/sbcap/sbcap_common.c b/src/sbcap/sbcap_common.c
index 86ca0b2..0596b53 100644
--- a/src/sbcap/sbcap_common.c
+++ b/src/sbcap/sbcap_common.c
@@ -141,6 +141,20 @@
}
}
+void *sbcap_as_find_ie(void *void_list, SBcAP_ProtocolIE_ID_t ie_id)
+{
+ A_SEQUENCE_OF(SBcAP_ProtocolIE_ID_t) *li = (void *)void_list;
+ int i;
+ for (i = 0; i < li->count; i++) {
+ /* "SBcAP_ProtocolIE_ID_t id" is first element in all *_IEs struct */
+ SBcAP_ProtocolIE_ID_t *cur_ie_id = li->array[i];
+ if (*cur_ie_id == ie_id) {
+ return cur_ie_id;
+ }
+ }
+ return NULL;
+}
+
void sbcap_set_log_area(int log_area)
{
_sbcap_DSBCAP = log_area;
diff --git a/src/sbcap_link_fsm.c b/src/sbcap_link_fsm.c
index 1087f1f..36bb8f9 100644
--- a/src/sbcap_link_fsm.c
+++ b/src/sbcap_link_fsm.c
@@ -129,20 +129,6 @@
.cleanup = sbcap_link_fsm_cleanup,
};
-static void *sbcap_as_find_ie(void *void_list, SBcAP_ProtocolIE_ID_t ie_id)
-{
- A_SEQUENCE_OF(SBcAP_ProtocolIE_ID_t) *li = (void *)void_list;
- int i;
- for (i = 0; i < li->count; i++) {
- /* "SBcAP_ProtocolIE_ID_t id" is first element in all *_IEs struct */
- SBcAP_ProtocolIE_ID_t *cur_ie_id = li->array[i];
- if (*cur_ie_id == ie_id) {
- return cur_ie_id;
- }
- }
- return NULL;
-}
-
static SBcAP_Message_Identifier_t *get_msg_id_ie(struct cbc_sbcap_link *link,
const SBcAP_SBC_AP_PDU_t *pdu)
{
--
To view, visit
https://gerrit.osmocom.org/c/osmo-cbc/+/28805
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Ib0c7fa12a8f6faa4271e4132ca5a5c656e717400
Gerrit-Change-Number: 28805
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange