mirror of
https://github.com/sheumann/NetDisk.git
synced 2024-12-21 19:29:19 +00:00
66 lines
1.6 KiB
C
66 lines
1.6 KiB
C
#ifndef SESSION_H
|
|
#define SESSION_H
|
|
|
|
#include <types.h>
|
|
#include "twoimg.h"
|
|
|
|
typedef struct Session {
|
|
/* Marinetti TCP connection status */
|
|
Word ipid;
|
|
Boolean tcpLoggedIn;
|
|
|
|
/* ReadTCP status */
|
|
LongWord readCount;
|
|
Byte *readPtr;
|
|
|
|
/* Marinetti error codes, both the tcperr* value and any tool error */
|
|
Word tcperr;
|
|
Word toolerr;
|
|
|
|
/* HTTP request to send (if non-NULL, points to malloc'd buffer) */
|
|
char *httpRequest;
|
|
/* Pointer to the range part within httpRequest */
|
|
char *httpRequestRange;
|
|
/* Length of HTTP request */
|
|
LongWord httpRequestLen;
|
|
|
|
/* HTTP response code */
|
|
LongWord responseCode;
|
|
|
|
/* IP address and TCP port of host */
|
|
LongWord ipAddr;
|
|
Word port;
|
|
|
|
/* Domain name or IP address of host (p-string, but also null-terminated) */
|
|
char hostName[257];
|
|
/* Time (GetTick) of last DNS lookup */
|
|
LongWord dnsTime;
|
|
|
|
/* Number of redirects followed */
|
|
Word redirectCount;
|
|
|
|
/* Values reported by server in Content-Range header */
|
|
LongWord rangeStart, rangeEnd, totalLength;
|
|
/* Value reported by server in Content-Length header */
|
|
LongWord contentLength;
|
|
|
|
/* Desired start/end of range for next request */
|
|
LongWord desiredStart, desiredEnd;
|
|
/* Expected length of disk image */
|
|
LongWord expectedLength;
|
|
|
|
/* Offset of disk image blocks within file */
|
|
LongWord dataOffset;
|
|
|
|
/* Buffer for initial bytes of file (which may be a disk image header) */
|
|
union {
|
|
unsigned char buf[32];
|
|
struct TwoImgHeader twoImgHeader;
|
|
} fileHeader;
|
|
} Session;
|
|
|
|
|
|
void EndNetDiskSession(Session *sess);
|
|
|
|
#endif
|