Apply some more of Derrell Lipman's changes.
[Samba/gebeck_regimport.git] / source3 / rpcclient / cmd_epmapper.c
blob4998286194c281326ed5af6296b8027f67219bfb
1 /*
2 Unix SMB/CIFS implementation.
3 RPC pipe client
5 Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "includes.h"
23 #include "rpcclient.h"
26 static NTSTATUS cmd_epm_map(struct cli_state *cli,
27 TALLOC_CTX *mem_ctx,
28 int argc, const char **argv)
30 EPM_HANDLE handle, entry_handle;
31 EPM_TOWER *towers;
32 EPM_FLOOR floors[5];
33 uint8 addr[4] = {0,0,0,0};
34 uint32 numtowers;
35 /* need to allow all this stuff to be passed in, but
36 for now, it demonstrates the call */
37 struct uuid if_uuid = {0xe3514235, 0x4b06, 0x11d1, \
38 { 0xab, 0x04 }, \
39 { 0x00, 0xc0, \
40 0x4f, 0xc2, 0xdc, 0xd2 } },
41 syn_uuid = {0x8a885d04, 0x1ceb, 0x11c9, \
42 { 0x9f, 0xe8 }, \
43 { 0x08, 0x00, \
44 0x2b, 0x10, 0x48, 0x60 } };
46 NTSTATUS result;
48 ZERO_STRUCT(handle);
49 numtowers = 1;
50 init_epm_floor_uuid(&floors[0], if_uuid, 4);
51 init_epm_floor_uuid(&floors[1], syn_uuid, 2);
52 init_epm_floor_rpc(&floors[2]);
54 /* sample for netbios named pipe query
55 init_epm_floor_np(&floors[3], "\\PIPE\\lsass");
56 init_epm_floor_nb(&floors[4], "\\\\psflinux");
58 init_epm_floor_tcp(&floors[3], 135);
59 init_epm_floor_ip(&floors[4], addr);
60 towers = talloc(mem_ctx, sizeof(EPM_TOWER));
61 init_epm_tower(mem_ctx, towers, floors, 5);
63 result = cli_epm_map(cli, mem_ctx, &handle, &towers, &entry_handle, &numtowers);
65 return result;
68 struct cmd_set epm_commands[] = {
70 { "EPMAPPER" },
72 { "map", RPC_RTYPE_NTSTATUS, cmd_epm_map, NULL, PI_EPM, "map endpoint", "" },
73 { NULL }