<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11694">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">abis_nm: Add support to parse OML IP and Unit Id in Get Attributes<br><br>Change-Id: Ia05e0b8fe3e28aaf2b2253d018f0614e83e23caa<br>---<br>M src/osmo-bsc/abis_nm.c<br>1 file changed, 22 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/11694/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c</span><br><span>index eabd4b5..f089787 100644</span><br><span>--- a/src/osmo-bsc/abis_nm.c</span><br><span>+++ b/src/osmo-bsc/abis_nm.c</span><br><span>@@ -473,6 +473,9 @@</span><br><span> uint16_t len;</span><br><span> int i;</span><br><span> int rc;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint16_t port;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct in_addr ia = {0};</span><br><span style="color: hsl(120, 100%, 40%);">+ char unit_id[40];</span><br><span> struct abis_nm_sw_desc sw_descr[MAX_BTS_ATTR];</span><br><span> </span><br><span> /* Parse Attribute Response Info content for 3GPP TS 52.021 ยง9.4.30 Manufacturer Id */</span><br><span>@@ -528,6 +531,25 @@</span><br><span> }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_PRIM_OML_CFG_LIST, 7)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ data = TLVP_VAL(tp, NM_ATT_IPACC_PRIM_OML_CFG_LIST);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (NM_ATT_IPACC_PRIM_OML_CFG == *data) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ia.s_addr = htonl(osmo_load32be(data+1));</span><br><span style="color: hsl(120, 100%, 40%);">+ port = osmo_load16be(data+5);</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGPFOH(DNM, LOGL_INFO, foh, "BTS%u Get Attributes Response: Primary OML IP is %s:%u\n", bts->nr, inet_ntoa(ia), port);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGPFOH(DNM, LOGL_ERROR, foh, "BTS%u Get Attributes Response: PRIM_OML_CFG_LIST unexpected format: %s\n",</span><br><span style="color: hsl(120, 100%, 40%);">+ bts->nr, osmo_hexdump(data, TLVP_LEN(tp, NM_ATT_IPACC_PRIM_OML_CFG_LIST)));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_UNIT_ID, 1)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ data = TLVP_VAL(tp, NM_ATT_IPACC_UNIT_ID);</span><br><span style="color: hsl(120, 100%, 40%);">+ len = TLVP_LEN(tp, NM_ATT_IPACC_UNIT_ID);</span><br><span style="color: hsl(120, 100%, 40%);">+ osmo_strlcpy(unit_id, (char*)data, OSMO_MIN(len, sizeof(unit_id)));</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGPFOH(DNM, LOGL_ERROR, foh, "BTS%u Get Attributes Response: Unit ID is %s\n", bts->nr, unit_id);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11694">change 11694</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11694"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia05e0b8fe3e28aaf2b2253d018f0614e83e23caa </div>
<div style="display:none"> Gerrit-Change-Number: 11694 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>