#include <assert.h>
#include "config.h"
#include "liblogging.h"
#include "sockets.h"
#include "beepmessage.h"
#include "beepframe.h"
#include "beepchannel.h"
#include "beepsession.h"
Functions | |
unsigned | sbFramRecvUnsigned (sbSockObj *pSock) |
Receive an unsigned integer from the channel. | |
srRetVal | sbFramActualRecvFramSEQ (sbFramObj *pThis, sbChanObj *pChan) |
Helper to sbFramActualRecvFram; receives an SEQ frame off the wire. | |
srRetVal | sbFramActualRecvFramCommonHdr (sbFramObj *pThis, sbChanObj *pChan) |
Helper to sbFramActualRecvFramAns and *Normal; receives the common header off the wire. | |
sbFramActualRecvFramCommonBody (sbFramObj *pThis, sbChanObj *pChan) | |
Helper to sbFramActualRecvFramAns and *Normal; receives the common body off the wire. | |
srRetVal | sbFramActualRecvFramANS (sbFramObj *pThis, sbChanObj *pChan) |
Helper to sbFramActualRecvFram; receives an ANS frame off the wire. | |
srRetVal | sbFramActualRecvFramNormal (sbFramObj *pThis, sbChanObj *pChan) |
Helper to sbFramActualRecvFram; receives a normal (that is non-SEQ and non-ANS) frame off the wire. | |
BEEPHdrID | sbFramHdrID (char *szCmd) |
Get the header ID for a given BEEP command header. | |
srRetVal | sbFramConstruct (sbFramObj **ppThis) |
Construct a frame. | |
BEEPHdrID | sbFramGetHdrID (sbFramObj *pThis) |
Returns the header id of this BEEP frame. | |
int | sbFramGetFrameLen (sbFramObj *pThis) |
return length of frame | |
char * | sbFramGetFrame (sbFramObj *pThis) |
return frame content | |
sbFramObj * | sbFramCreateFramFromMesg (sbChanObj *pChan, sbMesgObj *pMesg, char *pszCmd, SBansno uAnsno) |
Create a frame from a Message. | |
srRetVal | sbFramCreateSEQFram (sbFramObj **ppThis, sbChanObj *pChan, SBackno uAckno, SBwindow uWindow) |
Construct a SEQ frame for a given channel with a given ackno. | |
sbFramObj * | sbFramActualRecvFram (sbSessObj *pSess) |
Actually receive a frame off the tcp stream. | |
srRetVal | sbFramDestroy (sbFramObj *pThis) |
destroy a frame object | |
sbFramObj * | sbFramRecvFram (sbChanObj *pChan) |
Logically receive a frame. | |
srRetVal | sbFramSendFram (sbFramObj *pThis, sbChanObj *pChan) |
Send a frame on a channel (logical). | |
srRetVal | sbFramSetOnDestroyEvent (sbFramObj *pThis, void(*OnFramDestroy)(sbFramObj *), void *pUsr) |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of Adiscon GmbH or 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.
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.
|
Actually receive a frame off the tcp stream. Be sure to read architecture::c for a full explanation of what ActualRecvFram and its associated methods do in an overall context. In detail, it receives a frame off the wire and returns the resulting farme object to its caller. It detects different frame formats (like SEQ frames). This is a BLOCKING method call. It blocks until the frame is complete or a timeout occurs.
|
|
Helper to sbFramActualRecvFram; receives an ANS frame off the wire.
|
|
Helper to sbFramActualRecvFramAns and *Normal; receives the common body off the wire. The body is defined to start WITH the CRLF in the header. As such, this method processes the
|
|
Helper to sbFramActualRecvFramAns and *Normal; receives the common header off the wire.
|
|
Helper to sbFramActualRecvFram; receives a normal (that is non-SEQ and non-ANS) frame off the wire.
|
|
Helper to sbFramActualRecvFram; receives an SEQ frame off the wire. See RFC 3081, 3.1.3 for the semantics of a SEQ frame.
|
|
Construct a frame. This builds the memory structure, only but does not do anything to actually populate it. |
|
Create a frame from a Message. With the current implementation, there is a one-to-one relationship between fram and mesg, so this is faily simple ;)
|
|
Construct a SEQ frame for a given channel with a given ackno.
|
|
Get the header ID for a given BEEP command header. This is implemented in the sbFram object as sbFram ultimately creaetes the frames and thus the IDs. One could argue if a better place would be some util helper...
|
|
Logically receive a frame. This method uses the session object to do the physical receive. See architecture::c for a full description of this interaction. This is just a slim wrapper to hide the implementation details.
|
|
Receive an unsigned integer from the channel. Eats up characters as it processes them.
|
|
Send a frame on a channel (logical). This method does not directly put the data on the wire but calls the session object to initiate this. This sequence allows for limited multiprocessing inside the stack. Please see architecture::c for a full description. This is just a very thin layer in this release.
|