<p>Harald Welte <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/10569">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ipa: Document ipa_msg_recv* functions<br><br>Change-Id: Ie81e9dd9f9936a414e7cebb2bccffa6f42a302a7<br>---<br>M src/gsm/ipa.c<br>1 file changed, 22 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c</span><br><span>index 508cc13..d423c26 100644</span><br><span>--- a/src/gsm/ipa.c</span><br><span>+++ b/src/gsm/ipa.c</span><br><span>@@ -528,6 +528,9 @@</span><br><span> #ifdef HAVE_SYS_SOCKET_H</span><br><span> #include <sys/socket.h></span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Read one ipa message from socket fd without caching not fully received</span><br><span style="color: hsl(120, 100%, 40%);">+ * messages. See \ref ipa_msg_recv_buffered for further information.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span> int ipa_msg_recv(int fd, struct msgb **rmsg)</span><br><span> {</span><br><span>   int rc = ipa_msg_recv_buffered(fd, rmsg, NULL);</span><br><span>@@ -538,6 +541,25 @@</span><br><span>       return rc;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/*! Read one ipa message from socket fd or store part if still not fully received.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[in] fd The fd for the socket to read from.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[out] rmsg internally allocated msgb containing a fully received ipa message.</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \param[inout] tmp_msg internally allocated msgb caching data for not yet fully received message.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *  As ipa can run on top of stream based protocols such as TCP, there's the</span><br><span style="color: hsl(120, 100%, 40%);">+ *  possibility that such lower layers split ipa messages in several low level</span><br><span style="color: hsl(120, 100%, 40%);">+ *  packets. If a low layer packet is received containing several ipa frames,</span><br><span style="color: hsl(120, 100%, 40%);">+ *  this function will pull from the socket and return only the first one</span><br><span style="color: hsl(120, 100%, 40%);">+ *  available in the stream. As the socket will remain with data, it will</span><br><span style="color: hsl(120, 100%, 40%);">+ *  trigger again during next select() and then this function will fetch the</span><br><span style="color: hsl(120, 100%, 40%);">+ *  next ipa message, and so on.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ *  \returns -EAGAIN and allocated tmp_msg if message was not yet fully</span><br><span style="color: hsl(120, 100%, 40%);">+ *  received. Other negative values indicate an error and cached msgb will be</span><br><span style="color: hsl(120, 100%, 40%);">+ *  freed. 0 if socket is found dead. Positive value indicating l2 msgb len and</span><br><span style="color: hsl(120, 100%, 40%);">+ *  rmsg pointing to internally allocated msgb containing the ipa frame on</span><br><span style="color: hsl(120, 100%, 40%);">+ *  scucess.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span> int ipa_msg_recv_buffered(int fd, struct msgb **rmsg, struct msgb **tmp_msg)</span><br><span> {</span><br><span>    struct msgb *msg = tmp_msg ? *tmp_msg : NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10569">change 10569</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/10569"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie81e9dd9f9936a414e7cebb2bccffa6f42a302a7 </div>
<div style="display:none"> Gerrit-Change-Number: 10569 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>