#include "beepchannel.h"
#include "beepprofile.h"
Go to the source code of this file.
Compounds | |
struct | sbSessObject |
The session object. More... | |
Defines | |
#define | __LIB3195_BEEPSESSION_H_INCLUDED__ 1 |
#define | sbSessCHECKVALIDOBJECT(x) {assert((x) != NULL); assert((x)->OID == OIDsbSess);} |
#define | sbSessGetLastError(pThis) pThis->iLastErr |
Getthe last error for this module. | |
#define | sbSessSetLastError(pThis, iRet) pThis->iLastErr = iRet |
Set the last error for this module. | |
#define | sbSessResetLastError(pThis) pThis->iLastErr = SR_RET_OK |
reset the last error for this module | |
Typedefs | |
typedef enum sbSessState_ | sbSessState |
typedef enum sbSessTXState_ | sbSessTXState |
typedef sbSessObject | sbSessObj |
Enumerations | |
enum | sbSessState_ { sbSESSSTATE_OPEN, sbSESSSTATE_CLOSED, sbSESSSTATE_UNKNOWN = 0 } |
Session status. More... | |
enum | sbSessTXState_ { sbSESSTXSTATE_NO_TX_PENDING, sbSESSTXSTATE_IN_TX, sbSESSTXSTATE_UNKNOWN = 0 } |
Functions | |
sbSessObj * | sbSessOpenSession (char *pszRemotePeer, int iPort, struct sbNVTRObject *pProfSupported) |
Open a BEEP session. | |
srRetVal | sbSessCloseSession (sbSessObj *pThis) |
Closes the BEEP session. | |
sbChanObject * | sbSessRetrChanObj (sbSessObj *pThis, SBchannel uChanNo) |
Retrieve the channel object associated with the channel number. | |
sbFramObject * | sbSessRecvFram (sbSessObj *pThis, struct sbChanObject *pChan) |
Receive a frame for a specified channel from the tcp stream. | |
sbChanObject * | sbSessOpenChan (sbSessObj *pThis) |
Open a BEEP channel on an established session. | |
srRetVal | sbSessCloseChan (sbSessObj *pThis, struct sbChanObject *pChan) |
Close a channel. | |
srRetVal | sbSessDoReceive (sbSessObj *pThis, int bMustRcvPayloadFrame) |
Receive frames off the tcp stream. | |
srRetVal | sbSessSendFram (sbSessObj *pThis, struct sbFramObject *pFram, struct sbChanObject *pChan) |
Send the provided frame on the provided channel. | |
void | sbSessDestroy (sbSessObj *pThis) |
Destructor. | |
srRetVal | sbSessRemoteOpen (sbSessObj **pThis, sbSockObj *pSock, struct sbNVTRObject *pProfSupported) |
Open a BEEP session. | |
void | sbSessAbort (sbSessObj *pThis) |
Close a session without any further communication. | |
srRetVal | sbSessProcessGreeting (struct sbSessObject *pThis, struct sbMesgObject *pMesg) |
Process the remote peer's greeting message. | |
srRetVal | sbSessSendGreeting (struct sbSessObject *pSess, struct sbNVTRObject *pProfsSupported) |
Send a greeting message based on the currently registered profiles. |
2003-08-07 name value list for channnels added.
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.
|
Session status.
|
|
|
|
Close a session without any further communication. Can be used to abort a connection if
This method is void, because it *must* complete, no matter which errors it encounters. Furthermore, it is primarily intended to be called from destructors which are also void. Consider it to be an extended desctrutor. |
|
Close a channel. This is a very partial implementation of RFC 3080. For syslog-raw, I honestly and strongly beliefe it works. However, there may be implementations of syslog raw where it will not work or at least not work fully correctly.
|
|
Closes the BEEP session. 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. |
|
Destructor. 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. |
|
Receive frames off the tcp stream. SEQ frames are processed as they arrive. Other frames are buffered in the respective in-memory queue. This is a helper to sbSessRecvFram() and sbSessSendFram().
|
|
Open a BEEP channel on an established session.
|
|
Open a BEEP session. The initial greeting is sent and the remote peers initial greeting is accepted. Channel 0 is initialized and brought into operation.
|
|
Process the remote peer's greeting message. Most importantly, the list of profiles is extracted and stored in the session object.
|
|
Receive a frame for a specified channel from the tcp stream. This method handles intermixed frames from other channels. It calls back into the frame object to do the actual frame read (if no frame is buffered). See architecture::c for a full description.
|
|
Open a BEEP session. This method is called if a REMOTE peer requests an session open. As such, it does only the most pressing initialization work and then returns back to the caller. |
|
Retrieve the channel object associated with the channel number. This method allows to retrieve a channel number based on the actual channel.
|
|
Send the provided frame on the provided channel. While sending, concurrently incoming frames are buffered and SEQ frames are processed. This method blocks until pFram could be sent (this means it may need to wait for the proper SEQ frame). See architecture::c for full details on how this method "drives the BEEP stack".
|
|
Send a greeting message based on the currently registered profiles. We generate the greeting via a simple stringbuf, not with an XML parser. This saves execution time and is as good as the XML thing...
|