summaryrefslogtreecommitdiff
path: root/source3/aparser/srvsvc.struct
blob: e50fe11a822d67803de1c39379d17b9b15c09efa (plain)
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
module srvsvc

#define SRV_NETCONNENUM        0x08
#define SRV_NETFILEENUM        0x09
#define SRV_NETSESSENUM        0x0c
#define SRV_NETSHAREENUM       0x0f
#define SRV_NET_SHARE_GET_INFO 0x10
#define SRV_NET_SRV_GET_INFO   0x15
#define SRV_NET_SRV_SET_INFO   0x16
#define SRV_NET_REMOTE_TOD     0x1c

struct UNISTR2 {
       uint32 max_len;
       uint32 undoc;
       uint32 str_len;
       uint16 buffer[str_len];
};

struct LPWSTR {
       UNISTR2 *str;
};

struct ENUM_HND {
	uint32 *handle;           /* enumeration handle */
};

/* function 8 */
struct CONN_INFO_0 {
	uint32 id; /* connection id. */
};

struct CONN_INFO_1 {
	uint32 id; 
	uint32 type;
	uint32 num_opens;
	uint32 num_users;
	uint32 open_time;
	LPWSTR usr_name;
	LPWSTR net_name; 
};

struct CONN_ENUM_CTR {
	uint32 level;
	uint32 level2;
	uint32 num_entries;
	uint32 num_entries2;
	union *info[level] {
		case 0 CONN_INFO_0 info0[num_entries]; 
		case 1 CONN_INFO_1 info1[num_entries]; 
	}
};

struct SRV_R_NET_CONN_ENUM {
        .trailer;
	CONN_ENUM_CTR ctr;
        uint32 num_entries;
        ENUM_HND handle;
        uint32 status2;
};

struct SRV_Q_NET_CONN_ENUM {
       .trailer;
       LPWSTR dest_srv;
       LPWSTR qual_srv;
       uint32 level;
       uint32 level2;
       CONN_ENUM_CTR *ctr;
       uint32 max_len;
       ENUM_HND handle;
};

/* function 9 */
struct FILE_INFO_3 {
	uint32 id;            /* file index */
	uint32 perms;         /* file permissions. don't know what format */
	uint32 num_locks;     /* file locks */
	LPWSTR path_name; /* file name */
	LPWSTR user_name; /* file owner */
};

struct SRV_FILE_INFO_CTR {
	uint32 level;
	uint32 num_entries;
	uint32 dummy;
	union *file[level] {
	      case 3 FILE_INFO_3 info3[num_entries];
	}
};

struct SRV_Q_NET_FILE_ENUM {
       .trailer;
       LPWSTR srv_name;
       LPWSTR qual_name;
       uint32 dummy;
       uint32 level;
       SRV_FILE_INFO_CTR ctr;
       uint32 *status;
       uint32 preferred_len;
       ENUM_HND enum_hnd;
};


struct SRV_R_NET_FILE_ENUM {
       .trailer;
       uint32 level;
       uint32 dummy;
       SRV_FILE_INFO_CTR *ctr;
       uint32 total_entries;                    /* total number of files */
       ENUM_HND enum_hnd;
       uint32 status;        /* return status */
};


/* function 15 */
struct SRV_SHARE_INFO_1 {
	LPWSTR uni_netname;
	uint32 type;
	LPWSTR uni_remark;
};

struct SRV_SHARE_INFO_2 {
	LPWSTR uni_netname;
	uint32 type;
	LPWSTR uni_remark;
	uint32 perms;
	uint32 max_uses;
	uint32 num_uses;
	LPWSTR path;
	LPWSTR passwd;
};

struct SRV_R_NET_SHARE_ENUM {
       uint32 level;
       uint32 level2;
       uint32 *ret_count;
       uint32 num_entries;
       union *info[level] {
              case 1 SRV_SHARE_INFO_1 info1[num_entries];
              case 2 SRV_SHARE_INFO_2 info2[num_entries];
       }
       .trailer;
       uint32 count;
       ENUM_HND handle;
       uint32 status;
};



/* function 21 */
struct SERVER_INFO_100 {
	uint32  dwPlatformID;
	LPWSTR pszName;
};

struct SERVER_INFO_101 {
	    uint32  dwPlatformID;
	    LPWSTR pszName;
	    uint32  dwVerMajor;
	    uint32  dwVerMinor;
	    uint32  dwType;
	    LPWSTR pszComment;
};

struct SERVER_INFO_102 {
    uint32 dwPlatformID;
    LPWSTR pszName;
    uint32 dwVerMajor;
    uint32 dwVerMinor;
    uint32 dwType;
    LPWSTR pszComment;
    uint32 dwUsers;
    uint32 lDisc;
    uint32 bHidden;
    uint32 dwAnnounce;
    uint32 dwAnnDelta;
    uint32 dwLicenses;
    LPWSTR pszUserPath;
};

struct SRV_R_NET_SERVER_INFO {
       .trailer;
       uint32 level;
       union *info[level] {
		case 100 SERVER_INFO_100 sv100;
		case 101 SERVER_INFO_101 sv101;
		case 102 SERVER_INFO_102 sv102;
       }
       uint32 status;
};

struct SRV_Q_NET_SERVER_INFO {
       .trailer;
       LPWSTR server;
       uint32 level;
};