Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > e9fca32892116c2c27cf46145520942a > files > 36

liblogging-devel-1.0.6-2.mga7.armv7hl.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>liblogging: beepsession.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>beepsession.c File Reference</h1>Implementation of the BEEP Session Object.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;assert.h&gt;</code><br>
<code>#include "<a class="el" href="config_8h-source.html">config.h</a>"</code><br>
<code>#include "<a class="el" href="liblogging_8h-source.html">liblogging.h</a>"</code><br>
<code>#include "<a class="el" href="sockets_8h-source.html">sockets.h</a>"</code><br>
<code>#include "<a class="el" href="beepsession_8h-source.html">beepsession.h</a>"</code><br>
<code>#include "<a class="el" href="beepchannel_8h-source.html">beepchannel.h</a>"</code><br>
<code>#include "<a class="el" href="beepframe_8h-source.html">beepframe.h</a>"</code><br>
<code>#include "<a class="el" href="namevaluetree_8h-source.html">namevaluetree.h</a>"</code><br>
<code>#include "<a class="el" href="stringbuf_8h-source.html">stringbuf.h</a>"</code><br>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structsbChanObject.html">sbChanObj</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a0">sbSessRetrChanObj</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="liblogging_8h.html#a7">SBchannel</a> uChanNo)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Retrieve the channel object associated with the channel number. </em> <a href="#a0"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a1" doxytag="beepsession.c::sbSessProcessGreeting"></a>
<a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><b>sbSessProcessGreeting</b> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="structsbMesgObject.html">sbMesgObj</a> *pMesg)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a2" doxytag="beepsession.c::sbSessOpenSession"></a>
<a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td><td class="memItemRight" valign=bottom><b>sbSessOpenSession</b> (char *pszRemotePeer, int iPort, sbNVTRObj *pProfSupported)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a3">sbSessDoSEQ</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="structsbFramObject.html">sbFramObj</a> *pFram)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process the supplied SEQ frame. </em> <a href="#a3"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a4">sbSessDestroy</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a5">sbSessDoReceive</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, int bMustRcvPayloadFrame)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Receive frames off the tcp stream. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structsbFramObject.html">sbFramObj</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a6">sbSessRecvFram</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="structsbChanObject.html">sbChanObj</a> *pChan)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a7" doxytag="beepsession.c::sbSessSendFram"></a>
<a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><b>sbSessSendFram</b> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="structsbFramObject.html">sbFramObj</a> *pFram, <a class="el" href="structsbChanObject.html">sbChanObj</a> *pChan)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structsbChanObject.html">sbChanObj</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a8">sbSessOpenChan</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open a BEEP channel on an established session. </em> <a href="#a8"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a9" doxytag="beepsession.c::sbSessCloseChan"></a>
<a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><b>sbSessCloseChan</b> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis, <a class="el" href="structsbChanObject.html">sbChanObj</a> *pChan)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="beepsession_8c.html#a10">sbSessCloseSession</a> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pThis)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Closes the BEEP session. </em> <a href="#a10"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a name="a11" doxytag="beepsession.c::sbSessSendGreeting"></a>
<a class="el" href="liblogging_8h.html#a6">srRetVal</a>&nbsp;</td><td class="memItemRight" valign=bottom><b>sbSessSendGreeting</b> (<a class="el" href="structsbSessObject.html">sbSessObj</a> *pSess, sbNVTRObj *pProfsSupported)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Implementation of the BEEP Session Object. 
<p>
<dl compact><dt><b>Author:</b></dt><dd>Rainer Gerhards &lt;<a href="mailto:rgerhards@adiscon.com">rgerhards@adiscon.com</a>&gt; </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2003-08-04 <p>
2003-08-11 Integrated XML parser in closeSession and other areas (begun implementing it). <p>
2003-08-12 Added a list of remote peers profile to the session object. Now the <a class="el" href="beepsession_8c.html#a8">sbSessOpenChan()</a> can do intelligent checking if the remote peer supports the profile (and, if not, provide an error message and not try to connect). <p>
2003-09-04 Added support for multiple initiator (client) profiles.</dd></dl>
Copyright 2002-2003 Rainer Gerhards and Adiscon GmbH. All Rights Reserved.<p>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:<p>
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.<p>
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.<p>
* Neither the names of Adiscon GmbH nor Rainer Gerhards nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.<p>
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<hr><h2>Function Documentation</h2>
<a name="a10" doxytag="beepsession.c::sbSessCloseSession"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="liblogging_8h.html#a6">srRetVal</a> sbSessCloseSession </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>pThis</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Closes the BEEP session. 
<p>
First, the management channel (channel 0) is taken down and then the TCP stream is closed. This function can only be called after all sessions have been closed. Once the function returns, the session object is no longer valid and can no longer be used.     </td>
  </tr>
</table>
<a name="a4" doxytag="beepsession.c::sbSessDestroy"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void sbSessDestroy </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>pThis</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destructor. 
<p>
pThis is invalid when this function returns. The caller can no longer use it. The caller is also not allowed to free it - this is already done in this method.     </td>
  </tr>
</table>
<a name="a5" doxytag="beepsession.c::sbSessDoReceive"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="liblogging_8h.html#a6">srRetVal</a> sbSessDoReceive </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pThis</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>bMustRcvPayloadFrame</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Receive frames off the tcp stream. 
<p>
SEQ frames are processed as they arrive. Other frames are buffered in the respective in-memory queue. This is a helper to <a class="el" href="beepsession_8c.html#a6">sbSessRecvFram()</a> and <a class="el" href="beepsession_8h.html#a21">sbSessSendFram()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>bMustRcvPayloadFrame</em>&nbsp;</td><td>A boolean indicating if an actual payload frame must be received. If set to TRUE, the method blocks until a payload frame is received. All interim SEQ frames are processed, but will not make this method to return. If FALSE, the method will block until anything is received, including a SEQ. If a SEQ is received, it will be processed and the method returns. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a name="a3" doxytag="beepsession.c::sbSessDoSEQ"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="liblogging_8h.html#a6">srRetVal</a> sbSessDoSEQ </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pThis</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="structsbFramObject.html">sbFramObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pFram</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Process the supplied SEQ frame. 
<p>
Most notably, this means the window is updated in the respective channel object.<p>
According to the latest discussion on the BEEP WG mailing list and other sources, we silently ignore SEQ frames for non-existing channels. This most probably is not a protocol error but rather a SEQ frame arriving after the channel has been closed. This can happen due to TCP delays. Other implementors have suggested (and successfully implemented) ignoring these frames. This information is current as of August, 2003.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>pFram</em>&nbsp;</td><td>pointer to frame to process. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a name="a8" doxytag="beepsession.c::sbSessOpenChan"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="structsbChanObject.html">sbChanObj</a>* sbSessOpenChan </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>pThis</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Open a BEEP channel on an established session. 
<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000013">Todo:</a></b></dt><dd>think if we need to shut down anything else inside the BEEP session. <p>
think if we need to shut down anything else inside the BEEP session. </dd></dl>
    </td>
  </tr>
</table>
<a name="a6" doxytag="beepsession.c::sbSessRecvFram"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="structsbFramObject.html">sbFramObj</a>* sbSessRecvFram </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pThis</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="structsbChanObject.html">sbChanObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pChan</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000012">Todo:</a></b></dt><dd>think about a timeout here - we could block indefinitely...</dd></dl>
    </td>
  </tr>
</table>
<a name="a0" doxytag="beepsession.c::sbSessRetrChanObj"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="structsbChanObject.html">sbChanObj</a>* sbSessRetrChanObj </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structsbSessObject.html">sbSessObj</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>pThis</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="liblogging_8h.html#a7">SBchannel</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>uChanNo</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Retrieve the channel object associated with the channel number. 
<p>
This method allows to retrieve a channel number based on the actual channel.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>uChanNo</em>&nbsp;</td><td>channel number </td></tr>
  </table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign=top><em>pointer</em>&nbsp;</td><td>to channel object or NULL, if uChanNo could not be found. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Mon Oct 3 12:29:55 2005 for liblogging by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.2 </small></address>
</body>
</html>