tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / network / smbfs / source_code / include / smb / smb.h
blob6faa42def21afa7f7184e22f4bc09eaab91ba453
1 /*
2 * $Id$
4 * :ts=4
6 * smb.h
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>
12 #ifndef _LINUX_SMB_H
13 #define _LINUX_SMB_H
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))
37 enum smb_protocol
39 PROTOCOL_NONE,
40 PROTOCOL_CORE,
41 PROTOCOL_COREPLUS,
42 PROTOCOL_LANMAN1,
43 PROTOCOL_LANMAN2,
44 PROTOCOL_NT1
47 enum smb_conn_state
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 */
55 struct smb_dskattr
57 word total;
58 word allocblocks;
59 word blocksize;
60 word free;
64 * Contains all relevant data on a SMB networked file.
66 struct smb_dirent
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 */
72 time_t atime, mtime,
73 wtime, ctime; /* Times, as seen by the server, normalized */
74 /* to UTC. The ugly conversion happens in */
75 /* proc.c */
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 */