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