8 * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
9 * Modified for use with AmigaOS by Olaf Barthel <obarthel -at- gmx -dot- net>
15 #define SMB_MAXNAMELEN 255
17 typedef unsigned char byte
;
18 typedef unsigned short word
;
19 typedef unsigned long dword
;
22 * Set/Get values in SMB-byte order
25 #define PVAL(buf,pos) ((unsigned)BVAL(buf,pos))
27 #define BVAL(buf,pos) (((unsigned char *)(buf))[pos])
28 #define WVAL(buf,pos) (((word)PVAL(buf,pos))|((word)PVAL(buf,(pos)+1))<<8)
29 #define DVAL(buf,pos) (((dword)WVAL(buf,pos))|((dword)WVAL(buf,(pos)+2))<<16)
31 #define BSET(buf,pos,val) (BVAL(buf,pos)=((val) & 0xFF))
32 #define WSET(buf,pos,val) do { BVAL(buf,pos)=((val) & 0xFF); BVAL(buf,(pos)+1)=(((unsigned)(val))>>8) & 0xFF; } while (0)
33 #define DSET(buf,pos,val) do { WSET(buf,pos,(val)); WSET(buf,(pos)+2,((unsigned)(val))>>16); } while (0)
35 #define smb_base(buf) ((byte *)(((byte *)(buf))+4))
49 CONN_VALID
, /* everything's fine */
50 CONN_INVALID
, /* Something went wrong, but did not
51 try to reconnect yet. */
52 CONN_RETRIED
/* Tried a reconnection, but was refused */
64 * Contains all relevant data on a SMB networked file.
68 int opened
; /* is it open on the fileserver? */
69 word fileid
; /* What id to handle a file with? */
70 word attr
; /* Attribute fields, DOS value */
73 wtime
, ctime
; /* Times, as seen by the server, normalized */
74 /* to UTC. The ugly conversion happens in */
77 unsigned long size
; /* File size. */
78 char * complete_path
; /* Complete path, MS-DOS notation, with '\' */
79 size_t complete_path_size
; /* Number of bytes allocated for name */
80 int len
; /* Namelength. */
83 #endif /* _LINUX_SMB_H */