/* timing globals */
uint64_t get_total_size = 0;
-unsigned int get_total_time_ms = 0;
+uint_t get_total_time_ms = 0;
static uint64_t put_total_size = 0;
-static unsigned int put_total_time_ms = 0;
+static uint_t put_total_time_ms = 0;
/* totals globals */
static double dir_total;
if (NT_STATUS_IS_ERR(cli_unix_chmod(cli->tree, src, mode))) {
d_printf("%s chmod file %s 0%o\n",
- cli_errstr(cli->tree), src, (unsigned int)mode);
+ cli_errstr(cli->tree), src, (uint_t)mode);
return 1;
}
/* Tries to mount using the appropriate format. For 2.2 the struct,
for 2.4 the ascii version. */
static int
-do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
+do_mount(char *share_name, uint_t flags, struct smb_mount_data *data)
{
pstring opts;
struct utsname uts;
char *mount_point, *share_name = NULL;
FILE *mtab;
int fd;
- unsigned int flags;
+ uint_t flags;
struct smb_mount_data data;
struct mntent ment;
int server_zone;
time_t server_time;
- unsigned int readbraw_supported:1;
- unsigned int writebraw_supported:1;
+ uint_t readbraw_supported:1;
+ uint_t writebraw_supported:1;
const char *server_domain;
};
client library
*/
struct cli_options {
- unsigned int use_oplocks:1;
- unsigned int use_level2_oplocks:1;
- unsigned int use_spnego:1;
+ uint_t use_oplocks:1;
+ uint_t use_level2_oplocks:1;
+ uint_t use_spnego:1;
};
/* this is the context for the client transport layer */
/* is a readbraw pending? we need to handle that case
specially on receiving packets */
- unsigned int readbraw_pending:1;
+ uint_t readbraw_pending:1;
/* an idle function - if this is defined then it will be
called once every period milliseconds while we are waiting
/* set if this is a one-way request, meaning we are not
expecting a reply from the server. */
- unsigned int one_way_request:1;
+ uint_t one_way_request:1;
/* the mid of this packet - used to match replies */
uint16_t mid;
struct userdata_struct {
userdata_copy_fn copy_fn;
userdata_free_fn free_fn;
- unsigned int userdata_len;
+ uint_t userdata_len;
char data[16]; /* 16 is to ensure alignment/padding on all systems */
};
//FIXME
typedef struct ace_struct_s {
uint8_t type, flags;
- unsigned int perms; /* Perhaps a better def is in order */
+ uint_t perms; /* Perhaps a better def is in order */
DOM_SID *trustee;
} ACE;
#endif
struct bitmap {
uint32_t *b;
- unsigned int n;
+ uint_t n;
};
#define FLAG_BASIC 0x0001 /* fundamental options */
struct nmb_name {
char name[17];
char scope[64];
- unsigned int name_type;
+ uint_t name_type;
};
****************************************************************************/
int bitmap_find(struct bitmap *bm, unsigned ofs)
{
- unsigned int i, j;
+ uint_t i, j;
if (ofs > bm->n) ofs = 0;
*/
void MD5Final(uint8_t digest[16], struct MD5Context *ctx)
{
- unsigned int count;
+ uint_t count;
uint8_t *p;
/* Compute number of bytes mod 64 */
static void ping_message(int msg_type, pid_t src, void *buf, size_t len)
{
const char *msg = buf ? buf : "none";
- DEBUG(1,("INFO: Received PING message from PID %u [%s]\n",(unsigned int)src, msg));
+ DEBUG(1,("INFO: Received PING message from PID %u [%s]\n",(uint_t)src, msg));
message_send_pid(src, MSG_PONG, buf, len, True);
}
****************************************************************************/
static BOOL message_send_pid_internal(pid_t pid, int msg_type, const void *buf, size_t len,
- BOOL duplicates_allowed, unsigned int timeout)
+ BOOL duplicates_allowed, uint_t timeout)
{
TDB_DATA kbuf;
TDB_DATA dbuf;
****************************************************************************/
BOOL message_send_pid_with_timeout(pid_t pid, int msg_type, const void *buf, size_t len,
- BOOL duplicates_allowed, unsigned int timeout)
+ BOOL duplicates_allowed, uint_t timeout)
{
return message_send_pid_internal(pid, msg_type, buf, len, duplicates_allowed, timeout);
}
for (buf = msgs_buf; message_recv(msgs_buf, total_len, &msg_type, &src, &buf, &len); buf += len) {
DEBUG(10,("message_dispatch: received msg_type=%d src_pid=%u\n",
- msg_type, (unsigned int) src));
+ msg_type, (uint_t) src));
n_handled = 0;
for (dfn = dispatch_fns; dfn; dfn = dfn->next) {
if (dfn->msg_type == msg_type) {
if (!n_handled) {
DEBUG(5,("message_dispatch: warning: no handlers registed for "
"msg_type %d in pid %u\n",
- msg_type, (unsigned int)getpid()));
+ msg_type, (uint_t)getpid()));
}
}
SAFE_FREE(msgs_buf);
if (errno == ESRCH) {
DEBUG(2,("pid %u doesn't exist - deleting connections %d [%s]\n",
- (unsigned int)crec.pid, crec.cnum, crec.name));
+ (uint_t)crec.pid, crec.cnum, crec.name));
tdb_delete(the_tdb, kbuf);
}
}
}
memset(buf, 0, sizeof(buf));
- slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid());
+ slprintf(buf, sizeof(buf) - 1, "%u\n", (uint_t) getpid());
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
DEBUG(0,("ERROR: can't write to file %s: %s\n",
pidFile, strerror(errno)));
#define BLK_SIZE(b) ((int)*(int *)(((int *)b)-1))
-typedef unsigned int DWORD;
+typedef uint_t DWORD;
typedef unsigned short WORD;
typedef struct sk_struct SK_HDR;
DWORD uk5; /* 0 */
DWORD uk6; /* 1 */
DWORD first_key; /* offset */
- unsigned int dblk_size;
+ uint_t dblk_size;
DWORD uk7[116]; /* 1 */
DWORD chksum;
} REGF_HDR;
int type, size;
struct hbin_blk_s *next;
char *data; /* The data block */
- unsigned int file_offset; /* Offset in file */
- unsigned int free_space; /* Amount of free space in block */
- unsigned int fsp_off; /* Start of free space in block */
+ uint_t file_offset; /* Offset in file */
+ uint_t free_space; /* Amount of free space in block */
+ uint_t fsp_off; /* Start of free space in block */
int complete, stored;
} HBIN_BLK;
REGF *regf = h->backend_data;
REG_KEY *tmp = NULL, *own;
int namlen, clsname_len, sk_off, own_off;
- unsigned int nk_id;
+ uint_t nk_id;
SK_HDR *sk_hdr;
int type;
char key_name[1024], cls_name[1024];
DEBUG(2, ("Owner Offset: %0X\n", own_off));
DEBUGADD(2, (" Owner locn: %0X, Our locn: %0X\n",
- (unsigned int)own, (unsigned int)nk_hdr));
+ (uint_t)own, (uint_t)nk_hdr));
/*
* We should verify that the owner field is correct ...
* Allocate a unit of space ... and return a pointer as function param
* and the block's offset as a side effect
*/
-static void *nt_alloc_regf_space(REG_HANDLE *h, int size, unsigned int *off)
+static void *nt_alloc_regf_space(REG_HANDLE *h, int size, uint_t *off)
{
REGF *regf = h->backend_data;
int tmp = 0;
* that first, then the owner, then the group SID. So, we do it that way
* too.
*/
-static unsigned int nt_store_sec_desc(REG_HANDLE *regf, SEC_DESC *sd, char *locn)
+static uint_t nt_store_sec_desc(REG_HANDLE *regf, SEC_DESC *sd, char *locn)
{
SEC_DESC *rsd = (SEC_DESC *)locn;
- unsigned int size = 0, off = 0;
+ uint_t size = 0, off = 0;
if (!regf || !sd || !locn) return 0;
* If it has already been stored, just get its offset from record
* otherwise, store it and record its offset
*/
-static unsigned int nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec)
+static uint_t nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec)
{
int size = 0;
- unsigned int sk_off;
+ uint_t sk_off;
SK_HDR *sk_hdr;
if (sec->offset) return sec->offset;
static int nt_store_reg_key(REG_HANDLE *regf, REG_KEY *key)
{
NK_HDR *nk_hdr;
- unsigned int nk_off, sk_off, size;
+ uint_t nk_off, sk_off, size;
if (!regf || !key) return 0;
{
REGF *regf;
REGF_HDR *regf_hdr;
- unsigned int regf_id, hbin_id;
+ uint_t regf_id, hbin_id;
HBIN_HDR *hbin_hdr;
regf = (REGF *)talloc_p(h->mem_ctx, REGF);
* the keys and the RGDB contains the actual data.
*/
-typedef unsigned int DWORD;
+typedef uint_t DWORD;
typedef unsigned short WORD;
typedef struct creg_block {
Wrapper for srandom().
****************************************************************************/
-void sys_srandom(unsigned int seed)
+void sys_srandom(uint_t seed)
{
#if defined(HAVE_SRANDOM)
srandom(seed);
static inline int __spin_trylock(spinlock_t *lock)
{
- unsigned int result;
+ uint_t result;
asm volatile("ldstub [%1], %0"
: "=r" (result)
static inline int __spin_trylock(spinlock_t *lock)
{
- unsigned int result;
+ uint_t result;
__asm__ __volatile__(
"1: lwarx %0,0,%1\n\
/* Returns 0 if the lock is acquired, EBUSY otherwise. */
static inline int __spin_trylock(spinlock_t *lock)
{
- unsigned int val;
+ uint_t val;
val = __lock_test_and_set(lock, 1);
return val == 0 ? 0 : EBUSY;
}
/* Returns 1 if the lock is held, 0 otherwise. */
static inline int __spin_is_locked(spinlock_t *lock)
{
- unsigned int val;
+ uint_t val;
val = __add_and_fetch(lock, 0);
return val;
}
#elif defined(MIPS_SPINLOCKS)
-static inline unsigned int load_linked(unsigned long addr)
+static inline uint_t load_linked(unsigned long addr)
{
- unsigned int res;
+ uint_t res;
__asm__ __volatile__("ll\t%0,(%1)"
: "=r" (res)
return res;
}
-static inline unsigned int store_conditional(unsigned long addr, unsigned int value)
+static inline uint_t store_conditional(unsigned long addr, uint_t value)
{
- unsigned int res;
+ uint_t res;
__asm__ __volatile__("sc\t%0,(%2)"
: "=r" (res)
static inline int __spin_trylock(spinlock_t *lock)
{
- unsigned int mw;
+ uint_t mw;
do {
mw = load_linked(lock);
return 0;
}
-int tdb_create_rwlocks(int fd, unsigned int hash_size)
+int tdb_create_rwlocks(int fd, uint_t hash_size)
{
unsigned size, i;
tdb_rwlock_t *rwlocks;
return 0;
}
#else
-int tdb_create_rwlocks(int fd, unsigned int hash_size) { return 0; }
+int tdb_create_rwlocks(int fd, uint_t hash_size) { return 0; }
int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; }
int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; }
Lock a chain with timeout (in seconds).
****************************************************************************/
-static int tdb_chainlock_with_timeout_internal(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int timeout, int rw_type)
+static int tdb_chainlock_with_timeout_internal(TDB_CONTEXT *tdb, TDB_DATA key, uint_t timeout, int rw_type)
{
/* Allow tdb_chainlock to be interrupted by an alarm. */
int ret;
Write lock a chain. Return -1 if timeout or lock failed.
****************************************************************************/
-int tdb_chainlock_with_timeout(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int timeout)
+int tdb_chainlock_with_timeout(TDB_CONTEXT *tdb, TDB_DATA key, uint_t timeout)
{
return tdb_chainlock_with_timeout_internal(tdb, key, timeout, F_WRLCK);
}
Lock a chain by string. Return -1 if timeout or lock failed.
****************************************************************************/
-int tdb_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout)
+int tdb_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, uint_t timeout)
{
TDB_DATA key = make_tdb_data(keyval, strlen(keyval)+1);
Read lock a chain by string. Return -1 if timeout or lock failed.
****************************************************************************/
-int tdb_read_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout)
+int tdb_read_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, uint_t timeout)
{
TDB_DATA key = make_tdb_data(keyval, strlen(keyval)+1);
int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_create_rwlocks(int fd, unsigned int hash_size);
+int tdb_create_rwlocks(int fd, uint_t hash_size);
int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
#define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t))
#else
int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type);
int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type);
-int tdb_create_rwlocks(int fd, unsigned int hash_size);
+int tdb_create_rwlocks(int fd, uint_t hash_size);
#endif
int tdb_clear_spinlocks(TDB_CONTEXT *tdb);
#define TDB_SPINLOCK_SIZE(hash_size) 0
Sleep for a specified number of milliseconds.
********************************************************************/
-void msleep(unsigned int t)
+void msleep(uint_t t)
{
struct timeval tval;
if (len > maxlength) {
DEBUG(0,("ERROR: string overflow by %u (%u - %u) in safe_strcpy [%.50s]\n",
- (unsigned int)(len-maxlength), len, maxlength, src));
+ (uint_t)(len-maxlength), len, maxlength, src));
len = maxlength;
}
#endif
keytab, NULL, &tkt))) {
DEBUG(10,("ads_verify_ticket: enc type [%u] decrypted message !\n",
- (unsigned int)enctypes[i] ));
+ (uint_t)enctypes[i] ));
auth_ok = True;
break;
}
DEBUG((ret != KRB5_BAD_ENCTYPE) ? 3 : 10,
("ads_verify_ticket: enc type [%u] failed to decrypt with error %s\n",
- (unsigned int)enctypes[i], error_message(ret)));
+ (uint_t)enctypes[i], error_message(ret)));
}
release_server_mutex();
int result_code,
const char **code_string)
{
- unsigned int idx = 0;
+ uint_t idx = 0;
while (kpasswd_errors[idx].error_string != NULL) {
if (kpasswd_errors[idx].result_code ==
typedef struct ntlmssp_state
{
TALLOC_CTX *mem_ctx;
- unsigned int ref_count;
+ uint_t ref_count;
enum NTLMSSP_ROLE role;
enum samr_Role server_role;
uint32_t expected_state;
****************************************************************************/
static uint32_t unix_perms_to_wire(mode_t perms)
{
- unsigned int ret = 0;
+ uint_t ret = 0;
ret |= ((perms & S_IXOTH) ? UNIX_X_OTH : 0);
ret |= ((perms & S_IWOTH) ? UNIX_W_OTH : 0);
buf -= 4;
if (CVAL(buf,smb_com) != SMBtrans) {
- DEBUG(0,("lookup_pdc_name: datagram type %u != SMBtrans(%u)\n", (unsigned int)
- CVAL(buf,smb_com), (unsigned int)SMBtrans ));
+ DEBUG(0,("lookup_pdc_name: datagram type %u != SMBtrans(%u)\n", (uint_t)
+ CVAL(buf,smb_com), (uint_t)SMBtrans ));
free_packet(p_ret);
continue;
}
if(SVAL(buf2,0) != QUERYFORPDC_R) {
DEBUG(0,("lookup_pdc_name: datagram type (%u) != QUERYFORPDC_R(%u)\n",
- (unsigned int)SVAL(buf,0), (unsigned int)QUERYFORPDC_R ));
+ (uint_t)SVAL(buf,0), (uint_t)QUERYFORPDC_R ));
free_packet(p_ret);
continue;
}
{
memset( (char *)n, '\0', sizeof(struct nmb_name) );
push_ascii(n->name, name, 16, STR_TERMINATE|STR_UPPER);
- n->name_type = (unsigned int)type & 0xFF;
+ n->name_type = (uint_t)type & 0xFF;
StrnCpy( n->scope, lp_netbios_scope(), 63 );
strupper( n->scope );
}
struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr)
{
struct dom_sid *ret;
- unsigned int rev, ia, num_sub_auths, i;
+ uint_t rev, ia, num_sub_auths, i;
char *p;
if (strncasecmp(sidstr, "S-", 2)) {
/* Decode a sam password hash into a password. The password hash is the
same method used to store passwords in the NT registry. The DES key
used is based on the RID of the user. */
-void sam_pwd_hash(unsigned int rid, const uchar *in, uchar *out, int forw)
+void sam_pwd_hash(uint_t rid, const uchar *in, uchar *out, int forw)
{
uchar s[14];
(sid->id_auth[2] << 24);
ofs = snprintf(ret, maxlen, "S-%u-%lu",
- (unsigned int)sid->sid_rev_num, (unsigned long)ia);
+ (uint_t)sid->sid_rev_num, (unsigned long)ia);
for (i = 0; i < sid->num_auths; i++) {
ofs += snprintf(ret + ofs, maxlen - ofs, "-%lu", (unsigned long)sid->sub_auths[i]);
between smbd instances.
*******************************************************************************/
-BOOL secrets_named_mutex(const char *name, unsigned int timeout, size_t *p_ref_count)
+BOOL secrets_named_mutex(const char *name, uint_t timeout, size_t *p_ref_count)
{
size_t ref_count = *p_ref_count;
int ret = 0;
if (ret == 0) {
*p_ref_count = ++ref_count;
- DEBUG(10,("secrets_named_mutex: ref_count for mutex %s = %u\n", name, (unsigned int)ref_count ));
+ DEBUG(10,("secrets_named_mutex: ref_count for mutex %s = %u\n", name, (uint_t)ref_count ));
}
return (ret == 0);
}
}
*p_ref_count = --ref_count;
- DEBUG(10,("secrets_named_mutex_release: ref_count for mutex %s = %u\n", name, (unsigned int)ref_count ));
+ DEBUG(10,("secrets_named_mutex_release: ref_count for mutex %s = %u\n", name, (uint_t)ref_count ));
}
/* Treat a mode_t as an unsigned integer */
-typedef unsigned int mode_t;
+typedef uint_t mode_t;
/* flags to tdb_store() */
void conn_clear_vuid_cache(struct server_context *smb, uint16_t vuid)
{
struct tcon_context *conn;
- unsigned int i;
+ uint_t i;
for (conn=smb->tree.connections;conn;conn=conn->next) {
for (i=0;i<conn->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
if (cs->Clear && !process_exists(crec.pid) && (errno == ESRCH)) {
DEBUG(2,("pid %u doesn't exist - deleting connections %d [%s]\n",
- (unsigned int)crec.pid, crec.cnum, crec.name));
+ (uint_t)crec.pid, crec.cnum, crec.name));
if (tdb_delete(the_tdb, kbuf) != 0)
DEBUG(0,("count_fn: tdb_delete failed with error %s\n", tdb_errorstr(tdb) ));
return 0;
DEBUG(10,("register_message_flags: %s flags 0x%x\n",
doreg ? "adding" : "removing",
- (unsigned int)msg_flags ));
+ (uint_t)msg_flags ));
make_conn_key(NULL, "", &kbuf, &key);
}
DEBUG(10,("register_message_flags: new flags 0x%x\n",
- (unsigned int)pcrec->bcast_msg_flags ));
+ (uint_t)pcrec->bcast_msg_flags ));
SAFE_FREE(dbuf.dptr);
return True;
}
DEBUG(10,("register_vuid: allocated vuid = %u\n",
- (unsigned int)smb->users.next_vuid));
+ (uint_t)smb->users.next_vuid));
vuser->vuid = smb->users.next_vuid;
static BOOL rw_torture3(struct cli_state *c, const char *lockfname)
{
int fnum = -1;
- unsigned int i = 0;
+ uint_t i = 0;
char buf[131072];
char buf_rd[131072];
unsigned count;
printf("error: This server appears not to support timed lock requests\n");
}
printf("server slept for %u seconds for a %u second timeout\n",
- (unsigned int)(t2-t1), lock_timeout);
+ (uint_t)(t2-t1), lock_timeout);
if (NT_STATUS_IS_ERR(cli_close(cli1->tree, fnum2))) {
printf("close1 failed (%s)\n", cli_errstr(cli1->tree));
};
struct trunc_open_results {
- unsigned int num;
+ uint_t num;
uint32_t init_attr;
uint32_t trunc_attr;
uint32_t result_attr;
int fnum1;
BOOL correct = True;
uint16_t attr;
- unsigned int i, j, k, l;
+ uint_t i, j, k, l;
int failures = 0;
printf("starting open attr test\n");
printf("[%d] getatr check failed. [0x%x] trunc [0x%x] got attr 0x%x, should be 0x%x\n",
k, open_attrs_table[i],
open_attrs_table[j],
- (unsigned int)attr,
+ (uint_t)attr,
attr_results[l].result_attr);
correct = False;
CHECK_MAX_FAILURES(error_exit);
static void enum_jobs(uint16_t jobid, const char *ownername,
const char *notifyname, const char *datatype,
const char *jparms, uint16_t pos, uint16_t status,
- const char *jstatus, unsigned int submitted, unsigned int jobsize,
+ const char *jstatus, uint_t submitted, uint_t jobsize,
const char *comment)
{
d_printf(" %-23.23s %5d %9d ",
/****************************************************************************
send out one query
****************************************************************************/
-static BOOL query_one(const char *lookup, unsigned int lookup_type)
+static BOOL query_one(const char *lookup, uint_t lookup_type)
{
int j, count, flags = 0;
struct in_addr *ip_list=NULL;
int main(int argc,char *argv[])
{
int opt;
- unsigned int lookup_type = 0x0;
+ uint_t lookup_type = 0x0;
fstring lookup;
extern int optind;
extern char *optarg;