liblogging: beepsession.h Source File

Main Page | Compound List | File List | Compound Members | File Members | Related Pages

# beepsession.h

Go to the documentation of this file.

    00001
    00046 #ifndef __LIB3195_BEEPSESSION_H_INCLUDED__
    00047 #define __LIB3195_BEEPSESSION_H_INCLUDED__ 1
    00048 #define sbSessCHECKVALIDOBJECT(x) {assert((x) != NULL); assert((x)->OID == OIDsbSess);}
    00049
    00050 struct sbMesgObject;
    00051
    00052 #include "beepchannel.h"
    00053 #include "beepprofile.h"
    00054
    00055 #if FEATURE_LISTENER == 1
    00056
    00057         enum sbSessState_
    00058         {
    00059                 sbSESSSTATE_OPEN,
    00060                 sbSESSSTATE_CLOSED,
    00063                 sbSESSSTATE_UNKNOWN = 0
    00064         };
    00065         typedef enum sbSessState_ sbSessState;
    00066
    00067         enum sbSessTXState_
    00068         {
    00069                 sbSESSTXSTATE_NO_TX_PENDING,
    00070                 sbSESSTXSTATE_IN_TX,
    00071                 sbSESSTXSTATE_UNKNOWN = 0
    00072         };
    00073         typedef enum sbSessTXState_ sbSessTXState;
    00074 #endif
    00075
    00076 struct sbChanObject;
    00077 struct sbChanObject;
    00078 struct sbFramObject;
    00079 struct sbNVTRObject;
    00080 struct sbSessObject
    00084 {
    00085         srObjID OID;
    00086         srRetVal iLastErr;
    00087         struct sbSockObject *pSock;
    00088         struct sbChanObject *pChan0;
    00090         struct sbNVTRObject *pChannels;
    00091         struct sbNVTRObject* pRXQue;
    00092         struct sbNVTRObject *pRemoteProfiles;
    00093         srRetVal (*SendFramMethod)(struct sbSessObject *, struct sbFramObject *, struct sbChanObject *);
    00095         struct sbNVTRObject *pProfilesSupported;
    00096 #if FEATURE_LISTENER == 1
    00097         sbSessState iState;
    00098         sbSessTXState iTXState;
    00099         struct sbNVTRObject *pSendQue;
    00100         struct sbFramObject *pRecvFrame;
    00101         int     bNeedData;
    00102 #endif
    00103 };
    00104 typedef struct sbSessObject sbSessObj;
    00105
    00115 sbSessObj* sbSessOpenSession(char* pszRemotePeer, int iPort, struct sbNVTRObject *pProfSupported);
    00116 srRetVal sbSessCloseSession(sbSessObj *pThis);
    00117
    00118
    00119 /* The following three macros could also be inline code.
    00120  * For now, I have kept them to be macros to make
    00121  * facilitate porting.
    00122  */
    00123
    00125 #define sbSessGetLastError(pThis) pThis->iLastErr
    00126
    00128 #define sbSessSetLastError(pThis, iRet) pThis->iLastErr = iRet
    00129
    00131 #define sbSessResetLastError(pThis) pThis->iLastErr = SR_RET_OK
    00132
    00142 struct sbChanObject* sbSessRetrChanObj(sbSessObj *pThis, SBchannel uChanNo);
    00143
    00156 struct sbFramObject* sbSessRecvFram(sbSessObj* pThis, struct sbChanObject  *pChan);
    00157
    00170 struct sbChanObject* sbSessOpenChan(sbSessObj* pThis);
    00171
    00192 srRetVal sbSessCloseChan(sbSessObj *pThis, struct sbChanObject *pChan);
    00193
    00201 srRetVal sbSessCloseSession(sbSessObj *pThis);
    00202
    00218 srRetVal sbSessDoReceive(sbSessObj *pThis, int bMustRcvPayloadFrame);
    00219
    00232 srRetVal sbSessSendFram(sbSessObj *pThis, struct sbFramObject *pFram, struct sbChanObject *pChan);
    00233
    00239 void sbSessDestroy(sbSessObj *pThis);
    00240
    00247 srRetVal sbSessRemoteOpen(sbSessObj **pThis, sbSockObj *pSock, struct sbNVTRObject *pProfSupported);
    00248
    00260 void sbSessAbort(sbSessObj *pThis);
    00261
    00269 srRetVal sbSessProcessGreeting(struct sbSessObject *pThis, struct sbMesgObject *pMesg);
    00270
    00282 srRetVal sbSessSendGreeting(struct sbSessObject* pSess, struct sbNVTRObject *pProfsSupported);
    00283
    00284
    00285 #endif