summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clifsinfo.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-04-18 16:08:52 +0000
committerGerald Carter <jerry@samba.org>2005-04-18 16:08:52 +0000
commit4bdbd8bd0742c2c6e4ef65d7030a710412ad6234 (patch)
treeb0b63f76422bf70560832976c5e4174f01c70fb0 /source/libsmb/clifsinfo.c
parent65e71c35f782cb1c8a22c61e88f1f853b585b297 (diff)
downloadsamba-4bdbd8bd0742c2c6e4ef65d7030a710412ad6234.tar.gz
samba-4bdbd8bd0742c2c6e4ef65d7030a710412ad6234.tar.xz
samba-4bdbd8bd0742c2c6e4ef65d7030a710412ad6234.zip
r6369: update release notes
sync with SAMBA_3_0 (r6365). Getting ready for 3.0.15pre2
Diffstat (limited to 'source/libsmb/clifsinfo.c')
-rw-r--r--source/libsmb/clifsinfo.c115
1 files changed, 115 insertions, 0 deletions
diff --git a/source/libsmb/clifsinfo.c b/source/libsmb/clifsinfo.c
index 22c8bff3ba0..2874ee6ca1c 100644
--- a/source/libsmb/clifsinfo.c
+++ b/source/libsmb/clifsinfo.c
@@ -132,3 +132,118 @@ cleanup:
return ret;
}
+
+BOOL cli_get_fs_volume_info_old(struct cli_state *cli, fstring volume_name, uint32 *pserial_number)
+{
+ BOOL ret = False;
+ uint16 setup;
+ char param[2];
+ char *rparam=NULL, *rdata=NULL;
+ unsigned int rparam_count=0, rdata_count=0;
+ unsigned char nlen;
+
+ setup = TRANSACT2_QFSINFO;
+
+ SSVAL(param,0,SMB_INFO_VOLUME);
+
+ if (!cli_send_trans(cli, SMBtrans2,
+ NULL,
+ 0, 0,
+ &setup, 1, 0,
+ param, 2, 0,
+ NULL, 0, 560)) {
+ goto cleanup;
+ }
+
+ if (!cli_receive_trans(cli, SMBtrans2,
+ &rparam, &rparam_count,
+ &rdata, &rdata_count)) {
+ goto cleanup;
+ }
+
+ if (cli_is_error(cli)) {
+ ret = False;
+ goto cleanup;
+ } else {
+ ret = True;
+ }
+
+ if (rdata_count < 5) {
+ goto cleanup;
+ }
+
+ if (pserial_number) {
+ *pserial_number = IVAL(rdata,0);
+ }
+ nlen = CVAL(rdata,l2_vol_cch);
+ clistr_pull(cli, volume_name, rdata + l2_vol_szVolLabel, sizeof(fstring), nlen, STR_NOALIGN);
+
+ /* todo: but not yet needed
+ * return the other stuff
+ */
+
+cleanup:
+ SAFE_FREE(rparam);
+ SAFE_FREE(rdata);
+
+ return ret;
+}
+
+BOOL cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name, uint32 *pserial_number, time_t *pdate)
+{
+ BOOL ret = False;
+ uint16 setup;
+ char param[2];
+ char *rparam=NULL, *rdata=NULL;
+ unsigned int rparam_count=0, rdata_count=0;
+ unsigned int nlen;
+
+ setup = TRANSACT2_QFSINFO;
+
+ SSVAL(param,0,SMB_QUERY_FS_VOLUME_INFO);
+
+ if (!cli_send_trans(cli, SMBtrans2,
+ NULL,
+ 0, 0,
+ &setup, 1, 0,
+ param, 2, 0,
+ NULL, 0, 560)) {
+ goto cleanup;
+ }
+
+ if (!cli_receive_trans(cli, SMBtrans2,
+ &rparam, &rparam_count,
+ &rdata, &rdata_count)) {
+ goto cleanup;
+ }
+
+ if (cli_is_error(cli)) {
+ ret = False;
+ goto cleanup;
+ } else {
+ ret = True;
+ }
+
+ if (rdata_count < 19) {
+ goto cleanup;
+ }
+
+ if (pdate) {
+ *pdate = interpret_long_date(rdata);
+ }
+ if (pserial_number) {
+ *pserial_number = IVAL(rdata,8);
+ }
+ nlen = IVAL(rdata,12);
+ clistr_pull(cli, volume_name, rdata + 18, sizeof(fstring), nlen, STR_UNICODE);
+
+ /* todo: but not yet needed
+ * return the other stuff
+ */
+
+cleanup:
+ SAFE_FREE(rparam);
+ SAFE_FREE(rdata);
+
+ return ret;
+}