summaryrefslogtreecommitdiff
path: root/tcps_sess.h
diff options
context:
space:
mode:
Diffstat (limited to 'tcps_sess.h')
-rw-r--r--tcps_sess.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/tcps_sess.h b/tcps_sess.h
index 0433fdf..ff7c167 100644
--- a/tcps_sess.h
+++ b/tcps_sess.h
@@ -28,18 +28,12 @@
/* a forward-definition, we are somewhat cyclic */
struct tcpsrv_s;
-/* framing modes for TCP */
-typedef enum _TCPFRAMINGMODE {
- TCP_FRAMING_OCTET_STUFFING = 0, /* traditional LF-delimited */
- TCP_FRAMING_OCTET_COUNTING = 1 /* -transport-tls like octet count */
- } TCPFRAMINGMODE;
-
/* the tcps_sess object */
typedef struct tcps_sess_s {
BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
struct tcpsrv_s *pSrv; /* pointer back to my server (e.g. for callbacks) */
- int sock;
- int iMsg; /* index of next char to store in msg */
+ netstrm_t *pStrm;
+ int iMsg; /* index of next char to store in msg */
int bAtStrtOfFram; /* are we at the very beginning of a new frame? */
enum {
eAtStrtFram,
@@ -48,8 +42,9 @@ typedef struct tcps_sess_s {
} inputState; /* our current state */
int iOctetsRemain; /* Number of Octets remaining in message */
TCPFRAMINGMODE eFraming;
- char msg[MAXLINE+1];
- char *fromHost;
+ uchar msg[MAXLINE+1];
+ uchar *fromHost;
+ uchar *fromHostIP;
void *pUsr; /* a user-pointer */
} tcps_sess_t;
@@ -67,7 +62,8 @@ BEGINinterface(tcps_sess) /* name must also be changed in ENDinterface macro! */
rsRetVal (*SetTcpsrv)(tcps_sess_t *pThis, struct tcpsrv_s *pSrv);
rsRetVal (*SetUsrP)(tcps_sess_t*, void*);
rsRetVal (*SetHost)(tcps_sess_t *pThis, uchar*);
- rsRetVal (*SetSock)(tcps_sess_t *pThis, int);
+ rsRetVal (*SetHostIP)(tcps_sess_t *pThis, uchar*);
+ rsRetVal (*SetStrm)(tcps_sess_t *pThis, netstrm_t*);
rsRetVal (*SetMsgIdx)(tcps_sess_t *pThis, int);
ENDinterface(tcps_sess)
#define tcps_sessCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */