NetDisk/session.h

77 lines
1.9 KiB
C
Raw Permalink Normal View History

#ifndef SESSION_H
#define SESSION_H
#include <types.h>
#include "twoimg.h"
#include "diskcopy42.h"
2018-08-11 00:51:21 +00:00
typedef struct Session {
/* Marinetti TCP connection status */
Word ipid;
Boolean tcpLoggedIn;
/* ReadTCP status */
LongWord readCount;
Byte *readPtr;
LongWord lastReadTime;
/* 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 */
2018-08-01 06:37:22 +00:00
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;
2018-08-01 06:37:22 +00:00
/* Desired start/end of range for next request */
LongWord desiredStart, desiredEnd;
/* Expected length of disk image */
LongWord expectedLength;
2018-08-11 00:51:21 +00:00
/* Offset of disk image blocks within file */
LongWord dataOffset;
/* Length of disk image data */
LongWord dataLength;
2018-08-11 00:51:21 +00:00
/* Is the image in DOS order? */
Boolean dosOrder;
2018-10-02 02:49:00 +00:00
/* Should the GS/OS block cache be used? */
Boolean useCache;
/* Buffer for initial bytes of file (which may be a disk image header) */
2018-08-11 00:51:21 +00:00
union {
unsigned char buf[84];
2018-08-11 00:51:21 +00:00
struct TwoImgHeader twoImgHeader;
struct DiskCopy42Header diskCopy42Header;
2018-08-11 00:51:21 +00:00
} fileHeader;
} Session;
void EndNetDiskSession(Session *sess);
#endif