Import ncpfs 2.1.1
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
#ifndef _KERNEL_FS_H
|
||||
#define _KERNEL_FS_H
|
||||
|
||||
#include "glibstub.h"
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef _KERNEL_IF_H
|
||||
#define _KERNEL_IF_H
|
||||
|
||||
#include "glibstub.h"
|
||||
#ifdef HAVE_NET_IF_H
|
||||
#include <net/if.h>
|
||||
#else
|
||||
#include <linux/if.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef _KERNEL_IPX_H
|
||||
#define _KERNEL_IPX_H
|
||||
|
||||
#include "glibstub.h"
|
||||
#ifdef HAVE_NETIPX_IPX_H
|
||||
#include <netipx/ipx.h>
|
||||
#else
|
||||
#include <linux/ipx.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* ncp.h
|
||||
*
|
||||
* Copyright (C) 1995 by Volker Lendecke
|
||||
* Modified for sparc by J.F. Chadima
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_NCP_H
|
||||
#define _LINUX_NCP_H
|
||||
|
||||
#include "kernel/types.h"
|
||||
#include "kernel/ipx.h"
|
||||
|
||||
#define NCP_PTYPE (0x11)
|
||||
#define NCP_PORT (0x0451)
|
||||
|
||||
#define NCP_ALLOC_SLOT_REQUEST (0x1111)
|
||||
#define NCP_REQUEST (0x2222)
|
||||
#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
|
||||
|
||||
struct ncp_request_header {
|
||||
u_int16_t type __attribute__((packed));
|
||||
u_int8_t sequence __attribute__((packed));
|
||||
u_int8_t conn_low __attribute__((packed));
|
||||
u_int8_t task __attribute__((packed));
|
||||
u_int8_t conn_high __attribute__((packed));
|
||||
u_int8_t function __attribute__((packed));
|
||||
u_int8_t data[0] __attribute__((packed));
|
||||
};
|
||||
|
||||
#define NCP_REPLY (0x3333)
|
||||
#define NCP_POSITIVE_ACK (0x9999)
|
||||
|
||||
struct ncp_reply_header {
|
||||
__u16 type __attribute__((packed));
|
||||
__u8 sequence __attribute__((packed));
|
||||
__u8 conn_low __attribute__((packed));
|
||||
__u8 task __attribute__((packed));
|
||||
__u8 conn_high __attribute__((packed));
|
||||
__u8 completion_code __attribute__((packed));
|
||||
__u8 connection_state __attribute__((packed));
|
||||
__u8 data[0] __attribute__((packed));
|
||||
};
|
||||
|
||||
#define NCP_VOLNAME_LEN (16)
|
||||
#define NCP_NUMBER_OF_VOLUMES (64)
|
||||
struct ncp_volume_info {
|
||||
__u32 total_blocks;
|
||||
__u32 free_blocks;
|
||||
__u32 purgeable_blocks;
|
||||
__u32 not_yet_purgeable_blocks;
|
||||
__u32 total_dir_entries;
|
||||
__u32 available_dir_entries;
|
||||
__u8 sectors_per_block;
|
||||
char volume_name[NCP_VOLNAME_LEN + 1];
|
||||
};
|
||||
|
||||
/* these define the attribute byte as seen by NCP */
|
||||
#define aRONLY (ntohl(0x01000000))
|
||||
#define aHIDDEN (ntohl(0x02000000))
|
||||
#define aSYSTEM (ntohl(0x04000000))
|
||||
#define aEXECUTE (ntohl(0x08000000))
|
||||
#define aDIR (ntohl(0x10000000))
|
||||
#define aARCH (ntohl(0x20000000))
|
||||
|
||||
#define AR_READ (ntohs(0x0100))
|
||||
#define AR_WRITE (ntohs(0x0200))
|
||||
#define AR_EXCLUSIVE (ntohs(0x2000))
|
||||
|
||||
#define NCP_FILE_ID_LEN 6
|
||||
|
||||
/* Defines for Name Spaces */
|
||||
#define NW_NS_DOS 0
|
||||
#define NW_NS_MAC 1
|
||||
#define NW_NS_NFS 2
|
||||
#define NW_NS_FTAM 3
|
||||
#define NW_NS_OS2 4
|
||||
|
||||
/* Defines for ReturnInformationMask */
|
||||
#define RIM_NAME (ntohl(0x01000000L))
|
||||
#define RIM_SPACE_ALLOCATED (ntohl(0x02000000L))
|
||||
#define RIM_ATTRIBUTES (ntohl(0x04000000L))
|
||||
#define RIM_DATA_SIZE (ntohl(0x08000000L))
|
||||
#define RIM_TOTAL_SIZE (ntohl(0x10000000L))
|
||||
#define RIM_EXT_ATTR_INFO (ntohl(0x20000000L))
|
||||
#define RIM_ARCHIVE (ntohl(0x40000000L))
|
||||
#define RIM_MODIFY (ntohl(0x80000000L))
|
||||
#define RIM_CREATION (ntohl(0x00010000L))
|
||||
#define RIM_OWNING_NAMESPACE (ntohl(0x00020000L))
|
||||
#define RIM_DIRECTORY (ntohl(0x00040000L))
|
||||
#define RIM_RIGHTS (ntohl(0x00080000L))
|
||||
#define RIM_ALL (ntohl(0xFF0F0000L))
|
||||
#define RIM_COMPRESSED_INFO (ntohl(0x00000080L))
|
||||
|
||||
/* open/create modes */
|
||||
#define OC_MODE_OPEN 0x01
|
||||
#define OC_MODE_TRUNCATE 0x02
|
||||
#define OC_MODE_REPLACE 0x02
|
||||
#define OC_MODE_CREATE 0x08
|
||||
|
||||
/* open/create results */
|
||||
#define OC_ACTION_NONE 0x00
|
||||
#define OC_ACTION_OPEN 0x01
|
||||
#define OC_ACTION_CREATE 0x02
|
||||
#define OC_ACTION_TRUNCATE 0x04
|
||||
#define OC_ACTION_REPLACE 0x04
|
||||
|
||||
/* access rights attributes */
|
||||
#ifndef AR_READ_ONLY
|
||||
#define AR_READ_ONLY 0x0001
|
||||
#define AR_WRITE_ONLY 0x0002
|
||||
#define AR_DENY_READ 0x0004
|
||||
#define AR_DENY_WRITE 0x0008
|
||||
#define AR_COMPATIBILITY 0x0010
|
||||
#define AR_WRITE_THROUGH 0x0040
|
||||
#define AR_OPEN_COMPRESSED 0x0100
|
||||
#endif
|
||||
|
||||
struct nw_info_struct {
|
||||
__u32 spaceAlloc __attribute__((packed));
|
||||
__u32 attributes __attribute__((packed));
|
||||
__u16 flags __attribute__((packed));
|
||||
__u32 dataStreamSize __attribute__((packed));
|
||||
__u32 totalStreamSize __attribute__((packed));
|
||||
__u16 numberOfStreams __attribute__((packed));
|
||||
__u16 creationTime __attribute__((packed));
|
||||
__u16 creationDate __attribute__((packed));
|
||||
__u32 creatorID __attribute__((packed));
|
||||
__u16 modifyTime __attribute__((packed));
|
||||
__u16 modifyDate __attribute__((packed));
|
||||
__u32 modifierID __attribute__((packed));
|
||||
__u16 lastAccessDate __attribute__((packed));
|
||||
__u16 archiveTime __attribute__((packed));
|
||||
__u16 archiveDate __attribute__((packed));
|
||||
__u32 archiverID __attribute__((packed));
|
||||
__u16 inheritedRightsMask __attribute__((packed));
|
||||
__u32 dirEntNum __attribute__((packed));
|
||||
__u32 DosDirNum __attribute__((packed));
|
||||
__u32 volNumber __attribute__((packed));
|
||||
__u32 EADataSize __attribute__((packed));
|
||||
__u32 EAKeyCount __attribute__((packed));
|
||||
__u32 EAKeySize __attribute__((packed));
|
||||
__u32 NSCreator __attribute__((packed));
|
||||
__u8 nameLen __attribute__((packed));
|
||||
__u8 entryName[256] __attribute__((packed));
|
||||
};
|
||||
|
||||
/* modify mask - use with MODIFY_DOS_INFO structure */
|
||||
#define DM_ATTRIBUTES (ntohl(0x02000000L))
|
||||
#define DM_CREATE_DATE (ntohl(0x04000000L))
|
||||
#define DM_CREATE_TIME (ntohl(0x08000000L))
|
||||
#define DM_CREATOR_ID (ntohl(0x10000000L))
|
||||
#define DM_ARCHIVE_DATE (ntohl(0x20000000L))
|
||||
#define DM_ARCHIVE_TIME (ntohl(0x40000000L))
|
||||
#define DM_ARCHIVER_ID (ntohl(0x80000000L))
|
||||
#define DM_MODIFY_DATE (ntohl(0x00010000L))
|
||||
#define DM_MODIFY_TIME (ntohl(0x00020000L))
|
||||
#define DM_MODIFIER_ID (ntohl(0x00040000L))
|
||||
#define DM_LAST_ACCESS_DATE (ntohl(0x00080000L))
|
||||
#define DM_INHERITED_RIGHTS_MASK (ntohl(0x00100000L))
|
||||
#define DM_MAXIMUM_SPACE (ntohl(0x00200000L))
|
||||
|
||||
struct nw_modify_dos_info {
|
||||
__u32 attributes __attribute__((packed));
|
||||
__u16 creationDate __attribute__((packed));
|
||||
__u16 creationTime __attribute__((packed));
|
||||
__u32 creatorID __attribute__((packed));
|
||||
__u16 modifyDate __attribute__((packed));
|
||||
__u16 modifyTime __attribute__((packed));
|
||||
__u32 modifierID __attribute__((packed));
|
||||
__u16 archiveDate __attribute__((packed));
|
||||
__u16 archiveTime __attribute__((packed));
|
||||
__u32 archiverID __attribute__((packed));
|
||||
__u16 lastAccessDate __attribute__((packed));
|
||||
__u16 inheritanceGrantMask __attribute__((packed));
|
||||
__u16 inheritanceRevokeMask __attribute__((packed));
|
||||
__u32 maximumSpace __attribute__((packed));
|
||||
};
|
||||
|
||||
struct nw_file_info {
|
||||
struct nw_info_struct i;
|
||||
int opened;
|
||||
int access;
|
||||
__u32 server_file_handle __attribute__((packed));
|
||||
__u8 open_create_action __attribute__((packed));
|
||||
__u8 file_handle[6] __attribute__((packed));
|
||||
};
|
||||
|
||||
struct nw_search_sequence {
|
||||
__u8 volNumber __attribute__((packed));
|
||||
__u32 dirBase __attribute__((packed));
|
||||
__u32 sequence __attribute__((packed));
|
||||
};
|
||||
|
||||
#endif /* _LINUX_NCP_H */
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* ncp_fs.h
|
||||
*
|
||||
* Copyright (C) 1995, 1996 by Volker Lendecke
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _KERNEL_NCP_FS_H
|
||||
#define _KERNEL_NCP_FS_H
|
||||
|
||||
#include "kernel/fs.h"
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* ioctl commands
|
||||
*/
|
||||
|
||||
struct ncp_ioctl_request {
|
||||
unsigned int function;
|
||||
unsigned int size;
|
||||
char *data;
|
||||
};
|
||||
|
||||
struct ncp_fs_info {
|
||||
int version;
|
||||
struct sockaddr_ipx addr;
|
||||
__kerXX_uid_t mounted_uid;
|
||||
int connection; /* Connection number the server assigned us */
|
||||
int buffer_size; /* The negotiated buffer size, to be
|
||||
used for read/write requests! */
|
||||
|
||||
int volume_number;
|
||||
__u32 directory_id;
|
||||
};
|
||||
|
||||
struct ncp_sign_init
|
||||
{
|
||||
char sign_root[8];
|
||||
char sign_last[16];
|
||||
};
|
||||
|
||||
struct ncp_lock_ioctl
|
||||
{
|
||||
#define NCP_LOCK_LOG 0
|
||||
#define NCP_LOCK_SH 1
|
||||
#define NCP_LOCK_EX 2
|
||||
#define NCP_LOCK_CLEAR 256
|
||||
int cmd;
|
||||
int origin;
|
||||
unsigned int offset;
|
||||
unsigned int length;
|
||||
#define NCP_LOCK_DEFAULT_TIMEOUT 18
|
||||
#define NCP_LOCK_MAX_TIMEOUT 180
|
||||
int timeout;
|
||||
};
|
||||
|
||||
struct ncp_setroot_ioctl
|
||||
{
|
||||
int volNumber;
|
||||
int namespace;
|
||||
__u32 dirEntNum;
|
||||
};
|
||||
|
||||
#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
|
||||
#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_uid_t)
|
||||
#define NCP_IOC_CONN_LOGGED_IN _IO('n', 3)
|
||||
|
||||
#define NCP_GET_FS_INFO_VERSION (1)
|
||||
#define NCP_IOC_GET_FS_INFO _IOWR('n', 4, struct ncp_fs_info)
|
||||
|
||||
#define NCP_IOC_SIGN_INIT _IOR('n', 5, struct ncp_sign_init)
|
||||
#define NCP_IOC_SIGN_WANTED _IOR('n', 6, int)
|
||||
#define NCP_IOC_SET_SIGN_WANTED _IOW('n', 6, int)
|
||||
|
||||
#define NCP_IOC_LOCKUNLOCK _IOR('n', 7, struct ncp_lock_ioctl)
|
||||
|
||||
#define NCP_IOC_GETROOT _IOW('n', 8, struct ncp_setroot_ioctl)
|
||||
#define NCP_IOC_SETROOT _IOR('n', 8, struct ncp_setroot_ioctl)
|
||||
/*
|
||||
* The packet size to allocate. One page should be enough.
|
||||
*/
|
||||
#define NCP_PACKET_SIZE 4070
|
||||
|
||||
#define NCP_MAXPATHLEN 255
|
||||
#define NCP_MAXNAMELEN 14
|
||||
|
||||
#endif /* _LINUX_NCP_FS_H */
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef __KERNEL_ROUTE_H__
|
||||
#define __KERNEL_ROUTE_H__
|
||||
|
||||
#include "glibstub.h"
|
||||
#ifdef HAVE_NET_ROUTE_H
|
||||
#include <net/route.h>
|
||||
#else
|
||||
#include <linux/route.h>
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL_ROUTE_H__ */
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#ifndef __KERNEL_TYPES_H__
|
||||
#define __KERNEL_TYPES_H__
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#undef __u8
|
||||
#undef __u16
|
||||
#undef __u32
|
||||
#define __u8 u_int8_t
|
||||
#define __u16 u_int16_t
|
||||
#define __u32 u_int32_t
|
||||
|
||||
typedef u_int16_t __kerXX_uid_t;
|
||||
|
||||
#include <asm/posix_types.h>
|
||||
|
||||
typedef __kernel_pid_t __ker20_pid_t;
|
||||
typedef __kernel_uid_t __ker20_uid_t;
|
||||
typedef __kernel_gid_t __ker20_gid_t;
|
||||
typedef __kernel_mode_t __ker20_mode_t;
|
||||
|
||||
typedef __kernel_pid_t __ker21_pid_t;
|
||||
typedef __kernel_uid_t __ker21_uid_t;
|
||||
typedef __kernel_gid_t __ker21_gid_t;
|
||||
typedef __kernel_mode_t __ker21_mode_t;
|
||||
|
||||
#ifdef __GLIBC__
|
||||
/* why is this defined in posix_types ???? dirty hack... */
|
||||
#undef __FD_CLR
|
||||
#undef __FD_SET
|
||||
#undef __FD_ISSET
|
||||
#undef __FD_ZERO
|
||||
#ifdef _SELECTBITS_H
|
||||
#undef _SELECTBITS_H
|
||||
#include <selectbits.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL_TYPES_H__ */
|
||||
|
||||
Reference in New Issue
Block a user