OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [smb.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 *  smb.h
3
 *
4
 *  Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
5
 *
6
 */
7
 
8
#ifndef _LINUX_SMB_H
9
#define _LINUX_SMB_H
10
 
11
#define SMB_PORT 139
12
#define SMB_MAXNAMELEN 255
13
#define SMB_MAXPATHLEN 1024
14
 
15
#define SMB_DEF_MAX_XMIT 32768
16
 
17
/* Allocate max. 1 page */
18
#define TRANS2_MAX_TRANSFER (4096-17)
19
 
20
#include <asm/types.h>
21
#ifdef __KERNEL__
22
typedef u8  byte;
23
typedef u16 word;
24
typedef u32 dword;
25
#else
26
typedef unsigned char byte;
27
typedef unsigned short word;
28
typedef unsigned long dword;
29
#endif
30
 
31
/* The following macros have been taken directly from Samba. Thanks,
32
   Andrew! */
33
 
34
#undef CAREFUL_ALIGNMENT
35
 
36
/* we know that the 386 can handle misalignment and has the "right"
37
   byteorder */
38
#if defined(__i386__)
39
#define CAREFUL_ALIGNMENT 0
40
#endif
41
 
42
#ifndef CAREFUL_ALIGNMENT
43
#define CAREFUL_ALIGNMENT 1
44
#endif
45
 
46
#define BVAL(buf,pos) (((u8 *)(buf))[pos])
47
#define PVAL(buf,pos) ((unsigned)BVAL(buf,pos))
48
#define BSET(buf,pos,val) (BVAL(buf,pos) = (val))
49
 
50
 
51
#if CAREFUL_ALIGNMENT
52
#define WVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
53
#define DVAL(buf,pos) (WVAL(buf,pos)|WVAL(buf,(pos)+2)<<16)
54
 
55
#define SSVALX(buf,pos,val) (BVAL(buf,pos)=(val)&0xFF,BVAL(buf,pos+1)=(val)>>8)
56
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
57
#define WSET(buf,pos,val) { word __val = (val); \
58
        SSVALX((buf),(pos),((word)(__val))); }
59
#define DSET(buf,pos,val) { dword __val = (val); \
60
        SIVALX((buf),(pos),((dword)(__val))); }
61
#else
62
/* this handles things for architectures like the 386 that can handle
63
   alignment errors */
64
/*
65
   WARNING: This section is dependent on the length of word and dword
66
   being correct
67
*/
68
#define WVAL(buf,pos) (*(word *)((char *)(buf) + (pos)))
69
#define DVAL(buf,pos) (*(dword *)((char *)(buf) + (pos)))
70
#define WSET(buf,pos,val) WVAL(buf,pos)=((word)(val))
71
#define DSET(buf,pos,val) DVAL(buf,pos)=((dword)(val))
72
#endif
73
 
74
 
75
/* where to find the base of the SMB packet proper */
76
#define smb_base(buf) ((byte *)(((byte *)(buf))+4))
77
 
78
#define LANMAN1
79
#define LANMAN2
80
#define NT1
81
 
82
enum smb_protocol {
83
        PROTOCOL_NONE,
84
        PROTOCOL_CORE,
85
        PROTOCOL_COREPLUS,
86
        PROTOCOL_LANMAN1,
87
        PROTOCOL_LANMAN2,
88
        PROTOCOL_NT1
89
};
90
 
91
enum smb_case_hndl {
92
        CASE_DEFAULT,
93
        CASE_LOWER,
94
        CASE_UPPER
95
};
96
 
97
#ifdef __KERNEL__
98
 
99
enum smb_conn_state {
100
        CONN_VALID,             /* everything's fine */
101
        CONN_INVALID,           /* Something went wrong, but did not
102
                                   try to reconnect yet. */
103
        CONN_RETRIED            /* Tried a reconnection, but was refused */
104
};
105
 
106
struct smb_dskattr {
107
        word total;
108
        word allocblocks;
109
        word blocksize;
110
        word free;
111
};
112
 
113
/*
114
 * Contains all relevant data on a SMB networked file.
115
 */
116
struct smb_dirent {
117
 
118
        unsigned long   f_ino;
119
        umode_t         f_mode;
120
        nlink_t         f_nlink;
121
        uid_t           f_uid;
122
        gid_t           f_gid;
123
        kdev_t          f_rdev;
124
        off_t           f_size;
125
        time_t          f_atime;
126
        time_t          f_mtime;
127
        time_t          f_ctime;
128
        unsigned long   f_blksize;
129
        unsigned long   f_blocks;
130
 
131
        int             opened; /* is it open on the fileserver? */
132
        word            fileid; /* What id to handle a file with? */
133
        word            attr;   /* Attribute fields, DOS value */
134
 
135
        unsigned short  access; /* Access bits. */
136
        unsigned long   f_pos;  /* File position. (For readdir.) */
137
        unsigned char   name[SMB_MAXNAMELEN+1];
138
        int             len;    /* namelength */
139
};
140
 
141
#endif  /* __KERNEL__ */
142
#endif  /* _LINUX_SMB_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.