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

# beepchannel.h

Go to the documentation of this file.

    00001
    00046 #ifndef __LIB3195_BEEPCHANNEL_H_INCLUDED__
    00047 #define __LIB3195_BEEPCHANNEL_H_INCLUDED__ 1
    00048 #include "sockets.h"
    00049 #include "beepsession.h"
    00050
    00052 #define SBCHAN_INVALID_CHANNEL -1
    00053 #define sbChanCHECKVALIDOBJECT(x) {assert((x) != NULL); assert((x)->OID == OIDsbChan); assert((x)->iState != sbChan_STATE_INVALID);}
    00054
    00059 enum sbChannelState_
    00060 {
    00061         sbChan_STATE_INVALID = 0,
    00062         sbChan_STATE_INITIALIZED,
    00063         sbChan_STATE_OPEN,
    00064         sbChan_STATE_AWAITING_CLOSE,
    00065         sbChan_STATE_PENDING_CLOSE,
    00066         sbChan_STATE_CLOSED,
    00067         sbChan_STATE_BROKEN,
    00068         sbChan_STATE_ERR_FREE_NEEDED
    00069 };
    00070 typedef enum sbChannelState_ sbChannelState;
    00071
    00072 struct sbMesgObject;
    00073 struct sbSessObject;
    00074 struct sbChanObject
    00078 {
    00079         srObjID OID;
    00080         unsigned uChanNum;
    00081         unsigned uSeqno;
    00082         unsigned uMsgno;
    00083         unsigned uTXWin;
    00084         unsigned uTXWinLeft;
    00085         unsigned uRXWin;
    00086         unsigned uRXWinLeft;
    00087         sbSockObj* pSock;
    00088         struct sbSessObject* pSess;
    00089         sbChannelState iState;
    00090         void *pProfInstance;
    00091         struct sbProfObject *pProf;
    00092 };
    00093 typedef struct sbChanObject sbChanObj;
    00094
    00095 #include "beepmessage.h"
    00096
    00114 srRetVal sbChanSetChanno(sbChanObj *pThis, int iChanno);
    00115
    00120 sbChanObj* sbChanConstruct(struct sbSessObject* pSess);
    00121
    00133 srRetVal sbChanSendMesg(sbChanObj *pThis, struct sbMesgObject* pMesg, char* pszCmd);
    00134
    00148 srRetVal sbChanActualSendFram(sbChanObj *pThis, struct sbFramObject* pFram);
    00149
    00150
    00155 void sbChanDestroy(sbChanObj* pThis);
    00156
    00162 srRetVal sbChanUpdateChannelState(sbChanObj* pThis, int iNewState);
    00163
    00177 srRetVal sbChanAssignProfile(sbChanObj *pThis, struct sbProfObject *pProf);
    00178
    00184 void sbChanAbort(sbChanObj* pThis);
    00185
    00193 srRetVal sbChanSendErrResponse(sbChanObj *pThis, unsigned uErrCode, char* pszErrMsg);
    00194
    00198 srRetVal sbChanSetAwaitingClose(sbChanObj* pThis);
    00199
    00207 srRetVal sbChanSendSEQ(sbChanObj *pThis, unsigned uAckno, unsigned uWindow);
    00208
    00213 srRetVal sbChanSendOK(sbChanObj*pThis, void (*OnFrameDestroy)(struct sbFramObject*), void* pUsr);
    00214
    00218 srRetVal sbChanSetChanClosed(sbChanObj* pThis);
    00219
    00220 #endif