Import ncpfs 2.2.1

This commit is contained in:
ncpfs archive import
2026-04-28 20:39:59 +02:00
parent 0979ae6a41
commit 82706139bf
547 changed files with 176953 additions and 12604 deletions

148
include/ncp/eas.h Normal file
View File

@@ -0,0 +1,148 @@
/*
eas.h
Copyright (C) 2000 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision History:
1.00 2000, August 26 Petr Vandrovec <vandrove@vc.cvut.cz>
Initial release.
1.01 2001, December 31 Petr Vandrovec <vandrove@vc.cvut.cz>
Updated for SWIG.
*/
#ifndef __NCP_EAS_H__
#define __NCP_EAS_H__
#include <ncp/nwcalls.h>
#define NWEA_FL_CLOSE_IMM 0x0080
#define NWEA_FL_INFO(X) ((X) << 4)
#define NWEA_FL_INFO0 NWEA_FL_INFO(0)
#define NWEA_FL_INFO1 NWEA_FL_INFO(1)
#define NWEA_FL_INFO6 NWEA_FL_INFO(6)
#define NWEA_FL_INFO7 NWEA_FL_INFO(7)
#define NWEA_FL_CLOSE_ERR 0x0004
#define NWEA_FL_SRC_DIRENT 0x0000 /* volume + DOS dirEnt */
#define NWEA_FL_SRC_NWHANDLE 0x0001 /* handle from open */
#define NWEA_FL_SRC_EAHANDLE 0x0002 /* handle from previous EA op */
struct ncp_ea_enumerate_info {
uint_fast32_t errorCode;
uint_fast32_t totalEAs;
uint_fast32_t totalEAsDataSize;
uint_fast32_t totalEAsKeySize;
uint_fast32_t newEAhandle;
uint_fast16_t enumSequence;
uint_fast16_t returnedItems;
};
struct ncp_ea_read_info {
uint_fast32_t errorCode;
uint_fast32_t totalValuesLength;
uint_fast32_t newEAhandle;
uint_fast32_t accessFlag;
};
struct ncp_ea_write_info {
uint_fast32_t errorCode;
uint_fast32_t written;
uint_fast32_t newEAhandle;
};
/* level0 has no special info */
struct ncp_ea_info_level1 {
uint_fast32_t valueLength;
uint_fast32_t accessFlag;
#ifdef SWIG
%pragma(swig) readonly
uint_fast16_t keyLength;
uint_fast16_tLenPrefixCharArray key[256];
%pragma(swig) readwrite
#else
uint_fast16_t keyLength;
u_int8_t key[256];
#endif
};
struct ncp_ea_info_level6 {
uint_fast32_t valueLength;
uint_fast32_t accessFlag;
uint_fast32_t valueExtants;
uint_fast32_t keyExtants;
#ifdef SWIG
%pragma(swig) readonly
uint_fast16_t keyLength;
uint_fast16_tLenPrefixCharArray key[256];
%pragma(swig) readwrite
#else
uint_fast16_t keyLength;
u_int8_t key[256];
#endif
};
/* level7 is returned as char array */
NWCCODE ncp_ea_close(NWCONN_HANDLE conn, uint_fast32_t EAHandle);
NWCCODE ncp_ea_duplicate(NWCONN_HANDLE conn,
uint_fast16_t srcFlags,
uint_fast32_t srcHandleOrVol, uint_fast32_t srcZeroOrDir,
uint_fast16_t dstFlags,
uint_fast32_t dstHandleOrVol, uint_fast32_t dstZeroOrDir,
u_int32_t* duplicateCount,
u_int32_t* dataSizeDuplicated,
u_int32_t* keySizeDuplicated);
NWCCODE ncp_ea_enumerate(NWCONN_HANDLE conn,
uint_fast16_t flags,
uint_fast32_t handleOrVol, uint_fast32_t zeroOrDir,
uint_fast32_t inspectSize,
const void* key, size_t keyLen,
struct ncp_ea_enumerate_info* info,
void* data, size_t datalen, size_t* rdatalen);
NWCCODE ncp_ea_read(NWCONN_HANDLE conn,
uint_fast16_t flags,
uint_fast32_t handleOrVol, uint_fast32_t zeroOrDir,
uint_fast32_t inspectSize,
const void* key, size_t keyLen,
uint_fast32_t readOffset,
struct ncp_ea_read_info* info,
void* data, size_t datalen, size_t* rdatalen);
NWCCODE ncp_ea_write(NWCONN_HANDLE conn,
uint_fast16_t flags,
uint_fast32_t handleOrVol, uint_fast32_t zeroOrDir,
uint_fast32_t totalWriteSize,
const void* key, size_t keyLen,
uint_fast32_t writeOffset,
uint_fast32_t accessFlag,
struct ncp_ea_write_info* info,
const void* data, size_t datalen);
NWCCODE ncp_ea_extract_info_level1(const unsigned char* buffer,
const unsigned char* endbuf,
struct ncp_ea_info_level1* info, size_t maxsize,
size_t* needsize, const unsigned char** next);
NWCCODE ncp_ea_extract_info_level6(const unsigned char* buffer,
const unsigned char* endbuf,
struct ncp_ea_info_level6* info, size_t maxsize,
size_t* needsize, const unsigned char** next);
NWCCODE ncp_ea_extract_info_level7(const unsigned char* buffer,
const unsigned char* endbuf,
char* key, size_t maxsize, size_t* needsize,
const unsigned char** next);
#endif /* __NCP_EAS_H__ */

View File

@@ -0,0 +1,10 @@
#ifndef __EXT_SOCKET__
#define __EXT_SOCKET__
#include <sys/socket.h>
@socklen_t@
#endif /* __EXT_SOCKET__ */

View File

@@ -0,0 +1,33 @@
#ifndef __EXT_STDINT_H__
#define __EXT_STDINT_H__
#if @stdint_types@
/* we have stdint.h header */
#include <stdint.h>
#else
/* we have not stdint.h */
#include <ncp/kernel/types.h>
/* Signed. */
#define int_least8_t int8_t
#define int_least16_t int16_t
#define int_least32_t int32_t
/* Unsigned. */
#define uint_least8_t u_int8_t
#define uint_least16_t u_int16_t
#define uint_least32_t u_int32_t
/* Fast types. */
/* Signed. */
#define int_fast8_t u_int8_t
/* fix for WORDSIZE==16 ! */
#define int_fast16_t int
#define int_fast32_t int
/* Unsigned. */
#define uint_fast8_t u_int8_t
/* fix for WORDSIZE==16 ! */
#define uint_fast16_t unsigned int
#define uint_fast32_t unsigned int
#endif
#endif /* __EXT_STDINT_H__ */

142
include/ncp/ipxlib.h Normal file
View File

@@ -0,0 +1,142 @@
/*
ipxlib.h
Copyright (C) 1995 by Volker Lendecke
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1995 Volker Lendecke
Initial revision.
1.00 2001, September 15 Petr Vandrovec <vandrove@vc.cvut.cz>
Fixes for SWIG processing. Unwind nested structs so names
are defined here and not by SWIG.
*/
#ifndef _IPXLIB_H
#define _IPXLIB_H
#include <ncp/kernel/types.h>
#include <ncp/ncp.h>
#include <ncp/kernel/ipx.h>
typedef u_int32_t IPXNet;
typedef u_int16_t IPXPort;
typedef u_int8_t IPXNode[IPX_NODE_LEN];
typedef const u_int8_t CIPXNode[IPX_NODE_LEN];
#define IPX_USER_PTYPE (0x00)
#define IPX_RIP_PTYPE (0x01)
#define IPX_SAP_PTYPE (0x04)
#define IPX_AUTO_PORT (0x0000)
#define IPX_SAP_PORT (0x0452)
#define IPX_RIP_PORT (0x0453)
#define IPX_SAP_GENERAL_QUERY (0x0001)
#define IPX_SAP_GENERAL_RESPONSE (0x0002)
#define IPX_SAP_NEAREST_QUERY (0x0003)
#define IPX_SAP_NEAREST_RESPONSE (0x0004)
#define IPX_SAP_SPECIFIC_QUERY (0x000E)
#define IPX_SAP_SPECIFIC_RESPONSE (0x000F)
#define IPX_SAP_FILE_SERVER (0x0004)
struct sap_query
{
u_int16_t query_type; /* net order */
u_int16_t server_type; /* net order */
};
struct sap_server_ident
{
u_int16_t server_type __attribute__((packed));
char server_name[48] __attribute__((packed));
IPXNet server_network __attribute__((packed));
#ifdef SWIG
u_int8_t server_node[6] __attribute__((packed));
#else
IPXNode server_node __attribute__((packed));
#endif
IPXPort server_port __attribute__((packed));
u_int16_t intermediate_network __attribute__((packed));
};
#define IPX_RIP_REQUEST (0x1)
#define IPX_RIP_RESPONSE (0x2)
struct ipx_rt_def {
u_int32_t network __attribute__((packed));
u_int16_t hops __attribute__((packed));
u_int16_t ticks __attribute__((packed));
};
struct ipx_rip_packet
{
u_int16_t operation __attribute__((packed));
struct ipx_rt_def rt[1] __attribute__((packed));
};
#ifdef SWIG
#define IPX_BROADCAST_NODE "\xff\xff\xff\xff\xff\xff"
#define IPX_THIS_NODE "\0\0\0\0\0\0"
#else
#define IPX_BROADCAST_NODE ("\xff\xff\xff\xff\xff\xff")
#define IPX_THIS_NODE ("\0\0\0\0\0\0")
#endif
#define IPX_THIS_NET (0)
#ifndef IPX_NODE_LEN
#define IPX_NODE_LEN (6)
#endif
#ifdef __cplusplus
extern "C" {
#endif
void
ipx_print_node(IPXNode node);
void
ipx_print_network(IPXNet net);
void
ipx_print_port(IPXPort port);
void
ipx_fprint_node(FILE * file, IPXNode node);
void
ipx_fprint_network(FILE * file, IPXNet net);
void
ipx_fprint_port(FILE * file, IPXPort port);
int
ipx_sscanf_node(char *buf, unsigned char node[IPX_NODE_LEN]);
void
ipx_assign_node(IPXNode dest, CIPXNode src);
int
ipx_node_equal(CIPXNode n1, CIPXNode n2);
#ifdef NCP_IPX_SUPPORT
void
ipx_print_saddr(struct sockaddr_ipx *sipx);
void
ipx_fprint_saddr(FILE * file, struct sockaddr_ipx *sipx);
int
ipx_sscanf_saddr(char* buf, struct sockaddr_ipx* sipx);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _IPXLIB_H */

View File

@@ -0,0 +1,7 @@
#ifndef _KERNEL_FS_H
#define _KERNEL_FS_H
@ncp_sys_mount_h@
@ncp_linux_fs_h@
#endif

View File

@@ -0,0 +1,6 @@
#ifndef _KERNEL_IF_H
#define _KERNEL_IF_H
@ncp_net_if_h@
#endif

View File

@@ -0,0 +1,25 @@
#ifndef _KERNEL_IPX_H
#define _KERNEL_IPX_H
#include <ncp/ext/socket.h>
@ncp_ipx_headers_1@
@ncp_ipx_headers_2@
@ncp_ipx_defsiocprotoprivate@
#undef SIOCPROTOPRIVATE
#define SIOCPROTOPRIVATE 0x89E0
#endif
@ncp_ipx_defsiocaipx@
#undef SIOCAIPXITFCRT
#undef SIOCAIPXPRISLT
#undef SIOCIPXCFGDATA
#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1)
#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2)
#endif
#ifndef IPXPROTO_IPX
#define IPXPROTO_IPX (PF_IPX)
#endif
#endif

296
include/ncp/kernel/ncp.h Normal file
View File

@@ -0,0 +1,296 @@
/*
ncp.h
Copyright (C) 1995 by Volker Lendecke
Copyright (C) 1996 J.F. Chadima
Copyright (C) 1997, 1998, 1999 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1995 Volker Lendecke
Initial revision.
0.01 1996 J.F. Chadima
Modified for sparc.
0.02 1998 Petr Vandrovec <vandrove@vc.cvut.cz>
New flags...
1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license.
1.01 2001, November 4 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NW_NS_LONG definition.
Added couple of SWIG fixes.
*/
#ifndef _LINUX_NCP_H
#define _LINUX_NCP_H
#include <ncp/kernel/types.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 {
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 completion_code __attribute__((packed));
u_int8_t connection_state __attribute__((packed));
u_int8_t data[0] __attribute__((packed));
};
#define NCP_VOLNAME_LEN (16)
#define NCP_NUMBER_OF_VOLUMES (64)
#ifdef SWIG
struct ncp_volume_info {
u_int32_t total_blocks;
u_int32_t free_blocks;
u_int32_t purgeable_blocks;
u_int32_t not_yet_purgeable_blocks;
u_int32_t total_dir_entries;
u_int32_t available_dir_entries;
u_int8_t sectors_per_block;
fixedCharArray volume_name[NCP_VOLNAME_LEN + 1];
};
#else
struct ncp_volume_info {
u_int32_t total_blocks;
u_int32_t free_blocks;
u_int32_t purgeable_blocks;
u_int32_t not_yet_purgeable_blocks;
u_int32_t total_dir_entries;
u_int32_t available_dir_entries;
u_int8_t sectors_per_block;
char volume_name[NCP_VOLNAME_LEN + 1];
};
#endif
#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
#define NW_NS_LONG NW_NS_OS2
#define RIM_NAME 0x00000001
#define RIM_SPACE_ALLOCATED 0x00000002
#define RIM_ATTRIBUTES 0x00000004
#define RIM_DATA_SIZE 0x00000008
#define RIM_TOTAL_SIZE 0x00000010
#define RIM_EXT_ATTR_INFO 0x00000020
#define RIM_ARCHIVE 0x00000040
#define RIM_MODIFY 0x00000080
#define RIM_CREATION 0x00000100
#define RIM_OWNING_NAMESPACE 0x00000200
#define RIM_DIRECTORY 0x00000400
#define RIM_RIGHTS 0x00000800
#define RIM_ALL 0x00000FFF
#define RIM_REFERENCE_ID 0x00001000
#define RIM_NS_ATTRIBUTES 0x00002000
#define RIM_DATASTREAM_SIZES 0x00004000
#define RIM_DATASTREAM_LOGICALS 0x00008000
#define RIM_UPDATE_TIME 0x00010000
#define RIM_DOS_NAME 0x00020000
#define RIM_FLUSH_TIME 0x00040000
#define RIM_PARENT_BASE_ID 0x00080000
#define RIM_MAC_FINDER_INFO 0x00100000
#define RIM_SIBLING_COUNT 0x00200000
#define RIM_EFFECTIVE_RIGHTS 0x00400000
#define RIM_MAC_TIMES 0x00800000
#define RIM_LAST_ACCESS_TIME 0x01000000
#ifdef MAKE_NCPLIB
#define RIM_UNKNOWN25 0x02000000 /* fixme! */
#endif
#define RIM_SIZE64 0x04000000
#define RIM_NSS_LARGE_SIZES 0x40000000
#define RIM_COMPRESSED_INFO 0x80000000U
/* open/create modes */
#define OC_MODE_OPEN 0x01
#define OC_MODE_TRUNCATE 0x02
#define OC_MODE_REPLACE 0x02
#define OC_MODE_CREATE 0x08
#define OC_MODE_OPEN_64BIT_ACCESS 0x20
#define OC_MODE_READONLY_OK 0x40
#define OC_MODE_CALLBACK 0x80
/* 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
#define OC_ACTION_COMPRESSED 0x08
#define OC_ACTION_READONLY 0x80
/* 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
#ifdef SWIG
struct nw_info_struct {
u_int32_t spaceAlloc __attribute__((packed));
u_int32_t attributes __attribute__((packed));
u_int16_t flags __attribute__((packed));
u_int32_t dataStreamSize __attribute__((packed));
u_int32_t totalStreamSize __attribute__((packed));
u_int16_t numberOfStreams __attribute__((packed));
u_int16_t creationTime __attribute__((packed));
u_int16_t creationDate __attribute__((packed));
u_int32_t creatorID __attribute__((packed));
u_int16_t modifyTime __attribute__((packed));
u_int16_t modifyDate __attribute__((packed));
u_int32_t modifierID __attribute__((packed));
u_int16_t lastAccessDate __attribute__((packed));
u_int16_t archiveTime __attribute__((packed));
u_int16_t archiveDate __attribute__((packed));
u_int32_t archiverID __attribute__((packed));
u_int16_t inheritedRightsMask __attribute__((packed));
u_int32_t dirEntNum __attribute__((packed));
u_int32_t DosDirNum __attribute__((packed));
u_int32_t volNumber __attribute__((packed));
u_int32_t EADataSize __attribute__((packed));
u_int32_t EAKeyCount __attribute__((packed));
u_int32_t EAKeySize __attribute__((packed));
u_int32_t NSCreator __attribute__((packed));
%pragma(swig) readonly
u_int8_t nameLen __attribute__((packed));
%pragma(swig) readwrite
byteLenPrefixCharArray entryName[255] __attribute__((packed));
};
#else
struct nw_info_struct {
u_int32_t spaceAlloc __attribute__((packed));
u_int32_t attributes __attribute__((packed));
u_int16_t flags __attribute__((packed));
u_int32_t dataStreamSize __attribute__((packed));
u_int32_t totalStreamSize __attribute__((packed));
u_int16_t numberOfStreams __attribute__((packed));
u_int16_t creationTime __attribute__((packed));
u_int16_t creationDate __attribute__((packed));
u_int32_t creatorID __attribute__((packed));
u_int16_t modifyTime __attribute__((packed));
u_int16_t modifyDate __attribute__((packed));
u_int32_t modifierID __attribute__((packed));
u_int16_t lastAccessDate __attribute__((packed));
u_int16_t archiveTime __attribute__((packed));
u_int16_t archiveDate __attribute__((packed));
u_int32_t archiverID __attribute__((packed));
u_int16_t inheritedRightsMask __attribute__((packed));
u_int32_t dirEntNum __attribute__((packed));
u_int32_t DosDirNum __attribute__((packed));
u_int32_t volNumber __attribute__((packed));
u_int32_t EADataSize __attribute__((packed));
u_int32_t EAKeyCount __attribute__((packed));
u_int32_t EAKeySize __attribute__((packed));
u_int32_t NSCreator __attribute__((packed));
u_int8_t nameLen __attribute__((packed));
u_int8_t entryName[256] __attribute__((packed));
};
#endif
/* modify mask - use with MODIFY_DOS_INFO structure */
#define DM_ATTRIBUTES (0x00000002L)
#define DM_CREATE_DATE (0x00000004L)
#define DM_CREATE_TIME (0x00000008L)
#define DM_CREATOR_ID (0x00000010L)
#define DM_ARCHIVE_DATE (0x00000020L)
#define DM_ARCHIVE_TIME (0x00000040L)
#define DM_ARCHIVER_ID (0x00000080L)
#define DM_MODIFY_DATE (0x00000100L)
#define DM_MODIFY_TIME (0x00000200L)
#define DM_MODIFIER_ID (0x00000400L)
#define DM_LAST_ACCESS_DATE (0x00000800L)
#define DM_INHERITED_RIGHTS_MASK (0x00001000L)
#define DM_MAXIMUM_SPACE (0x00002000L)
struct nw_modify_dos_info {
u_int32_t attributes __attribute__((packed));
u_int16_t creationDate __attribute__((packed));
u_int16_t creationTime __attribute__((packed));
u_int32_t creatorID __attribute__((packed));
u_int16_t modifyDate __attribute__((packed));
u_int16_t modifyTime __attribute__((packed));
u_int32_t modifierID __attribute__((packed));
u_int16_t archiveDate __attribute__((packed));
u_int16_t archiveTime __attribute__((packed));
u_int32_t archiverID __attribute__((packed));
u_int16_t lastAccessDate __attribute__((packed));
u_int16_t inheritanceGrantMask __attribute__((packed));
u_int16_t inheritanceRevokeMask __attribute__((packed));
u_int32_t maximumSpace __attribute__((packed));
};
#ifdef SWIG
struct nw_file_info {
struct nw_info_struct i;
int opened;
int access;
u_int32_t server_file_handle __attribute__((packed));
u_int8_t open_create_action __attribute__((packed));
fixedArray file_handle[6] __attribute__((packed));
};
#else
struct nw_file_info {
struct nw_info_struct i;
int opened;
int access;
u_int32_t server_file_handle __attribute__((packed));
u_int8_t open_create_action __attribute__((packed));
u_int8_t file_handle[6] __attribute__((packed));
};
#endif
struct nw_search_sequence {
u_int8_t volNumber __attribute__((packed));
u_int32_t dirBase __attribute__((packed));
u_int32_t sequence __attribute__((packed));
};
#endif /* _LINUX_NCP_H */

199
include/ncp/kernel/ncp_fs.h Normal file
View File

@@ -0,0 +1,199 @@
/*
ncp_fs.h
Copyright (C) 1995, 1996 by Volker Lendecke
Copyright (C) 1998, 1999 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1995 Volker Lendecke
Initial revision.
0.01 1998 Petr Vandrovec <vandrove@vc.cvut.cz>
New ioctl: LOCKUNLOCK, GETROOT, SETROOT, GETOBJECTNAME,
SETOBJECTNAME, GETPRIVATEDATA, SETPRIVATEDATA
0.02 1998 Wolfram Pienkoss <wp@bszh.de>
New ioctl: GETCHARSETS, SETCHARSETS
0.03 1999, September Petr Vandrovec <vandrove@vc.cvut.cz>
New ioctl: GETDENTRYTTL, SETDENTRYTTL
1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license.
*/
/* TODO: These are all internal to ncpfs... Do something with them :-) */
#ifndef _KERNEL_NCP_FS_H
#define _KERNEL_NCP_FS_H
#include <ncp/kernel/fs.h>
#include <ncp/kernel/types.h>
#include <netinet/in.h>
#include <ncp/kernel/ipx.h>
struct ncp_sign_init
{
char sign_root[8];
char sign_last[16];
};
union ncp_sockaddr {
struct sockaddr any;
#ifdef NCP_IPX_SUPPORT
struct sockaddr_ipx ipx;
#endif
#ifdef NCP_IN_SUPPORT
struct sockaddr_in inet;
#endif
};
#ifdef NCP_KERNEL_NCPFS_AVAILABLE
/*
* ioctl commands
*/
struct ncp_ioctl_request {
unsigned int function;
unsigned int size;
char *data;
};
struct ncp_fs_info {
int version;
union ncp_sockaddr 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;
u_int32_t directory_id;
};
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 name_space;
u_int32_t dirEntNum;
};
struct ncp_objectname_ioctl
{
#define NCP_AUTH_NONE 0x00
#define NCP_AUTH_BIND 0x31
#define NCP_AUTH_NDS 0x32
int auth_type;
size_t object_name_len;
void* object_name;
};
struct ncp_privatedata_ioctl
{
size_t len;
void* data; /* ~1000 for NDS */
};
/* NLS charsets by ioctl */
#define NCP_IOCSNAME_LEN 20
struct ncp_nls_ioctl_old
{
int codepage;
unsigned char iocharset[NCP_IOCSNAME_LEN+1];
};
struct ncp_nls_ioctl
{
unsigned char codepage[NCP_IOCSNAME_LEN+1];
unsigned char iocharset[NCP_IOCSNAME_LEN+1];
};
#define NCP_IOC_NCPREQUEST _IOR('n', 1, struct ncp_ioctl_request)
#define NCP_IOC_GETMOUNTUID _IOW('n', 2, __kernel_uid_t)
#define NCP_IOC_GETMOUNTUID2 _IOW('n', 2, unsigned long)
#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)
#define NCP_IOC_GETOBJECTNAME _IOWR('n', 9, struct ncp_objectname_ioctl)
#define NCP_IOC_SETOBJECTNAME _IOR('n', 9, struct ncp_objectname_ioctl)
#define NCP_IOC_GETPRIVATEDATA _IOWR('n', 10, struct ncp_privatedata_ioctl)
#define NCP_IOC_SETPRIVATEDATA _IOR('n', 10, struct ncp_privatedata_ioctl)
#define NCP_IOC_GETCHARSETS _IOWR('n', 11, struct ncp_nls_ioctl)
#define NCP_IOC_SETCHARSETS _IOR('n', 11, struct ncp_nls_ioctl)
/* never released to Linus, will wanish shortly */
#define NCP_IOC_GETCHARSETS_OLD _IOWR('n', 11, struct ncp_nls_ioctl_old)
#define NCP_IOC_SETCHARSETS_OLD _IOR('n', 11, struct ncp_nls_ioctl_old)
#define NCP_IOC_GETDENTRYTTL _IOW('n', 12, u_int32_t)
#define NCP_IOC_SETDENTRYTTL _IOR('n', 12, u_int32_t)
#else
struct ncp_fs_info {
int version;
union ncp_sockaddr addr;
uid_t mounted_uid;
int connection; /* Connection number the server assigned us */
size_t buffer_size; /* The negotiated buffer size, to be
used for read/write requests! */
int volume_number;
u_int32_t directory_id;
};
#endif /* NCP_KERNEL_NCPFS_AVAILABLE */
/*
* The packet size to allocate. One page should be enough.
*/
#define NCP_PACKET_SIZE 65536
#define NCP_MAXPATHLEN 255
#define NCP_MAXNAMELEN 14
#endif /* _LINUX_NCP_FS_H */

View File

@@ -0,0 +1,7 @@
#ifndef __KERNEL_ROUTE_H__
#define __KERNEL_ROUTE_H__
@ncp_net_route_h@
#endif /* __KERNEL_ROUTE_H__ */

View File

@@ -0,0 +1,55 @@
#ifndef __KERNEL_TYPES_H__
#define __KERNEL_TYPES_H__
#include <sys/types.h>
@ncp_sys_select_h@
@ncp_in_support@
@ncp_ipx_support@
/* FIXME: What about configure?! */
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__ 1
/* AIX4.3.x has these types, but does not define
BIT_TYPES_DEFINED... */
#ifndef _H_INTTYPES
typedef unsigned char u_int8_t;
typedef unsigned short int u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned long long u_int64_t;
typedef signed char int8_t;
typedef signed short int int16_t;
typedef signed int int32_t;
typedef signed long long int64_t;
#endif
#endif /* __BIT_TYPES_DEFINED__ */
#if @USE_KERNEL@
#define NCP_KERNEL_NCPFS_AVAILABLE
typedef u_int16_t __kerXX_uid_t;
#include <linux/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;
#else
#undef NCP_KERNEL_NCPFS_AVAILABLE
#endif /* compiling on linux kernel with ncp support */
#endif /* __KERNEL_TYPES_H__ */

235
include/ncp/ncp.h Normal file
View File

@@ -0,0 +1,235 @@
/*
ncp.h
Copyright (C) 1995 by Volker Lendecke
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1995 Volker Lendecke
Initial revision.
0.01 1996 J.F. Chadima
Modified for sparc.
1.00 2001, March 4 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NCP_BINDERY_TREE.
*/
#ifndef _NCP_H
#define _NCP_H
#include <ncp/kernel/types.h>
#include <ncp/kernel/ipx.h>
#include <ncp/kernel/ncp.h>
#include <ncp/kernel/ncp_fs.h>
typedef u_int16_t NWObjectType;
typedef u_int32_t NWObjectID;
#define NCP_BINDERY_WILD (0xffff)
#define NCP_BINDERY_UNKNOWN (0x0000)
#define NCP_BINDERY_USER (0x0001)
#define NCP_BINDERY_UGROUP (0x0002) /* User Group */
#define NCP_BINDERY_PQUEUE (0x0003) /* Print Queue */
#define NCP_BINDERY_FSERVER (0x0004) /* File Server */
#define NCP_BINDERY_JSERVER (0x0005) /* Job Server */
#define NCP_BINDERY_GATEWAY (0x0006)
#define NCP_BINDERY_PSERVER (0x0007) /* Print Server */
#define NCP_BINDERY_ARCHQ (0x0008) /* Archive Queue */
#define NCP_BINDERY_ARCHSERVER (0x0009) /* Archive Server */
#define NCP_BINDERY_JQUEUE (0x000a) /* Job Queue */
#define NCP_BINDERY_ADMIN (0x000b)
#define NCP_BINDERY_BSERVER (0x0026) /* Bridge Server */
#define NCP_BINDERY_ADVPSERVER (0x0047) /* Advertising Print Server */
#define NCP_BINDERY_TREE (0x0278) /* NDS Tree */
#define NCP_BINDERY_NTSERVER (0x0640) /* NT Server */
#define NCP_BINDERY_ID_WILDCARD (0xffffffff)
#define NCP_BINDERY_NAME_LEN (48)
#ifndef IPX_NODE_LEN
#define IPX_NODE_LEN (6)
#endif
struct ncp_bindery_object {
NWObjectID object_id;
NWObjectType object_type;
#ifdef SWIG
fixedCharArray object_name[NCP_BINDERY_NAME_LEN];
#else
u_int8_t object_name[NCP_BINDERY_NAME_LEN];
#endif
u_int8_t object_flags;
u_int8_t object_security;
u_int8_t object_has_prop;
};
struct nw_property {
#ifdef SWIG
fixedArray value[128];
#else
u_int8_t value[128];
#endif
u_int8_t more_flag;
u_int8_t property_flag;
};
struct prop_net_address {
u_int32_t network __attribute__((packed));
#ifdef SWIG
fixedArray node[IPX_NODE_LEN];
#else
u_int8_t node[IPX_NODE_LEN] __attribute__((packed));
#endif
u_int16_t port __attribute__((packed));
};
struct ncp_filesearch_info {
u_int8_t volume_number;
u_int16_t directory_id;
u_int16_t sequence_no;
u_int8_t access_rights;
};
#define NCP_MAX_FILENAME (14)
struct ncp_file_info {
#ifdef SWIG
fixedArray file_id[NCP_FILE_ID_LEN];
fixedCharArray file_name[NCP_MAX_FILENAME + 1];
#else
u_int8_t file_id[NCP_FILE_ID_LEN];
char file_name[NCP_MAX_FILENAME + 1];
#endif
u_int8_t file_attributes;
u_int8_t file_mode;
u_int32_t file_length;
u_int16_t creation_date;
u_int16_t access_date;
u_int16_t update_date;
u_int16_t update_time;
};
#ifdef SWIG
struct nw_queue_job_entry {
u_int16_t InUse __attribute__((packed));
u_int32_t prev __attribute__((packed));
u_int32_t next __attribute__((packed));
u_int32_t ClientStation __attribute__((packed));
u_int32_t ClientTask __attribute__((packed));
u_int32_t ClientObjectID __attribute__((packed));
u_int32_t TargetServerID __attribute__((packed));
fixedArray TargetExecTime[6] __attribute__((packed));
fixedArray JobEntryTime[6] __attribute__((packed));
u_int32_t JobNumber __attribute__((packed));
u_int16_t JobType __attribute__((packed));
u_int16_t JobPosition __attribute__((packed));
u_int16_t JobControlFlags __attribute__((packed));
u_int8_t FileNameLen __attribute__((packed));
byteLenPrefixCharArray JobFileName[13] __attribute__((packed));
u_int32_t JobFileHandle __attribute__((packed));
u_int32_t ServerStation __attribute__((packed));
u_int32_t ServerTaskNumber __attribute__((packed));
u_int32_t ServerObjectID __attribute__((packed));
fixedCharArray JobTextDescription[50] __attribute__((packed));
fixedArray ClientRecordArea[152] __attribute__((packed));
};
struct queue_job {
struct nw_queue_job_entry j;
fixedArray file_handle[6];
};
#else
struct nw_queue_job_entry {
u_int16_t InUse __attribute__((packed));
u_int32_t prev __attribute__((packed));
u_int32_t next __attribute__((packed));
u_int32_t ClientStation __attribute__((packed));
u_int32_t ClientTask __attribute__((packed));
u_int32_t ClientObjectID __attribute__((packed));
u_int32_t TargetServerID __attribute__((packed));
u_int8_t TargetExecTime[6] __attribute__((packed));
u_int8_t JobEntryTime[6] __attribute__((packed));
u_int32_t JobNumber __attribute__((packed));
u_int16_t JobType __attribute__((packed));
u_int16_t JobPosition __attribute__((packed));
u_int16_t JobControlFlags __attribute__((packed));
u_int8_t FileNameLen __attribute__((packed));
char JobFileName[13] __attribute__((packed));
u_int32_t JobFileHandle __attribute__((packed));
u_int32_t ServerStation __attribute__((packed));
u_int32_t ServerTaskNumber __attribute__((packed));
u_int32_t ServerObjectID __attribute__((packed));
char JobTextDescription[50] __attribute__((packed));
char ClientRecordArea[152] __attribute__((packed));
};
struct queue_job {
struct nw_queue_job_entry j;
u_int8_t file_handle[6];
};
#endif
#define QJE_OPER_HOLD 0x80
#define QJE_USER_HOLD 0x40
#define QJE_ENTRYOPEN 0x20
#define QJE_SERV_RESTART 0x10
#define QJE_SERV_AUTO 0x08
/* ClientRecordArea for print jobs */
#define KEEP_ON 0x0400
#define NO_FORM_FEED 0x0800
#define NOTIFICATION 0x1000
#define DELETE_FILE 0x2000
#define EXPAND_TABS 0x4000
#define PRINT_BANNER 0x8000
#ifdef SWIG
struct print_job_record {
u_int8_t Version __attribute__((packed));
u_int8_t TabSize __attribute__((packed));
u_int16_t Copies __attribute__((packed));
u_int16_t CtrlFlags __attribute__((packed));
u_int16_t Lines __attribute__((packed));
u_int16_t Rows __attribute__((packed));
fixedCharArray FormName[16] __attribute__((packed));
fixedArray Reserved[6] __attribute__((packed));
fixedCharArray BannerName[13] __attribute__((packed));
fixedCharArray FnameBanner[13] __attribute__((packed));
fixedCharArray FnameHeader[14] __attribute__((packed));
fixedCharArray Path[80] __attribute__((packed));
};
#else
struct print_job_record {
u_int8_t Version __attribute__((packed));
u_int8_t TabSize __attribute__((packed));
u_int16_t Copies __attribute__((packed));
u_int16_t CtrlFlags __attribute__((packed));
u_int16_t Lines __attribute__((packed));
u_int16_t Rows __attribute__((packed));
char FormName[16] __attribute__((packed));
u_int8_t Reserved[6] __attribute__((packed));
char BannerName[13] __attribute__((packed));
char FnameBanner[13] __attribute__((packed));
char FnameHeader[14] __attribute__((packed));
char Path[80] __attribute__((packed));
};
#endif
#endif /* _NCP_H */

1639
include/ncp/ncplib.h Normal file

File diff suppressed because it is too large Load Diff

101
include/ncp/ndslib.h Normal file
View File

@@ -0,0 +1,101 @@
/*
NDS client for ncpfs
Copyright (C) 1997 Arne de Bruijn
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _NDSLIB_H_
#define _NDSLIB_H_
#include <ncp/ncplib.h>
#define ERR_NOT_ENOUGH_MEMORY -301
#define ERR_BAD_KEY -302
#define ERR_BAD_CONTEXT -303
#define ERR_BUFFER_FULL -304
#define ERR_BAD_SYNTAX -306
#define ERR_BUFFER_EMPTY -307
#define ERR_BAD_VERB -308
#define ERR_EXPECTED_IDENTIFIER -309
#define ERR_ATTR_TYPE_EXPECTED -311
#define ERR_ATTR_TYPE_NOT_EXPECTED -312
#define ERR_FILTER_TREE_EMPTY -313
#define ERR_INVALID_OBJECT_NAME -314
#define ERR_EXPECTED_RDN_DELIMITER -315
#define ERR_TOO_MANY_TOKENS -316
#define ERR_INCONSISTENT_MULTIAVA -317
#define ERR_COUNTRY_NAME_TOO_LONG -318
#define ERR_SYSTEM_ERROR -319
#define ERR_INVALID_HANDLE -322
#define ERR_BUFFER_ZERO_LENGTH -323
#define ERR_CONTEXT_CREATION -328
#define ERR_INVALID_SERVER_RESPONSE -330
#define ERR_NULL_POINTER -331
#define ERR_NO_CONNECTION -333
#define ERR_RDN_TOO_LONG -334
#define ERR_DUPLICATE_TYPE -335
#define ERR_NOT_LOGGED_IN -337
#define ERR_INVALID_PASSWORD_CHARS -338
#define ERR_TRANSPORT -340
#define ERR_NO_SUCH_SYNTAX -341
#define ERR_INVALID_DS_NAME -342
#define ERR_UNICODE_FILE_NOT_FOUND -348
#define ERR_DN_TOO_LONG -353
#define ERR_RENAME_NOT_ALLOWED -354
#define ERR_NO_SUCH_ENTRY -601
#define ERR_NO_SUCH_ATTRIBUTE -603
#define ERR_TRANSPORT_FAILURE -625
#define ERR_ALL_REFERRALS_FAILED -626
#define ERR_NO_REFERRALS -634
#define ERR_REMOTE_FAILURE -635
#define ERR_UNREACHABLE_SERVER -636
#define ERR_INVALID_REQUEST -641
#define ERR_CRUCIAL_REPLICA -656
#define ERR_TIME_NOT_SYNCHRONIZED -659
#define ERR_FAILED_AUTHENTICATION -669
#define ERR_ALIAS_OF_AN_ALIAS -681
#define ERR_INVALID_API_VERSION -683
#define ERR_SECURE_NCP_VIOLATION -684
#define ERR_OBSOLETE_API -700
#define ERR_INVALID_SIGNATURE -707
#ifdef NCP_OBSOLETE
#include <ncp/obsolete/o_ndslib.h>
#endif
#endif /* ifndef _NDSLIB_H_ */

653
include/ncp/nwcalls.h Normal file
View File

@@ -0,0 +1,653 @@
/*
nwcalls.h
Copyright (C) 1998-2001 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1998 Petr Vandrovec <vandrove@vc.cvut.cz>
Initial revision.
1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license.
1.01 2000, June 1 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWGetBinderyAccessLevel.
1.02 2001, January 7 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added NWCC_INFO_TREE_NAME, NWCCOpenConnByName and
NWCC_NAME_FORMAT_*.
1.03 2001, January 8 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added disk retrictions API calls.
1.04 2001, January 9 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added semaphores API calls.
1.05 2001, January 27 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWScanOpenFilesByConn2, ncp_ns_scan_connections_using_file.
Added NWGetNumberNCPExtensions, NWScanNCPExtensions.
1.06 2001, February 7 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added Broadcast API calls & defines
1.07 2001, February 4 Petr Vandrovec <vandrove@vc.cvut.cz>
Added ncp_ns_scan_physical_locks_by_file.
1.08 2001, February 10 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWGetVolumeName to header.
1.09 2001, February 25 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added NWIsObjectInSet.
1.10 2001, March 4 Petr Vandrovec <vandrove@vc.cvut.cz>
Added OT_TREE_NAME.
1.11 2001, June 3 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWGetDirSpaceLimitList, NWGetDirSpaceLimitList2,
ncp_get_directory_info.
Added NW_LIMIT_LIST, NW_MAX_VOLUME_NAME_LEN, DIR_SPACE_INFO.
1.12 2001, July 16 Petr Vandrovec <vandrove@vc.cvut.cz>
Added __NWDisableBroadcasts and __NWEnableBroadcasts.
1.13 2001, September 15 Petr Vandrovec <vandrove@vc.cvut.cz>
Fixes for SWIG. Unwind nested structs so that names are defined
in this header and not by SWIG.
1.14 2001, December 12 Hans Grobler <grobh@sun.ac.za>
Added TR_ALL define.
1.15 2001, December 30 Petr Vandrovec <vandrove@vc.cvut.cz>
Updates for SWIG.
*/
#ifndef __NWCALLS_H__
#define __NWCALLS_H__
#include <ncp/ncplib.h>
#include <ncp/ext/stdint.h>
typedef unsigned int nuint;
typedef u_int8_t nuint8;
typedef u_int16_t nuint16;
typedef u_int32_t nuint32;
typedef int nint;
typedef int16_t nint16;
typedef int32_t nint32;
typedef uint_least16_t nuint16a;
typedef uint_least32_t nuint32a;
typedef int_least16_t nint16a;
typedef int_least32_t nint32a;
typedef u_int8_t nbool8;
typedef nuint32a nflag32;
typedef struct nw_info_struct NW_ENTRY_INFO;
typedef nuint NWCONN_NUM; /* nuint16 ? */
#define nameLength nameLen
union NW_FRAGMENT_fragAddr {
void* rw;
const void* ro;
};
typedef struct {
union NW_FRAGMENT_fragAddr fragAddr;
#define fragAddress fragAddr.rw
size_t fragSize;
} NW_FRAGMENT;
/* including null byte... */
#define NW_MAX_VOLUME_NAME_LEN 17
#define TR_READ NCP_PERM_READ
#define TR_WRITE NCP_PERM_WRITE
#define TR_CREATE NCP_PERM_CREATE
#define TR_ERASE NCP_PERM_DELETE
#define TR_ACCESS_CTRL NCP_PERM_OWNER
#define TR_SEARCH NCP_PERM_SEARCH
#define TR_MODIFY NCP_PERM_MODIFY
#define TR_SUPERVISOR NCP_PERM_SUPER
#define TR_ALL NCP_PERM_ALL
#define OT_USER NCP_BINDERY_USER
#define OT_USER_GROUP NCP_BINDERY_UGROUP
#define OT_FILE_SERVER NCP_BINDERY_FSERVER
#define OT_TREE_NAME NCP_BINDERY_TREE
#define IM_NAME RIM_NAME
#define IM_DIRECTORY RIM_DIRECTORY
#define IM_ALL RIM_ALL
#define A_READ_ONLY 0x00000001 /* aRDONLY... but it is htonl-ed... fixme... */
#define A_HIDDEN 0x00000002
#define A_SYSTEM 0x00000004
#define A_EXECUTE_ONLY 0x00000008
#define A_DIRECTORY 0x00000010
#define A_NEEDS_ARCHIVED 0x00000020
#define A_EXECUTE_CONFIRM 0x00000040 /* does not occur in flags */
#define A_SHAREABLE 0x00000080
#define A_SEARCH_MODE 0x00000700
#define A_DONT_SUBALLOCATE 0x00000800
#define A_TRANSACTIONAL 0x00001000
#define A_INDEXED 0x00002000
#define A_READ_AUDIT 0x00004000
#define A_WRITE_AUDIT 0x00008000
#define A_IMMEDIATE_PURGE 0x00010000
#define A_RENAME_INHIBIT 0x00020000
#define A_DELETE_INHIBIT 0x00040000
#define A_COPY_INHIBIT 0x00080000
#define A_FILE_AUDITING 0x00100000
/* reserved 0x00200000 */
#define A_FILE_MIGRATED 0x00400000
#define A_DONT_MIGRATE 0x00800000
#define A_DATA_MIGRATION_SAVE_KEY \
0x01000000
#define A_IMMEDIATE_COMPRESS 0x02000000
#define A_FILE_COMPRESSED 0x04000000
#define A_DONT_COMPRESS 0x08000000
#define A_CREATE_HARDLINK 0x10000000
#define A_CANT_COMPRESS 0x20000000
#define A_ATTRIBUTES_ARCHIVE 0x40000000
/* reserved 0x80000000 */
#define NWCC_RESERVED 0x00000000
/* note that NWCC_TRAN_TYPE_x must match NT_x */
/* in past NWCC_TRAN_TYPE_IPX was equal to 1, but no API
returned it, they returned NT_IPX instead */
#define NWCC_TRAN_TYPE_IPX 0x00000000
#define NWCC_TRAN_TYPE_IPX_old 0x00000001
#define NWCC_TRAN_TYPE_UDP 0x00000008
#define NWCC_TRAN_TYPE_TCP 0x00000009
#define NWCC_TRAN_TYPE_WILD 0x00008000
#define NWCC_OPEN_PRIVATE 0x00000004
#define NWCC_OPEN_PUBLIC 0x00000008
#define NWCC_OPEN_NEW_CONN 0x00080000 /* ncpfs specific */
#define NWCC_INFO_AUTHENT_STATE 1
#define NWCC_INFO_BCAST_STATE 2
#define NWCC_INFO_TREE_NAME 4
#define NWCC_INFO_CONN_NUMBER 5
#define NWCC_INFO_USER_ID 6
#define NWCC_INFO_SERVER_NAME 7
#define NWCC_INFO_MAX_PACKET_SIZE 9
#define NWCC_INFO_SERVER_VERSION 12
#define NWCC_INFO_TRAN_ADDR 13
#define NWCC_INFO_USER_NAME 0x4000
#define NWCC_INFO_ROOT_ENTRY 0x4001
#define NWCC_INFO_MOUNT_UID 0x4002
#define NWCC_INFO_SECURITY 0x4003
#define NWCC_INFO_MOUNT_POINT 0x4004
#define NW_MAX_SERVER_NAME_LEN 49
#define NWCC_SECUR_SIGNING_IN_USE 0x0001
#define NWCC_SECUR_LEVEL_CHECKSUM 0x0100
#define NWCC_SECUR_LEVEL_SIGN_HEADERS 0x0200
#define NWCC_SECUR_LEVEL_SIGN_ALL 0x0400
#define NWCC_SECUR_LEVEL_ENCRYPT 0x0800
/* Authentication States */
#define NWCC_AUTHENT_STATE_NONE 0x0000
#define NWCC_AUTHENT_STATE_BIND 0x0001
#define NWCC_AUTHENT_STATE_NDS 0x0002
/* Broadcast States */
#define NWCC_BCAST_PERMIT_ALL 0x0000
#define NWCC_BCAST_PERMIT_SYSTEM 0x0001
#define NWCC_BCAST_PERMIT_NONE 0x0002
#define NWCC_BCAST_PERMIT_POLL 0x0003
/* Name Format types */
#define NWCC_NAME_FORMAT_NDS 0x0001
#define NWCC_NAME_FORMAT_BIND 0x0002
#define NWCC_NAME_FORMAT_NDS_TREE 0x0008
#define NWCC_NAME_FORMAT_WILD 0x8000
typedef struct {
unsigned int major;
unsigned int minor;
unsigned int revision;
} NWCCVersion;
typedef struct {
nuint32 type;
#ifdef SWIG
%pragma(swig) readonly
size_t len;
%pragma(swig) readwrite
NWCCTranAddr_buffer buffer[32];
#else
size_t len;
void* buffer;
#endif
#if defined(SWIG_BUILD)
nuint8 bufferdata[32];
#endif
} NWCCTranAddr;
struct NWCCRootEntry {
NWVOL_NUM volume;
NWDIR_ENTRY dirEnt;
};
#ifdef __cplusplus
extern "C" {
#endif
/* misc */
NWCCODE NWCallsInit(void* __NULL1, void* __NULL2);
NWCCODE NWRequest(NWCONN_HANDLE __conn, nuint, nuint, const NW_FRAGMENT*, nuint, NW_FRAGMENT*);
NWCCODE NWRequestSimple(NWCONN_HANDLE __conn, nuint, const void*, size_t, NW_FRAGMENT*);
/* bindery */
NWCCODE NWGetObjectName(NWCONN_HANDLE __conn, NWObjectID __objectid,
char* __objectname, NWObjectType* __objecttype);
NWCCODE NWGetObjectID(NWCONN_HANDLE __conn, const char* __objectname,
NWObjectType __objecttype, NWObjectID* __objectid);
NWCCODE NWGetBinderyAccessLevel(NWCONN_HANDLE __conn, nuint8* __rights,
NWObjectID* __objectid);
NWCCODE NWLogoutFromFileServer(NWCONN_HANDLE __conn); /* ncplib.c */
NWCCODE NWVerifyObjectPassword(NWCONN_HANDLE __conn, const char* __objectname,
NWObjectType __objecttype, const char* __objectpassword); /* ncplib.c */
/* filesystem */
NWCCODE NWGetNSEntryInfo(NWCONN_HANDLE __conn, nuint __dirhandle,
const char* __path, nuint __srcns, nuint __dstns,
nuint16 __attr, nuint32 __rim, NW_ENTRY_INFO* target);
NWCCODE NWParsePath(const char* __path, char* __server,
NWCONN_HANDLE* __pconn, char* __volume, char* __volpath);
NWCCODE ncp_get_volume_name(NWCONN_HANDLE __conn, NWVOL_NUM __vol, char* __name, size_t __maxlen); /* filemgmt.c */
NWCCODE NWGetVolumeNumber(NWCONN_HANDLE __conn, const char* __name, NWVOL_NUM* __vol);
NWCCODE NWGetVolumeName(NWCONN_HANDLE __conn, NWVOL_NUM __vol, char* __volume);
NWCCODE NWGetNSLoadedList(NWCONN_HANDLE __conn,
NWVOL_NUM __vol,
size_t __maxlen,
nuint8* __nslist,
size_t* __nslen); /* filemgmt.c */
typedef struct {
u_int16_t nextRequest;
u_int16_t openCount;
#ifdef SWIG
fixedArray buffer[512];
#else
u_int8_t buffer[512];
#endif
u_int16_t curRecord;
} OPEN_FILE_CONN_CTRL;
typedef struct {
u_int16_t taskNumber;
u_int8_t lockType;
u_int8_t accessControl;
u_int8_t lockFlag;
NWVOL_NUM volNumber;
NWDIR_ENTRY parent;
NWDIR_ENTRY dirEntry;
u_int8_t forkCount;
u_int8_t nameSpace;
#ifdef SWIG
%pragma(swig) readonly
size_t nameLen;
%pragma(swig) readwrite
size_tLenPrefixCharArray fileName[255];
#else
size_t nameLen;
char fileName[255];
#endif
} OPEN_FILE_CONN;
NWCCODE
NWScanOpenFilesByConn2(NWCONN_HANDLE conn,
NWCONN_NUM connNum,
u_int16_t *iterHandle,
OPEN_FILE_CONN_CTRL *openCtrl,
OPEN_FILE_CONN *openFile);
typedef struct
#ifndef SWIG
__CONN_USING_FILE
#endif
{
NWCONN_NUM connNumber;
u_int16_t taskNumber;
u_int8_t lockType;
u_int8_t accessControl;
u_int8_t lockFlag;
} CONN_USING_FILE;
typedef struct {
u_int16_t nextRequest;
u_int16_t useCount;
u_int16_t openCount;
u_int16_t openForReadCount;
u_int16_t openForWriteCount;
u_int16_t denyReadCount;
u_int16_t denyWriteCount;
u_int8_t locked;
u_int8_t forkCount;
u_int16_t connCount;
CONN_USING_FILE connInfo[70];
} CONNS_USING_FILE;
NWCCODE
ncp_ns_scan_connections_using_file(
NWCONN_HANDLE conn,
NWVOL_NUM vol,
NWDIR_ENTRY dirent,
int datastream,
u_int16_t *iterHandle,
CONN_USING_FILE *cf,
CONNS_USING_FILE *cfa);
typedef struct
#ifndef SWIG
__PHYSICAL_LOCK
#endif
{
u_int16_t loggedCount;
u_int16_t shareableLockCount;
ncp_off64_t recordStart;
ncp_off64_t recordEnd;
NWCONN_NUM connNumber;
u_int16_t taskNumber;
u_int8_t lockType;
} PHYSICAL_LOCK;
typedef struct {
u_int16_t nextRequest;
u_int16_t numRecords;
PHYSICAL_LOCK locks[32];
u_int16_t curRecord;
#ifdef SWIG
fixedArray reserved[8];
#else
u_int8_t reserved[8];
#endif
} PHYSICAL_LOCKS;
NWCCODE
ncp_ns_scan_physical_locks_by_file(
NWCONN_HANDLE conn,
NWVOL_NUM vol,
NWDIR_ENTRY dirent,
int datastream,
u_int16_t *iterHandle,
PHYSICAL_LOCK *lock,
PHYSICAL_LOCKS *locks);
typedef struct {
u_int16_t openCount;
u_int16_t semaphoreValue;
u_int16_t taskNumber;
#ifdef SWIG
fixedCharArray semaphoreName[128];
#else
char semaphoreName[128];
#endif
} CONN_SEMAPHORE;
typedef struct {
u_int16_t nextRequest;
u_int16_t numRecords;
#ifdef SWIG
fixedArray records[508];
#else
u_int8_t records[508];
#endif
u_int16_t curOffset;
u_int16_t curRecord;
} CONN_SEMAPHORES;
NWCCODE
NWScanSemaphoresByConn(
NWCONN_HANDLE conn,
NWCONN_NUM connNum,
u_int16_t *iterHandle,
CONN_SEMAPHORE *semaphore,
CONN_SEMAPHORES *semaphores);
/* management services */
NWCCODE NWOpenBindery(NWCONN_HANDLE __conn);
NWCCODE NWCloseBindery(NWCONN_HANDLE __conn);
NWCCODE NWDownFileServer(NWCONN_HANDLE __conn, nuint __force);
NWCCODE NWEnableFileServerLogin(NWCONN_HANDLE __conn);
NWCCODE NWDisableFileServerLogin(NWCONN_HANDLE __conn);
NWCCODE NWDisableTTS(NWCONN_HANDLE __conn);
NWCCODE NWEnableTTS(NWCONN_HANDLE __conn);
/* RPC services */
NWCCODE NWSMLoadNLM(NWCONN_HANDLE __conn, const char* __nlm);
NWCCODE NWSMUnloadNLM(NWCONN_HANDLE __conn, const char* __nlm);
NWCCODE NWSMMountVolume(NWCONN_HANDLE __conn, const char* __volume,
nuint32* __volnumber);
NWCCODE NWSMDismountVolumeByName(NWCONN_HANDLE __conn, const char* __volume);
NWCCODE NWSMDismountVolumeByNumber(NWCONN_HANDLE __conn, nuint32 __volnumber);
NWCCODE NWSMExecuteNCFFile(NWCONN_HANDLE __conn, const char* __ncf);
NWCCODE NWSMSetDynamicCmdStrValue(NWCONN_HANDLE __conn, const char* __param,
const char* __value);
NWCCODE NWSMSetDynamicCmdIntValue(NWCONN_HANDLE __conn, const char* __param,
nuint32 __value);
/* connection services */
NWCCODE NWClearConnectionNumber(NWCONN_HANDLE __conn, NWCONN_NUM __connnum);
NWCCODE NWGetObjectConnectionNumbers(NWCONN_HANDLE __conn,
const char* __objectname, NWObjectType __objecttype,
size_t* noOfReturnedConns, NWCONN_NUM* conns, size_t maxConns);
NWCCODE NWGetConnListFromObject(NWCONN_HANDLE __conn, NWObjectID objID,
NWCONN_NUM firstConn,
size_t* noOfReturnedConns, NWCONN_NUM* conns125); /* returned max. 125 */
/* message services */
NWCCODE NWSendBroadcastMessage(NWCONN_HANDLE __conn, const char* message,
size_t conns, NWCONN_NUM* connArray, nuint8* deliveryStatus);
/* local connection services */
NWCCODE NWGetConnectionNumber(NWCONN_HANDLE __conn, NWCONN_NUM* __connnum);
NWCCODE NWGetFileServerName(NWCONN_HANDLE __conn, char* __server);
NWCCODE NWGetFileServerVersion(NWCONN_HANDLE __conn, u_int16_t* version);
NWCCODE NWCCGetConnInfo(NWCONN_HANDLE __conn, nuint info,
size_t conninfolen, void* conninfoaddr);
NWCCODE NWCCOpenConnBySockAddr(const struct sockaddr* addr,
enum NET_ADDRESS_TYPE type, nuint openState,
nuint reserved, NWCONN_HANDLE* __pconn);
NWCCODE NWCCOpenConnByAddr(const NWCCTranAddr* addr, nuint openState,
nuint reserved, NWCONN_HANDLE* __pconn);
NWCCODE NWCCCloseConn(NWCONN_HANDLE __conn);
/* ncp extensions */
#define MAX_NCP_EXTENSION_NAME_BYTES 33
NWCCODE NWGetNumberNCPExtensions(NWCONN_HANDLE __conn, nuint* __exts);
NWCCODE NWScanNCPExtensions(NWCONN_HANDLE __conn, nuint32* __iter,
char* __extname, nuint8* __majorVersion,
nuint8* __minorVersion, nuint8* __revision,
nuint8 __queryData[32]);
NWCCODE NWEnableBroadcasts(NWCONN_HANDLE __conn);
NWCCODE NWDisableBroadcasts(NWCONN_HANDLE __conn);
#ifdef NCPFS_VERSION
NWCCODE __NWEnableBroadcasts(NWCONN_HANDLE __conn);
NWCCODE __NWDisableBroadcasts(NWCONN_HANDLE __conn);
#endif
NWCCODE NWGetBroadcastMode(NWCONN_HANDLE __conn, nuint16* __bcstmode) ;
NWCCODE NWSetBroadcastMode(NWCONN_HANDLE __conn, nuint16 __bcstmode);
NWCCODE NWCCOpenConnByName(NWCONN_HANDLE startConn, const char *serverName,
nuint nameFormat,nuint openState,
nuint reserved, NWCONN_HANDLE* __pconn);
typedef struct
#ifndef SWIG
__NWOBJ_REST
#endif
{
NWObjectID objectID;
nuint32 restriction;
} NWOBJ_REST;
typedef struct {
nuint8 numberOfEntries;
NWOBJ_REST resInfo[12];
} NWVolumeRestrictions;
typedef struct {
nuint8 numberOfEntries;
NWOBJ_REST resInfo[16];
} NWVOL_RESTRICTIONS;
NWCCODE NWGetObjDiskRestrictions(
NWCONN_HANDLE conn,
NWVOL_NUM volNumber,
NWObjectID objectID,
nuint32* restriction,
nuint32* inUse
);
NWCCODE NWScanVolDiskRestrictions(
NWCONN_HANDLE conn,
NWVOL_NUM volNum,
nuint32* iterhandle,
NWVolumeRestrictions * volInfo
);
NWCCODE NWScanVolDiskRestrictions2(
NWCONN_HANDLE conn,
NWVOL_NUM volNum,
nuint32* iterhandle,
NWVOL_RESTRICTIONS* volInfo
);
NWCCODE NWRemoveObjectDiskRestrictions(
NWCONN_HANDLE conn,
NWVOL_NUM volNum,
NWObjectID objID
);
NWCCODE NWSetObjectVolSpaceLimit(
NWCONN_HANDLE conn,
NWVOL_NUM volNum,
NWObjectID objID,
nuint32 restriction
);
NWCCODE NWGetDirSpaceLimitList(NWCONN_HANDLE conn, NWDIR_HANDLE dirhandle,
nuint8* __buffer512);
typedef struct
#ifndef SWIG
__tag_NW_LIMIT_LIST_list
#endif
{
nuint32 level;
nuint32 max;
nuint32 current;
} __NW_LIMIT_LIST_list;
typedef struct {
size_t numEntries;
__NW_LIMIT_LIST_list list[102];
} NW_LIMIT_LIST;
NWCCODE NWGetDirSpaceLimitList2(NWCONN_HANDLE conn, NWDIR_HANDLE dirhandle,
NW_LIMIT_LIST* limitlist);
typedef struct {
nuint32 totalBlocks;
nuint32 availableBlocks;
nuint32 purgeableBlocks;
nuint32 notYetPurgeableBlocks;
nuint32 totalDirEntries;
nuint32 availableDirEntries;
nuint32 reserved;
nuint8 sectorsPerBlock;
#ifdef SWIG
%pragma(swig) readonly
nuint8 volLen;
%pragma(swig) readwrite
byteLenPrefixCharArray volName[NW_MAX_VOLUME_NAME_LEN];
#else
nuint8 volLen;
char volName[NW_MAX_VOLUME_NAME_LEN];
#endif
} DIR_SPACE_INFO;
NWCCODE ncp_get_directory_info(NWCONN_HANDLE conn, NWDIR_HANDLE dirhandle,
DIR_SPACE_INFO* target);
typedef struct {
NWCONN_NUM connNumber;
nuint16 taskNumber;
} SEMAPHORE;
typedef struct {
nuint16 nextRequest;
nuint16 openCount;
nuint16 semaphoreValue;
nuint16 semaphoreCount;
SEMAPHORE semaphores[170];
nuint16 curRecord;
} SEMAPHORES;
/********************* not yet
NWCCODE NWScanSemaphoresByName(
NWCONN_HANDLE conn,
const char* semName,
nint16* iterHandle,
SEMAPHORE * semaphore,
SEMAPHORES * semaphores
);
******************************/
NWCCODE NWSignalSemaphore(NWCONN_HANDLE conn, nuint32 semHandle);
NWCCODE NWCloseSemaphore(NWCONN_HANDLE conn, nuint32 semHandle);
NWCCODE NWOpenSemaphore(NWCONN_HANDLE conn, const char* semName,
nint16 maxCount, nuint32* semHandle, nuint16* semOpenCount);
NWCCODE NWExamineSemaphore(NWCONN_HANDLE conn, nuint32 semHandle,
nint16* semValue, nuint16* semOpenCount);
NWCCODE NWWaitOnSemaphore(NWCONN_HANDLE conn, nuint32 semHandle,
nuint16 timeOutValue);
NWCCODE NWCancelWait(NWCONN_HANDLE conn);
NWCCODE NWCCGetConnAddress(NWCONN_HANDLE conn, nuint32 bufLen,
NWCCTranAddr* tranAddr);
NWCCODE NWCCGetConnAddressLength(NWCONN_HANDLE conn, nuint32* bufLen);
NWCCODE NWIsObjectInSet(NWCONN_HANDLE conn, const char* objectName,
NWObjectType objectType, const char* propertyName,
const char* memberName, NWObjectType memberType);
#ifdef __cplusplus
}
#endif
#endif /* __NWCALLS_H__ */

197
include/ncp/nwclient.h Normal file
View File

@@ -0,0 +1,197 @@
/*
nwclient.h
Copyright (C) 2001 Patrick Pollet
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
1.00 2000, February 27 Patrick Pollet
Initial version.
1.01 2000, February 27 Petr Vandrovec <vandrove@vc.cvut.cz>
Move generic defines into nwcalls.h.
*/
#ifndef __NWCLIENT_H__
#define __NWCLIENT_H__
#include <ncp/nwnet.h>
#define ATTR_LOCATION "L"
#define ATTR_LOGIN_SCRIPT "Login Script"
#define ATTR_GRP_MBS "Group Membership"
#define ATTR_HOST_SERVER "Host Server"
#define ATTR_HOST_RN "Host Resource Name"
#define ATTR_SMTP_EMAIL "Email Address"
#define ATTR_LDAP_EMAIL "Internet Email Address"
#define ATTR_FULL_NAME "Full Name"
#define ATTR_SURNAME "Surname"
#define ATTR_GIVEN_NAME "Given Name"
#define ATTR_POSTAL_ADDRESS "Postal Address"
#define ATTR_HOME_NW "Home Directory"
#define ATTR_MESSAGE_SERVER "Message Server"
#define ATTR_LOGIN_TIME "Login Time"
#define ATTR_PROFILE "Profile"
// the proper naming attribute may be customized here (must be a CI_STRING )
#define ATTR_GECOS ATTR_FULL_NAME
// syntaxes of the used attributes
#define SYN_LOCATION SYN_CI_STRING
#define SYN_LOGIN_SCRIPT SYN_STREAM
#define SYN_UID SYN_INTEGER
#define SYN_PGNAME SYN_DIST_NAME
#define SYN_PGID SYN_INTEGER
#define SYN_GID SYN_INTEGER
#define SYN_SHELL SYN_CE_STRING
#define SYN_COM SYN_CI_STRING
#define SYN_HOME SYN_CE_STRING
#define SYN_GRP_MBS SYN_DIST_NAME
#define SYN_PROFILE SYN_DIST_NAME
#ifdef __cplusplus
extern "C" {
#endif
/* caution to follow the NWIsDSServer convention all NWCXIs* fonctions
return non zero if OK */
int NWCXIsDSServer ( NWCONN_HANDLE conn, NWDSChar * treeName);
/* same as API return 1 if OK but removes the trailings '_____'*/
int NWCXIsSameTree (NWCONN_HANDLE conn, const NWDSChar *treeName) ;
/*return 1 if conn points to the tree treeName */
int NWCXIsSameServer(NWCONN_HANDLE conn, const NWDSChar* server);
/*return 1 if conn points to the server server */
NWCCODE NWCXIsPermanentConnection (NWCONN_HANDLE conn);
/*return 1 if conn is permanent */
NWDSCCODE NWCXIsDSAuthenticated(NWDSContextHandle ctx);
/* return true if a context has authentication keys*/
NWDSCCODE NWCXGetPreferredDSTree (NWDSChar * preferTree, size_t maxLen);
NWDSCCODE NWCXGetDefaultNameContext (const NWDSChar* treeName,NWDSChar * nameContext, size_t maxLen);
NWDSCCODE NWCXGetPreferredServer (const NWDSChar * forTree,NWDSChar *preferedServer, size_t maxLen);
NWDSCCODE NWCXGetDefaultUserName (const NWDSChar * forTree,NWDSChar *defaultName, size_t maxLen);
/*may be we should return current user's Unix name if nothing found in env ? */
NWDSCCODE NWCXGetDefaultPassword (const NWDSChar * forTree,NWDSChar *defaultPwd, size_t maxLen);
NWCCODE NWCXGetPermConnInfo(NWCONN_HANDLE conn, nuint info, size_t len,void* buffer);
/* return infos specific top permanent connexions*/
/* fails if not permanent pass to NWCCGetConnInfo if needed */
NWCCODE NWCXGetPermConnList (NWCONN_HANDLE* conns , int maxEntries, int* curEntries, uid_t uid);
/* returns the list of permanent connexions belonging to user uid*/
/* if uid=-1 = all Permanent connections (Root only can call it) */
NWCCODE NWCXGetPermConnListByTreeName (NWCONN_HANDLE* conns, int maxEntries,
int* curEntries, uid_t uid,
const NWDSChar *treeName);
/* returns the list of permanent connexions belonging to user uid*/
/* and related to tree treeName */
NWCCODE NWCXGetPermConnListByServerName (NWCONN_HANDLE* conns , int maxEntries,
int* curEntries, uid_t uid,
const NWDSChar *serverName);
/* returns the list of permanent connexions belonging to user uid*/
/* and related to server serverName */
NWDSCCODE NWDSCreateContextHandleMnt(NWDSContextHandle* ctx, const NWDSChar * treeName);
/* create a context ,add to it all permanent connections related to treeName */
/* belonging to me (by using getuid()) and */
NWDSCCODE NWCXAttachToTreeByName( NWCONN_HANDLE* conn, const NWDSChar * treeName);
/* open an unauthenticated connection to the first visible server belonging to treeName*/
/* misc NDS properties reading functions to alleviate writing future utilities */
NWDSCCODE NWCXGetNDSVolumeServerAndResourceName(NWDSContextHandle ctx,const NWDSChar* ndsName,
NWDSChar* serverName, size_t serverNameMaxLen,
NWDSChar *resourceName, size_t resourceNameMaxlen);
/* return server name (DN or RN) and volume name of a NDS volume name */
NWDSCCODE NWCXGetObjectHomeDirectory(NWDSContextHandle ctx,
const NWDSChar* ndsName,
NWDSChar* serverName,
size_t serverNameMaxLen,
NWDSChar *resourceName,
size_t resourceNameMaxLen,
NWDSChar* NDSvolumeName,
size_t NDSVolumeNameMaxLen,
NWDSChar* pathName,
size_t pathNameMaxLen);
NWDSCCODE NWCXGetObjectLastLoginTime(NWDSContextHandle ctx,
const NWDSChar* ndsName,
time_t * tm);
NWDSCCODE NWCXGetObjectMessageServer(NWDSContextHandle ctx,
const NWDSChar* ndsName,
NWDSChar* serverName,
int serverNameMaxLen);
NWDSCCODE NWCXGetObjectLoginScript(NWDSContextHandle ctx,const NWDSChar* objectName,
char* buffer, int * len, int maxlen);
NWDSCCODE NWCXGetContextLoginScript(NWDSContextHandle ctx,const NWDSChar* objectName,
char* buffer, int * len,int maxlen);
NWDSCCODE NWCXGetProfileLoginScript(NWDSContextHandle ctx,const NWDSChar* objectName,
char* buffer, int * len, int maxlen);
/* read a single valued string attribute */
NWDSCCODE NWCXGetStringAttributeValue (NWDSContextHandle ctx,
const NWDSChar* objectName,
const NWDSChar* attrName,
char* buffer, int maxlen);
/* read a single valued numeric attribute */
NWDSCCODE NWCXGetIntAttributeValue (NWDSContextHandle ctx,
const NWDSChar* objectName,
const NWDSChar* attrName,
int * value);
/* read & convert to string a single valued attribute */
NWDSCCODE NWCXGetAttributeValueAsString (NWDSContextHandle ctx,
const NWDSChar* objectName,
const NWDSChar* attrName,
char* buffer, size_t maxlen);
/* read a multi valued string attribute */
/* caller MUST free the buffer created here */
NWDSCCODE NWCXGetMultiStringAttributeValue (NWDSContextHandle ctx,
const NWDSChar* objectName,
const NWDSChar* attrName,
char** buffer) ;
/* misc utilities */
NWDSCCODE NWCXSplitNameAndContext (NWDSContextHandle ctx,const NWDSChar * dn,
char * name, char* context);
#ifdef __cplusplus
}
#endif
#endif /* __NWCLIENT_H__ */

122
include/ncp/nwfse.h Normal file
View File

@@ -0,0 +1,122 @@
/*
nwfse.h
Copyright (C) 2002 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
1.00 2002, July 21 Petr Vandrovec <vandrove@vc.cvut.cz>
Initial revision.
*/
#ifndef __NWFSE_H__
#define __NWFSE_H__
#include <ncp/nwcalls.h>
typedef struct {
u_int32_t currentServerTime;
u_int8_t vconsoleVersion;
u_int8_t vconsoleRevision;
} NWSERVER_AND_VCONSOLE_INFO;
#define FSE_LOGGED_IN 0x00000001
#define FSE_BEING_ABORTED 0x00000002
#define FSE_AUDITED 0x00000004
#define FSE_NEEDS_SECURITY_CHANGE 0x00000008
#define FSE_MAC_STATION 0x00000010
#define FSE_AUTHENTICATED_TEMPORARY 0x00000020
#define FSE_AUDIT_CONNECTION_RECORDED 0x00000040
#define FSE_DSAUDIT_CONNECTION_RECORDED 0x00000080
#define FSE_WRITE 1
#define FSE_WRITE_ABORTED 2
#define FSE_NOT_WRITING 0
#define FSE_WRITE_IN_PROGRESS 1
#define FSE_WRITE_BEING_STOPPED 2
#define FSE_NCP_CONNECTION_TYPE 2
#define FSE_NLM_CONNECTION_TYPE 3
#define FSE_AFP_CONNECTION_TYPE 4
#define FSE_FTAM_CONNECTION_TYPE 5
#define FSE_ANCP_CONNECTION_TYPE 6
#define FSE_ACP_CONNECTION_TYPE 7
#define FSE_SMB_CONNECTION_TYPE 8
#define FSE_WINSOCK_CONNECTION_TYPE 9
#define FSE_HTTP_CONNECTION_TYPE 10
#define FSE_UDP_CONNECTION_TYPE 11
typedef struct {
u_int32_t connNum;
u_int32_t useCount;
u_int8_t connServiceType;
u_int8_t loginTime[7];
u_int32_t status;
u_int32_t expirationTime;
u_int32_t objType;
u_int8_t transactionFlag;
u_int8_t logicalLockThreshold;
u_int8_t recordLockThreshold;
u_int8_t fileWriteFlags;
u_int8_t fileWriteState;
u_int8_t filler;
u_int16_t fileLockCount;
u_int16_t recordLockCount;
u_int64_t totalBytesRead;
u_int64_t totalBytesWritten;
u_int32_t totalRequests;
u_int32_t heldRequests;
u_int64_t heldBytesRead;
u_int64_t heldBytesWritten;
} NWUSER_INFO;
typedef struct {
NWSERVER_AND_VCONSOLE_INFO serverTimeAndVConsoleInfo;
u_int16_t reserved;
NWUSER_INFO userInfo;
} NWFSE_USER_INFO;
#define NWFSE_NLM_NUMS_MAX 130
typedef struct {
NWSERVER_AND_VCONSOLE_INFO serverTimeAndVConsoleInfo;
u_int16_t reserved;
u_int32_t numberNLMsLoaded;
u_int32_t NLMsInList;
u_int32_t NLMNums[NWFSE_NLM_NUMS_MAX];
} NWFSE_NLM_LOADED_LIST;
#ifdef __NWCOMPAT__
typedef NWSERVER_AND_VCONSOLE_INFO SERVER_AND_VCONSOLE_INFO;
typedef NWUSER_INFO USER_INFO;
#define FSE_NLM_NUMS_MAX NWFSE_NLM_NUMS_MAX
#endif
#ifdef __cplusplus
extern "C" {
#endif
NWCCODE NWGetUserInfo(NWCONN_HANDLE conn, NWCONN_NUM connNum, char *userName, NWFSE_USER_INFO *userInfo);
NWCCODE NWGetNLMLoadedList(NWCONN_HANDLE conn, u_int32_t startNum, NWFSE_NLM_LOADED_LIST *fseNLMLoadedList);
#ifdef __cplusplus
}
#endif
#endif /* __NWFSE_H__ */

954
include/ncp/nwnet.h.in Normal file
View File

@@ -0,0 +1,954 @@
/*
nwnet.h
Copyright (C) 1999 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Revision history:
0.00 1999 Petr Vandrovec <vandrove@vc.cvut.cz>
Initial revision.
1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added license.
1.01 2000, February 7 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSSearch* function group.
1.02 2000, April Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSGenerateObjectKeyPair, NWDSVerifyObjectPassword,
NWDSChangeObjectPassword functions group.
1.03 2000, April 26 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSGetNDSStatistics, NWDSAbortPartitionOperation,
NWDSGetCountByClassAndName.
1.04 2000, April 27 Petr Vandrovec <vandrove@vc.cvut.cz>
Added DSPING* definitions.
Added NWDSGetDSVerInfo, NWDSJoinPartitions,
NWDSListPartitions, NWDSGetServerName.
1.05 2000, April 28 Petr Vandrovec <vandrove@vc.cvut.cz>
Added DSP_* definitions.
Added NWDSListPartitionsExtInfo, NWDSGetPartitionInfo,
NWDSGetPartitionExtInfoPtr, NWDSGetPartitionExtInfo,
NWDSSplitPartition, NWDSRemovePartition.
1.06 2000, April 29 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSAddReplica, NWDSRemoveReplica, NWDSChangeReplicaType.
1.07 2000, April 30 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSPartitionReceiveAllUpdates,
NWDSPartitionSendAllUpdates, NWDSSyncPartition,
NWDSGetPartitionRoot.
Added NWDSGetEffectiveRights, NWDSListAttrsEffectiveRights.
Added NWDSExtSyncList, NWDSExtSyncRead.
1.08 2000, May 1 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSGetBinderyContext, NWDSReloadDS,
NWDSResetNDSStatistics.
Added NWDSRepairTimeStamps.
Added NWGetFileServerUTCTime.
1.09 2000, May 4 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSReadClassDef, NWDSGetClassDefCount, NWDSGetClassDef.
1.10 2000, May 6 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSGetClassItemCount, NWDSGetClassItem.
1.11 2000, May 7 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSPutClassItem, NWDSPutClassName, NWDSBeginClassItem,
NWDSDefineClass, NWDSRemoveClassDef,
NWDSListContainableClasses, NWDSModifyClassDef,
NWDSReadAttrDef, NWDSGetAttrDef, NWDSDefineAttr,
NWDSRemoveAttrDef.
1.12 2000, May 8 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSSyncSchema.
1.13 2001, January 15 Patrick Pollet <patrick.pollet@insa-lyon.fr>
Added NWDSReadSyntaxes, NWDSPutSyntaxName,NWDSGetSyntaxDef,
NWDSGetSyntaxCount,NWDSReadSyntaxDef, NWDSGetSyntaxID,
NWDSScanConnsForTrees, NWDSScanForAvailableTrees,
NWDSReturnBlockOfAvailableTrees, NWDSWhoAmI
1.14 2001, March 10 Petr Vandrovec <vandrove@vc.cvut.cz>
Moved several defs from nwclient here.
1.15 2001, June 2 Petr Vandrovec <vandrove@vc.cvut.cz>
Add NWDSPutFilter and NWDSFreeFilter.
1.16 2001, December 11 Hans Grobler <grobh@sun.ac.za>
Added DS_ATTR_* definitions.
1.17 2001, December 31 Petr Vandrovec <vandrove@vc.cvut.cz>
Added NWDSDuplicateContext.
1.18 2002, January 20 Petr Vandrovec <vandrove@vc.cvut.cz>
Added __NWDSOpenStream.
*/
#ifndef __NWNET_H__
#define __NWNET_H__
#include <ncp/ndslib.h>
#include <ncp/nwcalls.h>
@wchar_h@
#ifndef NWDSChar
typedef char NWDSChar;
#define NWDSChar NWDSChar
#endif
#ifdef SWIG
struct __NWDSContextHandle;
#endif
typedef struct __NWDSContextHandle *NWDSContextHandle;
typedef int NWDSCCODE;
#define DCK_FLAGS 1
#define DCK_CONFIDENCE 2
#define DCK_NAME_CONTEXT 3
#define DCK_LAST_CONNECTION 8
#define DCK_TREE_NAME 11
#define DCK_DSI_FLAGS 12
#define DCK_NAME_FORM 13
#define DCK_LOCAL_CHARSET 32
#define DCV_DEREF_ALIASES 0x00000001
#define DCV_XLATE_STRINGS 0x00000002
#define DCV_TYPELESS_NAMES 0x00000004
#define DCV_CANONICALIZE_NAMES 0x00000010
#define DCV_DEREF_BASE_CLASS 0x00000040
#define DCV_DISALLOW_REFERRALS 0x00000080
#define DCV_LOW_CONF 0
#define DCV_MED_CONF 1
#define DCV_HIGH_CONF 2
#define MAX_RDN_CHARS 128
#define MAX_DN_CHARS 256
#define MAX_SCHEMA_NAME_CHARS 32
#define MAX_TREE_NAME_CHARS 32
#define MAX_ASN1_NAME 32
#define MAX_RDN_BYTES (4*(MAX_RDN_CHARS+1))
#define MAX_DN_BYTES (4*(MAX_DN_CHARS+1))
#define MAX_SCHEMA_NAME_BYTES (4*(MAX_SCHEMA_NAME_CHARS+1))
#define MAX_TREE_NAME_BYTES (4*(MAX_TREE_NAME_CHARS+1))
#define DS_NCP_VERB 104
#define DS_NCP_PING 1
#define DS_NCP_FRAGMENT 2
#define DS_NCP_BINDERY_CONTEXT 4
#define DS_NCP_GET_DS_STATISTICS 6
#define DS_NCP_RESET_DS_COUNTERS 7
#define DS_NCP_RELOAD 8
#define DSPING_SUPPORTED_FIELDS 0x00000001
#define DSPING_DEPTH 0x00000002
#define DSPING_BUILD_NUMBER 0x00000004
#define DSPING_FLAGS 0x00000008
/* also 0x3F0 flags are defined, but as they are not exposed through any NW API...
BTW, you must use ping v1 for them */
#define DSPING_SAP_NAME 0x00010000
#define DSPING_TREE_NAME 0x00020000
/* also 0x001C0000 flags are defined, but as they are not exposed through any NW API...
BTW, you must use ping v1 for them */
#define DSV_RESOLVE_NAME 1
#define DSV_READ_ENTRY_INFO 2
#define DSV_READ 3
#define DSV_COMPARE 4
#define DSV_LIST 5
#define DSV_SEARCH 6
#define DSV_ADD_ENTRY 7
#define DSV_REMOVE_ENTRY 8
#define DSV_MODIFY_ENTRY 9
#define DSV_MODIFY_RDN 10
#define DSV_DEFINE_ATTR 11
#define DSV_READ_ATTR_DEF 12
#define DSV_REMOVE_ATTR_DEF 13
#define DSV_DEFINE_CLASS 14
#define DSV_READ_CLASS_DEF 15
#define DSV_MODIFY_CLASS_DEF 16
#define DSV_REMOVE_CLASS_DEF 17
#define DSV_LIST_CONTAINABLE_CLASSES 18
#define DSV_GET_EFFECTIVE_RIGHTS 19
#define DSV_REMOVE_PARTITION 21
#define DSV_LIST_PARTITIONS 22
#define DSV_SPLIT_PARTITION 23
#define DSV_JOIN_PARTITIONS 24
#define DSV_ADD_REPLICA 25
#define DSV_REMOVE_REPLICA 26
#define DSV_OPEN_STREAM 27
#define DSV_SEARCH_FILTER 28
#define DSV_CHANGE_REPLICA_TYPE 31
#define DSV_SYNC_PARTITION 38
#define DSV_SYNC_SCHEMA 39
#define DSV_READ_SYNTAXES 40
#define DSV_BEGIN_MOVE_ENTRY 42
#define DSV_FINISH_MOVE_ENTRY 43
#define DSV_CLOSE_ITERATION 50
#define DSV_GET_SERVER_ADDRESS 53
#define DSV_SET_KEYS 54
#define DSV_CHANGE_PASSWORD 55
#define DSV_VERIFY_PASSWORD 56
#define DSV_BEGIN_LOGIN 57
#define DSV_FINISH_LOGIN 58
#define DSV_BEGIN_AUTHENTICATION 59
#define DSV_FINISH_AUTHENTICATION 60
#define DSV_REPAIR_TIMESTAMPS 63
#define DSV_ABORT_PARTITION_OPERATION 76
#define DSV_PARTITION_FUNCTIONS 78
#define DSV_GET_BINDERY_CONTEXTS 95
#define DSI_OUTPUT_FIELDS 0x00000001
#define DSI_ENTRY_ID 0x00000002
#define DSI_ENTRY_FLAGS 0x00000004
#define DSI_SUBORDINATE_COUNT 0x00000008
#define DSI_MODIFICATION_TIME 0x00000010
#define DSI_MODIFICATION_TIMESTAMP 0x00000020
#define DSI_CREATION_TIMESTAMP 0x00000040
#define DSI_PARTITION_ROOT_ID 0x00000080
#define DSI_PARENT_ID 0x00000100
#define DSI_REVISION_COUNT 0x00000200
#define DSI_REPLICA_TYPE 0x00000400
#define DSI_BASE_CLASS 0x00000800
#define DSI_ENTRY_RDN 0x00001000
#define DSI_ENTRY_DN 0x00002000
#define DSI_PARTITION_ROOT_DN 0x00004000
#define DSI_PARENT_DN 0x00008000
#define DSI_PURGE_TIME 0x00010000
#define DSI_DEREFERENCE_BASE_CLASS 0x00020000
#define DSI_REPLICA_NUMBER 0x00040000
#define DSI_REPLICA_STATE 0x00080000
#define DCV_NF_PARTIAL_DOT 1
#define DCV_NF_FULL_DOT 2
#define DCV_NF_SLASH 3
#define DEFAULT_MESSAGE_LEN 4096
#ifdef SWIG
#define NO_MORE_ITERATIONS (0xFFFFFFFFUL)
#else
#define NO_MORE_ITERATIONS ((nuint32)-1)
#endif
/* DSV_READ */
#define DS_ATTRIBUTE_NAMES 0x00
#define DS_ATTRIBUTE_VALUES 0x01
#define DS_EFFECTIVE_PRIVILEGES 0x02 /* only for NWDSListAttrsEffectiveRights */
#define DS_VALUE_INFO 0x03
#define DS_ABBREVIATED_VALUE 0x04
/* DSV_MODIFY_ENTRY */
#define DS_ADD_ATTRIBUTE 0x00
#define DS_REMOVE_ATTRIBUTE 0x01 /* does not have value... */
#define DS_ADD_VALUE 0x02
#define DS_REMOVE_VALUE 0x03
#define DS_ADDITIONAL_VALUE 0x04
#define DS_OVERWRITE_VALUE 0x05
#define DS_CLEAR_ATTRIBUTE 0x06 /* does not have value... */
#define DS_CLEAR_VALUE 0x07
/* DSV_SEARCH */
#define DS_SEARCH_ENTRY 0x00
#define DS_SEARCH_SUBORDINATES 0x01
#define DS_SEARCH_SUBTREE 0x02
#define DS_SEARCH_PARTITION 0x03
/* DSV_READ_CLASS_DEF */
#define DS_CLASS_DEF_NAMES 0
#define DS_CLASS_DEFS 1
#define DS_EXPANDED_CLASSS_DEFS 2
#define DS_INFO_CLASS_DEFS 3
#define DS_FULL_CLASS_DEFS 4
/* #define DS_FULL_CLASS_DEFS_AND_TIMESTAMPS 5 */
/* NWDSGenerateObjectKeyPair* */
#define NDS_PASSWORD 1
/* DSV_LIST_PARTITIONS */
#define DSP_OUTPUT_FIELDS 0x00000001
#define DSP_PARTITION_ID 0x00000002
#define DSP_REPLICA_STATE 0x00000004
#define DSP_MODIFICATION_TIMESTAMP 0x00000008
#define DSP_PURGE_TIME 0x00000010
#define DSP_LOCAL_PARTITION_ID 0x00000020
#define DSP_PARTITION_DN 0x00000040
#define DSP_REPLICA_TYPE 0x00000080
#define DSP_PARTITION_BUSY 0x00000100
/* #define DSP_UNKNOWN_00000200 0x00000200 NDS 8.17 does not have it, beta of DirXML NDS 8400 has it */
/* NDS Attribute Rights */
#define DS_ENTRY_BROWSE 0x00000001
#define DS_ENTRY_ADD 0x00000002
#define DS_ENTRY_DELETE 0x00000004
#define DS_ENTRY_RENAME 0x00000008
#define DS_ENTRY_SUPERVISOR 0x00000010
#define DS_ENTRY_INHERIT_CTL 0x00000040
#define DS_ENTRY_MASK (DS_ENTRY_BROWSE | DS_ENTRY_ADD | DS_ENTRY_DELETE | \
DS_ENTRY_RENAME | DS_ENTRY_SUPERVISOR | \
DS_ENTRY_INHERIT_CTL)
#define DS_ATTR_COMPARE 0x00000001
#define DS_ATTR_READ 0x00000002
#define DS_ATTR_WRITE 0x00000004
#define DS_ATTR_SELF 0x00000008
#define DS_ATTR_SUPERVISOR 0x00000020
#define DS_ATTR_INHERIT_CTL 0x00000040
#define DS_ATTR_MASK (DS_ATTR_COMPARE | DS_ATTR_READ | DS_ATTR_WRITE | \
DS_ATTR_SELF | DS_ATTR_SUPERVISOR | \
DS_ATTR_INHERIT_CTL)
typedef enum SYNTAX {
SYN_UNKNOWN = 0, /* 0 */
SYN_DIST_NAME, /* 1 */
SYN_CE_STRING, /* 2 */
SYN_CI_STRING, /* 3 */
SYN_PR_STRING, /* 4 */
SYN_NU_STRING, /* 5 */
SYN_CI_LIST, /* 6 */
SYN_BOOLEAN, /* 7 */
SYN_INTEGER, /* 8 */
SYN_OCTET_STRING, /* 9 */
SYN_TEL_NUMBER, /* 10 */
SYN_FAX_NUMBER, /* 11 */
SYN_NET_ADDRESS, /* 12 */
SYN_OCTET_LIST, /* 13 */
SYN_EMAIL_ADDRESS, /* 14 */
SYN_PATH, /* 15 */
SYN_REPLICA_POINTER, /* 16 */
SYN_OBJECT_ACL, /* 17 */
SYN_PO_ADDRESS, /* 18 */
SYN_TIMESTAMP, /* 19 */
SYN_CLASS_NAME, /* 20 */
SYN_STREAM, /* 21 */
SYN_COUNTER, /* 22 */
SYN_BACK_LINK, /* 23 */
SYN_TIME, /* 24 */
SYN_TYPED_NAME, /* 25 */
SYN_HOLD, /* 26 */
SYN_INTERVAL, /* 27 */
SYNTAX_COUNT
} SYNTAX;
#ifndef SWIG
typedef struct {
size_t numOfBits;
u_int8_t* data;
} Bit_String_T;
typedef NWDSChar * DN_T; /* 1, SYN_DIST_NAME */
typedef NWDSChar * CE_String_T; /* 2, SYN_CE_STRING */
typedef NWDSChar * CI_String_T; /* 3, SYN_CI_STRING */
typedef NWDSChar * PR_String_T; /* 4, SYN_PR_STRING */
typedef NWDSChar * NU_String_T; /* 5, SYN_NU_STRING */
typedef struct _ci_list {
struct _ci_list* next;
NWDSChar* s;
} CI_List_T; /* 6, SYN_CI_LIST */
typedef nuint8 Boolean_T; /* 7, SYN_BOOLEAN */
typedef nint32a Integer_T; /* 8, SYN_INTEGER */
typedef struct {
size_t length;
u_int8_t* data;
} Octet_String_T; /* 9, SYN_OCTET_STRING */
typedef NWDSChar * TN_String_T; /* 10, SYN_TEL_NUMBER */
typedef struct {
NWDSChar* telephoneNumber;
Bit_String_T parameters;
} Fax_Number_T; /* 11, SYN_FAX_NUMBER */
typedef struct {
enum NET_ADDRESS_TYPE addressType;
size_t addressLength;
u_int8_t* address;
} Net_Address_T; /* 12, SYN_NET_ADDRESS */
typedef struct _octet_list {
struct _octet_list* next;
size_t length;
u_int8_t* data;
} Octet_List_T; /* 13, SYN_OCTET_LIST */
typedef struct {
nuint32a type;
NWDSChar* address;
} EMail_Address_T; /* 14, SYN_EMAIL_ADDRESS */
typedef struct {
nuint32a nameSpaceType;
NWDSChar* volumeName;
NWDSChar* path;
} Path_T; /* 15, SYN_PATH */
typedef struct {
NWDSChar* serverName;
nint32a replicaType;
nint32a replicaNumber;
size_t count;
Net_Address_T replicaAddressHint[1];
} Replica_Pointer_T; /* 16, SYN_REPLICA_POINTER */
typedef struct {
NWDSChar* protectedAttrName;
NWDSChar* subjectName;
nuint32a privileges;
} Object_ACL_T; /* 17, SYN_OBJECT_ACL */
typedef NWDSChar *
Postal_Address_T[6]; /* 18, SYN_PO_ADDRESS */
#endif /* not SWIG */
typedef struct {
nuint32a wholeSeconds;
nuint16a replicaNum;
nuint16a eventID;
} TimeStamp_T; /* 19, SYN_TIMESTAMP */
#ifndef SWIG
typedef NWDSChar * Class_Name_T; /* 20, SYN_CLASS_NAME */
typedef Octet_String_T Stream_T; /* 21, SYN_STREAM */
typedef nuint32a Counter_T; /* 22, SYN_COUNTER */
typedef struct {
NWObjectID remoteID;
NWDSChar* objectName;
} Back_Link_T; /* 23, SYN_BACK_LINK */
typedef time_t Time_T; /* 24, SYN_TIME */
typedef struct {
NWDSChar* objectName;
nuint32a level;
nuint32a interval;
} Typed_Name_T; /* 25, SYN_TYPED_NAME */
typedef struct {
NWDSChar* objectName;
nuint32a amount;
} Hold_T; /* 26, SYN_HOLD */
#if 0 /* SYN_INTERVAL uses SYN_INTEGER directly ?! */
typedef nuint32a Interval_T; /* 27, SYN_INTERVAL */
#endif
#endif /* not SWIG */
#ifdef SWIG
struct tagAsn1ID_T {
%pragma(swig) readonly
size_t length;
%pragma(swig) readwrite
size_tLenPrefixCharArray data[MAX_ASN1_NAME];
};
typedef struct tagAsn1ID_T Asn1ID_T;
#else
typedef struct
#ifdef SWIG_BUILD
tagAsn1ID_T
#endif
{
size_t length;
nuint8 data[MAX_ASN1_NAME];
} Asn1ID_T;
#endif
typedef struct {
nuint32a attrFlags;
enum SYNTAX attrSyntaxID;
nuint32 attrLower;
nuint32 attrUpper;
Asn1ID_T asn1ID;
} Attr_Info_T;
typedef struct {
nuint32a classFlags;
Asn1ID_T asn1ID;
} Class_Info_T;
typedef struct {
nuint32a objectFlags;
nuint32a subordinateCount;
time_t modificationTime;
/* we cannot make this type NWDSChar... */
char baseClass[MAX_SCHEMA_NAME_BYTES + 2];
} Object_Info_T;
struct tagBuf_T {
nuint operation;
nuint bufFlags;
nuint8* dataend;
nuint8* curPos;
nuint8* data;
nuint8* allocend;
nuint cmdFlags; /* NWDSRead, NWDSSearch */
nuint32 dsiFlags; /* NWDSSearch, NWDSReadObjectInfo */
nuint8* attrCountPtr; /* used by NWDSPutAttrName/NWDSPutChange */
nuint8* valCountPtr; /* used by NWDSPutAttrVal */
};
typedef struct tagBuf_T Buf_T;
typedef Buf_T *pBuf_T;
typedef pBuf_T *ppBuf_T;
typedef struct {
nuint32 statsVersion;
nuint32 noSuchEntry;
nuint32 localEntry;
nuint32 typeReferral;
nuint32 aliasReferral;
nuint32 requestCount;
nuint32 requestDataSize;
nuint32 replyDataSize;
nuint32 resetTime;
nuint32 transportReferral;
nuint32 upReferral;
nuint32 downReferral;
} NDSStatsInfo_T;
typedef nuint32a NWObjectCount;
/* we are using the same env names as the Caldera client (hope they won't mind) */
#define PREFER_TREE_ENV "NWCLIENT_PREFERRED_TREE"
#define PREFER_CTX_ENV "NWCLIENT_DEFAULT_NAME_CONTEXT"
#define PREFER_SRV_ENV "NWCLIENT_PREFERRED_SERVER"
#define PREFER_USER_ENV "NWCLIENT_DEFAULT_USER"
/*this one is an extra by PP for a possible autologon*/
#define PREFER_PWD_ENV "NWCLIENT_DEFAULT_PASSWORD"
#ifdef __cplusplus
extern "C" {
#endif
NWDSCCODE NWDSInitRequester(void); /* temporary */ /* D */
NWDSCCODE NWCFragmentRequest(NWCONN_HANDLE conn, nuint32 verb,
nuint numRq, const NW_FRAGMENT* rq,
nuint numRp, NW_FRAGMENT* rp, size_t *replyLen);
NWDSCCODE NWDSCreateContextHandle(NWDSContextHandle* ctx); /* D */
NWDSContextHandle NWDSCreateContext(void); /* obsolete */ /* D */
NWDSCCODE NWDSDuplicateContextHandle(NWDSContextHandle ctx,
NWDSContextHandle* newctx); /* D */
NWDSContextHandle NWDSDuplicateContext(NWDSContextHandle ctx); /* obsolete */ /* D */
NWDSCCODE NWDSFreeContext(NWDSContextHandle ctxToFree); /* D */
NWDSCCODE NWDSGetContext2(NWDSContextHandle ctx, int key,
void* ptr, size_t len);
NWDSCCODE NWDSGetContext(NWDSContextHandle ctx, int key, void* ptr);
NWDSCCODE NWDSSetContext(NWDSContextHandle ctx, int key, const void* ptr);
NWDSCCODE NWDSSetTransport(NWDSContextHandle, size_t, const NET_ADDRESS_TYPE*);
NWDSCCODE NWDSAllocBuf(size_t Buf_T_size, pBuf_T *buf); /* D */
NWDSCCODE NWDSFreeBuf(pBuf_T freebuf); /* D */
NWDSCCODE NWDSInitBuf(NWDSContextHandle ctx, nuint verb, Buf_T* initBuf); /* D */
NWDSCCODE NWDSComputeAttrValSize(NWDSContextHandle ctx, Buf_T* buf,
enum SYNTAX synt, size_t* size); /* D */
NWDSCCODE NWDSGetAttrVal(NWDSContextHandle ctx, Buf_T* buf, enum SYNTAX synt,
void* val); /* D */
NWDSCCODE NWDSGetAttrCount(NWDSContextHandle ctx, Buf_T* buf,
NWObjectCount* count); /* D */
NWDSCCODE NWDSGetAttrName(NWDSContextHandle ctx, Buf_T* buf, NWDSChar* name,
NWObjectCount* valcount, enum SYNTAX* syntaxID); /* D */
NWDSCCODE NWDSGetAttrValFlags(NWDSContextHandle ctx, Buf_T* buf,
nuint32* flags); /* D */
NWDSCCODE NWDSGetAttrValModTime(NWDSContextHandle ctx, Buf_T* buf,
TimeStamp_T* stamp); /* D */
NWDSCCODE NWDSPutAttrVal(NWDSContextHandle ctx, Buf_T* buf,
enum SYNTAX syntaxID, const void* attrVal_syn3); /* Partially */
NWDSCCODE NWDSPutAttrName(NWDSContextHandle ctx, Buf_T* buf,
const NWDSChar* name); /* D */
NWDSCCODE NWDSPutAttrNameAndVal(NWDSContextHandle ctx, Buf_T* buf,
const NWDSChar* name, enum SYNTAX syntaxID,
const void* attrVal_syn4); /* Partially */
NWDSCCODE NWDSPutChange(NWDSContextHandle ctx, Buf_T* buf,
nuint changeType, const NWDSChar* name); /* D */
NWDSCCODE NWDSPutChangeAndVal(NWDSContextHandle ctx, Buf_T* buf,
nuint changeType, const NWDSChar* name,
enum SYNTAX syntaxID, const void* attrVal_syn5); /* Partially */
NWDSCCODE NWDSGetObjectCount(NWDSContextHandle ctx, Buf_T* buf,
NWObjectCount* count); /* D */
NWDSCCODE NWDSGetObjectName(NWDSContextHandle ctx, Buf_T* buf, NWDSChar* name,
NWObjectCount* attrs, Object_Info_T* oit); /* D */
NWDSCCODE NWDSGetObjectNameAndInfo(NWDSContextHandle ctx, Buf_T* buf,
NWDSChar* name, NWObjectCount* attrs, char** info);
NWDSCCODE NWDSGetPartitionInfo(NWDSContextHandle ctx, Buf_T* buf,
NWDSChar* partitionRoot, nuint32* replicaType);
NWDSCCODE NWDSGetPartitionExtInfoPtr(NWDSContextHandle ctx, Buf_T* buf,
char** infoPtr, char** infoPtrEnd);
NWDSCCODE NWDSGetPartitionExtInfo(NWDSContextHandle ctx, char* infoPtr,
char* infoPtrEnd, nflag32 infoFlag,
size_t* length, void* data);
NWDSCCODE NWDSGetServerName(NWDSContextHandle ctx, Buf_T* buf,
NWDSChar* serverDN, NWObjectCount* partCount);
NWDSCCODE NWDSGetDSIInfo(NWDSContextHandle ctx, void* buffer, size_t blen,
nuint32 dsiflag, void* dst);
NWDSCCODE NWDSRemoveAllTypesW(NWDSContextHandle ctx, const wchar_t* src,
wchar_t* dst);
NWDSCCODE NWDSRemoveAllTypes(NWDSContextHandle ctx, const NWDSChar* src,
NWDSChar* dst); /* D */
NWDSCCODE NWDSCanonicalizeNameW(NWDSContextHandle ctx, const wchar_t* src,
wchar_t* dst);
NWDSCCODE NWDSCanonicalizeName(NWDSContextHandle ctx, const NWDSChar* src,
NWDSChar* dst); /* D */
NWDSCCODE NWDSAbbreviateNameW(NWDSContextHandle ctx, const wchar_t* src,
wchar_t* dst);
NWDSCCODE NWDSAbbreviateName(NWDSContextHandle ctx, const NWDSChar* src,
NWDSChar* dst); /* D */
NWDSCCODE NWDSGetBinderyContext(NWDSContextHandle ctx,
NWCONN_HANDLE conn, NWDSChar* binderyEmulationContext); /* D */
NWDSCCODE __NWGetFileServerUTCTime(NWCONN_HANDLE conn,
nuint32* timev, nuint32* OUTPUT, nuint32* flags,
nuint32* OUTPUT2, nuint32* OUTPUT3, nuint32* OUTPUT4,
nuint32* OUTPUT5); /* D */
NWDSCCODE NWGetFileServerUTCTime(NWCONN_HANDLE conn, nuint32* timev); /* D */
NWDSCCODE NWDSGetObjectHostServerAddress(NWDSContextHandle ctx,
const NWDSChar* objectName, NWDSChar* serverDN,
Buf_T* serverAddresses); /* D */
NWDSCCODE NWDSGetServerDN(NWDSContextHandle ctx, NWCONN_HANDLE conn,
NWDSChar* name); /* D */
NWDSCCODE NWDSGetServerAddress(NWDSContextHandle ctx, NWCONN_HANDLE conn,
NWObjectCount* addrcnt, Buf_T* addrBuf); /* D */
NWDSCCODE NWDSGetServerAddress2(NWDSContextHandle ctx, NWCONN_HANDLE conn,
NWObjectCount* addrcnt, Buf_T* addrBuf); /* D */
NWDSCCODE NWDSMapIDToName(NWDSContextHandle ctx, NWCONN_HANDLE conn,
NWObjectID ID, NWDSChar* name); /* D */
NWDSCCODE NWDSMapNameToID(NWDSContextHandle ctx, NWCONN_HANDLE conn,
const NWDSChar* name, NWObjectID* ID); /* D */
NWDSCCODE NWDSGetDSVerInfo(NWCONN_HANDLE conn, nuint32* dsVersion,
nuint32* rootMostEntryDepth, char* sapName, nuint32* flags,
wchar_t* treeName); /* D */
NWDSCCODE NWDSGetNDSStatistics(NWDSContextHandle ctx,
const NWDSChar* serverDN, size_t statsInfoLen,
NDSStatsInfo_T* statsInfo); /* D */
NWDSCCODE NWDSReloadDS(NWDSContextHandle ctx, const NWDSChar* serverDN); /* D */
NWDSCCODE NWDSResetNDSStatistics(NWDSContextHandle ctx,
const NWDSChar* serverDN);
NWDSCCODE __NWDSCompare(NWDSContextHandle ctx, NWCONN_HANDLE conn,
NWObjectID objectID, Buf_T* buf, nbool8* matched);
NWDSCCODE __NWDSOpenStream(NWDSContextHandle ctx, const NWDSChar* objectName,
const NWDSChar* attrName, nflag32 flags, NWCONN_HANDLE* rconn,
char fileHandle[6], ncp_off64_t* fileSize);
NWDSCCODE NWDSAddObject(NWDSContextHandle ctx, const NWDSChar* name,
nuint32* iterHandle, nbool8 more, Buf_T* buf); /* D */
NWDSCCODE NWDSAuthenticateConn(NWDSContextHandle ctx, NWCONN_HANDLE conn);
NWDSCCODE NWDSChangeObjectPassword(NWDSContextHandle ctx, nflag32 flags,
const NWDSChar* objectName, const char* oldPassword,
const char* newPassword);
NWDSCCODE NWDSCloseIteration(NWDSContextHandle ctx, nuint32 iterHandle,
nuint32 verb);
NWDSCCODE NWDSCompare(NWDSContextHandle ctx, const NWDSChar* name,
Buf_T* buf, nbool8* matched);
NWDSCCODE NWDSExtSyncList(NWDSContextHandle ctx, const NWDSChar* objectName,
const NWDSChar* className, const NWDSChar* subordinateName,
nuint32* iterHandle, const TimeStamp_T* timeStamp,
nuint onlyContainers, Buf_T* objectList);
NWDSCCODE NWDSExtSyncRead(NWDSContextHandle ctx, const NWDSChar* objectName,
nuint infoType, nuint allAttrs, Buf_T* in_attrNames,
nuint32* iterHandle, const TimeStamp_T* timeStamp,
Buf_T* objectInfo);
NWDSCCODE NWDSExtSyncSearch(NWDSContextHandle ctx, const NWDSChar* objectName,
nint scope, nuint searchAliases, Buf_T* in_filter,
const TimeStamp_T* timeStamp, nuint infoType,
nuint allAttrs, Buf_T* in_attrNames, nuint32* iterHandle,
NWObjectCount countObjectsToSearch,
NWObjectCount* countObjectsSearched,
Buf_T* objectInfo);
NWDSCCODE NWDSGenerateObjectKeyPair2(NWDSContextHandle ctx,
const NWDSChar* objectName, NWObjectID pseudoID, size_t pwdLen,
const nuint8* pwdHash, nflag32 optionsFlag);
NWDSCCODE NWDSGenerateObjectKeyPair(NWDSContextHandle ctx,
const NWDSChar* objectName, const char* objectPassword,
nflag32 optionsFlag);
NWDSCCODE NWDSGetCountByClassAndName(NWDSContextHandle ctx,
const NWDSChar* objectName, const NWDSChar* className,
const NWDSChar* subordinateName, NWObjectCount* count);
NWDSCCODE NWDSGetEffectiveRights(NWDSContextHandle ctx,
const NWDSChar* subjectName, const NWDSChar* objectName,
const NWDSChar* attrName, nuint32* privileges);
NWDSCCODE NWDSList(NWDSContextHandle ctx, const NWDSChar* name,
nuint32* iterHandle, Buf_T* objectList); /* D */
NWDSCCODE NWDSListAttrsEffectiveRights(NWDSContextHandle ctx,
const NWDSChar* objectName, const NWDSChar* subjectName,
nuint allAttrs, Buf_T* in_attrNames, nuint32* iterHandle,
Buf_T* privilegeInfo);
NWDSCCODE NWDSListByClassAndName(NWDSContextHandle ctx, const NWDSChar* name,
const NWDSChar* className, const NWDSChar* subordinateName,
nuint32* iterHandle, Buf_T* objectList);
NWDSCCODE NWDSListContainers(NWDSContextHandle ctx, const NWDSChar* name,
nuint32* iterHandle, Buf_T* objectList);
NWDSCCODE NWDSModifyDN(NWDSContextHandle ctx, const NWDSChar* oldName,
const NWDSChar* newName, nuint deleteOldRDN); /* D */
NWDSCCODE NWDSModifyObject(NWDSContextHandle ctx, const NWDSChar* name,
nuint32* iterHandle, nbool8 more, Buf_T* buf); /* D */
NWDSCCODE NWDSModifyRDN(NWDSContextHandle ctx, const NWDSChar* oldName,
const NWDSChar* newRDN, nuint deleteOldRDN); /* D */
NWDSCCODE NWDSMoveObject(NWDSContextHandle ctx, const NWDSChar* oldName,
const NWDSChar* newParent, const NWDSChar* newRDN); /* D */
NWDSCCODE NWDSOpenConnToNDSServer(NWDSContextHandle ctx,
const NWDSChar* serverDN, NWCONN_HANDLE* pconn); /* D */
NWDSCCODE NWDSRead(NWDSContextHandle ctx, const NWDSChar* name,
nuint infoType, nuint allAttrs, Buf_T* in_attrNames,
nuint32* iterHandle, Buf_T* objectInfo); /* D */
NWDSCCODE NWDSReadObjectDSIInfo(NWDSContextHandle ctx, const NWDSChar* name,
size_t bufflen, void* buffer);
NWDSCCODE NWDSReadObjectInfo(NWDSContextHandle ctx, const NWDSChar* name,
NWDSChar* distName, Object_Info_T* oit); /* D */
NWDSCCODE NWDSRemoveObject(NWDSContextHandle ctx, const NWDSChar* name); /* D */
NWDSCCODE NWDSResolveName(NWDSContextHandle ctx, const NWDSChar* name,
NWCONN_HANDLE* conn, NWObjectID* ID); /* D */
NWDSCCODE NWDSSearch(NWDSContextHandle ctx, const NWDSChar* objectName,
nint scope, nuint searchAliases, Buf_T* in_filter,
nuint infoType, nuint allAttrs, Buf_T* in_attrNames,
nuint32* iterHandle, NWObjectCount countObjectsToSearch,
NWObjectCount* countObjectsSearched, Buf_T* objectInfo);
NWDSCCODE NWDSVerifyObjectPassword(NWDSContextHandle ctx, nflag32 flags,
const NWDSChar* objectName, const char* objectPassword);
/* NWIsDSServer returns true/false instead of error code! */
NWDSCCODE NWIsDSServer(NWCONN_HANDLE conn, char* treename); /* D */
NWDSCCODE NWIsDSServerW(NWCONN_HANDLE conn, wchar_t* treename);
NWDSCCODE NWDSAbortPartitionOperation(NWDSContextHandle ctx,
const NWDSChar* partitionRoot);
NWDSCCODE NWDSAddReplica(NWDSContextHandle ctx, const NWDSChar* serverDN,
const NWDSChar* partitionRoot, nuint32 replicaType);
NWDSCCODE NWDSChangeReplicaType(NWDSContextHandle ctx,
const NWDSChar* partitionRoot, const NWDSChar* serverDN,
nuint32 newReplicaType);
NWDSCCODE NWDSGetPartitionRoot(NWDSContextHandle ctx,
const NWDSChar* objectName, NWDSChar* partitionRoot); /* D */
NWDSCCODE NWDSJoinPartitions(NWDSContextHandle ctx,
const NWDSChar* subordinatePartition, nflag32 flags); /* D */
NWDSCCODE NWDSListPartitions(NWDSContextHandle ctx, nuint32* iterHandle,
const NWDSChar* serverDN, Buf_T* partitions);
NWDSCCODE NWDSListPartitionsExtInfo(NWDSContextHandle ctx, nuint32* iterHandle,
const NWDSChar* serverDN, nflag32 dspFlags,
Buf_T* partitions);
NWDSCCODE NWDSPartitionReceiveAllUpdates(NWDSContextHandle ctx,
const NWDSChar* partitionRoot, const NWDSChar* serverDN);
NWDSCCODE NWDSPartitionSendAllUpdates(NWDSContextHandle ctx,
const NWDSChar* partitionRoot, const NWDSChar* serverDN);
NWDSCCODE NWDSRemovePartition(NWDSContextHandle ctx,
const NWDSChar* partitionRoot);
NWDSCCODE NWDSRemoveReplica(NWDSContextHandle ctx, const NWDSChar* serverDN,
const NWDSChar* partitionRoot);
NWDSCCODE NWDSRepairTimeStamps(NWDSContextHandle ctx,
const NWDSChar* partitionRoot);
NWDSCCODE NWDSSplitPartition(NWDSContextHandle ctx,
const NWDSChar* subordinatePartition, nflag32 flags); /* D */
NWDSCCODE NWDSSyncPartition(NWDSContextHandle ctx, const NWDSChar* serverDN,
const NWDSChar* partitionRoot, nuint32 seconds);
NWDSCCODE NWDSBeginClassItem(NWDSContextHandle ctx, Buf_T* in_classItems);
NWDSCCODE NWDSDefineAttr(NWDSContextHandle ctx, const NWDSChar* attrName,
const Attr_Info_T* attrInfo);
NWDSCCODE NWDSDefineClass(NWDSContextHandle ctx, const NWDSChar* className,
const Class_Info_T* classInfo, Buf_T* in_classItems);
NWDSCCODE NWDSGetAttrDef(NWDSContextHandle ctx, Buf_T* in_attrDefs,
NWDSChar* attrName, Attr_Info_T* attrInfo); /* D */
NWDSCCODE NWDSGetClassDef(NWDSContextHandle ctx, Buf_T* in_classDefs,
NWDSChar* className, Class_Info_T* classInfo);
NWDSCCODE NWDSGetClassDefCount(NWDSContextHandle ctx, Buf_T* in_classDefs,
NWObjectCount* classDefCount);
NWDSCCODE NWDSGetClassItem(NWDSContextHandle ctx, Buf_T* in_classDefs,
NWDSChar* item);
NWDSCCODE NWDSGetClassItemCount(NWDSContextHandle ctx, Buf_T* in_classDefs,
NWObjectCount* itemCount);
NWDSCCODE NWDSListContainableClasses(NWDSContextHandle ctx,
const NWDSChar* parentName, nuint32* iterHandle,
Buf_T* containableClasses);
NWDSCCODE NWDSModifyClassDef(NWDSContextHandle ctx, const NWDSChar* className,
Buf_T* in_optionalAttrs);
NWDSCCODE NWDSPutClassItem(NWDSContextHandle ctx, Buf_T* in_classDefs,
const NWDSChar* itemName);
#ifdef SWIG
NWDSCCODE NWDSPutClassName(NWDSContextHandle ctx, Buf_T* in_classDefs,
const NWDSChar* itemName); /* D */
#else
#define NWDSPutClassName(ctx, classDefs, itemName) \
NWDSPutClassItem(ctx, classDefs, itemName)
#endif
NWDSCCODE NWDSReadAttrDef(NWDSContextHandle ctx, nuint infoType,
nuint allAttrs, Buf_T* in_attrNames, nuint32* iterHandle,
Buf_T* attrDefs); /* D */
NWDSCCODE NWDSReadClassDef(NWDSContextHandle ctx, nuint infoType,
nuint allClasses, Buf_T* in_classNames, nuint32* iterHandle,
Buf_T* classDefs);
NWDSCCODE NWDSRemoveAttrDef(NWDSContextHandle ctx, const NWDSChar* attrName);
NWDSCCODE NWDSRemoveClassDef(NWDSContextHandle ctx, const NWDSChar* className);
NWDSCCODE NWDSSyncSchema(NWDSContextHandle ctx, const NWDSChar* serverDN,
nuint32a delaySeconds);
struct _filter_node {
struct _filter_node* parent;
struct _filter_node* left;
struct _filter_node* right;
void* value;
enum SYNTAX syntax;
nuint token;
};
typedef struct {
struct _filter_node* fn;
nuint level;
nuint32 expect;
} Filter_Cursor_T;
#define FTOK_END 0
#define FTOK_OR 1
#define FTOK_AND 2
#define FTOK_NOT 3
#define FTOK_LPAREN 4
#define FTOK_RPAREN 5
#define FTOK_AVAL 6
#define FTOK_EQ 7
#define FTOK_GE 8
#define FTOK_LE 9
#define FTOK_APPROX 10
#define FTOK_ANAME 14
#define FTOK_PRESENT 15
#define FTOK_RDN 16
#define FTOK_BASECLS 17
#define FTOK_MODTIME 18
#define FTOK_VALTIME 19
#define FBIT_END (1 << FTOK_END)
#define FBIT_OR (1 << FTOK_OR)
#define FBIT_AND (1 << FTOK_AND)
#define FBIT_NOT (1 << FTOK_NOT)
#define FBIT_LPAREN (1 << FTOK_LPAREN)
#define FBIT_RPAREN (1 << FTOK_RPAREN)
#define FBIT_AVAL (1 << FTOK_AVAL)
#define FBIT_EQ (1 << FTOK_EQ)
#define FBIT_GE (1 << FTOK_GE)
#define FBIT_LE (1 << FTOK_LE)
#define FBIT_APPROX (1 << FTOK_APPROX)
#define FBIT_ANAME (1 << FTOK_ANAME)
#define FBIT_PRESENT (1 << FTOK_PRESENT)
#define FBIT_RDN (1 << FTOK_RDN)
#define FBIT_BASECLS (1 << FTOK_BASECLS)
#define FBIT_MODTIME (1 << FTOK_MODTIME)
#define FBIT_VALTIME (1 << FTOK_VALTIME)
#define FBIT_OPERAND (FBIT_NOT | FBIT_LPAREN | FBIT_ANAME | FBIT_PRESENT | FBIT_RDN | FBIT_BASECLS | FBIT_MODTIME | FBIT_VALTIME)
#define FBIT_RELOP (FBIT_EQ | FBIT_GE | FBIT_LE | FBIT_APPROX)
#define FBIT_BOOLOP (FBIT_OR | FBIT_AND)
NWDSCCODE NWDSAddFilterToken(Filter_Cursor_T* cur, nuint token, const void* value,
enum SYNTAX syntax);
NWDSCCODE NWDSAllocFilter(Filter_Cursor_T** cur);
NWDSCCODE NWDSDelFilterToken(Filter_Cursor_T* cur,
void (*freeVal)(enum SYNTAX, void*));
NWDSCCODE NWDSPutFilter(NWDSContextHandle ctx, Buf_T* buf,
Filter_Cursor_T* cur, void (*freeVal)(enum SYNTAX, void*));
NWDSCCODE NWDSFreeFilter(Filter_Cursor_T* cur,
void (*freeVal)(enum SYNTAX, void*));
NWDSCCODE NWDSAddConnection(NWDSContextHandle __ctx, NWCONN_HANDLE __conn);
/***************************PP */
#define DS_SYNTAX_NAMES 0
#define DS_SYNTAX_DEFS 1
#define DS_STRING 0x0001
#define DS_SINGLE_VALUED 0x0002
#define DS_SUPPORT_ORDER 0x0004
#define DS_SUPPORT_EQUALS 0x0008
#define DS_IGNORE_CASE 0x0010
#define DS_IGNORE_SPACE 0x0020
#define DS_IGNORE_DASH 0x0040
#define DS_ONLY_DIGITS 0x0080
#define DS_ONLY_PRINTABLE 0x0100
#define DS_SIZEABLE 0x0200
#define DS_BITWISE_EQUALS 0x0400
typedef struct {
enum SYNTAX ID;
char defStr[MAX_SCHEMA_NAME_BYTES + 2];
nuint16 flags;
} Syntax_Info_T;
NWDSCCODE NWDSReadSyntaxes(NWDSContextHandle ctx, nuint infoType,
nuint allSyntaxes, Buf_T* in_syntaxNames,
nuint32* iterHandle, Buf_T* syntaxDefs);
NWDSCCODE NWDSPutSyntaxName(NWDSContextHandle ctx, Buf_T* buf,
const NWDSChar* syntaxName);
NWDSCCODE NWDSGetSyntaxDef(NWDSContextHandle ctx, Buf_T* buf,
NWDSChar* syntaxName, Syntax_Info_T* syntaxDef);
NWDSCCODE NWDSGetSyntaxCount(NWDSContextHandle ctx, Buf_T* buf,
NWObjectCount* syntaxCount);
NWDSCCODE NWDSReadSyntaxDef(NWDSContextHandle context, enum SYNTAX syntaxID,
Syntax_Info_T* syntaxDef);
NWDSCCODE NWDSGetSyntaxID(NWDSContextHandle ctx, const NWDSChar* attrName,
enum SYNTAX* syntaxID);
/************* end syntaxes**************/
NWDSCCODE NWDSScanConnsForTrees(NWDSContextHandle context, nuint numOfPtrs,
nuint* numOfTrees, NWDSChar** treeBufPtrs);
NWDSCCODE NWDSScanForAvailableTrees(NWDSContextHandle context,
NWCONN_HANDLE connHandle, const char* scanFilter,
nint32* scanIndex, NWDSChar* treeName);
NWDSCCODE NWDSReturnBlockOfAvailableTrees(NWDSContextHandle context,
NWCONN_HANDLE connHandle, const char* scanFilter,
const void* lastBlocksString, const NWDSChar* endBoundString,
nuint32 maxTreeNames, NWDSChar** arrayOfNames,
nuint32* numberOfTrees, nuint32* totalUniqueTrees);
NWDSCCODE NWDSWhoAmI(NWDSContextHandle context, NWDSChar* myDN);
#ifdef __cplusplus
}
#endif
#endif /* __NWNET_H__ */

View File

@@ -0,0 +1,40 @@
/*
ncplib.h
Copyright (C) 1995, 1996 by Volker Lendecke
Copyright (C) 1997-2001 Petr Vandrovec
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _OBSOLETE_NCPLIB_H
#define _OBSOLETE_NCPLIB_H
#ifndef _NCPLIB_H
#error "Do not include this file directly, compile your project with -DNCP_OBSOLETE instead"
#endif
#ifdef __cplusplus
extern "C" {
#endif
long
ncp_renegotiate_connparam(NWCONN_HANDLE conn, int buffsize, int options);
#ifdef __cplusplus
}
#endif
#endif /* _NCPLIB_H */

View File

@@ -0,0 +1,48 @@
/*
NDS client for ncpfs
Copyright (C) 1997 Arne de Bruijn
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _O_NDSLIB_H_
#define _O_NDSLIB_H_
typedef unsigned short uni_char;
/* old compat code */
#define NDS_GRACE_PERIOD 0x89DF
#ifdef __cplusplus
extern "C" {
#endif
int strlen_u(const uni_char *s);
uni_char getchr_u(const uni_char *s);
void strcpy_uc(char *d, const uni_char *s);
void strcpy_cu(uni_char *d, const char *s);
long nds_get_server_name(NWCONN_HANDLE conn, uni_char **server_name);
long nds_get_tree_name(NWCONN_HANDLE conn, char *name, int name_buf_len);
long nds_login_auth(NWCONN_HANDLE conn, const char *user, const char *pwd);
long nds_resolve_name(struct ncp_conn *conn, int flags, uni_char *entry_name,
int *entry_id, int *remote, struct sockaddr *serv_addr, size_t *addr_len);
long nds_read(NWCONN_HANDLE conn, u_int32_t object_id, uni_char *prop_name,
u_int32_t *syntax_id, void **outbuf, size_t *outlen);
#ifdef __cplusplus
}
#endif
#endif /* ifndef _O_NDSLIB_H_ */