本文整理汇总了C++中smb_rq_init函数的典型用法代码示例。如果您正苦于以下问题:C++ smb_rq_init函数的具体用法?C++ smb_rq_init怎么用?C++ smb_rq_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smb_rq_init函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: smb_smb_open_print_file
int
smb_smb_open_print_file(struct smb_ctx *ctx, int setuplen, int mode,
const char *ident, smbfh *fhp)
{
struct smb_rq *rqp;
struct mbdata *mbp;
int error;
error = smb_rq_init(ctx, SMB_COM_OPEN_PRINT_FILE, 2, &rqp);
if (error)
return error;
mbp = smb_rq_getrequest(rqp);
mb_put_uint16le(mbp, setuplen);
mb_put_uint16le(mbp, mode);
smb_rq_wend(rqp);
mb_put_uint8(mbp, SMB_DT_ASCII);
smb_rq_dstring(mbp, ident);
error = smb_rq_simple(rqp);
if (!error) {
mbp = smb_rq_getreply(rqp);
mb_get_uint16(mbp, fhp);
}
smb_rq_done(rqp);
return error;
}
示例2: smb_rq_alloc
int
smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred,
struct smb_rq **rqpp)
{
struct smb_rq *rqp;
int error;
rqp = kmalloc(sizeof(*rqp), M_SMBRQ, M_WAITOK);
error = smb_rq_init(rqp, layer, cmd, scred);
rqp->sr_flags |= SMBR_ALLOCED;
if (error) {
smb_rq_done(rqp);
return error;
}
*rqpp = rqp;
return 0;
}
示例3: smb_smb_close_print_file
int
smb_smb_close_print_file(struct smb_ctx *ctx, smbfh fh)
{
struct smb_rq *rqp;
struct mbdata *mbp;
int error;
error = smb_rq_init(ctx, SMB_COM_CLOSE_PRINT_FILE, 0, &rqp);
if (error)
return error;
mbp = smb_rq_getrequest(rqp);
mb_put_mem(mbp, (char*)&fh, 2);
smb_rq_wend(rqp);
error = smb_rq_simple(rqp);
smb_rq_done(rqp);
return error;
}
示例4: smb_rq_alloc
int
smb_rq_alloc(struct smb_connobj *layer, uchar_t cmd, struct smb_cred *scred,
struct smb_rq **rqpp)
{
struct smb_rq *rqp;
int error;
rqp = (struct smb_rq *)kmem_alloc(sizeof (struct smb_rq), KM_SLEEP);
if (rqp == NULL)
return (ENOMEM);
error = smb_rq_init(rqp, layer, cmd, scred);
if (error) {
smb_rq_done(rqp);
return (error);
}
rqp->sr_flags |= SMBR_ALLOCED;
*rqpp = rqp;
return (0);
}
示例5: smbfs_smb_setpattr
/*
* Set DOS file attributes. mtime should be NULL for dialects above lm10
*/
int
smbfs_smb_setpattr(struct smbnode *np, u_int16_t attr, struct timespec *mtime,
struct smb_cred *scred)
{
struct smb_rq rq, *rqp = &rq;
struct smb_share *ssp = np->n_mount->sm_share;
struct mbchain *mbp;
u_long time;
int error, svtz;
error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_SET_INFORMATION, scred);
if (error)
return error;
svtz = SSTOVC(ssp)->vc_sopt.sv_tz;
smb_rq_getrequest(rqp, &mbp);
smb_rq_wstart(rqp);
mb_put_uint16le(mbp, attr);
if (mtime) {
smb_time_local2server(mtime, svtz, &time);
} else
time = 0;
mb_put_uint32le(mbp, time); /* mtime */
mb_put_mem(mbp, NULL, 5 * 2, MB_MZERO);
smb_rq_wend(rqp);
smb_rq_bstart(rqp);
mb_put_uint8(mbp, SMB_DT_ASCII);
do {
error = smbfs_fullpath(mbp, SSTOVC(ssp), np, NULL, 0);
if (error)
break;
mb_put_uint8(mbp, SMB_DT_ASCII);
mb_put_uint8(mbp, 0);
smb_rq_bend(rqp);
error = smb_rq_simple(rqp);
if (error) {
SMBERROR("smb_rq_simple(rqp) => error %d\n", error);
break;
}
} while(0);
smb_rq_done(rqp);
return error;
}