File: ncp_fs_sb.h

package info (click to toggle)
kernel-source-2.0.38 2.0.38-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 34,660 kB
  • ctags: 102,964
  • sloc: ansic: 632,204; asm: 26,444; makefile: 4,286; sh: 1,276; perl: 761; tcl: 408; cpp: 277; lisp: 211; awk: 134
file content (83 lines) | stat: -rw-r--r-- 2,078 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 *  ncp_fs_sb.h
 *
 *  Copyright (C) 1995, 1996 by Volker Lendecke
 *
 */

#ifndef _NCP_FS_SB
#define _NCP_FS_SB

#include <linux/ncp_mount.h>
#include <linux/types.h>

#ifdef __KERNEL__

#define NCP_DEFAULT_BUFSIZE 1024
#define NCP_DEFAULT_OPTIONS 0		/* 2 for packet signatures */

struct ncp_server {

	struct ncp_mount_data m; /* Nearly all of the mount data is of
				    interest for us later, so we store
				    it completely. */

	__u8 name_space[NCP_NUMBER_OF_VOLUMES];

	struct file *ncp_filp;	/* File pointer to ncp socket */
	struct file *wdog_filp;	/* File pointer to wdog socket */
	struct file *msg_filp;	/* File pointer to message socket */
	void *data_ready;	/* The wdog socket gets a new
				   data_ready callback. We store the
				   old one for checking purposes and
				   to reset it on unmounting. */

	u8         sequence;
	u8         task;
	u16        connection;	/* Remote connection number */

	u8         completion;	/* Status message from server */
	u8         conn_status;	/* Bit 4 = 1 ==> Server going down, no
				   requests allowed anymore.
				   Bit 0 = 1 ==> Server is down. */

	int        buffer_size;	/* Negotiated bufsize */

	int        reply_size;	/* Size of last reply */

	int        packet_size;
	unsigned char *packet;	/* Here we prepare requests and
				   receive replies */

	int        lock;	/* To prevent mismatch in protocols. */
	struct wait_queue *wait;

	int        current_size; /* for packet preparation */
	int        has_subfunction;
	int        ncp_reply_size;

        struct ncp_inode_info root;
	char       root_path;	/* '\0' */

/* info for packet signing */
	int sign_wanted;        /* 1=Server needs signed packets */
	int sign_active;        /* 0=don't do signing, 1=do */
	char sign_root[8];	/* generated from password and encr. key */
	char sign_last[16];	
};

static inline int
ncp_conn_valid(struct ncp_server *server)
{
	return ((server->conn_status & 0x11) == 0);
}

static inline void
ncp_invalidate_conn(struct ncp_server *server)
{
	server->conn_status |= 0x01;
}

#endif /* __KERNEL__ */

#endif