3 Unix SMB/CIFS implementation.
4 Samba end point mapper utility and mapping functions
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.
24 /*******************************************************************/
25 /* _epm_map - fill out mapping on input and output structs */
26 /*******************************************************************/
27 void _epm_map(pipes_struct
*ps
, const EPM_Q_MAP
*q_u
, EPM_R_MAP
*r_u
)
30 uint8 target_address
[] = { 9, 53, 95, 27 };
31 EPM_FLOOR
*floors
= talloc(ps
->mem_ctx
, sizeof(EPM_FLOOR
) *
32 q_u
->tower
->num_floors
);
33 EPM_TOWER
*towers
= talloc(ps
->mem_ctx
,
34 sizeof(EPM_TOWER
) * MAX_TOWERS
);
35 EPM_TOWER_ARRAY array
;
37 if (!floors
|| !towers
) {
38 DEBUG(0, ("_epm_map: talloc failed!\n"));
42 for (i
= 0; i
< q_u
->tower
->num_floors
; i
++) {
43 switch (q_u
->tower
->floors
[i
].lhs
.protocol
) {
45 init_epm_floor_uuid(&floors
[i
],
46 q_u
->tower
->floors
[i
].
48 q_u
->tower
->floors
[i
].
52 init_epm_floor_rpc(&floors
[i
]);
55 /* for now map all requests to port 135 */
56 init_epm_floor_tcp(&floors
[i
], 135);
59 init_epm_floor_ip(&floors
[i
], target_address
);
64 init_epm_tower(ps
->mem_ctx
, &towers
[0], floors
, 5);
65 init_epm_tower_array(ps
->mem_ctx
, &array
, towers
, 1);
66 init_epm_r_map(ps
->mem_ctx
, r_u
, &q_u
->term_handle
, &array
, 1, 0);