1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

the vluke program now takes a structure name on the command line

(This used to be commit 6a3e7ba4f0716eb414daba4ab8aae974db4deba0)
This commit is contained in:
Andrew Tridgell 2000-05-16 15:03:48 +00:00
parent 058ecd89b4
commit 9b86339869
6 changed files with 79 additions and 16 deletions

View File

@ -7,16 +7,11 @@ function produce_harness(f,
print_template(f, "harness_start.tpl", v);
for (i=0;i<num_tests;i++) {
v["TEST"] = tests[i];
for (i=0;i<num_structs;i++) {
v["TEST"] = structs[i, "name"];
print_template(f, "harness.tpl", v);
}
print_template(f, "harness_end.tpl", v);
}
function add_test(test)
{
tests[num_tests] = test;
num_tests++;
}

View File

@ -20,6 +20,9 @@ function start_struct(name)
function end_struct()
{
printf("struct %s with %d elements\n",
structs[num_structs, "name"],
structs[num_structs, "num_elems"]);
num_structs++;
current_struct="";
}

View File

@ -1,7 +1,4 @@
module srvsvc
test SRV_R_NET_SHARE_ENUM
test SRV_R_NET_SERVER_INFO
test SRV_Q_NET_SERVER_INFO
#define SRV_NETCONNENUM 0x08
#define SRV_NETFILEENUM 0x09
@ -42,21 +39,78 @@ struct CONN_INFO_1 {
LPWSTR net_name;
};
struct SRV_R_NET_CONN_ENUM {
struct CONN_ENUM_CTR {
uint32 level;
uint32 level2;
uint32 num_entries;
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;
uint32 count;
uint32 level;
CONN_ENUM_CTR ctr;
ENUM_HND handle;
uint32 status1;
uint32 num_entries;
uint32 status;
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;

View File

@ -0,0 +1,5 @@
if (strcmp(test,"@TEST@")==0) {
@TEST@ il;
ret = io_@TEST@("@TEST@", ps, 0, &il, PARSE_SCALARS|PARSE_BUFFERS);
}

View File

@ -0,0 +1,3 @@
return ret;
}

View File

@ -30,11 +30,14 @@ int main(int argc, char *argv[])
prs_init(&ps, 0, 4, MARSHALL);
ps.is_dynamic=True;
prs_read(&ps, fd, st.st_size, 0);
ps.data_offset = 0;
ps.data_offset = 0;
ps.buffer_size = ps.grow_size;
ps.io = UNMARSHALL;
ret = run_test(test, &ps);
printf("\nret=%s\n", ret?"OK":"Bad");
printf("Trailer is %d bytes\n\n", ps.grow_size - ps.data_offset);
dump_data(0, ps.data_p, ps.grow_size);
if (ps.grow_size - ps.data_offset > 0) {
dump_data(0, ps.data_p + ps.data_offset, ps.grow_size - ps.data_offset);
}
return !ret;
}