source: branches/samba-3.0/source/ndpsmb/test.c@ 614

Last change on this file since 614 was 5, checked in by Yuri Dario, 18 years ago

OS/2 client code, initial import.

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#include "includes.h"
2
3int main(void)
4{
5 fstring server, share, user, password;
6 pstring workgroup;
7 pstring path;
8 struct in_addr rem_ip;
9 struct in_addr server_ip;
10
11 DEBUGLEVEL = 10;
12 setup_logging("test", True);
13 init_globals();
14
15 load_interfaces();
16
17 if (!init_names())
18 {
19 return 1;
20 }
21
22// strncpy(workgroup, "I-TEL", sizeof(workgroup) - 1);
23 strncpy(workgroup, "xxx", sizeof(workgroup) - 1);
24// *workgroup = 0;
25 *server = 0;
26 *share = 0;
27 *password = 0;
28 strncpy(user, "guest", sizeof(user) - 1);
29
30printf("1\n");
31 if (!find_master_ip(workgroup, &server_ip)) {
32 struct user_auth_info u_info;
33 struct cli_state *cli;
34printf("2\n");
35 DEBUG(4, ("Unable to find master browser for workgroup %s\n",
36 workgroup));
37 /* find the name of the server ... */
38 pstrcpy(u_info.username, user);
39 pstrcpy(u_info.password, password);
40
41printf("3\n");
42 if (!(cli = get_ipc_connect_master_ip_bcast(workgroup, &u_info))) {
43 DEBUG(4, ("Unable to find master browser by "
44 "broadcast\n"));
45 errno = ENOENT;
46 return 1;
47 }
48printf("4\n");
49
50 fstrcpy(server, cli->desthost);
51printf("4 <%s>\n", server);
52 cli_shutdown(cli);
53 } else {
54printf("5\n");
55 if (!name_status_find("*", 0, 0, server_ip, server)) {
56 errno = ENOENT;
57 return 1;
58 }
59printf("6 <%s>\n", server);
60 }
61 return 0;
62}
Note: See TracBrowser for help on using the repository browser.