-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwspackets.h
154 lines (131 loc) · 2.72 KB
/
wspackets.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef PC2PACKETS_INCLUDED
#define PC2PACKETS_INCLUDED
#include "gsys.h"
int get_str(byt **bpx,uint32_t *lenx, byt **rbp, uint32_t *rlen);
int get_uint32_t(byt **bpx,uint32_t *lenx, uint32_t *resx);
int deserialize(byt *bp,uint32_t len);
int serialize(char *pk,uint32_t *len);
/* packet types */
#define pc2pstart 12345
#define pc2init pc2pstart
#define pc2loginres pc2init+1
#define pc2open pc2loginres+1
#define pc2openres pc2open+1
#define pc2fin pc2openres+1
#define pc2finres pc2fin+1
#define pc2write pc2finres+1
#define pc2writeres pc2write+1
#define pc2readrecord pc2writeres+1
#define pc2readrecordres pc2readrecord+1
#define pc2read pc2readrecordres+1
#define pc2readres pc2read+1
#define pc2close pc2readres+1
#define pc2closeres pc2close+1
#define pc2escape pc2closeres+1
#define pc2readguires pc2escape+1
#define pc2schar pc2readguires+1
#define pc2end pc2schar
struct pc2_short_iop {
int chan_flag;
int siz_eq;
int len_eq;
int tim_eq;
int io_flag;
};
struct pc2_initpacket {
uint32_t lenl;
swrd type;
char info[256];
};
struct pc2_loginres {
uint32_t lenl;
swrd type;
uint32_t res;
// 0 == ok ,
// 1 == logonuser failed
// 2 == pipe function failed
// 3 == spawn failed
uint32_t os_error;
int keynum; // cryptor keynum if res == 0
int mode;
};
struct pc2_open {
uint32_t lenl;
swrd type;
int chan;
};
struct pc2_openres {
uint32_t lenl;
swrd type;
swrd sm32_error;
int chan_flag;
};
struct pc2_escape {
uint32_t lenl;
swrd type;
};
struct pc2_finres {
uint32_t lenl;
swrd type;
swrd sm32_error;
byt finbuf[32];
};
struct pc2_write {
uint32_t lenl;
swrd type;
struct pc2_short_iop siop;
uint32_t dlenl;
byt data[4];
};
struct pc2_writeres {
uint32_t lenl;
swrd type;
swrd sm32_error;
int chan_flag;
};
struct pc2_readrecord {
uint32_t lenl;
swrd type;
struct pc2_short_iop siop;
};
struct pc2_readrecordres {
uint32_t lenl;
swrd type;
swrd sm32_error;
uint32_t dlenl;
byt data[4];
};
struct pc2_read {
uint32_t lenl;
swrd type;
swrd notused;
struct pc2_short_iop siop;
};
struct pc2_readres {
uint32_t lenl;
swrd type;
swrd sm32_error;
int ctl;
int dlm;
uint32_t dlenl;
byt data[4];
};
struct pc2_close {
uint32_t lenl;
swrd type;
swrd notused;
struct pc2_short_iop siop;
};
struct pc2_closeres {
uint32_t lenl;
swrd type;
};
struct pc2_schar {
uint32_t lenl;
swrd type;
swrd ikey;
uint32_t dlenl;
char data[4];
};
//!gn!
#endif