Import ncpfs 2.0.9

This commit is contained in:
ncpfs archive import
2026-04-28 20:39:58 +02:00
parent fff159f2db
commit f88460b2e6
50 changed files with 3616 additions and 3076 deletions

View File

@@ -16,25 +16,25 @@ typedef long errcode_t;
#include <stdarg.h>
/* ANSI C -- use prototypes etc */
void com_err (const char *, long, const char *, ...);
void com_err_va (const char *whoami, errcode_t code, const char *fmt,
va_list args);
char const *error_message (long);
void com_err(const char *, long, const char *,...);
void com_err_va(const char *whoami, errcode_t code, const char *fmt,
va_list args);
char const *error_message(long);
extern void (*com_err_hook) (const char *, long, const char *, va_list);
void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
(const char *, long, const char *, va_list);
void (*reset_com_err_hook (void)) (const char *, long, const char *, va_list);
int init_error_table(const char * const *msgs, int base, int count);
void (*set_com_err_hook(void (*)(const char *, long, const char *, va_list)))
(const char *, long, const char *, va_list);
void (*reset_com_err_hook(void)) (const char *, long, const char *, va_list);
int init_error_table(const char *const *msgs, int base, int count);
#else
/* no prototypes */
void com_err ();
void com_err_va ();
char *error_message ();
void com_err();
void com_err_va();
char *error_message();
extern void (*com_err_hook) ();
void (*set_com_err_hook ()) ();
void (*reset_com_err_hook ()) ();
void (*set_com_err_hook()) ();
void (*reset_com_err_hook()) ();
int init_error_table();
#endif
#define __COM_ERR_H
#endif /* ! defined(__COM_ERR_H) */
#endif /* ! defined(__COM_ERR_H) */

View File

@@ -15,9 +15,9 @@
#include <linux/ipx.h>
#include <stdio.h>
typedef unsigned long IPXNet;
typedef unsigned long IPXNet;
typedef unsigned short IPXPort;
typedef unsigned char IPXNode[IPX_NODE_LEN];
typedef unsigned char IPXNode[IPX_NODE_LEN];
#define IPX_USER_PTYPE (0x00)
#define IPX_RIP_PTYPE (0x01)
@@ -33,30 +33,35 @@ typedef unsigned char IPXNode[IPX_NODE_LEN];
#define IPX_SAP_FILE_SERVER (0x0004)
struct sap_query {
unsigned short query_type; /* net order */
unsigned short server_type; /* net order */
struct sap_query
{
unsigned short query_type; /* net order */
unsigned short server_type; /* net order */
};
struct sap_server_ident {
unsigned short server_type __attribute__ ((packed));
char server_name[48] __attribute__ ((packed));
IPXNet server_network __attribute__ ((packed));
IPXNode server_node __attribute__ ((packed));
IPXPort server_port __attribute__ ((packed));
unsigned short intermediate_network __attribute__ ((packed));
struct sap_server_ident
{
unsigned short server_type __attribute__((packed));
char server_name[48] __attribute__((packed));
IPXNet server_network __attribute__((packed));
IPXNode server_node __attribute__((packed));
IPXPort server_port __attribute__((packed));
unsigned short intermediate_network __attribute__((packed));
};
#define IPX_RIP_REQUEST (0x1)
#define IPX_RIP_RESPONSE (0x2)
struct ipx_rip_packet {
__u16 operation __attribute__ ((packed));
struct ipx_rt_def {
__u32 network __attribute__ ((packed));
__u16 hops __attribute__ ((packed));
__u16 ticks __attribute__ ((packed));
} rt[1] __attribute__ ((packed));
struct ipx_rip_packet
{
__u16 operation __attribute__((packed));
struct ipx_rt_def
{
__u32 network __attribute__((packed));
__u16 hops __attribute__((packed));
__u16 ticks __attribute__((packed));
}
rt[1] __attribute__((packed));
};
#define IPX_BROADCAST_NODE ("\xff\xff\xff\xff\xff\xff")
@@ -68,26 +73,26 @@ struct ipx_rip_packet {
#endif
void
ipx_print_node(IPXNode node);
ipx_print_node(IPXNode node);
void
ipx_print_network(IPXNet net);
ipx_print_network(IPXNet net);
void
ipx_print_port(IPXPort port);
ipx_print_port(IPXPort port);
void
ipx_print_saddr(struct sockaddr_ipx* sipx);
ipx_print_saddr(struct sockaddr_ipx *sipx);
void
ipx_fprint_node(FILE *file, IPXNode node);
ipx_fprint_node(FILE * file, IPXNode node);
void
ipx_fprint_network(FILE *file, IPXNet net);
ipx_fprint_network(FILE * file, IPXNet net);
void
ipx_fprint_port(FILE *file, IPXPort port);
ipx_fprint_port(FILE * file, IPXPort port);
void
ipx_fprint_saddr(FILE *file, struct sockaddr_ipx* sipx);
ipx_fprint_saddr(FILE * file, struct sockaddr_ipx *sipx);
int
ipx_sscanf_node(char *buf, unsigned char node[IPX_NODE_LEN]);
ipx_sscanf_node(char *buf, unsigned char node[IPX_NODE_LEN]);
void
ipx_assign_node(IPXNode dest, IPXNode src);
ipx_assign_node(IPXNode dest, IPXNode src);
int
ipx_node_equal(IPXNode n1,IPXNode n2);
ipx_node_equal(IPXNode n1, IPXNode n2);
#endif /* _IPXLIB_H */
#endif /* _IPXLIB_H */

View File

@@ -19,26 +19,115 @@
#include "ipxlib.h"
#include "com_err.h"
typedef __u8 byte;
typedef __u16 word;
typedef __u32 dword;
#ifndef memzero
#include <string.h>
#define memzero(object) memset(&(object), 0, sizeof(object))
#endif
void
str_upper(char *name);
#define BVAL(buf,pos) (((__u8 *)(buf))[pos])
#define PVAL(buf,pos) ((unsigned)BVAL(buf,pos))
#define BSET(buf,pos,val) (BVAL(buf,pos) = (val))
enum connect_state {
static inline word
WVAL_HL(__u8 * buf, int pos)
{
return PVAL(buf, pos) << 8 | PVAL(buf, pos + 1);
}
static inline dword
DVAL_HL(__u8 * buf, int pos)
{
return WVAL_HL(buf, pos) << 16 | WVAL_HL(buf, pos + 2);
}
static inline void
WSET_HL(__u8 * buf, int pos, word val)
{
BSET(buf, pos, val >> 8);
BSET(buf, pos + 1, val & 0xff);
}
static inline void
DSET_HL(__u8 * buf, int pos, dword val)
{
WSET_HL(buf, pos, val >> 16);
WSET_HL(buf, pos + 2, val & 0xffff);
}
/* we know that the 386 can handle misalignment and has the "right"
byteorder */
#if defined(__i386__)
static inline word
WVAL_LH(__u8 * buf, int pos)
{
return *((word *) (buf + pos));
}
static inline dword
DVAL_LH(__u8 * buf, int pos)
{
return *((dword *) (buf + pos));
}
static inline void
WSET_LH(__u8 * buf, int pos, word val)
{
*((word *) (buf + pos)) = val;
}
static inline void
DSET_LH(__u8 * buf, int pos, dword val)
{
*((dword *) (buf + pos)) = val;
}
#else
static inline word
WVAL_LH(__u8 * buf, int pos)
{
return PVAL(buf, pos) | PVAL(buf, pos + 1) << 8;
}
static inline dword
DVAL_LH(__u8 * buf, int pos)
{
return WVAL_LH(buf, pos) | WVAL_LH(buf, pos + 2) << 16;
}
static inline void
WSET_LH(__u8 * buf, int pos, word val)
{
BSET(buf, pos, val & 0xff);
BSET(buf, pos + 1, val >> 8);
}
static inline void
DSET_LH(__u8 * buf, int pos, dword val)
{
WSET_LH(buf, pos, val & 0xffff);
WSET_LH(buf, pos + 2, val >> 16);
}
#endif
void
str_upper(char *name);
enum connect_state
{
NOT_CONNECTED = 0,
CONN_PERMANENT,
CONN_TEMPORARY
};
struct ncp_conn {
struct ncp_conn
{
enum connect_state is_connected;
char server[NCP_BINDERY_NAME_LEN];
char user [NCP_BINDERY_NAME_LEN];
char user[NCP_BINDERY_NAME_LEN];
struct ncp_fs_info i;
@@ -66,7 +155,8 @@ struct ncp_conn {
char packet[NCP_PACKET_SIZE];
};
struct ncp_conn_spec {
struct ncp_conn_spec
{
char server[NCP_BINDERY_NAME_LEN];
char user[NCP_BINDERY_NAME_LEN];
uid_t uid;
@@ -74,12 +164,14 @@ struct ncp_conn_spec {
char password[NCP_BINDERY_NAME_LEN];
};
struct ncp_search_seq {
struct ncp_search_seq
{
struct nw_search_sequence s;
int namespace;
};
struct ncp_property_info {
struct ncp_property_info
{
__u8 property_name[16];
__u8 property_flags;
__u8 property_security;
@@ -94,46 +186,47 @@ struct ncp_property_info {
from the list. It was designed after the X Windows init
functions. */
struct ncp_conn *
ncp_initialize(int *argc, char **argv,
int login_necessary, long *err);
ncp_initialize(int *argc, char **argv,
int login_necessary, long *err);
/* You can login as another object by this procedure. As a first use
pserver comes to mind. */
struct ncp_conn *
ncp_initialize_as(int *argc, char **argv,
int login_necessary, int login_type, long *err);
ncp_initialize_as(int *argc, char **argv,
int login_necessary, int login_type, long *err);
/* Open a connection */
struct ncp_conn *
ncp_open(const struct ncp_conn_spec *spec, long *err);
ncp_open(const struct ncp_conn_spec *spec, long *err);
/* Open a connection on an existing mount point */
struct ncp_conn *
ncp_open_mount(const char *mount_point, long *err);
ncp_open_mount(const char *mount_point, long *err);
/* Find a permanent connection that fits the spec, return NULL if
* there is none. */
char *
ncp_find_permanent(const struct ncp_conn_spec *spec);
ncp_find_permanent(const struct ncp_conn_spec *spec);
/* Find the address of a file server */
struct sockaddr_ipx *
ncp_find_fileserver(const char *server_name, long *err);
ncp_find_fileserver(const char *server_name, long *err);
/* Find the address of a server */
struct sockaddr_ipx *
ncp_find_server(const char **server_name, int type, long *err);
ncp_find_server(const char **server_name, int type, long *err);
/* Detach from a permanent connection or destroy a temporary
connection */
long
ncp_close(struct ncp_conn *conn);
ncp_close(struct ncp_conn *conn);
/* like getmntent, get_ncp_conn_ent scans /etc/mtab for usable
connections */
struct ncp_conn_ent {
struct ncp_conn_ent
{
char server[NCP_BINDERY_NAME_LEN];
char user[NCP_BINDERY_NAME_LEN];
uid_t uid;
@@ -141,7 +234,7 @@ struct ncp_conn_ent {
};
struct ncp_conn_ent *
ncp_get_conn_ent(FILE *filep);
ncp_get_conn_ent(FILE * filep);
#define NWCLIENT (".nwclient")
#define NWC_NOPASSWORD ("-")
@@ -149,165 +242,168 @@ ncp_get_conn_ent(FILE *filep);
/* find an appropriate connection */
struct ncp_conn_spec *
ncp_find_conn_spec(const char *server, const char *user, const char *password,
int login_necessary, uid_t uid, long *err);
ncp_find_conn_spec(const char *server, const char *user, const char *password,
int login_necessary, uid_t uid, long *err);
long
ncp_get_file_server_description_strings(struct ncp_conn *conn,
char target[512]);
ncp_get_file_server_description_strings(struct ncp_conn *conn,
char target[512]);
long
ncp_get_file_server_time(struct ncp_conn *conn, time_t *target);
ncp_get_file_server_time(struct ncp_conn *conn, time_t * target);
long
ncp_set_file_server_time(struct ncp_conn *conn, time_t *source);
ncp_set_file_server_time(struct ncp_conn *conn, time_t * source);
struct ncp_file_server_info {
__u8 ServerName[48] __attribute__ ((packed));
__u8 FileServiceVersion __attribute__ ((packed));
__u8 FileServiceSubVersion __attribute__ ((packed));
__u16 MaximumServiceConnections __attribute__ ((packed));
__u16 ConnectionsInUse __attribute__ ((packed));
__u16 NumberMountedVolumes __attribute__ ((packed));
__u8 Revision __attribute__ ((packed));
__u8 SFTLevel __attribute__ ((packed));
__u8 TTSLevel __attribute__ ((packed));
__u16 MaxConnectionsEverUsed __attribute__ ((packed));
__u8 AccountVersion __attribute__ ((packed));
__u8 VAPVersion __attribute__ ((packed));
__u8 QueueVersion __attribute__ ((packed));
__u8 PrintVersion __attribute__ ((packed));
__u8 VirtualConsoleVersion __attribute__ ((packed));
__u8 RestrictionLevel __attribute__ ((packed));
__u8 InternetBridge __attribute__ ((packed));
__u8 Reserved[60] __attribute__ ((packed));
struct ncp_file_server_info
{
__u8 ServerName[48] __attribute__((packed));
__u8 FileServiceVersion __attribute__((packed));
__u8 FileServiceSubVersion __attribute__((packed));
__u16 MaximumServiceConnections __attribute__((packed));
__u16 ConnectionsInUse __attribute__((packed));
__u16 NumberMountedVolumes __attribute__((packed));
__u8 Revision __attribute__((packed));
__u8 SFTLevel __attribute__((packed));
__u8 TTSLevel __attribute__((packed));
__u16 MaxConnectionsEverUsed __attribute__((packed));
__u8 AccountVersion __attribute__((packed));
__u8 VAPVersion __attribute__((packed));
__u8 QueueVersion __attribute__((packed));
__u8 PrintVersion __attribute__((packed));
__u8 VirtualConsoleVersion __attribute__((packed));
__u8 RestrictionLevel __attribute__((packed));
__u8 InternetBridge __attribute__((packed));
__u8 Reserved[60] __attribute__((packed));
};
long
ncp_get_file_server_information(struct ncp_conn *conn,
struct ncp_file_server_info *target);
ncp_get_file_server_information(struct ncp_conn *conn,
struct ncp_file_server_info *target);
long
ncp_get_connlist(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
int *returned_no, __u8 conn_numbers[256]);
ncp_get_connlist(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
int *returned_no, __u8 conn_numbers[256]);
long
ncp_get_stations_logged_info(struct ncp_conn *conn,
__u32 connection,
struct ncp_bindery_object *target,
time_t *login_time);
ncp_get_stations_logged_info(struct ncp_conn *conn,
__u32 connection,
struct ncp_bindery_object *target,
time_t * login_time);
long
ncp_get_internet_address(struct ncp_conn *conn,
__u32 connection,
struct sockaddr_ipx *target,
__u8 *conn_type);
ncp_get_internet_address(struct ncp_conn *conn,
__u32 connection,
struct sockaddr_ipx *target,
__u8 * conn_type);
long
ncp_send_broadcast(struct ncp_conn *conn,
__u8 no_conn, const __u8 *connections,
const char *message);
ncp_send_broadcast(struct ncp_conn *conn,
__u8 no_conn, const __u8 * connections,
const char *message);
long
ncp_get_encryption_key(struct ncp_conn *conn,
char *target);
ncp_get_encryption_key(struct ncp_conn *conn,
char *target);
long
ncp_get_bindery_object_id(struct ncp_conn *conn,
__u16 object_type,
const char *object_name,
struct ncp_bindery_object *target);
long
ncp_get_bindery_object_name(struct ncp_conn *conn,
__u32 object_id,
struct ncp_bindery_object *target);
long
ncp_scan_bindery_object(struct ncp_conn *conn,
__u32 last_id, __u16 object_type, char *search_string,
struct ncp_bindery_object *target);
long
ncp_create_bindery_object(struct ncp_conn *conn,
__u16 object_type,
const char *object_name,
__u8 object_security,
__u8 object_status);
long
ncp_delete_bindery_object(struct ncp_conn *conn,
__u16 object_type,
const char *object_name);
long
ncp_change_object_security(struct ncp_conn *conn,
ncp_get_bindery_object_id(struct ncp_conn *conn,
__u16 object_type,
const char *object_name,
__u8 security);
struct ncp_bindery_object *target);
long
ncp_get_bindery_object_name(struct ncp_conn *conn,
__u32 object_id,
struct ncp_bindery_object *target);
long
ncp_scan_bindery_object(struct ncp_conn *conn,
__u32 last_id, __u16 object_type, char *search_string,
struct ncp_bindery_object *target);
long
ncp_create_bindery_object(struct ncp_conn *conn,
__u16 object_type,
const char *object_name,
__u8 object_security,
__u8 object_status);
long
ncp_delete_bindery_object(struct ncp_conn *conn,
__u16 object_type,
const char *object_name);
struct ncp_station_addr {
__u32 NetWork __attribute__ ((packed));
__u8 Node[6] __attribute__ ((packed));
__u16 Socket __attribute__ ((packed));
long
ncp_change_object_security(struct ncp_conn *conn,
__u16 object_type,
const char *object_name,
__u8 security);
struct ncp_station_addr
{
__u32 NetWork __attribute__((packed));
__u8 Node[6] __attribute__((packed));
__u16 Socket __attribute__((packed));
};
struct ncp_prop_login_control {
__u8 AccountExpireDate[3] __attribute__ ((packed));
__u8 Disabled __attribute__ ((packed));
__u8 PasswordExpireDate[3] __attribute__ ((packed));
__u8 GraceLogins __attribute__ ((packed));
__u16 PasswordExpireInterval __attribute__ ((packed));
__u8 MaxGraceLogins __attribute__ ((packed));
__u8 MinPasswordLength __attribute__ ((packed));
__u16 MaxConnections __attribute__ ((packed));
__u8 ConnectionTimeMask[42] __attribute__ ((packed));
__u8 LastLogin[6] __attribute__ ((packed));
__u8 RestrictionMask __attribute__ ((packed));
__u8 reserved __attribute__ ((packed));
__u32 MaxDiskUsage __attribute__ ((packed));
__u16 BadLoginCount __attribute__ ((packed));
__u32 BadLoginCountDown __attribute__ ((packed));
struct ncp_station_addr LastIntruder __attribute__ ((packed));
};
struct ncp_prop_login_control
{
__u8 AccountExpireDate[3] __attribute__((packed));
__u8 Disabled __attribute__((packed));
__u8 PasswordExpireDate[3] __attribute__((packed));
__u8 GraceLogins __attribute__((packed));
__u16 PasswordExpireInterval __attribute__((packed));
__u8 MaxGraceLogins __attribute__((packed));
__u8 MinPasswordLength __attribute__((packed));
__u16 MaxConnections __attribute__((packed));
__u8 ConnectionTimeMask[42] __attribute__((packed));
__u8 LastLogin[6] __attribute__((packed));
__u8 RestrictionMask __attribute__((packed));
__u8 reserved __attribute__((packed));
__u32 MaxDiskUsage __attribute__((packed));
__u16 BadLoginCount __attribute__((packed));
__u32 BadLoginCountDown __attribute__((packed));
struct ncp_station_addr LastIntruder __attribute__((packed));
};
long
ncp_read_property_value(struct ncp_conn *conn,
int object_type, const char *object_name,
int segment, const char *prop_name,
struct nw_property *target);
ncp_read_property_value(struct ncp_conn *conn,
int object_type, const char *object_name,
int segment, const char *prop_name,
struct nw_property *target);
long
ncp_scan_property(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
__u32 last_id, char *search_string,
struct ncp_property_info *property_info);
ncp_scan_property(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
__u32 last_id, char *search_string,
struct ncp_property_info *property_info);
long
ncp_add_object_to_set(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u16 member_type,
const char *member_name);
ncp_add_object_to_set(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u16 member_type,
const char *member_name);
long
ncp_change_property_security(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u8 property_security);
ncp_change_property_security(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u8 property_security);
long
ncp_create_property(struct ncp_conn *conn,
ncp_create_property(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
const char *property_name,
__u8 property_flags, __u8 property_security);
long
ncp_delete_object_from_set(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u16 member_type,
const char *member_name);
long
ncp_delete_property(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name);
ncp_delete_object_from_set(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u16 member_type,
const char *member_name);
long
ncp_write_property_value(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u8 segment,
struct nw_property *property_value);
ncp_delete_property(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name);
long
ncp_write_property_value(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const char *property_name,
__u8 segment,
struct nw_property *property_value);
/* Bit masks for security flag */
#define NCP_SEC_CHECKSUMMING_REQUESTED (1)
@@ -317,138 +413,138 @@ ncp_write_property_value(struct ncp_conn *conn,
#define NCP_SEC_LIP_DISABLED (128)
long
ncp_get_big_ncp_max_packet_size(struct ncp_conn *conn,
__u16 proposed_max_size,
__u8 proposed_security_flag,
__u16 *accepted_max_size,
__u16 *echo_socket,
__u8 *accepted_security_flag);
ncp_get_big_ncp_max_packet_size(struct ncp_conn *conn,
__u16 proposed_max_size,
__u8 proposed_security_flag,
__u16 * accepted_max_size,
__u16 * echo_socket,
__u8 * accepted_security_flag);
long
ncp_login_encrypted(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
const unsigned char *key,
const unsigned char *passwd);
ncp_login_encrypted(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
const unsigned char *key,
const unsigned char *passwd);
long
ncp_login_unencrypted(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const unsigned char *passwd);
ncp_login_unencrypted(struct ncp_conn *conn,
__u16 object_type, const char *object_name,
const unsigned char *passwd);
long
ncp_change_login_passwd(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
const unsigned char *key,
const unsigned char *oldpasswd,
const unsigned char *newpasswd);
ncp_change_login_passwd(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
const unsigned char *key,
const unsigned char *oldpasswd,
const unsigned char *newpasswd);
#define NCP_GRACE_PERIOD (0xdf)
long
ncp_login_user(struct ncp_conn *conn,
const unsigned char *username,
const unsigned char *password);
ncp_login_user(struct ncp_conn *conn,
const unsigned char *username,
const unsigned char *password);
long
ncp_get_volume_info_with_number(struct ncp_conn *conn, int n,
struct ncp_volume_info *target);
ncp_get_volume_info_with_number(struct ncp_conn *conn, int n,
struct ncp_volume_info *target);
long
ncp_get_volume_number(struct ncp_conn *conn, const char *name,
int *target);
ncp_get_volume_number(struct ncp_conn *conn, const char *name,
int *target);
long
ncp_file_search_init(struct ncp_conn *conn,
int dir_handle, const char *path,
struct ncp_filesearch_info *target);
ncp_file_search_init(struct ncp_conn *conn,
int dir_handle, const char *path,
struct ncp_filesearch_info *target);
long
ncp_file_search_continue(struct ncp_conn *conn,
struct ncp_filesearch_info *fsinfo,
int attributes, const char *path,
struct ncp_file_info *target);
ncp_file_search_continue(struct ncp_conn *conn,
struct ncp_filesearch_info *fsinfo,
int attributes, const char *path,
struct ncp_file_info *target);
long
ncp_get_finfo(struct ncp_conn *conn,
int dir_handle, const char *path, const char *name,
struct ncp_file_info *target);
ncp_get_finfo(struct ncp_conn *conn,
int dir_handle, const char *path, const char *name,
struct ncp_file_info *target);
long
ncp_open_file(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr, int access,
struct ncp_file_info *target);
long
ncp_close_file(struct ncp_conn *conn, const char *file_id);
long
ncp_create_newfile(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr,
struct ncp_file_info *target);
long
ncp_create_file(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr,
struct ncp_file_info *target);
long
ncp_erase_file(struct ncp_conn *conn,
ncp_open_file(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr);
int attr, int access,
struct ncp_file_info *target);
long
ncp_close_file(struct ncp_conn *conn, const char *file_id);
long
ncp_rename_file(struct ncp_conn *conn,
int old_handle, const char *old_path,
int attr,
int new_handle, const char *new_path);
ncp_create_newfile(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr,
struct ncp_file_info *target);
long
ncp_create_directory(struct ncp_conn *conn,
int dir_handle, const char *path,
int inherit_mask);
ncp_create_file(struct ncp_conn *conn,
int dir_handle, const char *path,
int attr,
struct ncp_file_info *target);
long
ncp_delete_directory(struct ncp_conn *conn,
int dir_handle, const char *path);
long
ncp_rename_directory(struct ncp_conn *conn,
int dir_handle,
const char *old_path, const char *new_path);
long
ncp_add_trustee(struct ncp_conn *conn,
ncp_erase_file(struct ncp_conn *conn,
int dir_handle, const char *path,
__u32 object_id, __u8 rights);
int attr);
long
ncp_delete_trustee(struct ncp_conn *conn,
int dir_handle, const char *path, __u32 object_id);
ncp_rename_file(struct ncp_conn *conn,
int old_handle, const char *old_path,
int attr,
int new_handle, const char *new_path);
long
ncp_read(struct ncp_conn *conn, const char *file_id,
off_t offset, size_t count, char *target);
ncp_create_directory(struct ncp_conn *conn,
int dir_handle, const char *path,
int inherit_mask);
long
ncp_write(struct ncp_conn *conn, const char *file_id,
off_t offset, size_t count, const char *source);
ncp_delete_directory(struct ncp_conn *conn,
int dir_handle, const char *path);
long
ncp_copy_file(struct ncp_conn *conn,
const char source_file[6],
const char target_file[6],
__u32 source_offset,
__u32 target_offset,
__u32 count,
__u32 *copied_count);
ncp_rename_directory(struct ncp_conn *conn,
int dir_handle,
const char *old_path, const char *new_path);
long
ncp_obtain_file_or_subdir_info(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs, __u32 rim,
__u8 vol, __u32 dirent, const char *path,
struct nw_info_struct *target);
ncp_add_trustee(struct ncp_conn *conn,
int dir_handle, const char *path,
__u32 object_id, __u8 rights);
long
ncp_delete_trustee(struct ncp_conn *conn,
int dir_handle, const char *path, __u32 object_id);
long
ncp_read(struct ncp_conn *conn, const char *file_id,
off_t offset, size_t count, char *target);
long
ncp_write(struct ncp_conn *conn, const char *file_id,
off_t offset, size_t count, const char *source);
long
ncp_copy_file(struct ncp_conn *conn,
const char source_file[6],
const char target_file[6],
__u32 source_offset,
__u32 target_offset,
__u32 count,
__u32 * copied_count);
long
ncp_obtain_file_or_subdir_info(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs, __u32 rim,
__u8 vol, __u32 dirent, const char *path,
struct nw_info_struct *target);
#define NCP_PERM_READ (0x001)
#define NCP_PERM_WRITE (0x002)
@@ -461,103 +557,103 @@ ncp_obtain_file_or_subdir_info(struct ncp_conn *conn,
#define NCP_PERM_SUPER (0x100)
long
ncp_get_eff_directory_rights(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs,
__u8 vol, __u32 dirent, const char *path,
__u16 *my_effective_rights);
ncp_get_eff_directory_rights(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs,
__u8 vol, __u32 dirent, const char *path,
__u16 * my_effective_rights);
long
ncp_do_lookup(struct ncp_conn *conn,
struct nw_info_struct *dir,
char *path, /* may only be one component */
struct nw_info_struct *target);
ncp_do_lookup(struct ncp_conn *conn,
struct nw_info_struct *dir,
char *path, /* may only be one component */
struct nw_info_struct *target);
long
ncp_modify_file_or_subdir_dos_info(struct ncp_conn *conn,
struct nw_info_struct *file,
__u32 info_mask,
struct nw_modify_dos_info *info);
ncp_modify_file_or_subdir_dos_info(struct ncp_conn *conn,
struct nw_info_struct *file,
__u32 info_mask,
struct nw_modify_dos_info *info);
long
ncp_del_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *dir, char *name);
ncp_del_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *dir, char *name);
long
ncp_open_create_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *dir, char *name,
int open_create_mode,
__u32 create_attributes,
int desired_acc_rights,
struct nw_file_info *target);
ncp_open_create_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *dir, char *name,
int open_create_mode,
__u32 create_attributes,
int desired_acc_rights,
struct nw_file_info *target);
long
ncp_initialize_search(struct ncp_conn *conn,
const struct nw_info_struct *dir,
int namespace,
struct ncp_search_seq *target);
ncp_initialize_search(struct ncp_conn *conn,
const struct nw_info_struct *dir,
int namespace,
struct ncp_search_seq *target);
long
ncp_search_for_file_or_subdir(struct ncp_conn *conn,
struct ncp_search_seq *seq,
struct nw_info_struct *target);
ncp_search_for_file_or_subdir(struct ncp_conn *conn,
struct ncp_search_seq *seq,
struct nw_info_struct *target);
long
ncp_ren_or_mov_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *old_dir, char *old_name,
struct nw_info_struct *new_dir, char *new_name);
ncp_ren_or_mov_file_or_subdir(struct ncp_conn *conn,
struct nw_info_struct *old_dir, char *old_name,
struct nw_info_struct *new_dir, char *new_name);
long
ncp_create_queue_job_and_file(struct ncp_conn *conn,
ncp_create_queue_job_and_file(struct ncp_conn *conn,
__u32 queue_id,
struct queue_job *job);
long
ncp_close_file_and_start_job(struct ncp_conn *conn,
__u32 queue_id,
struct queue_job *job);
long
ncp_close_file_and_start_job(struct ncp_conn *conn,
__u32 queue_id,
struct queue_job *job);
ncp_attach_to_queue(struct ncp_conn *conn,
__u32 queue_id);
long
ncp_attach_to_queue(struct ncp_conn *conn,
__u32 queue_id);
ncp_detach_from_queue(struct ncp_conn *conn,
__u32 queue_id);
long
ncp_detach_from_queue(struct ncp_conn *conn,
__u32 queue_id);
ncp_service_queue_job(struct ncp_conn *conn, __u32 queue_id, __u16 job_type,
struct queue_job *job);
long
ncp_service_queue_job(struct ncp_conn *conn, __u32 queue_id, __u16 job_type,
struct queue_job *job);
ncp_finish_servicing_job(struct ncp_conn *conn, __u32 queue_id,
__u32 job_number, __u32 charge_info);
long
ncp_finish_servicing_job(struct ncp_conn *conn, __u32 queue_id,
__u32 job_number, __u32 charge_info);
ncp_abort_servicing_job(struct ncp_conn *conn, __u32 queue_id,
__u32 job_number);
long
ncp_abort_servicing_job(struct ncp_conn *conn, __u32 queue_id,
__u32 job_number);
ncp_get_broadcast_message(struct ncp_conn *conn, char message[256]);
long
ncp_get_broadcast_message(struct ncp_conn *conn, char message[256]);
long
ncp_dealloc_dir_handle(struct ncp_conn *conn, __u8 dir_handle);
ncp_dealloc_dir_handle(struct ncp_conn *conn, __u8 dir_handle);
#define NCP_ALLOC_PERMANENT (0x0000)
#define NCP_ALLOC_TEMPORARY (0x0001)
#define NCP_ALLOC_SPECIAL (0x0002)
long
ncp_alloc_short_dir_handle(struct ncp_conn *conn,
struct nw_info_struct *dir,
__u16 alloc_mode,
__u8 *target);
ncp_alloc_short_dir_handle(struct ncp_conn *conn,
struct nw_info_struct *dir,
__u16 alloc_mode,
__u8 * target);
long
ncp_get_effective_dir_rights(struct ncp_conn *conn,
struct nw_info_struct *file,
__u16 *target);
ncp_get_effective_dir_rights(struct ncp_conn *conn,
struct nw_info_struct *file,
__u16 * target);
struct ncp_trustee_struct
{
@@ -566,10 +662,10 @@ struct ncp_trustee_struct
};
long
ncp_add_trustee_set(struct ncp_conn *conn,
__u8 volume_number, __u32 dir_entry,
__u16 rights_mask,
int object_count, struct ncp_trustee_struct *rights);
ncp_add_trustee_set(struct ncp_conn *conn,
__u8 volume_number, __u32 dir_entry,
__u16 rights_mask,
int object_count, struct ncp_trustee_struct *rights);
#endif /* _NCPLIB_H */
#endif /* _NCPLIB_H */