mirror of
https://github.com/samba-team/samba.git
synced 2025-12-04 08:23:50 +03:00
r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
f3b1d3bdc7
commit
af6f1f8a01
@@ -23,7 +23,7 @@
|
||||
/****************************************************************************
|
||||
send an ack for an oplock break request
|
||||
****************************************************************************/
|
||||
BOOL cli_oplock_ack(struct cli_tree *tree, uint16 fnum, uint16 ack_level)
|
||||
BOOL cli_oplock_ack(struct cli_tree *tree, uint16_t fnum, uint16_t ack_level)
|
||||
{
|
||||
BOOL ret;
|
||||
struct cli_request *req;
|
||||
|
||||
@@ -45,7 +45,7 @@ struct cli_session *cli_session_init(struct cli_transport *transport)
|
||||
|
||||
session->mem_ctx = mem_ctx;
|
||||
session->transport = transport;
|
||||
session->pid = (uint16)getpid();
|
||||
session->pid = (uint16_t)getpid();
|
||||
session->vuid = UID_FIELD_INVALID;
|
||||
session->transport->reference_count++;
|
||||
|
||||
@@ -144,7 +144,7 @@ NTSTATUS smb_raw_session_setup_recv(struct cli_request *req,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
union smb_sesssetup *parms)
|
||||
{
|
||||
uint16 len;
|
||||
uint16_t len;
|
||||
char *p;
|
||||
|
||||
if (!cli_request_receive(req)) {
|
||||
|
||||
@@ -127,9 +127,9 @@ BOOL cli_transport_connect(struct cli_transport *transport,
|
||||
/****************************************************************************
|
||||
get next mid in sequence
|
||||
****************************************************************************/
|
||||
uint16 cli_transport_next_mid(struct cli_transport *transport)
|
||||
uint16_t cli_transport_next_mid(struct cli_transport *transport)
|
||||
{
|
||||
uint16 mid;
|
||||
uint16_t mid;
|
||||
struct cli_request *req;
|
||||
|
||||
mid = transport->next_mid;
|
||||
|
||||
@@ -69,7 +69,7 @@ uint_t ea_pull_struct(const DATA_BLOB *blob,
|
||||
struct ea_struct *ea)
|
||||
{
|
||||
uint8 nlen;
|
||||
uint16 vlen;
|
||||
uint16_t vlen;
|
||||
|
||||
if (blob->length < 6) {
|
||||
return 0;
|
||||
|
||||
@@ -111,10 +111,10 @@ static struct cli_request *smb_raw_t2mkdir_send(struct cli_tree *tree,
|
||||
union smb_mkdir *parms)
|
||||
{
|
||||
struct smb_trans2 t2;
|
||||
uint16 setup = TRANSACT2_MKDIR;
|
||||
uint16_t setup = TRANSACT2_MKDIR;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct cli_request *req;
|
||||
uint16 data_total;
|
||||
uint16_t data_total;
|
||||
|
||||
mem_ctx = talloc_init("t2mkdir");
|
||||
|
||||
@@ -219,10 +219,10 @@ static struct cli_request *smb_raw_t2open_send(struct cli_tree *tree,
|
||||
union smb_open *parms)
|
||||
{
|
||||
struct smb_trans2 t2;
|
||||
uint16 setup = TRANSACT2_OPEN;
|
||||
uint16_t setup = TRANSACT2_OPEN;
|
||||
TALLOC_CTX *mem_ctx = talloc_init("smb_raw_t2open");
|
||||
struct cli_request *req;
|
||||
uint16 list_size;
|
||||
uint16_t list_size;
|
||||
|
||||
list_size = ea_list_size(parms->t2open.in.num_eas, parms->t2open.in.eas);
|
||||
|
||||
|
||||
@@ -261,10 +261,10 @@ static NTSTATUS smb_raw_info_backend(struct cli_session *session,
|
||||
Very raw query file info - returns param/data blobs - (async send)
|
||||
****************************************************************************/
|
||||
static struct cli_request *smb_raw_fileinfo_blob_send(struct cli_tree *tree,
|
||||
uint16 fnum, uint16 info_level)
|
||||
uint16_t fnum, uint16_t info_level)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_QFILEINFO;
|
||||
uint16_t setup = TRANSACT2_QFILEINFO;
|
||||
struct cli_request *req;
|
||||
TALLOC_CTX *mem_ctx = talloc_init("raw_fileinfo");
|
||||
|
||||
@@ -314,10 +314,10 @@ static NTSTATUS smb_raw_fileinfo_blob_recv(struct cli_request *req,
|
||||
****************************************************************************/
|
||||
static struct cli_request *smb_raw_pathinfo_blob_send(struct cli_tree *tree,
|
||||
const char *fname,
|
||||
uint16 info_level)
|
||||
uint16_t info_level)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_QPATHINFO;
|
||||
uint16_t setup = TRANSACT2_QPATHINFO;
|
||||
struct cli_request *req;
|
||||
TALLOC_CTX *mem_ctx = talloc_init("raw_pathinfo");
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ failed:
|
||||
****************************************************************************/
|
||||
static struct cli_request *smb_raw_qfsinfo_send(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint16 info_level)
|
||||
uint16_t info_level)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_QFSINFO;
|
||||
uint16_t setup = TRANSACT2_QFSINFO;
|
||||
|
||||
tp.in.max_setup = 0;
|
||||
tp.in.flags = 0;
|
||||
@@ -133,7 +133,7 @@ struct cli_request *smb_raw_fsinfo_send(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
union smb_fsinfo *fsinfo)
|
||||
{
|
||||
uint16 info_level;
|
||||
uint16_t info_level;
|
||||
|
||||
/* handle the only non-trans2 call separately */
|
||||
if (fsinfo->generic.level == RAW_QFS_DSKATTR) {
|
||||
@@ -144,7 +144,7 @@ struct cli_request *smb_raw_fsinfo_send(struct cli_tree *tree,
|
||||
}
|
||||
|
||||
/* the headers map the trans2 levels direct to info levels */
|
||||
info_level = (uint16)fsinfo->generic.level;
|
||||
info_level = (uint16_t)fsinfo->generic.level;
|
||||
|
||||
return smb_raw_qfsinfo_send(tree, mem_ctx, info_level);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ static struct cli_request *smb_raw_ntioctl_send(struct cli_tree *tree,
|
||||
union smb_ioctl *parms)
|
||||
{
|
||||
struct smb_nttrans nt;
|
||||
uint16 setup[4];
|
||||
uint16_t setup[4];
|
||||
|
||||
nt.in.max_setup = 0;
|
||||
nt.in.max_param = 0;
|
||||
|
||||
@@ -26,7 +26,7 @@ change notify (async send)
|
||||
struct cli_request *smb_raw_changenotify_send(struct cli_tree *tree, struct smb_notify *parms)
|
||||
{
|
||||
struct smb_nttrans nt;
|
||||
uint16 setup[4];
|
||||
uint16_t setup[4];
|
||||
|
||||
nt.in.max_setup = 0;
|
||||
nt.in.max_param = parms->in.buffer_size;
|
||||
|
||||
@@ -152,7 +152,7 @@ struct cli_request *cli_request_setup_session(struct cli_session *session,
|
||||
uint8 command, unsigned wct, unsigned buflen)
|
||||
{
|
||||
struct cli_request *req;
|
||||
uint16 flags2;
|
||||
uint16_t flags2;
|
||||
uint32_t capabilities;
|
||||
|
||||
req = cli_request_setup_transport(session->transport, command, wct, buflen);
|
||||
@@ -341,8 +341,8 @@ static BOOL handle_oplock_break(struct cli_transport *transport, uint_t len, con
|
||||
}
|
||||
|
||||
if (transport->oplock.handler) {
|
||||
uint16 tid = SVAL(hdr, HDR_TID);
|
||||
uint16 fnum = SVAL(vwv,VWV(2));
|
||||
uint16_t tid = SVAL(hdr, HDR_TID);
|
||||
uint16_t fnum = SVAL(vwv,VWV(2));
|
||||
uint8 level = CVAL(vwv,VWV(3)+1);
|
||||
transport->oplock.handler(transport, tid, fnum, level, transport->oplock.private);
|
||||
}
|
||||
@@ -370,7 +370,7 @@ BOOL cli_request_receive_next(struct cli_transport *transport)
|
||||
char *buffer, *hdr, *vwv;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct cli_request *req;
|
||||
uint16 wct, mid = 0;
|
||||
uint16_t wct, mid = 0;
|
||||
|
||||
len = cli_sock_read(transport->socket, header, 4);
|
||||
if (len != 4) {
|
||||
@@ -635,7 +635,7 @@ size_t cli_req_append_bytes(struct cli_request *req, const uint8 *bytes, size_t
|
||||
append variable block (type 5 buffer) into the data portion of the request packet
|
||||
return the number of bytes added
|
||||
*/
|
||||
size_t cli_req_append_var_block(struct cli_request *req, const uint8 *bytes, uint16 byte_len)
|
||||
size_t cli_req_append_var_block(struct cli_request *req, const uint8 *bytes, uint16_t byte_len)
|
||||
{
|
||||
cli_req_grow_allocation(req, byte_len + 3 + req->out.data_size);
|
||||
SCVAL(req->out.data + req->out.data_size, 0, 5);
|
||||
@@ -831,7 +831,7 @@ BOOL cli_raw_pull_data(struct cli_request *req, const char *src, int len, char *
|
||||
/*
|
||||
put a NTTIME into a packet
|
||||
*/
|
||||
void cli_push_nttime(void *base, uint16 offset, NTTIME t)
|
||||
void cli_push_nttime(void *base, uint16_t offset, NTTIME t)
|
||||
{
|
||||
SBVAL(base, offset, t);
|
||||
}
|
||||
@@ -839,7 +839,7 @@ void cli_push_nttime(void *base, uint16 offset, NTTIME t)
|
||||
/*
|
||||
pull a NTTIME from a packet
|
||||
*/
|
||||
NTTIME cli_pull_nttime(void *base, uint16 offset)
|
||||
NTTIME cli_pull_nttime(void *base, uint16_t offset)
|
||||
{
|
||||
NTTIME ret = BVAL(base, offset);
|
||||
return ret;
|
||||
@@ -967,7 +967,7 @@ size_t cli_blob_pull_string(struct cli_session *session,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
DATA_BLOB *blob,
|
||||
WIRE_STRING *dest,
|
||||
uint16 len_offset, uint16 str_offset,
|
||||
uint16_t len_offset, uint16_t str_offset,
|
||||
unsigned flags)
|
||||
{
|
||||
int extra;
|
||||
@@ -1022,7 +1022,7 @@ size_t cli_blob_pull_unix_string(struct cli_session *session,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
DATA_BLOB *blob,
|
||||
const char **dest,
|
||||
uint16 str_offset,
|
||||
uint16_t str_offset,
|
||||
unsigned flags)
|
||||
{
|
||||
int extra = 0;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
****************************************************************************/
|
||||
static void smb_raw_search_backend(struct cli_request *req,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint16 count,
|
||||
uint16_t count,
|
||||
void *private,
|
||||
BOOL (*callback)(void *private, union smb_search_data *file))
|
||||
|
||||
@@ -129,12 +129,12 @@ static NTSTATUS smb_raw_search_next_old(struct cli_tree *tree,
|
||||
static NTSTATUS smb_raw_search_first_blob(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx, /* used to allocate output blobs */
|
||||
union smb_search_first *io,
|
||||
uint16 info_level,
|
||||
uint16_t info_level,
|
||||
DATA_BLOB *out_param_blob,
|
||||
DATA_BLOB *out_data_blob)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_FINDFIRST;
|
||||
uint16_t setup = TRANSACT2_FINDFIRST;
|
||||
NTSTATUS status;
|
||||
|
||||
tp.in.max_setup = 0;
|
||||
@@ -181,12 +181,12 @@ static NTSTATUS smb_raw_search_first_blob(struct cli_tree *tree,
|
||||
static NTSTATUS smb_raw_search_next_blob(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
union smb_search_next *io,
|
||||
uint16 info_level,
|
||||
uint16_t info_level,
|
||||
DATA_BLOB *out_param_blob,
|
||||
DATA_BLOB *out_data_blob)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_FINDNEXT;
|
||||
uint16_t setup = TRANSACT2_FINDNEXT;
|
||||
NTSTATUS status;
|
||||
|
||||
tp.in.max_setup = 0;
|
||||
@@ -236,7 +236,7 @@ static NTSTATUS smb_raw_search_next_blob(struct cli_tree *tree,
|
||||
static int parse_trans2_search(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
enum search_level level,
|
||||
uint16 flags,
|
||||
uint16_t flags,
|
||||
DATA_BLOB *blob,
|
||||
union smb_search_data *data)
|
||||
{
|
||||
@@ -450,8 +450,8 @@ static int parse_trans2_search(struct cli_tree *tree,
|
||||
static NTSTATUS smb_raw_t2search_backend(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
enum search_level level,
|
||||
uint16 flags,
|
||||
int16 count,
|
||||
uint16_t flags,
|
||||
int16_t count,
|
||||
DATA_BLOB *blob,
|
||||
void *private,
|
||||
BOOL (*callback)(void *private, union smb_search_data *file))
|
||||
@@ -495,7 +495,7 @@ NTSTATUS smb_raw_search_first(struct cli_tree *tree,
|
||||
union smb_search_first *io, void *private,
|
||||
BOOL (*callback)(void *private, union smb_search_data *file))
|
||||
{
|
||||
uint16 info_level = 0;
|
||||
uint16_t info_level = 0;
|
||||
DATA_BLOB p_blob, d_blob;
|
||||
NTSTATUS status;
|
||||
|
||||
@@ -505,7 +505,7 @@ NTSTATUS smb_raw_search_first(struct cli_tree *tree,
|
||||
if (io->generic.level >= RAW_SEARCH_GENERIC) {
|
||||
return NT_STATUS_INVALID_LEVEL;
|
||||
}
|
||||
info_level = (uint16)io->generic.level;
|
||||
info_level = (uint16_t)io->generic.level;
|
||||
|
||||
status = smb_raw_search_first_blob(tree, mem_ctx,
|
||||
io, info_level, &p_blob, &d_blob);
|
||||
@@ -539,7 +539,7 @@ NTSTATUS smb_raw_search_next(struct cli_tree *tree,
|
||||
union smb_search_next *io, void *private,
|
||||
BOOL (*callback)(void *private, union smb_search_data *file))
|
||||
{
|
||||
uint16 info_level = 0;
|
||||
uint16_t info_level = 0;
|
||||
DATA_BLOB p_blob, d_blob;
|
||||
NTSTATUS status;
|
||||
|
||||
@@ -549,7 +549,7 @@ NTSTATUS smb_raw_search_next(struct cli_tree *tree,
|
||||
if (io->generic.level >= RAW_SEARCH_GENERIC) {
|
||||
return NT_STATUS_INVALID_LEVEL;
|
||||
}
|
||||
info_level = (uint16)io->generic.level;
|
||||
info_level = (uint16_t)io->generic.level;
|
||||
|
||||
status = smb_raw_search_next_blob(tree, mem_ctx,
|
||||
io, info_level, &p_blob, &d_blob);
|
||||
|
||||
@@ -132,12 +132,12 @@ static BOOL smb_raw_setinfo_backend(struct cli_tree *tree,
|
||||
****************************************************************************/
|
||||
static struct cli_request *smb_raw_setfileinfo_blob_send(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint16 fnum,
|
||||
uint16 info_level,
|
||||
uint16_t fnum,
|
||||
uint16_t info_level,
|
||||
DATA_BLOB *blob)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_SETFILEINFO;
|
||||
uint16_t setup = TRANSACT2_SETFILEINFO;
|
||||
|
||||
tp.in.max_setup = 0;
|
||||
tp.in.flags = 0;
|
||||
@@ -166,11 +166,11 @@ static struct cli_request *smb_raw_setfileinfo_blob_send(struct cli_tree *tree,
|
||||
static struct cli_request *smb_raw_setpathinfo_blob_send(struct cli_tree *tree,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
const char *fname,
|
||||
uint16 info_level,
|
||||
uint16_t info_level,
|
||||
DATA_BLOB *blob)
|
||||
{
|
||||
struct smb_trans2 tp;
|
||||
uint16 setup = TRANSACT2_SETPATHINFO;
|
||||
uint16_t setup = TRANSACT2_SETPATHINFO;
|
||||
|
||||
tp.in.max_setup = 0;
|
||||
tp.in.flags = 0;
|
||||
|
||||
@@ -119,9 +119,9 @@ NTSTATUS smb_raw_trans2_recv(struct cli_request *req,
|
||||
}
|
||||
|
||||
while (1) {
|
||||
uint16 param_count, param_ofs, param_disp;
|
||||
uint16 data_count, data_ofs, data_disp;
|
||||
uint16 total_data2, total_param2;
|
||||
uint16_t param_count, param_ofs, param_disp;
|
||||
uint16_t data_count, data_ofs, data_disp;
|
||||
uint16_t total_data2, total_param2;
|
||||
|
||||
/* parse out the total lengths again - they can shrink! */
|
||||
total_data2 = SVAL(req->in.vwv, VWV(1));
|
||||
|
||||
@@ -68,7 +68,7 @@ static BOOL set_smb_signing_real_common(struct cli_transport *transport)
|
||||
|
||||
static void mark_packet_signed(struct cli_request *req)
|
||||
{
|
||||
uint16 flags2;
|
||||
uint16_t flags2;
|
||||
flags2 = SVAL(req->out.hdr, HDR_FLG2);
|
||||
flags2 |= FLAGS2_SMB_SECURITY_SIGNATURES;
|
||||
SSVAL(req->out.hdr, HDR_FLG2, flags2);
|
||||
|
||||
Reference in New Issue
Block a user