diff options
author | Luke Leighton <lkcl@samba.org> | 1999-10-30 22:34:38 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-10-30 22:34:38 +0000 |
commit | 4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d (patch) | |
tree | 76981c3569f836f7f815168f76caf7a255fc15e4 /source3/rpcclient/display.c | |
parent | eae9b12ca56837a2a39c1ebad21eee7e502b579b (diff) | |
download | samba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.tar.gz samba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.tar.bz2 samba-4cda1d2b4faaf9a3abeb338e909a52f8b51fd89d.zip |
NetServerTransportEnum parsing, client-side and rpcclient "srvtransports" added.
(This used to be commit 37f4aac06fec3fbb34ed40d1010829b2e1f28558)
Diffstat (limited to 'source3/rpcclient/display.c')
-rw-r--r-- | source3/rpcclient/display.c | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c index 4595cdecc7..e3b35cedc9 100644 --- a/source3/rpcclient/display.c +++ b/source3/rpcclient/display.c @@ -479,6 +479,117 @@ void display_srv_conn_info_ctr(FILE *out_hnd, enum action_type action, /**************************************************************************** +transport info level 0 display function +****************************************************************************/ +void display_tprt_info_0(FILE *out_hnd, enum action_type action, + TPRT_INFO_0 *info0, TPRT_INFO_0_STR *str0) +{ + if (info0 == NULL || str0 == NULL) + { + return; + } + + switch (action) + { + case ACTION_HEADER: + { + fprintf(out_hnd, "Connection Info Level 0:\n"); + + break; + } + case ACTION_ENUMERATE: + { + fstring trans_name; + fstring trans_addr; + fstring addr_name; + + unistr2_to_ascii(trans_name, &str0->uni_trans_name, sizeof(trans_name)-1); + buffer4_to_str(trans_addr, &str0->buf_trans_addr, sizeof(trans_addr)-1); + unistr2_to_ascii(addr_name, &str0->uni_addr_name, sizeof(addr_name)-1); + + fprintf(out_hnd, "\tnum_vcs :\t%d\n", info0->num_vcs); + fprintf(out_hnd, "\ttransport name:\t%s\n", trans_name); + fprintf(out_hnd, "\ttransport addr:\t%s\n", trans_addr); + fprintf(out_hnd, "\taddress name:\t%s\n", addr_name); + + break; + } + case ACTION_FOOTER: + { + fprintf(out_hnd, "\n"); + break; + } + } + +} + +/**************************************************************************** +transport info level 0 container display function +****************************************************************************/ +void display_srv_tprt_info_0_ctr(FILE *out_hnd, enum action_type action, + SRV_TPRT_INFO_0 *ctr) +{ + if (ctr == NULL) + { + fprintf(out_hnd, "display_srv_tprt_info_0_ctr: unavailable due to an internal error\n"); + return; + } + + switch (action) + { + case ACTION_HEADER: + { + break; + } + case ACTION_ENUMERATE: + { + int i; + + for (i = 0; i < ctr->num_entries_read; i++) + { + display_tprt_info_0(out_hnd, ACTION_HEADER , &(ctr->info_0[i]), &(ctr->info_0_str[i])); + display_tprt_info_0(out_hnd, ACTION_ENUMERATE, &(ctr->info_0[i]), &(ctr->info_0_str[i])); + display_tprt_info_0(out_hnd, ACTION_FOOTER , &(ctr->info_0[i]), &(ctr->info_0_str[i])); + } + break; + } + case ACTION_FOOTER: + { + break; + } + } +} + +/**************************************************************************** +transport info container display function +****************************************************************************/ +void display_srv_tprt_info_ctr(FILE *out_hnd, enum action_type action, + SRV_TPRT_INFO_CTR *ctr) +{ + if (ctr == NULL || ctr->ptr_tprt_ctr == 0) + { + fprintf(out_hnd, "display_srv_tprt_info_ctr: unavailable due to an internal error\n"); + return; + } + + switch (ctr->switch_value) + { + case 0: + { + display_srv_tprt_info_0_ctr(out_hnd, action, + &(ctr->tprt.info0)); + break; + } + default: + { + fprintf(out_hnd, "display_srv_tprt_info_ctr: Unknown Info Level\n"); + break; + } + } +} + + +/**************************************************************************** share info level 1 display function ****************************************************************************/ void display_share_info_1(FILE *out_hnd, enum action_type action, |