summaryrefslogtreecommitdiff
path: root/source3/client/clientutil.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-10-21 09:39:08 +0000
committerAndrew Tridgell <tridge@samba.org>1997-10-21 09:39:08 +0000
commit60328722098bf291664a8a63a245b35cb96fae28 (patch)
treed2a60526f279ac9782a353519b56d892f2c8e6d7 /source3/client/clientutil.c
parent0891bb6a910841455162876be09a92107cd9df00 (diff)
downloadsamba-60328722098bf291664a8a63a245b35cb96fae28.tar.gz
samba-60328722098bf291664a8a63a245b35cb96fae28.tar.bz2
samba-60328722098bf291664a8a63a245b35cb96fae28.zip
some cleanups in the clientutil.c code.
I'm actually hoping to remove this module completely once we convert nmbd to using the new (much cleaner) clientgen.c smbclient now also reports if it connects as a guest user (This used to be commit 3af8d855facfc436cb4b64fa58aca8c056a5348e)
Diffstat (limited to 'source3/client/clientutil.c')
-rw-r--r--source3/client/clientutil.c65
1 files changed, 35 insertions, 30 deletions
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 01b4a09321..9dd1dc040e 100644
--- a/source3/client/clientutil.c
+++ b/source3/client/clientutil.c
@@ -77,7 +77,7 @@ extern int Client;
/****************************************************************************
setup basics in a outgoing packet
****************************************************************************/
-void cli_setup_pkt(char *outbuf)
+static void cli_setup_pkt(char *outbuf)
{
SSVAL(outbuf,smb_pid,pid);
SSVAL(outbuf,smb_uid,uid);
@@ -89,11 +89,14 @@ void cli_setup_pkt(char *outbuf)
}
}
+
+
/****************************************************************************
receive a SMB trans or trans2 response allocating the necessary memory
****************************************************************************/
-BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len,
- int *param_len, char **data,char **param)
+static BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len,
+ int *param_len, char **data,
+ char **param)
{
int total_data=0;
int total_param=0;
@@ -171,7 +174,7 @@ BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len,
/****************************************************************************
send a session request
****************************************************************************/
-BOOL cli_send_session_request(char *inbuf, char *outbuf)
+static BOOL cli_send_session_request(char *inbuf, char *outbuf)
{
fstring dest;
char *p;
@@ -667,35 +670,12 @@ void cli_send_logout(void)
}
-
-/****************************************************************************
-call a remote api
-****************************************************************************/
-BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt,
- int *rdrcnt, char *param,char *data, char **rparam,char **rdata)
-{
- static char *inbuf=NULL;
- static char *outbuf=NULL;
-
- if (!inbuf) inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
- if (!outbuf) outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
-
- cli_send_trans_request(outbuf,SMBtrans,"\\PIPE\\LANMAN",0,0,
- data,param,NULL,
- drcnt,prcnt,0,
- mdrcnt,mprcnt,0);
-
- return (cli_receive_trans_response(inbuf,SMBtrans,
- rdrcnt,rprcnt,
- rdata,rparam));
-}
-
/****************************************************************************
send a SMB trans or trans2 request
****************************************************************************/
-BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags,
- char *data,char *param,uint16 *setup, int ldata,int lparam,
- int lsetup,int mdata,int mparam,int msetup)
+static BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags,
+ char *data,char *param,uint16 *setup, int ldata,int lparam,
+ int lsetup,int mdata,int mparam,int msetup)
{
int i;
int this_ldata,this_lparam;
@@ -803,6 +783,31 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl
}
+
+/****************************************************************************
+call a remote api
+****************************************************************************/
+BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt,
+ int *rdrcnt, char *param,char *data,
+ char **rparam, char **rdata)
+{
+ static char *inbuf=NULL;
+ static char *outbuf=NULL;
+
+ if (!inbuf) inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
+ if (!outbuf) outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
+
+ cli_send_trans_request(outbuf,SMBtrans,"\\PIPE\\LANMAN",0,0,
+ data,param,NULL,
+ drcnt,prcnt,0,
+ mdrcnt,mprcnt,0);
+
+ return (cli_receive_trans_response(inbuf,SMBtrans,
+ rdrcnt,rprcnt,
+ rdata,rparam));
+}
+
+
/****************************************************************************
open the client sockets
****************************************************************************/