From 8d94de787e954f4dca2b805ff974412b1f532f10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Aug 2003 00:55:35 +0000 Subject: Patch from waider@waider.ie to print out Port Type. Jeremy. (This used to be commit 8516baf58d333a54bcbe1c1a08eee499b3dd2636) --- source3/include/rpc_spoolss.h | 6 ++++++ source3/rpcclient/cmd_spoolss.c | 26 +++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index c2e3d92787..f96b4fa96a 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -1302,6 +1302,12 @@ typedef struct s_port_info_2 } PORT_INFO_2; +/* Port Type bits */ +#define PORT_TYPE_WRITE 0x0001 +#define PORT_TYPE_READ 0x0002 +#define PORT_TYPE_REDIRECTED 0x0004 +#define PORT_TYPE_NET_ATTACHED 0x0008 + typedef struct spool_q_enumports { uint32 name_ptr; diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c index b2fa802e9a..d2e62ac3a3 100644 --- a/source3/rpcclient/cmd_spoolss.c +++ b/source3/rpcclient/cmd_spoolss.c @@ -395,7 +395,31 @@ static void display_port_info_2(PORT_INFO_2 *i2) rpcstr_pull(buffer, i2->description.buffer, sizeof(buffer), -1, STR_TERMINATE); printf("\tDescription:\t[%s]\n", buffer); - printf("\tPort Type:\t[%d]\n", i2->port_type); + printf("\tPort Type:\t" ); + if ( i2->port_type ) { + int comma = 0; /* hack */ + printf( "[" ); + if ( i2->port_type & PORT_TYPE_READ ) { + printf( "Read" ); + comma = 1; + } + if ( i2->port_type & PORT_TYPE_WRITE ) { + printf( "%sWrite", comma ? ", " : "" ); + comma = 1; + } + /* These two have slightly different interpretations + on 95/98/ME but I'm disregarding that for now */ + if ( i2->port_type & PORT_TYPE_REDIRECTED ) { + printf( "%sRedirected", comma ? ", " : "" ); + comma = 1; + } + if ( i2->port_type & PORT_TYPE_NET_ATTACHED ) { + printf( "%sNet-Attached", comma ? ", " : "" ); + } + printf( "]\n" ); + } else { + printf( "[Unset]\n" ); + } printf("\tReserved:\t[%d]\n", i2->reserved); printf("\n"); } -- cgit