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>
10 * Modified for supporting SMBlockingX packets by Peter Riede <Noster-Riede -at- T-Online -dot- de>
13 #ifndef _LINUX_SMB_FS_H
14 #define _LINUX_SMB_FS_H
18 #include <smb/smb_mount.h>
19 #include <smb/smb_fs_sb.h>
21 #include <netinet/in.h>
23 #define SMB_HEADER_LEN 37 /* includes everything up to, but not
26 /* This structure is used to pass the arguments to smb_proc_lockingX
30 off_t offset
; /* offset to first byte to be (un)locked */
31 long len
; /* bytesize of the block */
34 /* Macros to get at offsets within smb_lkrng and smb_unlkrng
35 structures. We cannot define these as actual structures
36 due to possible differences in structure packing
37 on different machines/compilers. */
39 #define SMB_LPID_OFFSET(indx) (10 * (indx))
40 #define SMB_LKOFF_OFFSET(indx) ( 2 + (10 * (indx)))
41 #define SMB_LKLEN_OFFSET(indx) ( 6 + (10 * (indx)))
42 #define SMB_LARGE_LKOFF_OFFSET_HIGH(indx) (4 + (20 * (indx)))
43 #define SMB_LARGE_LKOFF_OFFSET_LOW(indx) (8 + (20 * (indx)))
44 #define SMB_LARGE_LKLEN_OFFSET_HIGH(indx) (12 + (20 * (indx)))
45 #define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx)))
47 /*****************************************************************************/
50 byte
*smb_encode_smb_length(byte
*p
, dword len
);
51 dword
smb_len(const byte
*packet
);
52 int smb_proc_open(struct smb_server
*server
, const char *pathname
, int len
, struct smb_dirent
*entry
);
53 int smb_proc_close(struct smb_server
*server
, word fileid
, dword mtime
);
54 int smb_proc_read(struct smb_server
*server
, struct smb_dirent
*finfo
, off_t offset
, long count
, char *data
, int fs
);
55 int smb_proc_read_raw(struct smb_server
*server
, struct smb_dirent
*finfo
, off_t offset
, long count
, char *data
);
56 int smb_proc_write (struct smb_server
*server
, struct smb_dirent
*finfo
, off_t offset
, long count
, const char *data
);
57 int smb_proc_write_raw(struct smb_server
*server
, struct smb_dirent
*finfo
, off_t offset
, long count
, const char *data
);
58 int smb_proc_lseek (struct smb_server
*server
, struct smb_dirent
*finfo
, off_t offset
, int mode
, off_t
* new_position_ptr
);
59 int smb_proc_lockingX (struct smb_server
*server
, struct smb_dirent
*finfo
, struct smb_lkrng
*locks
, int num_entries
, int mode
, long timeout
);
60 int smb_proc_create(struct smb_server
*server
, const char *path
, int len
, struct smb_dirent
*entry
);
61 int smb_proc_mv(struct smb_server
*server
, const char *opath
, const int olen
, const char *npath
, const int nlen
);
62 int smb_proc_mkdir(struct smb_server
*server
, const char *path
, const int len
);
63 int smb_proc_rmdir(struct smb_server
*server
, const char *path
, const int len
);
64 int smb_proc_unlink(struct smb_server
*server
, const char *path
, const int len
);
65 int smb_proc_trunc(struct smb_server
*server
, word fid
, dword length
);
66 int smb_proc_readdir(struct smb_server
*server
, char *path
, int fpos
, int cache_size
, struct smb_dirent
*entry
);
67 int smb_proc_getattr_core(struct smb_server
*server
, const char *path
, int len
, struct smb_dirent
*entry
);
68 int smb_proc_getattrE(struct smb_server
*server
, struct smb_dirent
*entry
);
69 int smb_proc_setattr_core(struct smb_server
*server
, const char *path
, int len
, struct smb_dirent
*new_finfo
);
70 int smb_proc_setattrE(struct smb_server
*server
, word fid
, struct smb_dirent
*new_entry
);
71 int smb_proc_dskattr (struct smb_server
*server
, struct smb_dskattr
*attr
);
72 int smb_proc_connect(struct smb_server
*server
);
75 int smb_receive (struct smb_server
*server
, int sock_fd
);
76 int smb_catch_keepalive(struct smb_server
*server
);
77 int smb_dont_catch_keepalive(struct smb_server
*server
);
78 int smb_release(struct smb_server
*server
);
79 int smb_connect(struct smb_server
*server
);
80 int smb_request(struct smb_server
*server
);
81 int smb_trans2_request(struct smb_server
*server
, int *data_len
, int *param_len
, char **data
, char **param
);
82 int smb_request_read_raw(struct smb_server
*server
, unsigned char *target
, int max_len
);
83 int smb_request_write_raw(struct smb_server
*server
, unsigned const char *source
, int length
);
85 #endif /* _LINUX_SMB_FS_H */