-
Notifications
You must be signed in to change notification settings - Fork 1
/
session.h
76 lines (58 loc) · 1.93 KB
/
session.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef SESSION_H
#define SESSION_H
#include <types.h>
#include "twoimg.h"
#include "diskcopy42.h"
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 */
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;
/* Length of disk image data */
LongWord dataLength;
/* Is the image in DOS order? */
Boolean dosOrder;
/* Should the GS/OS block cache be used? */
Boolean useCache;
/* Buffer for initial bytes of file (which may be a disk image header) */
union {
unsigned char buf[84];
struct TwoImgHeader twoImgHeader;
struct DiskCopy42Header diskCopy42Header;
} fileHeader;
} Session;
void EndNetDiskSession(Session *sess);
#endif