Restructure for camke build
This commit is contained in:
47
include/CMakeLists.txt
Normal file
47
include/CMakeLists.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
#################################
|
||||
# Project
|
||||
##############
|
||||
|
||||
#################################
|
||||
# Dependencies
|
||||
##############
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/config.h"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
|
||||
#################################
|
||||
# Compiler Switches
|
||||
##############
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
)
|
||||
|
||||
link_directories(
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
)
|
||||
|
||||
#################################
|
||||
# Source Files
|
||||
##############
|
||||
|
||||
|
||||
#SET (include_src
|
||||
# cbmcopy.h
|
||||
# d64copy.h
|
||||
# opencbm.h
|
||||
# )
|
||||
|
||||
#################################
|
||||
# Linking
|
||||
##############
|
||||
|
||||
#################################
|
||||
# Install Files
|
||||
##############
|
||||
|
||||
#install(FILES ${include_src} DESTINATION ${INCLUDE_INSTALL_DIR})
|
||||
101
include/config.h.cmake
Normal file
101
include/config.h.cmake
Normal file
@@ -0,0 +1,101 @@
|
||||
/* config.h: 22-Jun-00 */
|
||||
/* some of this config is needed by make, others by cc */
|
||||
|
||||
#define DO_DEBUG @MARS_NWE_DEBUG@
|
||||
/* compile in debug code */
|
||||
#define FUNC_17_02_IS_DEBUG @MARS_NWE_DEBUG_DOSUTILS@
|
||||
/* allow debugging with mars_dosutils */
|
||||
|
||||
#define DO_TESTING 0 /* set this to "1" to test only */
|
||||
|
||||
#if DO_TESTING
|
||||
# define FILENAME_NW_INI "./nw.ini" /* full name of ini (conf) file */
|
||||
# define PATHNAME_PROGS "." /* where to find the executables */
|
||||
# define PATHNAME_BINDERY "." /* directory for bindery-files */
|
||||
#else
|
||||
# define FILENAME_NW_INI "@MARS_NWE_INSTALL_FULL_CONFDIR@/nwserv.conf"
|
||||
/* full name of ini (conf) file */
|
||||
# define PATHNAME_PROGS "@CMAKE_INSTALL_FULL_SBINDIR@"
|
||||
/* where to find the executables */
|
||||
# define PATHNAME_BINDERY "@MARS_NWE_DATA_DIR@/bindery"
|
||||
/* directory for bindery-files */
|
||||
#endif
|
||||
|
||||
#define PATHNAME_PIDFILES "@MARS_NWE_PID_DIR@"
|
||||
/* directory for 'pidfiles' */
|
||||
|
||||
/* <---- logging the logins via "mars_nwe" in utmp/wtmp ----------------> */
|
||||
#define FILENAME_UTMP UTMP_FILE /* use "NULL" instead of UTMP_FILE */
|
||||
/* to disable logging via utmp */
|
||||
#define FILENAME_WTMP WTMP_FILE /* use "NULL" instead of WTMP_FILE */
|
||||
/* to disable logging via wtmp */
|
||||
|
||||
#define NETWORK_SERIAL_NMBR 0x44444444L
|
||||
/* serial number (4 byte) */
|
||||
#define NETWORK_APPL_NMBR 0x2222 /* application number (2 byte) */
|
||||
|
||||
#define MAX_CONNECTIONS @MAX_CONNECTIONS@
|
||||
/* max. number of simultaneous */
|
||||
/* connections handled by mars_nwe */
|
||||
/* !! NOTE !! */
|
||||
/* If set > 255 some NCP calls will probably not work, try it with caution */
|
||||
/* and you should apply examples/kpatch2.0.29 to kernels prior 2.0.32 */
|
||||
|
||||
|
||||
#define IPX_DATA_GR_546 2 /* 0 = max. IPX Packets = 546 +30 Byte ( 512 Byte RWBuff) */
|
||||
/* 1 = max. IPX packets = 1058 +30 Byte (1024 Byte RWBuff) */
|
||||
/* 2 = max. IPX packets = 1470 +30 Byte (1444 Byte RWBuff) */
|
||||
/* 3 = max. IPX packets = 4130 +30 Byte (4096 Byte RWBuff) */
|
||||
|
||||
#define ENABLE_BURSTMODE 0 /* 0 = disable burstmode, 1 = enable burstmode */
|
||||
/* still NOT working correct !!!!! */
|
||||
/* to get Burstmode really enabled, section '6' in conf-file */
|
||||
/* must be set to a value > 1 (3.12 Server) */
|
||||
/* and kernel-patch examples/kpatch2.0.29 should be used for */
|
||||
/* kernels prior 2.0.32 */
|
||||
|
||||
|
||||
#define USE_MMAP 1 /* use mmap systen call, not always best choice */
|
||||
|
||||
#if 0
|
||||
#define SOCK_EXTERN 0x8005 /* creat socket for external access */
|
||||
/* i.e. Xmarsmon from H. Buchholz */
|
||||
#endif
|
||||
|
||||
/* <--------------------------------------------------------------------> */
|
||||
#define MAX_NW_VOLS @MAX_VOLS@
|
||||
/* max. number of mars_nwe-volumes */
|
||||
#define MAX_FILE_HANDLES_CONN @MAX_FILES@
|
||||
/* max. number of open files per */
|
||||
/* connection */
|
||||
/* <--------------- new namespace services call -----------------------> */
|
||||
#define MAX_DIR_BASE_ENTRIES 50 /* max. cached base entries per */
|
||||
/* connection */
|
||||
#define WITH_NAME_SPACE_CALLS 1 /* Namespace Calls are only minimal */
|
||||
/* supported so far. */
|
||||
/* To enable testing of them this */
|
||||
/* entry must be changed to '1' and */
|
||||
/* entry '6' in ini file should be set*/
|
||||
/* to > '0', too. */
|
||||
/* <--------------------------------------------------------------------> */
|
||||
#define HANDLE_ALL_SAP_TYPS 1 /* if set to 0 only SAP-Typ 4 Servers */
|
||||
/* will be put into routing table and */
|
||||
/* if set to 1 all SAP Typs will be */
|
||||
/* used. */
|
||||
|
||||
#define PERSISTENT_SYMLINKS 0 /* change to '1' for persistent symlinks */
|
||||
/* main idea from Victor Khimenko */
|
||||
/* still NOT working !! */
|
||||
|
||||
/* <--------------- next is for linux only ----------------------------> */
|
||||
#define INTERNAL_RIP_SAP @MARS_NWE_INTERNAL_RIP_SAP@
|
||||
/* use internal/own rip/sap routines */
|
||||
|
||||
#define SHADOW_PWD @MARS_NWE_SHADOW_PWD@
|
||||
/* change to '1' for shadow passwds */
|
||||
#define QUOTA_SUPPORT @MARS_NWE_QUOTA_SUPPORT@
|
||||
/* change to '1' for quota support */
|
||||
|
||||
/* for sending 'Request being serviced' replys, /lenz */
|
||||
#define CALL_NWCONN_OVER_SOCKET 0
|
||||
|
||||
290
include/connect.h
Normal file
290
include/connect.h
Normal file
@@ -0,0 +1,290 @@
|
||||
/* connect.h 04-Apr-00 */
|
||||
#ifndef _CONNECT_H_
|
||||
#define _CONNECT_H_
|
||||
|
||||
typedef struct {
|
||||
uint8 path[256]; /* directory */
|
||||
uint8 fn[256]; /* file */
|
||||
int volume; /* Volume Number */
|
||||
int has_wild; /* fn has wildcards */
|
||||
} NW_PATH;
|
||||
|
||||
typedef struct {
|
||||
uint8 name[14]; /* filename in DOS format */
|
||||
uint8 attrib[2]; /* LO-HI attrib, ext_attrib */
|
||||
uint8 size[4]; /* size of file */
|
||||
uint8 create_date[2];
|
||||
uint8 acces_date[2];
|
||||
uint8 modify_date[2];
|
||||
uint8 modify_time[2];
|
||||
} NW_FILE_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8 name[14]; /* dirname */
|
||||
uint8 attrib[2]; /* LO-HI attrib, ext_attrib */
|
||||
uint8 create_date[2];
|
||||
uint8 create_time[2];
|
||||
uint8 owner_id[4];
|
||||
uint8 access_right_mask;
|
||||
uint8 reserved; /* future use */
|
||||
uint8 next_search[2];
|
||||
} NW_DIR_INFO;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8 time[2];
|
||||
uint8 date[2];
|
||||
uint8 id[4];
|
||||
} NW_FILE_DATES_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8 subdir[4];
|
||||
uint8 attributes[4]; /* 0x20,0,0,0 LO-HI */
|
||||
uint8 uniqueid; /* 0 */
|
||||
uint8 flags; /* 0x18 */
|
||||
uint8 namespace; /* 0 */
|
||||
uint8 namlen;
|
||||
uint8 name[12];
|
||||
NW_FILE_DATES_INFO created;
|
||||
NW_FILE_DATES_INFO archived;
|
||||
NW_FILE_DATES_INFO updated;
|
||||
uint8 size[4];
|
||||
uint8 reserved_1[44];
|
||||
uint8 inherited_rights_mask[2];
|
||||
uint8 last_access_date[2];
|
||||
uint8 reserved_2[28];
|
||||
} NW_DOS_FILE_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8 subdir[4];
|
||||
uint8 attributes[4]; /* 0x10,0,0,0 LO-HI */
|
||||
uint8 uniqueid; /* 0 */
|
||||
uint8 flags; /* 0x14 or 0x1c */
|
||||
uint8 namespace; /* 0 */
|
||||
uint8 namlen;
|
||||
uint8 name[12];
|
||||
NW_FILE_DATES_INFO created;
|
||||
NW_FILE_DATES_INFO archived;
|
||||
uint8 modify_time[2];
|
||||
uint8 modify_date[2];
|
||||
uint8 next_trustee[4];
|
||||
uint8 reserved_1[48];
|
||||
uint8 max_space[4];
|
||||
uint8 inherited_rights_mask[2];
|
||||
uint8 reserved_2[26];
|
||||
} NW_DOS_DIR_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8 searchsequence[4];
|
||||
union {
|
||||
NW_DOS_DIR_INFO d;
|
||||
NW_DOS_FILE_INFO f;
|
||||
} u;
|
||||
} NW_SCAN_DIR_INFO;
|
||||
|
||||
typedef struct {
|
||||
uint8 searchsequence[4]; /* same as NW_SCAN_DIR_INFO */
|
||||
uint8 change_bits[4]; /* LO-HI, 2=Attributes */
|
||||
union {
|
||||
NW_DOS_DIR_INFO d;
|
||||
NW_DOS_FILE_INFO f;
|
||||
} u;
|
||||
} NW_SET_DIR_INFO;
|
||||
|
||||
extern int use_mmap;
|
||||
extern int tells_server_version;
|
||||
extern int server_version_flags;
|
||||
extern int max_burst_send_size;
|
||||
extern int max_burst_recv_size;
|
||||
extern int default_uid;
|
||||
extern int default_gid;
|
||||
|
||||
extern int nw_init_connect(void);
|
||||
extern void nw_exit_connect(void);
|
||||
|
||||
extern int nw_free_handles(int task);
|
||||
|
||||
extern int nw_creat_open_file(int dir_handle, uint8 *data, int len,
|
||||
NW_FILE_INFO *info, int attrib, int access, int mode, int task);
|
||||
|
||||
extern int nw_delete_files(int dir_handle, int searchattrib, uint8 *data, int len);
|
||||
extern int nw_set_file_information(int dir_handle, uint8 *data, int len,
|
||||
int searchattrib, NW_FILE_INFO *f);
|
||||
|
||||
extern int nw_set_file_attributes(int dir_handle, uint8 *data, int len,
|
||||
int attrib, int newattrib);
|
||||
|
||||
extern int nw_mv_files(int searchattrib,
|
||||
int sourcedirhandle, uint8 *sourcedata, int qlen,
|
||||
int zdirhandle, uint8 *destdata, int destdatalen);
|
||||
|
||||
extern int mv_dir(int dir_handle, uint8 *sourcedata, int qlen,
|
||||
uint8 *destdata, int destdatalen);
|
||||
|
||||
extern int nw_unlink_node(int volume, uint8 *unname, struct stat *stb);
|
||||
extern int nw_creat_node(int volume, uint8 *unname, int mode);
|
||||
|
||||
extern int nw_utime_node(int volume, uint8 *unname, struct stat *stb,
|
||||
time_t t);
|
||||
|
||||
extern int nw_mk_rd_dir(int dir_handle, uint8 *data, int len, int mode);
|
||||
|
||||
extern int nw_search(uint8 *info, uint32 *fileowner,
|
||||
int dirhandle, int searchsequence,
|
||||
int search_attrib, uint8 *data, int len);
|
||||
|
||||
extern int nw_dir_get_vol_path(int dirhandle, uint8 *path);
|
||||
|
||||
extern int nw_dir_search(uint8 *info,
|
||||
int dirhandle, int searchsequence,
|
||||
int search_attrib, uint8 *data, int len);
|
||||
|
||||
|
||||
extern int nw_find_dir_handle( int dir_handle,
|
||||
uint8 *data, /* zus<75>tzlicher Pfad */
|
||||
int len); /* L<>nge Pfad */
|
||||
|
||||
extern int xinsert_new_dir(int volume, uint8 *path,
|
||||
int dev, int inode,
|
||||
int drive, int is_temp, int task);
|
||||
|
||||
extern int nw_alloc_dir_handle(
|
||||
int dir_handle, /* directory handle */
|
||||
uint8 *data, /* extra path */
|
||||
int len, /* len of datat */
|
||||
int driveletter, /* A .. Z normal */
|
||||
int is_temphandle, /* temp Handle 1 */
|
||||
/* spez. temp Handle 2 */
|
||||
int task, /* Prozess Task */
|
||||
int *eff_rights);
|
||||
|
||||
|
||||
extern int nw_open_dir_handle( int dir_handle,
|
||||
uint8 *data, /* extra path */
|
||||
int len, /* len data */
|
||||
int *volume, /* Volume */
|
||||
int *dir_id, /* similar to filehandle*/
|
||||
int *searchsequence);
|
||||
|
||||
|
||||
extern int nw_free_dir_handle(int dir_handle, int task);
|
||||
|
||||
extern int alter_dir_handle(int targetdir, int volume, uint8 *path,
|
||||
int dev, int inode, int task);
|
||||
|
||||
extern int nw_set_dir_handle(int targetdir, int dir_handle,
|
||||
uint8 *data, int len, int task);
|
||||
|
||||
extern int nw_get_directory_path(int dir_handle, uint8 *name, int size_name);
|
||||
|
||||
extern int nw_get_vol_number(int dir_handle);
|
||||
|
||||
|
||||
|
||||
extern int nw_get_eff_dir_rights(int dir_handle, uint8 *data, int len,
|
||||
int modus);
|
||||
|
||||
extern int nw_scan_dir_info(int dir_handle, uint8 *data, int len,
|
||||
uint8 *subnr, uint8 *subname,
|
||||
uint8 *subdatetime, uint8 *owner);
|
||||
|
||||
|
||||
extern void get_dos_file_attrib(NW_DOS_FILE_INFO *f,
|
||||
struct stat *stb,
|
||||
int volume,
|
||||
uint8 *path,
|
||||
char *unixname);
|
||||
|
||||
void get_dos_dir_attrib(NW_DOS_DIR_INFO *f,
|
||||
struct stat *stb,
|
||||
int volume,
|
||||
uint8 *path,
|
||||
char *unixname);
|
||||
|
||||
|
||||
#define MAX_NW_DIRS 255
|
||||
extern int act_uid;
|
||||
extern int act_gid;
|
||||
extern int act_obj_id; /* not login == 0 */
|
||||
extern int act_id_flags; /* &1 == supervisor equivalence !!! */
|
||||
extern int entry8_flags; /* special flags, see examples nw.ini, entry 8 */
|
||||
extern int entry31_flags; /* special flags, see examples nw.ini, entry 31 */
|
||||
|
||||
extern int conn_get_full_path(int dirhandle, uint8 *data, int len,
|
||||
uint8 *fullpath, int size_fullpath);
|
||||
|
||||
extern int conn_get_kpl_unxname(char *unixname,
|
||||
int size_unixname,
|
||||
int dirhandle,
|
||||
uint8 *data, int len);
|
||||
|
||||
extern void set_default_guid(void);
|
||||
extern void set_guid(int gid, int uid);
|
||||
extern void reset_guid(void);
|
||||
extern void reseteuid(void);
|
||||
extern int in_act_groups(gid_t gid);
|
||||
extern int get_unix_access_rights(struct stat *stb, uint8 *unixname);
|
||||
extern int get_unix_eff_rights(struct stat *stb);
|
||||
extern void set_nw_user(int gid, int uid,
|
||||
int id_flags,
|
||||
uint32 obj_id, uint8 *objname,
|
||||
int unxloginlen, uint8 *unxloginname,
|
||||
int grpcount, uint32 *grps);
|
||||
|
||||
extern uint32 get_file_owner(struct stat *stb);
|
||||
|
||||
extern int nw_scan_a_directory(uint8 *rdata,
|
||||
int dirhandle,
|
||||
uint8 *data,
|
||||
int len,
|
||||
int searchattrib,
|
||||
uint32 searchbeg); /* 32 bit */
|
||||
|
||||
extern int nw_scan_a_root_dir(uint8 *rdata,
|
||||
int dirhandle);
|
||||
|
||||
extern int nw_set_a_directory_entry(int dirhandle,
|
||||
uint8 *data,
|
||||
int len,
|
||||
int searchattrib,
|
||||
uint32 searchbeg,
|
||||
NW_SET_DIR_INFO *f);
|
||||
|
||||
extern int fn_dos_match(uint8 *s, uint8 *p, int options);
|
||||
|
||||
extern void un_date_2_nw(time_t time, uint8 *d, int high_low);
|
||||
extern time_t nw_2_un_time(uint8 *d, uint8 *t);
|
||||
|
||||
extern void un_time_2_nw(time_t time, uint8 *d, int high_low);
|
||||
|
||||
extern void mangle_dos_name(NW_VOL *vol, uint8 *unixname, uint8 *pp);
|
||||
|
||||
extern int nw_add_trustee(int dir_handle, uint8 *data, int len,
|
||||
uint32 id, int trustee, int extended);
|
||||
|
||||
extern int nw_del_trustee(int dir_handle, uint8 *data, int len,
|
||||
uint32 id, int extended);
|
||||
|
||||
extern int nw_set_dir_info(int dir_handle, uint8 *data, int len,
|
||||
uint32 owner_id, int max_rights,
|
||||
uint8 *creationdate, uint8 *creationtime);
|
||||
|
||||
extern int nw_scan_user_trustee(int volume, int *sequence, uint32 id,
|
||||
int *access_mask, uint8 *path);
|
||||
|
||||
extern int nw_scan_for_trustee( int dir_handle,
|
||||
int sequence,
|
||||
uint8 *path,
|
||||
int len,
|
||||
int max_entries,
|
||||
uint32 *ids,
|
||||
int *trustees,
|
||||
int extended);
|
||||
|
||||
extern int nw_log_file(int lock_flag,
|
||||
int timeout,
|
||||
int dir_handle,
|
||||
int len,
|
||||
char *data);
|
||||
|
||||
#endif
|
||||
25
include/debmask.h
Normal file
25
include/debmask.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* debmask.h: 23-Jul-97 */
|
||||
#ifndef _DEBMASK_H_
|
||||
#define _DEBMASK_H_
|
||||
/*
|
||||
* several debug masks.
|
||||
* second paramter in debug entries 100 .. 1xx
|
||||
*
|
||||
*/
|
||||
|
||||
/* NWCONN */
|
||||
#define D_FH_OPEN 1 /* file open/close */
|
||||
#define D_FH_LOCK 2 /* file lock/unlock */
|
||||
#define D_FH_FLUSH 4 /* file flushes */
|
||||
|
||||
#define D_FN_NAMES 8
|
||||
#define D_FN_SEARCH 0x10 /* file search */
|
||||
|
||||
#define D_ACCESS 0x20 /* access rights */
|
||||
#define D_TRUSTEES 0x40 /* trustees */
|
||||
|
||||
/* NWBIND */
|
||||
#define D_BIND_REQ 0x8000 /* all Requests */
|
||||
|
||||
#endif
|
||||
|
||||
147
include/emutli.h
Normal file
147
include/emutli.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/* emutli.h 18-Nov-99 */
|
||||
|
||||
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _EMUTLI_H_
|
||||
#define _EMUTLI_H_
|
||||
|
||||
#ifdef FREEBSD
|
||||
# include <netipx/ipx.h>
|
||||
# define sipx_node sipx_addr.x_host.c_host
|
||||
# define sipx_network sipx_addr.x_net.c_net
|
||||
# define ipx_netlong(iaddr) (((union ipx_net_u *)(&((iaddr).x_net)))->long_e)
|
||||
|
||||
# define ETHERTYPE_IPX 0x8137
|
||||
# define IPX_RT_8022 ETHERTYPE_IPX
|
||||
# define IPX_RT_8023 ETHERTYPE_IPX
|
||||
# define IPX_RT_SNAP ETHERTYPE_IPX
|
||||
# define IPX_RT_BLUEBOOK ETHERTYPE_IPX
|
||||
int ipx_iffind(char *ifname,struct ipx_addr *addr);
|
||||
#else
|
||||
# include <linux/types.h>
|
||||
# include <netinet/in.h>
|
||||
# ifdef _GNU_SOURCE_
|
||||
# include <netipx/ipx.h>
|
||||
# else
|
||||
# include <linux/ipx.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short int uint16;
|
||||
typedef unsigned long int uint32;
|
||||
|
||||
#define IPX_NET_SIZE 4
|
||||
#define IPX_NODE_SIZE 6
|
||||
#define IPX_SOCK_SIZE 2
|
||||
|
||||
typedef struct {
|
||||
uint8 net[IPX_NET_SIZE];
|
||||
uint8 node[IPX_NODE_SIZE];
|
||||
uint8 sock[IPX_SOCK_SIZE];
|
||||
} ipxAddr_t;
|
||||
|
||||
#define IPXCMPSOCK(a, b) ( \
|
||||
((char *)(a))[0] == ((char*)(b))[0] && \
|
||||
((char *)(a))[1] == ((char*)(b))[1] \
|
||||
)
|
||||
|
||||
#define IPXCMPNODE(a, b) ( \
|
||||
((char *)(a))[0] == ((char*)(b))[0] && \
|
||||
((char *)(a))[1] == ((char*)(b))[1] && \
|
||||
((char *)(a))[2] == ((char*)(b))[2] && \
|
||||
((char *)(a))[3] == ((char*)(b))[3] && \
|
||||
((char *)(a))[4] == ((char*)(b))[4] && \
|
||||
((char *)(a))[5] == ((char*)(b))[5] \
|
||||
)
|
||||
|
||||
#define IPXCMPNET(a, b) ( \
|
||||
((char *)(a))[0] == ((char*)(b))[0] && \
|
||||
((char *)(a))[1] == ((char*)(b))[1] && \
|
||||
((char *)(a))[2] == ((char*)(b))[2] && \
|
||||
((char *)(a))[3] == ((char*)(b))[3] \
|
||||
)
|
||||
|
||||
struct netbuf {
|
||||
unsigned int maxlen;
|
||||
unsigned int len;
|
||||
char *buf;
|
||||
};
|
||||
|
||||
struct t_bind {
|
||||
struct netbuf addr;
|
||||
unsigned int qlen;
|
||||
};
|
||||
|
||||
|
||||
struct t_unitdata {
|
||||
struct netbuf addr; /* address */
|
||||
struct netbuf opt; /* options */
|
||||
struct netbuf udata; /* userdata */
|
||||
};
|
||||
|
||||
struct t_uderr {
|
||||
struct netbuf addr; /* address */
|
||||
struct netbuf opt; /* options */
|
||||
long error; /* eroorcode */
|
||||
};
|
||||
|
||||
struct pollfd {
|
||||
int fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
|
||||
#define POLLIN 0x0001 /* fd readable */
|
||||
#define POLLPRI 0x0002 /* high priority */
|
||||
|
||||
#define TOUTSTATE 6 /* out of state */
|
||||
|
||||
extern void set_locipxdebug(int debug);
|
||||
extern void set_sock_debug(int sock);
|
||||
extern void set_emu_tli(void);
|
||||
|
||||
extern int poll(struct pollfd *fds, unsigned long nfds, int timeout);
|
||||
extern int t_open(char *name, int open_mode, char *p);
|
||||
extern int t_bind(int sock, struct t_bind *a_in, struct t_bind *a_out);
|
||||
extern int t_unbind(int sock);
|
||||
extern void t_error(char *s);
|
||||
extern int t_close(int fd);
|
||||
extern inline int t_rcvudata(int fd, struct t_unitdata *ud, int *flags);
|
||||
extern int t_rcvuderr(int fd, struct t_uderr *ud);
|
||||
extern inline int t_sndudata(int fd, struct t_unitdata *ud);
|
||||
|
||||
#ifndef IPX_FRAME_8022
|
||||
# define OLD_KERNEL_IPX 1
|
||||
# define IPX_FRAME_8022 IPX_RT_8022
|
||||
#endif
|
||||
|
||||
#ifndef IPX_FRAME_8023
|
||||
# define IPX_FRAME_8023 0
|
||||
#endif
|
||||
|
||||
#ifndef IPX_FRAME_SNAP
|
||||
# define IPX_FRAME_SNAP IPX_RT_SNAP
|
||||
#endif
|
||||
|
||||
#ifndef IPX_FRAME_ETHERII
|
||||
# define IPX_FRAME_ETHERII IPX_RT_BLUEBOOK
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
43
include/emutli1.h
Normal file
43
include/emutli1.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* emutli1.h 05-May-98 */
|
||||
|
||||
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _EMUTLI1_H_
|
||||
#define _EMUTLI1_H_
|
||||
|
||||
extern void set_locipxdebug(int debug);
|
||||
|
||||
extern int read_interface_data(uint8* data, uint32 *rnet, uint8 *node,
|
||||
int *flags, uint8 *name);
|
||||
|
||||
extern int get_interface_frame_name(char *name, uint32 net);
|
||||
extern int add_device_net(char *devname, int frame, uint32 netnum);
|
||||
|
||||
extern int get_frame_name(uint8 *framename, int frame);
|
||||
extern int ipx_inuse(int mode);
|
||||
extern int init_ipx(uint32 network, uint32 node, int ipx_debug, int flags);
|
||||
extern void exit_ipx(int full);
|
||||
extern int init_dev(char *devname, int frame, uint32 network, int wildmask);
|
||||
extern void exit_dev(char *devname, int frame);
|
||||
|
||||
extern void ipx_route_add(uint32 dest_net,
|
||||
uint32 route_net,
|
||||
uint8 *route_node);
|
||||
|
||||
extern void ipx_route_del(uint32 net);
|
||||
#endif
|
||||
16
include/extpipe.h
Normal file
16
include/extpipe.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/* extpipe.h 31-Jul-98 */
|
||||
|
||||
#ifndef _EXTPIPE_H_
|
||||
#define _EXTPIPE_H_
|
||||
|
||||
/* enhanced pipe handling */
|
||||
typedef struct {
|
||||
int fds[3]; /* filedescriptor to 0,1,2 of new process */
|
||||
int command_pid; /* pid of piped command */
|
||||
int flags; /* special flags */
|
||||
} FILE_PIPE;
|
||||
|
||||
extern int ext_pclose(FILE_PIPE *fp);
|
||||
extern FILE_PIPE *ext_popen(char *command, int uid, int gid, int flags);
|
||||
|
||||
#endif
|
||||
14
include/nameos2.h
Normal file
14
include/nameos2.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* nameos2.h: 08-Aug-96
|
||||
*
|
||||
* (C)opyright (C) 1993,1996 Martin Stover, Marburg, Germany
|
||||
*/
|
||||
#ifndef _NAMEOS2_H_
|
||||
#define _NAMEOS2_H_
|
||||
#if WITH_NAME_SPACE_CALLS
|
||||
|
||||
extern void mangle_os2_name(NW_VOL *vol, uint8 *unixname, uint8 *pp, int len);
|
||||
extern int fn_os2_match(uint8 *s, uint8 *p, int soptions);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
120
include/namspace.h
Normal file
120
include/namspace.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/* namspace.h 01-Feb-98 : NameSpace Services, mars_nwe */
|
||||
|
||||
/* (C)opyright (C) 1993,1998 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _NAMSPACE_H_
|
||||
#define _NAMSPACE_H_
|
||||
#if WITH_NAME_SPACE_CALLS
|
||||
|
||||
#define NAME_DOS 0
|
||||
#define NAME_MAC 1
|
||||
#define NAME_NFS 2
|
||||
#define NAME_FTAM 3
|
||||
#define NAME_OS2 4
|
||||
|
||||
typedef struct {
|
||||
uint8 volume; /* Volumenumber */
|
||||
uint8 base[4]; /* Base or short Handle, handle is base[0] !! */
|
||||
uint8 flag; /* 0=handle, 1=base, 0xff=not path nor handle */
|
||||
uint8 components; /* nmbrs of pathes, components */
|
||||
uint8 pathes[1]; /* form len+name (like Pascal) */
|
||||
/* ATTENTION
|
||||
* a pathlen of 0 means '..' (cd dir ..) !!
|
||||
* first seen with Novell client32
|
||||
*/
|
||||
} NW_HPATH;
|
||||
|
||||
typedef struct {
|
||||
uint8 attributes[4];
|
||||
uint8 created_date[2];
|
||||
uint8 created_time[2];
|
||||
uint8 created_id[4];
|
||||
uint8 modified_date[2];
|
||||
uint8 modified_time[2];
|
||||
uint8 modified_id[4];
|
||||
uint8 archived_date[2];
|
||||
uint8 archived_time[2];
|
||||
uint8 archived_id[4];
|
||||
uint8 last_access_date[2];
|
||||
uint8 rightsgrantmask[2];
|
||||
uint8 rightsrevokemask[2];
|
||||
uint8 maxspace[4];
|
||||
} DOS_MODIFY_INFO;
|
||||
|
||||
#define INFO_MSK_ENTRY_NAME 0x00000001
|
||||
#define INFO_MSK_DATA_STREAM_SPACE 0x00000002
|
||||
#define INFO_MSK_ATTRIBUTE_INFO 0x00000004
|
||||
#define INFO_MSK_DATA_STREAM_SIZE 0x00000008
|
||||
#define INFO_MSK_TOTAL_DATA_STREAM_SIZE 0x00000010
|
||||
#define INFO_MSK_EXT_ATTRIBUTES 0x00000020
|
||||
#define INFO_MSK_ARCHIVE_INFO 0x00000040
|
||||
#define INFO_MSK_MODIFY_INFO 0x00000080
|
||||
#define INFO_MSK_CREAT_INFO 0x00000100
|
||||
#define INFO_MSK_NAME_SPACE_INFO 0x00000200
|
||||
#define INFO_MSK_DIR_ENTRY_INFO 0x00000400
|
||||
#define INFO_MSK_RIGHTS_INFO 0x00000800
|
||||
|
||||
|
||||
/* Search Attributes */
|
||||
#define W_SEARCH_ATTR_DIR 0x00008000
|
||||
#define W_SEARCH_ATTR_ALL 0x00008006
|
||||
|
||||
|
||||
/* OPEN/CREAT Modes */
|
||||
#define OPC_MODE_OPEN 0x01
|
||||
#define OPC_MODE_REPLACE 0x02
|
||||
#define OPC_MODE_CREAT 0x08
|
||||
|
||||
/* OPEN/CREAT ACTION Results */
|
||||
#define OPC_ACTION_OPEN 0x01
|
||||
#define OPC_ACTION_CREAT 0x02
|
||||
#define OPC_ACTION_REPLACE 0x04
|
||||
|
||||
|
||||
/* Modify File or Subdirektory DOS Info infomask */
|
||||
#define DOS_MSK_ATTRIBUTE 0x00000002
|
||||
|
||||
#define DOS_MSK_CREAT_DATE 0x00000004
|
||||
#define DOS_MSK_CREAT_TIME 0x00000008
|
||||
#define DOS_MSK_CREAT_ID 0x00000010
|
||||
|
||||
#define DOS_MSK_ARCHIVE_DATE 0x00000020
|
||||
#define DOS_MSK_ARCHIVE_TIME 0x00000040
|
||||
#define DOS_MSK_ARCHIVE_ID 0x00000080
|
||||
|
||||
#define DOS_MSK_MODIFY_DATE 0x00000100
|
||||
#define DOS_MSK_MODIFY_TIME 0x00000200
|
||||
#define DOS_MSK_MODIFY_ID 0x00000400
|
||||
|
||||
#define DOS_MSK_ACCESS_DATE 0x00000800
|
||||
#define DOS_MSK_INHERIT_RIGHTS 0x00001000
|
||||
#define DOS_MSK_MAX_SPACE 0x00002000
|
||||
|
||||
extern int handle_func_0x57(uint8 *p, uint8 *responsedata, int task);
|
||||
extern int handle_func_0x56(uint8 *p, uint8 *responsedata, int task);
|
||||
|
||||
extern int fill_namespace_buffer(int volume, uint8 *rdata);
|
||||
extern int get_namespace_dir_entry(int volume, uint32 basehandle,
|
||||
int namspace, uint8 *rdata);
|
||||
|
||||
extern void exit_name_space_module(void);
|
||||
extern void init_name_space_module(int max_baseh, int max_searchh);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
490
include/net.h
Normal file
490
include/net.h
Normal file
@@ -0,0 +1,490 @@
|
||||
/* net.h 12-Jan-99 */
|
||||
|
||||
/* (C)opyright (C) 1993,1996 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _M_NET_H_
|
||||
#define _M_NET_H_
|
||||
|
||||
#ifndef _XOPEN_SOURCE
|
||||
# define _XOPEN_SOURCE 1
|
||||
#endif
|
||||
#define _SVID_SOURCE 1
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h> /* moved 12-May-98 0.99.pl9 */
|
||||
|
||||
#include <signal.h>
|
||||
#ifdef __USE_BSD
|
||||
# undef signal
|
||||
# define signal sysv_signal
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#ifndef LINUX
|
||||
/* z.B. USL */
|
||||
# include <sys/tiuser.h>
|
||||
#endif
|
||||
|
||||
#include <sys/fcntl.h>
|
||||
/* #include <sys/types.h> moved 12-May-98 0.99.pl9 */
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <sys/wait.h>
|
||||
#include <utmp.h>
|
||||
#include <grp.h>
|
||||
|
||||
#include <sys/errno.h>
|
||||
extern int errno;
|
||||
|
||||
#ifndef LINUX
|
||||
# include <stropts.h>
|
||||
# include <poll.h>
|
||||
# include <sys/nwctypes.h>
|
||||
# include <sys/stream.h>
|
||||
/* # include "common.h" */
|
||||
/* # include "portable.h" , needed ??? */
|
||||
# include <sys/ipx_app.h>
|
||||
#else
|
||||
# include <sys/ioctl.h>
|
||||
# include "emutli.h" /* TLI-EMULATION */
|
||||
# include "emutli1.h" /* TLI-EMULATION */
|
||||
#endif
|
||||
|
||||
#include <pwd.h>
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef min
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#ifndef LINUX
|
||||
# define inline /**/
|
||||
#endif
|
||||
|
||||
#ifdef SPARC
|
||||
# define U16_TO_BE16 X_U16_TO_16
|
||||
# define U32_TO_BE32 X_U32_TO_32
|
||||
# define U16_TO_16 X_U16_TO_BE16
|
||||
# define U32_TO_32 X_U32_TO_BE32
|
||||
#else
|
||||
# define U16_TO_BE16 X_U16_TO_BE16
|
||||
# define U32_TO_BE32 X_U32_TO_BE32
|
||||
# define U16_TO_16 X_U16_TO_16
|
||||
# define U32_TO_32 X_U32_TO_32
|
||||
#endif
|
||||
|
||||
#define X_U16_TO_BE16(u, b) { uint16 a=(uint16)(u); \
|
||||
*( (uint8*) (b) ) = *( ((uint8*) (&a)) +1); \
|
||||
*( ((uint8*) (b)) +1) = *( (uint8*) (&a)); }
|
||||
|
||||
#define X_U32_TO_BE32(u, b) { uint32 a=(uint32)(u); \
|
||||
*( (uint8*) (b)) = *( ((uint8*) (&a))+3); \
|
||||
*( ((uint8*) (b)) +1) = *( ((uint8*) (&a))+2); \
|
||||
*( ((uint8*) (b)) +2) = *( ((uint8*) (&a))+1); \
|
||||
*( ((uint8*) (b)) +3) = *( (uint8*) (&a)); }
|
||||
|
||||
#define X_U16_TO_16(u, b) { uint16 a=(uint16)(u); \
|
||||
((uint8*)b)[0] = ((uint8*)&a)[0]; \
|
||||
((uint8*)b)[1] = ((uint8*)&a)[1]; }
|
||||
|
||||
#define X_U32_TO_32(u, b) { uint32 a=(uint32)(u); \
|
||||
((uint8*)b)[0] = ((uint8*)&a)[0]; \
|
||||
((uint8*)b)[1] = ((uint8*)&a)[1]; \
|
||||
((uint8*)b)[2] = ((uint8*)&a)[2]; \
|
||||
((uint8*)b)[3] = ((uint8*)&a)[3]; }
|
||||
|
||||
#define GET_BE16(b) ( (int) *(((uint8*)(b))+1) \
|
||||
| ( ( (int) *( (uint8*)(b) ) << 8) ) )
|
||||
|
||||
#define GET_BE32(b) ( (uint32) *(((uint8*)(b))+3) \
|
||||
| ( ((uint32) *(((uint8*)(b))+2) ) << 8) \
|
||||
| ( ((uint32) *(((uint8*)(b))+1) ) << 16) \
|
||||
| ( ((uint32) *( (uint8*)(b) ) ) << 24) )
|
||||
|
||||
|
||||
#define GET_16(b) ( (int) *( (uint8*)(b) ) \
|
||||
| ( ( (int) *(((uint8*)(b))+1) << 8) ) )
|
||||
|
||||
#define GET_32(b) ( (uint32) *( (uint8*)(b) ) \
|
||||
| ( ((uint32) *(((uint8*)(b))+1) ) << 8) \
|
||||
| ( ((uint32) *(((uint8*)(b))+2) ) << 16) \
|
||||
| ( ((uint32) *(((uint8*)(b))+3) ) << 24) )
|
||||
|
||||
|
||||
#define MAX_U32 ((uint32)0xffffffffL)
|
||||
#define MAX_U16 ((uint16)0xffff)
|
||||
|
||||
#define MAX_I32 0x7fffffff
|
||||
|
||||
/* ===================> config.h <======================= */
|
||||
#ifdef CALL_NWCONN_OVER_SOCKET
|
||||
# undef CALL_NWCONN_OVER_SOCKET
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef CALL_NWCONN_OVER_SOCKET
|
||||
# ifdef LINUX
|
||||
# ifdef SIOCIPXNCPCONN
|
||||
# define CALL_NWCONN_OVER_SOCKET 1
|
||||
# else
|
||||
# define CALL_NWCONN_OVER_SOCKET 0
|
||||
# endif
|
||||
# else
|
||||
# define CALL_NWCONN_OVER_SOCKET 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DO_DEBUG
|
||||
# define DO_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if DO_DEBUG
|
||||
# ifndef FUNC_17_02_IS_DEBUG
|
||||
# define FUNC_17_02_IS_DEBUG 0
|
||||
# endif
|
||||
#else
|
||||
# undef FUNC_17_02_IS_DEBUG
|
||||
# define FUNC_17_02_IS_DEBUG 0
|
||||
#endif
|
||||
|
||||
#ifndef MAX_CONNECTIONS
|
||||
# define MAX_CONNECTIONS 5 /* maximum Number of connections */
|
||||
#endif
|
||||
|
||||
#ifndef MAX_NW_VOLS
|
||||
# define MAX_NW_VOLS 10 /* maximum Number of volumes */
|
||||
#endif
|
||||
|
||||
#ifndef MAX_FILE_HANDLES_CONN
|
||||
# define MAX_FILE_HANDLES_CONN 80
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef MAX_NET_DEVICES
|
||||
# define MAX_NET_DEVICES 5
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FILENAME_NW_INI
|
||||
# define FILENAME_NW_INI "./nw.ini" /* location of ini (conf) file */
|
||||
#endif
|
||||
|
||||
#ifndef PATHNAME_BINDERY
|
||||
# define PATHNAME_BINDERY "/var/nwserv/db" /* location of bindery files */
|
||||
#endif
|
||||
|
||||
#ifndef PATHNAME_PIDFILES
|
||||
# define PATHNAME_PIDFILES "/var/run" /* location of pidfiles */
|
||||
#endif
|
||||
|
||||
#ifndef FILENAME_UTMP
|
||||
# define FILENAME_UTMP UTMP_FILE
|
||||
#endif
|
||||
|
||||
#ifndef FILENAME_WTMP
|
||||
# define FILENAME_WTMP WTMP_FILE
|
||||
#endif
|
||||
|
||||
#ifndef NETWORK_SERIAL_NMBR
|
||||
# define NETWORK_SERIAL_NMBR 0x44444444L /* Serial Number 4 Byte */
|
||||
#endif
|
||||
#ifndef NETWORK_APPL_NMBR
|
||||
# define NETWORK_APPL_NMBR 0x2222 /* Applikation Number 2 Byte */
|
||||
#endif
|
||||
|
||||
#ifndef IPX_DATA_GR_546
|
||||
# define IPX_DATA_GR_546 2
|
||||
#endif
|
||||
|
||||
#ifndef USE_MMAP
|
||||
# define USE_MMAP 1
|
||||
#endif
|
||||
|
||||
#ifndef WITH_NAME_SPACE_CALLS
|
||||
# define WITH_NAME_SPACE_CALLS 0
|
||||
#endif
|
||||
|
||||
#ifndef MAX_DIR_BASE_ENTRIES
|
||||
# define MAX_DIR_BASE_ENTRIES 50
|
||||
#endif
|
||||
|
||||
#if MAX_DIR_BASE_ENTRIES < 10
|
||||
# define MAX_DIR_BASE_ENTRIES 10
|
||||
#endif
|
||||
|
||||
#ifndef HANDLE_ALL_SAP_TYPS
|
||||
# define HANDLE_ALL_SAP_TYPS 1
|
||||
#endif
|
||||
|
||||
#if IPX_DATA_GR_546
|
||||
# if IPX_DATA_GR_546 == 3
|
||||
# define IPX_MAX_DATA 4130
|
||||
# define RW_BUFFERSIZE 4096
|
||||
# elif IPX_DATA_GR_546 == 2
|
||||
# define IPX_MAX_DATA 1470
|
||||
# define RW_BUFFERSIZE 1444
|
||||
# else
|
||||
# define IPX_MAX_DATA 1058
|
||||
# define RW_BUFFERSIZE 1024
|
||||
# endif
|
||||
#else
|
||||
# define IPX_MAX_DATA 546
|
||||
# define RW_BUFFERSIZE 512
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_BURSTMODE
|
||||
# define ENABLE_BURSTMODE 0 /* no Burst mode by default */
|
||||
#endif
|
||||
|
||||
#ifndef PERSISTENT_SYMLINKS
|
||||
# define PERSISTENT_SYMLINKS 0
|
||||
#endif
|
||||
|
||||
#ifndef SOCK_EXTERN
|
||||
# define SOCK_EXTERN 0 /* no external SOCKET */
|
||||
#endif
|
||||
|
||||
#ifndef DO_TESTING
|
||||
# define DO_TESTING 0
|
||||
#endif
|
||||
|
||||
#ifndef NEW_ATTRIB_HANDLING
|
||||
# define NEW_ATTRIB_HANDLING 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LINUX
|
||||
# ifndef QUOTA_SUPPORT
|
||||
# define QUOTA_SUPPORT 0
|
||||
# endif
|
||||
#else
|
||||
# undef QUOTA_SUPPORT
|
||||
# define QUOTA_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
# ifdef IN_NWROUTED
|
||||
# undef INTERNAL_RIP_SAP
|
||||
# define INTERNAL_RIP_SAP 1
|
||||
# endif
|
||||
# ifndef INTERNAL_RIP_SAP
|
||||
# define INTERNAL_RIP_SAP 1
|
||||
# endif
|
||||
# ifdef FREEBSD
|
||||
/* FreeBSD has own rip/sap router */
|
||||
# undef INTERNAL_RIP_SAP
|
||||
# define INTERNAL_RIP_SAP 0
|
||||
# endif
|
||||
#else
|
||||
/* USL has rip/sap router builtin */
|
||||
# undef INTERNAL_RIP_SAP
|
||||
# define INTERNAL_RIP_SAP 0
|
||||
#endif
|
||||
|
||||
#define MAX_SERVER_NAME 48
|
||||
|
||||
typedef union {
|
||||
struct S_SIP { /* Server Identification Packet, siehe auch SAP */
|
||||
uint8 response_type[2]; /*hi-lo */
|
||||
/* 2 periodic bzw. Shutdown */
|
||||
/* bzw. General Service Response */
|
||||
/* 4 nearest Service Response */
|
||||
uint8 server_type[2]; /*hi-lo */
|
||||
/* 0x0 unknown */
|
||||
/* 0x1 user */
|
||||
/* 0x2 user/group */
|
||||
/* 0x3 Print Queue */
|
||||
/* 0x4 File Server */
|
||||
/* 0x5 Job Server */
|
||||
/* 0x6 Gateway */
|
||||
/* 0x7 Printserver */
|
||||
/* 0x9 Archive Server */
|
||||
/* 0x24 Remote Bridge Server */
|
||||
/* 0x47 Advertising Print Server */
|
||||
/* 0x107 Netware 386 */
|
||||
/* 0xFFFF (-1) WILD */
|
||||
|
||||
uint8 server_name[MAX_SERVER_NAME];
|
||||
ipxAddr_t server_adr;
|
||||
uint8 intermediate_networks[2]; /* hi-lo */
|
||||
/* normal 0 */
|
||||
/* down 16 */
|
||||
} sip; /* Server Identifikation Packet */
|
||||
struct S_SQP { /* Service Query Packet */
|
||||
uint8 query_type[2]; /* hi low */
|
||||
/* 1 general Service Query */
|
||||
/* 3 nearest Server Query */
|
||||
uint8 server_type[2]; /* hi low s.o. */
|
||||
} sqp;
|
||||
struct S_SAP {
|
||||
uint8 sap_operation[2]; /* hi-low */
|
||||
struct S_SAPS {
|
||||
uint8 server_type[2];
|
||||
uint8 server_name[MAX_SERVER_NAME];
|
||||
ipxAddr_t server_adr;
|
||||
uint8 server_hops[2];
|
||||
} saps;
|
||||
} sap;
|
||||
struct S_WDOG { /* Watchdog */
|
||||
uint8 connid; /* connection ID */
|
||||
uint8 status; /* STATUS */
|
||||
} wdog;
|
||||
struct S_CONFREQ { /* IPX Diagnose */
|
||||
uint8 count;
|
||||
uint8 ex_node[6];
|
||||
} confreq;
|
||||
struct S_RIP { /* ROUTING */
|
||||
uint8 operation[2]; /* 1 request, 2 response */
|
||||
uint8 network[4];
|
||||
uint8 hops[2]; /* Anzahl Routerspassagen um Netzwerk zu Erreichen */
|
||||
uint8 ticks[2]; /* Zeit in 1/18 sec. um Netzwerk Nummer zu erreichen */
|
||||
} rip;
|
||||
struct S_DIAGRESP {
|
||||
uint8 majorversion;
|
||||
uint8 minorversion;
|
||||
uint8 spx_diag_sock[2]; /* SPX Diagnose SOCKET */
|
||||
uint8 anz; /* Anzahl Componente */
|
||||
/* .... Componente
|
||||
* uint8 id; 0:IPX/SPX, 1: BRIGDE Driver, 2: Shell driver
|
||||
* 3: Shell, 4: VAP Shell
|
||||
*
|
||||
* extented 5: external Bridge, 6 Files Server/Bridge
|
||||
* 7: non dedicated IPX/SPX
|
||||
*
|
||||
* extented haben folgende Zusatzfelder
|
||||
* uint8 count; Anzahl Local Networks
|
||||
* jetzt pro Network
|
||||
* uint8 type; 0: LAN-Board,
|
||||
* 1: non dedicated File/Sever(virtuelles Board)
|
||||
* 2: redirected remote Line;
|
||||
*
|
||||
* uint8 net; Netwerk Adresse
|
||||
* uint8 node; Node
|
||||
*
|
||||
*
|
||||
*/
|
||||
} diaresp;
|
||||
struct S_NCPRESPONSE { /* size = 8 */
|
||||
uint8 type[2]; /* 0x3333 or internal 0x3232 */
|
||||
uint8 sequence;
|
||||
uint8 connection; /* low connection */
|
||||
uint8 task;
|
||||
uint8 high_connection; /* high connection */
|
||||
uint8 completition; /* bzw. ERROR CODE */
|
||||
uint8 connect_status;
|
||||
} ncpresponse;
|
||||
struct S_NCPREQUEST { /* size = 7 */
|
||||
uint8 type[2]; /* 0x1111 or 0x2222 or internal 0x1212 */
|
||||
uint8 sequence;
|
||||
uint8 connection; /* low connection */
|
||||
uint8 task;
|
||||
uint8 high_connection; /* high connection */
|
||||
uint8 function; /* Function */
|
||||
} ncprequest;
|
||||
struct S_BURSTPACKET { /* size = 36 */
|
||||
uint8 type[2]; /* 0x7777 */
|
||||
uint8 flags; /* 0x10 = EOB (EndOfBurst) */
|
||||
/* 0x80 = SYS (Systemflag) */
|
||||
uint8 streamtyp; /* 2 = BIG_SEND_BURST stream typ */
|
||||
uint8 source_conn[4];
|
||||
uint8 dest_conn[4];
|
||||
uint8 packet_sequence[4]; /* hi-lo, incr. by every packet */
|
||||
uint8 delaytime[4]; /* hi-lo, statistik */
|
||||
uint8 burst_seq[2]; /* akt_sequence ? */
|
||||
uint8 ack_seq[2]; /* next_sequnce ? */
|
||||
|
||||
uint8 burstsize[4]; /* hi-lo, complete burstsize */
|
||||
uint8 burstoffset[4]; /* hi-lo */
|
||||
|
||||
uint8 datasize[2]; /* hi-lo, number of data byte's in this packet */
|
||||
uint8 missing[2]; /* 0,0 , number of missing fragments, follows */
|
||||
} burstpacket;
|
||||
struct S_OWN_DATA {
|
||||
struct {
|
||||
uint8 type[2]; /* 0xeeee */
|
||||
uint8 sequence;
|
||||
uint8 reserved; /* its good for alignement */
|
||||
} h; /* header */
|
||||
struct {
|
||||
int size; /* size of next two entries */
|
||||
int function;
|
||||
uint8 data[1];
|
||||
} d;
|
||||
} owndata;
|
||||
struct S_OWN_REPLY {
|
||||
uint8 type[2]; /* 0xefef */
|
||||
uint8 sequence;
|
||||
uint8 result; /* perhaps we need it */
|
||||
} ownreply;
|
||||
char data[IPX_MAX_DATA];
|
||||
} IPX_DATA;
|
||||
|
||||
typedef struct S_SIP SIP;
|
||||
typedef struct S_SQP SQP;
|
||||
typedef struct S_SAP SAP;
|
||||
typedef struct S_SAPS SAPS;
|
||||
typedef struct S_RIP RIP;
|
||||
|
||||
typedef struct S_CONFREQ CONFREQ;
|
||||
typedef struct S_DIAGRESP DIAGRESP;
|
||||
typedef struct S_NCPRESPONSE NCPRESPONSE;
|
||||
typedef struct S_NCPREQUEST NCPREQUEST;
|
||||
typedef struct S_BURSTPACKET BURSTPACKET;
|
||||
typedef struct S_OWN_DATA OWN_DATA;
|
||||
typedef struct S_OWN_REPLY OWN_REPLY;
|
||||
|
||||
/* SOCKETS */
|
||||
#define SOCK_AUTO 0x0000 /* Autobound Socket */
|
||||
#define SOCK_ROUTE 0x0001 /* Routing Information */
|
||||
#define SOCK_ECHO 0x0002 /* Echo Protokoll Packet */
|
||||
#define SOCK_ERROR 0x0003 /* Error Handler Packet */
|
||||
#define SOCK_NCP 0x0451 /* File Service CORE */
|
||||
#define SOCK_SAP 0x0452 /* SAP Service Advertising Packet */
|
||||
#define SOCK_RIP 0x0453 /* Routing Information Packet */
|
||||
#define SOCK_NETBIOS 0x0455 /* NET BIOS Packet */
|
||||
#define SOCK_DIAGNOSE 0x0456 /* Diagnostic Packet */
|
||||
#define SOCK_PSERVER 0x8060 /* Print Server's Socket */
|
||||
#define SOCK_NVT 0x8063 /* NVT (Network Virtual Terminal) */
|
||||
|
||||
|
||||
/* PACKET TYPES */
|
||||
#define PACKT_0 0 /* unknown */
|
||||
#define PACKT_ROUTE 1 /* Routing Information */
|
||||
#define PACKT_ECHO 2 /* Echo Packet */
|
||||
#define PACKT_ERROR 3 /* Error Packet */
|
||||
#define PACKT_EXCH 4 /* Packet Exchange Packet */
|
||||
#define PACKT_SPX 5 /* SPX Packet */
|
||||
/* 16 - 31 Experimental */
|
||||
#define PACKT_CORE 17 /* Core Protokoll (NCP) */
|
||||
|
||||
#define FD_NWSERV 3 /* one after stderr */
|
||||
|
||||
#include "net1.h"
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
#endif
|
||||
54
include/net1.h
Normal file
54
include/net1.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* net1.h 19.09.99 */
|
||||
|
||||
/* (C)opyright (C) 1993-99 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _M_NET1_H_
|
||||
#define _M_NET1_H_
|
||||
|
||||
#ifndef LINUX
|
||||
extern void print_t_info(struct t_info *t);
|
||||
extern void print_ud_data(struct t_unitdata *ud);
|
||||
#endif
|
||||
|
||||
extern char *xvisable_ipx_adr(ipxAddr_t *p, int modus);
|
||||
#define visable_ipx_adr(adr) xvisable_ipx_adr((adr), 0)
|
||||
|
||||
extern void print_ipx_addr(ipxAddr_t *p);
|
||||
extern void print_ipx_data(IPX_DATA *p);
|
||||
extern void print_sip_data(SIP *sip);
|
||||
|
||||
extern void adr_to_ipx_addr(ipxAddr_t *p, char *s);
|
||||
extern void ipx_addr_to_adr(char *s, ipxAddr_t *p);
|
||||
|
||||
extern int open_ipx_socket(ipxAddr_t *addr, int sock_nr);
|
||||
|
||||
extern int send_ipx_data(int fd, int pack_typ,
|
||||
int data_len, char *data,
|
||||
ipxAddr_t *to_addr, char *comment);
|
||||
|
||||
extern int receive_ipx_data(int fd, int *pack_typ, IPX_DATA *d,
|
||||
ipxAddr_t *fromaddr, int waitmsec);
|
||||
|
||||
extern int send_own_data(int fd, IPX_DATA *d, ipxAddr_t *toaddr);
|
||||
extern int send_own_reply(int fd, int result, int sequence, ipxAddr_t *toaddr);
|
||||
|
||||
extern int get_ipx_addr(ipxAddr_t *addr);
|
||||
|
||||
extern uint8 *station_fn;
|
||||
extern int find_station_match(int entry, ipxAddr_t *addr);
|
||||
|
||||
#endif
|
||||
27
include/nwattrib.h
Normal file
27
include/nwattrib.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* nwattrib.h 30-Apr-98 */
|
||||
|
||||
#ifndef _NWATTRIB_H_
|
||||
#define _NWATTRIB_H_
|
||||
|
||||
/* <-------------- File Attributes -------------> */
|
||||
#define FILE_ATTR_NORMAL 0x00000000
|
||||
#define FILE_ATTR_R 0x00000001
|
||||
#define FILE_ATTR_H 0x00000002
|
||||
#define FILE_ATTR_S 0x00000004
|
||||
#define FILE_ATTR_DIR 0x00000010
|
||||
#define FILE_ATTR_A 0x00000020
|
||||
#define FILE_ATTR_SHARE 0x00000080
|
||||
|
||||
#define FILE_ATTR_RENAME_INH 0x00020000
|
||||
#define FILE_ATTR_DELETE_INH 0x00040000
|
||||
|
||||
extern uint32 get_nw_attrib_dword(int volume, char *unixname, struct stat *stb);
|
||||
extern int set_nw_attrib_dword(int volume, char *unixname, struct stat *stb, uint32 attrib);
|
||||
extern int set_nw_attrib_byte (int volume, char *unixname, struct stat *stb, int battrib);
|
||||
extern int set_nw_attrib_word(int volume, char *unixname, struct stat *stb, int wattrib);
|
||||
extern void set_nw_archive_bit(int volume, char *unixname, int dev, ino_t inode);
|
||||
|
||||
|
||||
extern void free_nw_ext_inode(int volume, char *unixname, int dev, ino_t inode);
|
||||
#endif
|
||||
|
||||
49
include/nwbind.h
Normal file
49
include/nwbind.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* nwbind.h 23-Apr-98 */
|
||||
|
||||
#ifndef _NWBIND_H_
|
||||
#define _NWBIND_H_
|
||||
|
||||
#define MAX_SEMA_CONN 10 /* 10 Semaphore / connection */
|
||||
|
||||
|
||||
typedef struct {
|
||||
int handle; /* semahore handle */
|
||||
int opencount; /* times open */
|
||||
} SEMA_CONN;
|
||||
|
||||
|
||||
typedef void (*RESPONSE_FUNC)(int connection,
|
||||
char *data,
|
||||
int data_len,
|
||||
int completition);
|
||||
|
||||
typedef struct {
|
||||
int sequence;
|
||||
int function;
|
||||
time_t sendtime;
|
||||
char *data;
|
||||
int data_len;
|
||||
RESPONSE_FUNC func;
|
||||
} NWCONN_REQUEST;
|
||||
|
||||
typedef struct {
|
||||
ipxAddr_t client_adr; /* address remote client */
|
||||
uint32 object_id; /* logged object */
|
||||
/* 0 = not logged in */
|
||||
int id_flags; /* &1 == supervisor (equivalence) */
|
||||
/* flags are also availible in */
|
||||
/* connection based routines */
|
||||
|
||||
uint8 crypt_key[8]; /* password generation */
|
||||
time_t t_login; /* login time */
|
||||
uint8 message[60]; /* saved BCastmessage */
|
||||
int active; /* 0=closed, 1= active */
|
||||
int send_to_sock; /* this is the receiving sock */
|
||||
int pid_nwconn; /* pid of user process nwconn */
|
||||
NWCONN_REQUEST *request_nwconn; /* last request to nwconn */
|
||||
int last_used_sequence;
|
||||
int count_semas; /* open semahores */
|
||||
SEMA_CONN semas[MAX_SEMA_CONN];
|
||||
} CONNECTION;
|
||||
|
||||
#endif
|
||||
7
include/nwconn.h
Normal file
7
include/nwconn.h
Normal file
@@ -0,0 +1,7 @@
|
||||
/* nwconn.h 13-May-98 */
|
||||
#ifndef _NWCONN_H_
|
||||
#define _NWCONN_H_
|
||||
extern int act_pid;
|
||||
extern void nwconn_set_program_title(char *s);
|
||||
#endif
|
||||
|
||||
12
include/nwcrypt.h
Normal file
12
include/nwcrypt.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* nwcrypt.h 22-Jun-96 */
|
||||
extern void shuffle(unsigned char *lon,
|
||||
const unsigned char *buf, int buflen,
|
||||
unsigned char *target);
|
||||
|
||||
extern void nw_encrypt(unsigned char *fra,
|
||||
unsigned char *buf,unsigned char *til);
|
||||
|
||||
|
||||
extern void nw_decrypt_newpass(char *oldpwd, char *newpwd, char *undecr);
|
||||
extern void newpassencrypt(char *old, char *new, char *out);
|
||||
|
||||
285
include/nwdbm.h
Normal file
285
include/nwdbm.h
Normal file
@@ -0,0 +1,285 @@
|
||||
/* nwdbm.h 25-Apr-00 */
|
||||
/* (C)opyright (C) 1993,2000 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _NWDBM_H_
|
||||
#define _NWDBM_H_
|
||||
|
||||
#define NETOBJ_KEY_SIZE 4
|
||||
|
||||
typedef struct {
|
||||
uint32 id; /* Objekt ID */
|
||||
/* --------------- */
|
||||
uint8 name[48];
|
||||
uint16 type;
|
||||
uint8 flags; /* statisch, dynamisch */
|
||||
uint8 security;
|
||||
} NETOBJ;
|
||||
|
||||
#define NETIOBJ_KEY_SIZE 50
|
||||
typedef struct {
|
||||
uint8 name[48];
|
||||
uint16 type;
|
||||
/* --------------- */
|
||||
uint32 id; /* Objekt ID */
|
||||
} NETIOBJ;
|
||||
|
||||
#define NETPROP_KEY_SIZE 5
|
||||
typedef struct {
|
||||
uint32 obj_id; /* ID OBJECT */
|
||||
uint8 id; /* PROPERTY id */
|
||||
/* --------------- */
|
||||
uint8 name[16];
|
||||
uint8 flags; /* statisch, dynamisch */
|
||||
uint8 security;
|
||||
} NETPROP;
|
||||
|
||||
#define NETVAL_KEY_SIZE 6
|
||||
typedef struct {
|
||||
uint32 obj_id; /* ID OBJECT */
|
||||
uint8 prop_id; /* PROPERTY id */
|
||||
uint8 segment; /* Segment Nr */
|
||||
/* --------------- */
|
||||
uint8 value[128]; /* Inhalt */
|
||||
} NETVAL;
|
||||
|
||||
/* Object Flags */
|
||||
#define O_FL_STAT 0x0
|
||||
#define O_FL_DYNA 0x1
|
||||
|
||||
/* Property Flags */
|
||||
/* BIT 7 */
|
||||
#define P_FL_STAT 0x0
|
||||
#define P_FL_DYNA 0x1
|
||||
/* BIT 6 */
|
||||
#define P_FL_ITEM 0x0
|
||||
#define P_FL_SET 0x2
|
||||
|
||||
extern int tells_server_version;
|
||||
extern int password_scheme;
|
||||
|
||||
extern uint8 *sys_unixname; /* Unixname of SYS: ends with '/' */
|
||||
extern int sys_unixnamlen; /* len of unixname */
|
||||
extern int sys_downshift; /* is SYS downshift */
|
||||
extern uint8 *sys_sysname; /* Name of first Volume, normally SYS */
|
||||
|
||||
extern uint32 network_serial_nmbr;
|
||||
extern uint16 network_appl_nmbr;
|
||||
extern int entry8_flags;
|
||||
|
||||
#define PW_SCHEME_CHANGE_PW 1
|
||||
#define PW_SCHEME_LOGIN 2
|
||||
#define PW_SCHEME_GET_KEY_FAIL 4
|
||||
#define PW_SCHEME_ALLOW_EMPTY_PW 8
|
||||
|
||||
/*
|
||||
** LOGIN_CONTROL structure is an 86 byte structure that contains
|
||||
** account password information
|
||||
** Paolo Prandini <prandini@spe.it> mst:25-Apr-00
|
||||
**
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
uint8 accountExpiresYear;
|
||||
uint8 accountExpiresMonth;
|
||||
uint8 accountExpiresDay;
|
||||
uint8 accountExpired;
|
||||
|
||||
uint8 passwordExpiresYear;
|
||||
uint8 passwordExpiresMonth;
|
||||
uint8 passwordExpiresDay;
|
||||
uint8 passwordGraceLogins;
|
||||
uint8 expirationInterval[2]; /* hi-lo */
|
||||
uint8 graceReset;
|
||||
uint8 minimumPasswordLength;
|
||||
|
||||
uint8 maxConcurrentConnections[2]; /* hi-lo */
|
||||
uint8 timeBitMap[42];
|
||||
uint8 lastLoginDate[6];
|
||||
uint8 restrictionFlags; // bit 0=1 disallow pwd change,
|
||||
// bit 1=1 require unique pwd
|
||||
uint8 filler;
|
||||
uint8 maxDiskBlocks[4]; /* hi-lo */
|
||||
uint8 badLoginCount[2]; /* hi-lo */
|
||||
uint8 nextResetTime[4]; /* hi-lo */
|
||||
uint8 badStationAddress[12];
|
||||
|
||||
} LOGIN_CONTROL;
|
||||
|
||||
/*
|
||||
** USER_DEFAULTS structure is a structure that contains
|
||||
** default account password information
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
uint8 accountExpiresYear;
|
||||
uint8 accountExpiresMonth;
|
||||
uint8 accountExpiresDay;
|
||||
uint8 restrictionFlags;
|
||||
uint8 expirationInterval[2]; /* hi-lo */
|
||||
uint8 graceReset;
|
||||
uint8 minimumPasswordLength;
|
||||
|
||||
uint8 maxConcurrentConnections[2]; /* hi-lo */
|
||||
uint8 timeBitMap[42];
|
||||
uint8 balance[4]; /* ?? */
|
||||
uint8 creditLimit[4]; /* ?? */
|
||||
uint8 maxDiskBlocks[4]; /* hi-lo */
|
||||
uint8 createHomeDir;
|
||||
|
||||
} USER_DEFAULTS;
|
||||
|
||||
|
||||
/* next routine is in nwbind.c !!!! */
|
||||
extern int b_acc(uint32 obj_id, int security, int forwrite);
|
||||
|
||||
extern void sync_dbm(void);
|
||||
|
||||
extern int nw_get_prop(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
int segment_nr,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
uint8 *property_value,
|
||||
uint8 *more_segments,
|
||||
uint8 *property_flags);
|
||||
|
||||
|
||||
extern int find_obj_id(NETOBJ *o);
|
||||
extern int scan_for_obj(NETOBJ *o, uint32 last_obj_id, int ignore_rights);
|
||||
|
||||
extern int nw_delete_obj(NETOBJ *obj);
|
||||
extern int nw_rename_obj(NETOBJ *o, uint8 *newname);
|
||||
extern int nw_change_obj_security(NETOBJ *o, int newsecurity);
|
||||
extern int nw_get_obj(NETOBJ *o);
|
||||
|
||||
|
||||
extern int nw_get_prop_val_by_obj_id(uint32 obj_id,
|
||||
int segment_nr,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
uint8 *property_value,
|
||||
uint8 *more_segments,
|
||||
uint8 *property_flags);
|
||||
|
||||
extern int nw_get_prop_val(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
int segment_nr,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
uint8 *property_value,
|
||||
uint8 *more_segments,
|
||||
uint8 *property_flags);
|
||||
|
||||
extern int nw_delete_property(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen);
|
||||
|
||||
extern int nw_is_member_in_set(uint32 obj_id, char *propname,
|
||||
uint32 member_id);
|
||||
|
||||
extern int nw_is_obj_in_set(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
int member_type,
|
||||
uint8 *member_name, int member_namlen);
|
||||
|
||||
extern int nw_add_obj_to_set(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
int member_type,
|
||||
uint8 *member_name, int member_namlen);
|
||||
|
||||
extern int nw_delete_obj_from_set(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
int member_type,
|
||||
uint8 *member_name, int member_namlen);
|
||||
|
||||
|
||||
|
||||
extern int nw_write_prop_value(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
int segment_nr, int erase_segments,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
uint8 *property_value);
|
||||
|
||||
|
||||
extern int nw_change_prop_security(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
int prop_security);
|
||||
|
||||
extern int nw_scan_property(NETPROP *prop,
|
||||
int object_type,
|
||||
uint8 *object_name,
|
||||
int object_namlen,
|
||||
uint8 *prop_name,
|
||||
int prop_namlen,
|
||||
uint32 *last_scan);
|
||||
|
||||
extern int nw_get_prop_val_str(uint32 q_id, char *propname, uint8 *buff);
|
||||
|
||||
extern int nw_create_obj(NETOBJ *obj, uint32 wanted_id);
|
||||
|
||||
|
||||
extern int nw_obj_has_prop(NETOBJ *obj);
|
||||
|
||||
|
||||
extern int nw_create_prop(int object_type,
|
||||
uint8 *object_name, int object_namlen,
|
||||
uint8 *prop_name, int prop_namlen,
|
||||
int prop_flags, int prop_security);
|
||||
|
||||
extern uint32 nw_new_obj_prop(uint32 wanted_id,
|
||||
char *objname, int objtype, int objflags, int objsecurity,
|
||||
char *propname, int propflags, int propsecurity,
|
||||
char *value, int valuesize, int ever);
|
||||
|
||||
extern int nw_is_security_equal(uint32 id1, uint32 id2);
|
||||
#define HAVE_SU_RIGHTS(id) ( ((id)==1L) || !nw_is_security_equal(1L, (id)))
|
||||
extern int get_groups_i_m_in(uint32 id, uint32 *gids);
|
||||
|
||||
extern int get_guid(int *gid, int *uid, uint32 obj_id, uint8 *name);
|
||||
|
||||
/* mst:25-Apr-00 */
|
||||
extern int nw_get_login_control(uint32 obj_id, LOGIN_CONTROL *plc);
|
||||
extern int nw_set_login_control(uint32 obj_id, LOGIN_CONTROL *plc);
|
||||
|
||||
extern int nw_test_passwd(uint32 obj_id, uint8 *vgl_key, uint8 *akt_key);
|
||||
extern int nw_test_unenpasswd(uint32 obj_id, uint8 *password);
|
||||
extern int nw_set_passwd(uint32 obj_id, char *password, int dont_ch);
|
||||
|
||||
extern int nw_keychange_passwd(uint32 obj_id,
|
||||
uint8 *cryptkey, uint8 *oldpass,
|
||||
int cryptedlen, uint8 *newpass,
|
||||
int id_flags);
|
||||
|
||||
extern int nw_test_adr_time_access(uint32 obj_id, ipxAddr_t *client_adr);
|
||||
|
||||
|
||||
extern int nwdbm_mkdir(char *unixname, int mode, int flags);
|
||||
extern int nwdbm_rmdir(char *path);
|
||||
extern void test_ins_unx_user(uint32 id);
|
||||
extern int test_allow_password_change(uint32 id);
|
||||
|
||||
extern int nw_fill_standard(char *servername, ipxAddr_t *adr);
|
||||
extern int nw_init_dbm(char *servername, ipxAddr_t *adr);
|
||||
extern void nw_exit_dbm(void);
|
||||
|
||||
extern int do_export_dbm(char *path);
|
||||
extern int do_import_dbm(char *path);
|
||||
extern int do_export_dbm_to_dir(void);
|
||||
|
||||
|
||||
#endif
|
||||
69
include/nwfile.h
Normal file
69
include/nwfile.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* nwfile.h 10-Nov-99 */
|
||||
#ifndef _NWFILE_H_
|
||||
#define _NWFILE_H_
|
||||
#include "extpipe.h"
|
||||
|
||||
typedef struct {
|
||||
int task; /* for which task */
|
||||
int fd; /* filehandle from system open/creat */
|
||||
long offd; /* actual file offset */
|
||||
uint8 *p_mmap; /* for use with mmap */
|
||||
int size_mmap;
|
||||
time_t tmodi; /* modification TIME */
|
||||
int modified; /* is file modified / written */
|
||||
FILE_PIPE *f; /* for PIPE */
|
||||
int fh_flags; /* 2 = PIPE */
|
||||
/* 4 = don't reuse after close */
|
||||
/* 0x20 = readonly */
|
||||
int st_dev; /* device */
|
||||
int st_ino; /* inode */
|
||||
char fname[256]; /* UNIX filename */
|
||||
int volume; /* Volume */
|
||||
int inuse; /* used for multiple open of filehandle */
|
||||
int access; /* open access */
|
||||
} FILE_HANDLE;
|
||||
|
||||
/* fh_flags */
|
||||
#define FH_IS_PIPE 0x01
|
||||
#define FH_IS_PIPE_COMMAND 0x02
|
||||
#define FH_DO_NOT_REUSE 0x04
|
||||
#define FH_IS_READONLY 0x20 /* filesystem is readonly */
|
||||
#define FH_OPENED_RO 0x40 /* is opened RO */
|
||||
|
||||
extern void sig_bus_mmap(int rsig);
|
||||
|
||||
extern void init_file_module(int task);
|
||||
|
||||
extern int file_creat_open(int volume, uint8 *unixname,
|
||||
struct stat *stbuff,
|
||||
int attrib, int access, int creatmode, int task);
|
||||
|
||||
extern int nw_set_fdate_time(uint32 fhandle, uint8 *datum, uint8 *zeit);
|
||||
|
||||
|
||||
extern int nw_close_file(int fhandle, int reset_reuse, int task);
|
||||
extern int nw_commit_file(int fhandle);
|
||||
|
||||
extern uint8 *file_get_unix_name(int fhandle);
|
||||
|
||||
extern int nw_read_file(int fhandle, uint8 *data, int size, uint32 offset);
|
||||
extern int nw_seek_file(int fhandle, int modus);
|
||||
extern int nw_write_file(int fhandle, uint8 *data, int size, uint32 offset);
|
||||
extern int nw_server_copy(int qfhandle, uint32 qoffset,
|
||||
int zfhandle, uint32 zoffset,
|
||||
uint32 size);
|
||||
|
||||
extern int nw_log_physical_record(int fhandle, uint32 offset, uint32 size, uint16 timeout, int do_lock);
|
||||
|
||||
extern int fd_2_fname(int fhandle, char *buf, int bufsize);
|
||||
extern FILE_HANDLE *fd_2_fh(int fhandle);
|
||||
extern int get_nwfd(int fhandle);
|
||||
extern void log_file_module(FILE *f);
|
||||
extern int nw_get_count_open_files(uint8 *handlebuf, uint32 offset);
|
||||
|
||||
extern int nw_log_logical_record(int lock_flag,
|
||||
int timeout,
|
||||
int len,
|
||||
uint8 *data);
|
||||
extern void dump_locks(int dev, int inode, int fd, FILE *f);
|
||||
#endif
|
||||
35
include/nwfname.h
Normal file
35
include/nwfname.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* nwfname.h 17-Jun-97 */
|
||||
|
||||
#ifndef _NWFNAME_H_
|
||||
#define _NWFNAME_H_ 1
|
||||
|
||||
|
||||
extern void init_nwfname(char *convfile);
|
||||
|
||||
extern uint8 *up_fn(uint8 *ss);
|
||||
extern uint8 *down_fn(uint8 *ss);
|
||||
extern uint8 *dos2unixcharset(uint8 *ss);
|
||||
extern uint8 *unix2doscharset(uint8 *ss);
|
||||
|
||||
extern int dfn_imatch(uint8 a, uint8 b);
|
||||
extern int ufn_imatch(uint8 a, uint8 b);
|
||||
|
||||
#if PERSISTENT_SYMLINKS
|
||||
typedef struct {
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
int islink; /* if symblic link */
|
||||
} S_STATB;
|
||||
extern int s_stat(char *path, struct stat *statbuf, S_STATB *stb);
|
||||
extern int s_utime(char *fn, struct utimbuf *ut, S_STATB *stb);
|
||||
extern int s_chmod(char *fn, umode_t mode, S_STATB *stb);
|
||||
#else
|
||||
# define s_stat(path, statbuf, stb) \
|
||||
stat((path), (statbuf))
|
||||
# define s_utime(fn, ut, stb) \
|
||||
utime((fn), (ut))
|
||||
# define s_chmod(fn, mode, stb) \
|
||||
chmod((fn), (mode))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
28
include/nwqconn.h
Normal file
28
include/nwqconn.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* nwqconn.h 14-Apr-98 */
|
||||
#ifndef _NWQCONN_H_
|
||||
#define _NWQCONN_H_
|
||||
#include "queuedef.h"
|
||||
extern int creat_queue_job(int task,
|
||||
uint32 q_id,
|
||||
uint8 *queue_job,
|
||||
uint8 *responsedata,
|
||||
uint8 old_call);
|
||||
|
||||
extern int close_queue_job(uint32 q_id, int job_id);
|
||||
extern int close_queue_job2(uint32 q_id, int job_id,
|
||||
uint8 *client_area,
|
||||
uint8 *prc, int prc_len);
|
||||
|
||||
extern int service_queue_job(int task,
|
||||
uint32 q_id,
|
||||
uint8 *queue_job,
|
||||
uint8 *responsedata,
|
||||
uint8 old_call);
|
||||
|
||||
extern int finish_abort_queue_job(uint32 q_id, int job_id);
|
||||
extern uint32 get_queue_job_fhandle(uint32 q_id, int job_id);
|
||||
|
||||
extern void free_queue_jobs(void);
|
||||
|
||||
extern void free_connection_task_jobs(int task);
|
||||
#endif
|
||||
55
include/nwqueue.h
Normal file
55
include/nwqueue.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* nwqueue.h 14-Apr-98 */
|
||||
#ifndef _NWQUEUE_H_
|
||||
#define _NWQUEUE_H_
|
||||
#include "queuedef.h"
|
||||
|
||||
extern int nw_get_q_dirname(uint32 q_id, uint8 *buff);
|
||||
|
||||
extern int nw_creat_queue_job(int connection, int task, uint32 object_id,
|
||||
uint32 q_id, uint8 *q_job, uint8 *responsedata,
|
||||
int old_call);
|
||||
|
||||
extern int nw_close_queue_job(uint32 q_id, int job_id,
|
||||
uint8 *responsedata);
|
||||
|
||||
extern int nw_get_queue_status(uint32 q_id, int *status, int *entries,
|
||||
int *servers, int server_ids[], int server_conns[]);
|
||||
|
||||
extern int nw_set_queue_status(uint32 q_id, int status);
|
||||
|
||||
extern int nw_get_q_job_entry(uint32 q_id, int job_id, uint32 fhandle,
|
||||
uint8 *responsedata, int old_call);
|
||||
extern int nw_get_queue_job_list_old(uint32 q_id, uint8 *responsedata);
|
||||
extern int nw_get_queue_job_list(uint32 q_id, uint32 offset, uint8 *responsedata);
|
||||
extern int nw_get_queue_job_file_size(uint32 q_id, int job_id);
|
||||
extern int nw_change_queue_job_entry(uint32 q_id, uint8 *qjstruct);
|
||||
|
||||
extern int nw_remove_job_from_queue(uint32 user_id, uint32 q_id, int job_id);
|
||||
|
||||
extern void nw_close_connection_jobs(int connection, int task);
|
||||
|
||||
|
||||
/* ------------------ for queue servers ------------------- */
|
||||
extern int nw_attach_server_to_queue(uint32 user_id,
|
||||
int connection,
|
||||
uint32 q_id);
|
||||
|
||||
extern int nw_detach_server_from_queue(uint32 user_id,
|
||||
int connection,
|
||||
uint32 q_id);
|
||||
|
||||
extern int nw_service_queue_job(uint32 user_id, int connection, int task,
|
||||
uint32 q_id, int job_typ,
|
||||
uint8 *responsedata, int old_call);
|
||||
|
||||
extern int nw_finish_abort_queue_job(int mode, uint32 user_id, int connection,
|
||||
uint32 q_id, int job_id);
|
||||
|
||||
extern int nw_creat_queue(int q_typ, uint8 *q_name, int q_name_len,
|
||||
uint8 *path, int path_len, uint32 *q_id);
|
||||
|
||||
extern int nw_destroy_queue(uint32 q_id);
|
||||
|
||||
extern void exit_queues(void);
|
||||
extern void init_queues(int entry18_flags_p);
|
||||
#endif
|
||||
109
include/nwserv.h
Normal file
109
include/nwserv.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/* nwserv.h 17-Jul-97 */
|
||||
/* (C)opyright (C) 1993,1995 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _M_NWSERV_H_
|
||||
#define _M_NWSERV_H_
|
||||
extern uint32 internal_net; /* NETWORKNUMMER INTERN (SERVER) */
|
||||
extern int no_internal; /* no use of internal net */
|
||||
extern int auto_detect_interfaces;
|
||||
extern ipxAddr_t my_server_adr; /* Address of this server */
|
||||
extern char my_nwname[50]; /* Name of this server */
|
||||
extern int print_route_tac; /* every x broadcasts print it */
|
||||
extern int print_route_mode; /* append */
|
||||
extern char *pr_route_info_fn; /* filename */
|
||||
extern int wdogs_till_tics;
|
||||
extern time_t acttime_stamp;
|
||||
|
||||
typedef struct {
|
||||
char *devname; /* "eth0" or "isdnX" or ?? */
|
||||
int frame; /* frametyp */
|
||||
int ticks; /* ether:ticks=1, isdn:ticks=7 */
|
||||
uint32 net; /* NETWORK NUMBER */
|
||||
int is_up; /* Is this device up ? */
|
||||
int wildmask; /* wildmask, 1=name, 2=frame, 4=net */
|
||||
time_t updated_time;
|
||||
int needs_update;
|
||||
} NW_NET_DEVICE;
|
||||
|
||||
/* <========== DEVICES ==========> */
|
||||
extern int count_net_devices;
|
||||
extern int max_net_devices;
|
||||
extern NW_NET_DEVICE **net_devices;
|
||||
|
||||
/* <======== SOCKETS =========> */
|
||||
#if !IN_NWROUTED
|
||||
# define WDOG_SLOT 0 /* Watchdog send + recv */
|
||||
|
||||
# if SOCK_EXTERN
|
||||
# define EXTERN_SLOT (WDOG_SLOT+1)
|
||||
# ifdef _MAR_TESTS_1
|
||||
# define PSERVER_SLOT (EXTERN_SLOT+1)
|
||||
# define SAP_SLOT (PSERVER_SLOT+1)
|
||||
# else
|
||||
# define SAP_SLOT (EXTERN_SLOT+1)
|
||||
# endif
|
||||
# else
|
||||
# ifdef _MAR_TESTS_1
|
||||
# define PSERVER_SLOT (WDOG_SLOT+1)
|
||||
# define SAP_SLOT (PSERVER_SLOT+1)
|
||||
# else
|
||||
# define SAP_SLOT (WDOG_SLOT+1)
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# define SAP_SLOT 0
|
||||
#endif
|
||||
|
||||
#if INTERNAL_RIP_SAP
|
||||
# define RIP_SLOT (SAP_SLOT +1)
|
||||
# define ROUTE_SLOT (RIP_SLOT +1)
|
||||
# define DIAG_SLOT (ROUTE_SLOT +1)
|
||||
# if 0
|
||||
# define ECHO_SLOT (DIAG_SLOT +1)
|
||||
# define ERR_SLOT (ECHO_SLOT +1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
extern int sockfd[];
|
||||
|
||||
extern void ins_del_bind_net_addr(uint8 *name, int styp, ipxAddr_t *adr);
|
||||
extern void send_server_response(int respond_typ,
|
||||
int styp, ipxAddr_t *to_addr);
|
||||
|
||||
extern void print_routing_info(int force);
|
||||
extern void send_sap_rip_broadcast(int mode);
|
||||
extern void rip_for_net(uint32 net);
|
||||
extern void get_servers(void);
|
||||
|
||||
extern void handle_rip(int fd, int ipx_pack_typ,
|
||||
int data_len, IPX_DATA *ipxdata,
|
||||
ipxAddr_t *from_addr);
|
||||
|
||||
extern int activate_slow_net(uint32 net);
|
||||
|
||||
extern void insert_delete_server(uint8 *name,
|
||||
int styp,
|
||||
ipxAddr_t *addr,
|
||||
ipxAddr_t *from_addr,
|
||||
int hops,
|
||||
int do_delete, /* delete = 1 */
|
||||
int flags);
|
||||
|
||||
extern int dont_send_wdog(ipxAddr_t *addr);
|
||||
extern void realloc_net_devices(void);
|
||||
extern int test_ins_device_net(uint32 rnet);
|
||||
#endif
|
||||
17
include/nwshare.h
Normal file
17
include/nwshare.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* nwshare.h: 25-Sep-99*/
|
||||
/* (C)opyright (C) 1993-1999 Martin Stover, Marburg, Germany
|
||||
*/
|
||||
|
||||
#ifndef _NWSHARE_H_
|
||||
#define _NWSHARE_H_ 1
|
||||
/* changed by: Ingmar Thiemann <ingmar@gefas.com> */
|
||||
extern int share_file(int dev, int inode, int open_mode, int action);
|
||||
extern int share_lock( int dev, int inode, int fd, int action,
|
||||
int lock_flag, int l_start, int l_len, int timeout );
|
||||
extern int share_unlock_all( int dev, int inode, int fd );
|
||||
|
||||
extern int share_set_file_add_rm(int lock_flag, int dev, int inode);
|
||||
extern int share_set_logrec_add_rm(int lock_flag, int timeout, int len, char *data);
|
||||
extern int share_handle_lock_sets(int type, int lock_flag, int timeout);
|
||||
|
||||
#endif
|
||||
142
include/nwvolume.h
Normal file
142
include/nwvolume.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/* nwvolume.h 09-Oct-99 */
|
||||
/* (C)opyright (C) 1993-1999 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _NWVOLUME_H_
|
||||
#define _NWVOLUME_H_
|
||||
|
||||
#define MAX_DEV_NAMESPACE_MAPS 16
|
||||
|
||||
typedef struct {
|
||||
int dev;
|
||||
int namespace;
|
||||
} DEV_NAMESPACE_MAP;
|
||||
|
||||
/*
|
||||
* This is inserted for namespace calls, to can map an
|
||||
* volume->dev->inode->namespace to an uint32 basehandle
|
||||
* without loosing too many places.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8 *path;
|
||||
uint8 len;
|
||||
int trustee;
|
||||
} VOLUME_TRUSTEE;
|
||||
|
||||
typedef struct {
|
||||
uint8 *sysname; /* VOL_NAME */
|
||||
uint8 *unixname; /* UNIX-DIR with ending '/' */
|
||||
int unixnamlen; /* len of unixname */
|
||||
/* next 2 fields added by Andrew Sapozhnikov */
|
||||
/* for Extend "Volume is home" feature */
|
||||
|
||||
int dev; /* dev and inode of volume root */
|
||||
int inode;
|
||||
|
||||
uint8 *homeaddon; /* tail for $HOME-relative volumes */
|
||||
int addonlen; /* len of tail part of unixname */
|
||||
DEV_NAMESPACE_MAP *dev_namespace_maps[MAX_DEV_NAMESPACE_MAPS];
|
||||
int max_maps_count; /* may be less than MAX_DEV_NAMESPACE_MAPS */
|
||||
int maps_count; /* count of dev_namespace_maps */
|
||||
uint32 high_inode; /* hight inode to can handle correct */
|
||||
int options; /* see defines below */
|
||||
uint8 *os2buf; /* special stuff for os2 namspace */
|
||||
|
||||
int umode_dir; /* umask/umode for creating dirs */
|
||||
int umode_file; /* umask/umode for creating files */
|
||||
|
||||
/* Trustee handling */
|
||||
VOLUME_TRUSTEE *trustees;
|
||||
int max_alloc_trustees;
|
||||
int count_trustees;
|
||||
uint32 trustee_id; /* id of last searched vol trustees */
|
||||
int trustee_namespace;
|
||||
unsigned int trustee_sernum;
|
||||
time_t trustee_last_test_time; /* when did we test trustee sernum */
|
||||
} NW_VOL;
|
||||
|
||||
/* vol options */
|
||||
#define VOL_OPTION_DOWNSHIFT 0x0001 /* downshift */
|
||||
#define VOL_OPTION_IS_PIPE 0x0002 /* Volume contains pipes */
|
||||
#define VOL_OPTION_REMOUNT 0x0004 /* Volume can be remounted (cdroms) */
|
||||
#define VOL_OPTION_IS_HOME 0x0008 /* Volume is USERS HOME */
|
||||
#define VOL_OPTION_ONE_DEV 0x0010 /* Volume has only one filesys */
|
||||
#define VOL_OPTION_READONLY 0x0020 /* Volume is readonly */
|
||||
#define VOL_OPTION_IGNCASE 0x0040 /* Do ignore up/downshift */
|
||||
#define VOL_OPTION_NO_INODES 0x0080 /* Volume do not have fixed inodes */
|
||||
#define VOL_OPTION_TRUSTEES 0x0100 /* Volume use Trustees */
|
||||
#define VOL_OPTION_ATTRIBUTES 0x0200 /* Volume use 'real' Attributes */
|
||||
#define VOL_OPTION_IGNUNXRIGHT 0x0400 /* Ignore rights granted in UN*X FS */
|
||||
#define VOL_OPTION_UNX_RIGHT 0x0800 /* Use UN*X real rights */
|
||||
|
||||
/* namespaces */
|
||||
#define VOL_NAMESPACE_DOS 0x1000
|
||||
#define VOL_NAMESPACE_OS2 0x2000
|
||||
#define VOL_NAMESPACE_NFS 0x4000
|
||||
|
||||
/* stolen from GNU-fileutils */
|
||||
/* Space usage statistics for a filesystem. Blocks are 512-byte. */
|
||||
struct fs_usage {
|
||||
long fsu_blocks; /* Total blocks. */
|
||||
long fsu_bfree; /* Free blocks available to superuser. */
|
||||
long fsu_bavail; /* Free blocks available to non-superuser. */
|
||||
long fsu_files; /* Total file nodes. */
|
||||
long fsu_ffree; /* Free file nodes. */
|
||||
};
|
||||
|
||||
extern NW_VOL *nw_volumes;
|
||||
extern int used_nw_volumes;
|
||||
extern int loaded_namespaces;
|
||||
extern uint8 *home_dir;
|
||||
extern int home_dir_len;
|
||||
extern char *path_vol_inodes_cache; /* for namespace routines */
|
||||
extern char *path_attributes; /* for attribute handling */
|
||||
extern char *path_trustees; /* for trustee handling */
|
||||
|
||||
extern void nw_init_volumes(FILE *f);
|
||||
extern void nw_setup_vol_opts(int act_gid, int act_uid,
|
||||
int act_umode_dir, int act_umode_file,
|
||||
uint8 *unxlogin);
|
||||
|
||||
extern int nw_get_volume_number(uint8 *volname, int namelen);
|
||||
extern int nw_get_volume_name(int volnr, uint8 *volname, int size_volname);
|
||||
|
||||
extern int get_volume_umode_dir(int volnr);
|
||||
extern int get_volume_umode_file(int volnr);
|
||||
|
||||
extern int nw_get_fs_usage(uint8 *volname, struct fs_usage *fsu, int limit);
|
||||
extern int get_volume_options(int volnr);
|
||||
extern int get_volume_inode(int volnr, struct stat *stb);
|
||||
extern int get_volume_unixnamlen(int volnr);
|
||||
|
||||
extern int nw_set_vol_restrictions(uint8 volnr, int uid, uint32 quota);
|
||||
extern int nw_get_vol_restrictions(uint8 volnr, int uid, uint32 *quota, uint32 *inuse);
|
||||
|
||||
extern uint32 nw_vol_inode_to_handle(int volume, ino_t inode,
|
||||
DEV_NAMESPACE_MAP *dnm);
|
||||
|
||||
extern ino_t nw_vol_handle_to_inode(int volume, uint32 handle,
|
||||
DEV_NAMESPACE_MAP *dnm);
|
||||
|
||||
extern int vol_trustees_were_changed(int volume);
|
||||
|
||||
extern int get_volume_user_trustee(int volume, uint32 id,
|
||||
int namespace,
|
||||
int *sequence,
|
||||
int *trustee, uint8 *path);
|
||||
|
||||
#endif
|
||||
78
include/queuedef.h
Normal file
78
include/queuedef.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* queuedef.h 09-Aug-97 */
|
||||
|
||||
#ifndef _QUEUEDEF_H_
|
||||
#define _QUEUEDEF_H_
|
||||
typedef struct {
|
||||
uint8 record_in_use[2];
|
||||
uint8 record_previous[4];
|
||||
uint8 record_next[4];
|
||||
|
||||
uint8 client_connection[4]; /* Lo-Hi */
|
||||
uint8 client_task[4]; /* Lo-Hi */
|
||||
uint8 client_id[4]; /* Hi-Lo */
|
||||
|
||||
uint8 target_id[4]; /* 0xff, 0xff, 0xff, 0xff */
|
||||
uint8 target_execute_time[6]; /* all 0xff */
|
||||
uint8 job_entry_time[6]; /* all zero */
|
||||
uint8 job_id[4]; /* Hi-Lo */
|
||||
uint8 job_typ[2]; /* Hi-Lo */
|
||||
uint8 job_position[2]; /* Lo-Hi, e.g. 0x01, 0x00 */
|
||||
uint8 job_control_flags[2]; /* Lo-Hi, e.g. 0x10, 0x00 */
|
||||
/* 0x80 operator hold flag */
|
||||
/* 0x40 user hold flag */
|
||||
/* 0x20 entry open flag */
|
||||
/* 0x10 service restart flag */
|
||||
/* 0x08 autostart flag */
|
||||
|
||||
uint8 job_file_name[14]; /* len + DOS filename */
|
||||
uint8 job_file_handle[4];
|
||||
uint8 server_station[4];
|
||||
uint8 server_task[4];
|
||||
uint8 server_id[4];
|
||||
/* offset 78 */
|
||||
uint8 job_description[50]; /* "LPT1 Catch" */
|
||||
uint8 client_area[152];
|
||||
} QUEUE_JOB;
|
||||
|
||||
typedef struct {
|
||||
uint8 client_connection;
|
||||
uint8 client_task;
|
||||
uint8 client_id[4];
|
||||
uint8 target_id[4]; /* 0xff, 0xff, 0xff, 0xff */
|
||||
uint8 target_execute_time[6]; /* all 0xff */
|
||||
uint8 job_entry_time[6]; /* all zero */
|
||||
uint8 job_id[2]; /* Hi-Lo */
|
||||
uint8 job_typ[2]; /* Hi-Lo */
|
||||
uint8 job_position; /* zero */
|
||||
uint8 job_control_flags;
|
||||
/* 0x80 operator hold flag */
|
||||
/* 0x40 user hold flag */
|
||||
/* 0x20 entry open flag */
|
||||
/* 0x10 service restart flag */
|
||||
/* 0x08 autostart flag */
|
||||
|
||||
uint8 job_file_name[14]; /* len + DOS filename */
|
||||
uint8 job_file_handle[6];
|
||||
uint8 server_station;
|
||||
uint8 server_task;
|
||||
uint8 server_id[4];
|
||||
/* offset 54 */
|
||||
uint8 job_description[50]; /* "LPT1 Catch" */
|
||||
uint8 client_area[152];
|
||||
} QUEUE_JOB_OLD; /* before 3.11 */
|
||||
|
||||
typedef struct {
|
||||
uint8 version; /* normal 0x0 */
|
||||
uint8 tabsize; /* normal 0x8 */
|
||||
uint8 count_copies[2]; /* copies 0x0, 0x01 */
|
||||
uint8 print_flags[2]; /* 0x0, 0xc0 e.g. with banner */
|
||||
uint8 max_lines[2]; /* 0x0, 0x42 */
|
||||
uint8 max_chars[2]; /* 0x0, 0x84 */
|
||||
uint8 form_name[16]; /* "UNKNOWN" */
|
||||
uint8 reserved[6]; /* all zero */
|
||||
uint8 banner_user_name[13]; /* "SUPERVISOR" */
|
||||
uint8 banner_file_name[13]; /* "LST:" */
|
||||
uint8 banner_header_file_name[14]; /* all zero */
|
||||
uint8 file_path_name[80]; /* all zero */
|
||||
} QUEUE_PRINT_AREA;
|
||||
#endif
|
||||
9
include/sema.h
Normal file
9
include/sema.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/* sema.h: 07-Aug-97 */
|
||||
|
||||
#ifndef _SEMA_H_
|
||||
#define _SEMA_H_
|
||||
|
||||
extern void clear_conn_semas(CONNECTION *c);
|
||||
extern int handle_func_0x20(CONNECTION *c, uint8 *p, int ufunc, uint8 *responsedata);
|
||||
|
||||
#endif
|
||||
98
include/tools.h
Normal file
98
include/tools.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* tools.h : 18-Apr-00 */
|
||||
|
||||
/* (C)opyright (C) 1993-2000 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _TOOLS_H_
|
||||
#define _TOOLS_H_
|
||||
|
||||
/* processes which need tools */
|
||||
#define NWSERV 1
|
||||
#define NCPSERV 2
|
||||
#define NWCONN 3
|
||||
#define NWCLIENT 4
|
||||
#define NWBIND 5
|
||||
#define NWROUTED 6
|
||||
|
||||
extern void x_x_xfree(char **p);
|
||||
extern int x_x_xnewstr(uint8 **p, uint8 *s);
|
||||
|
||||
#define xfree(p) x_x_xfree((char **)&(p))
|
||||
#define new_str(p, s) x_x_xnewstr((uint8 **)&(p), s)
|
||||
|
||||
extern char *xmalloc(uint size);
|
||||
extern char *xcmalloc(uint size);
|
||||
extern int strmaxcpy(uint8 *dest, uint8 *source, int len);
|
||||
#define xstrcpy(d, s) strmaxcpy((d), (s), sizeof(d)-1)
|
||||
#define xstrmaxcpy(d, s, len) strmaxcpy((d), (s), min(sizeof(d)-1, (len)) )
|
||||
|
||||
extern void xdprintf(int dlevel, int mode, char *p, ...);
|
||||
extern void errorp(int mode, char *what, char *p, ...);
|
||||
extern FILE *open_nw_ini(void);
|
||||
extern int get_ini_entry(FILE *f, int entry, uint8 *str, int strsize);
|
||||
extern char *get_div_pathes(char *buff, char *name, int what, char *p, ... );
|
||||
#define get_exec_path(bu, progn) get_div_pathes((bu), (progn), 0, NULL)
|
||||
|
||||
extern int get_ini_int(int what);
|
||||
extern void get_ini_debug(int what);
|
||||
extern void get_debug_level(uint8 *buf);
|
||||
extern void init_tools(int module, int options);
|
||||
extern void exit_tools(void);
|
||||
|
||||
extern uint8 down_char(uint8 ch);
|
||||
extern uint8 up_char(uint8 ch);
|
||||
extern uint8 *downstr(uint8 *ss);
|
||||
extern uint8 *upstr(uint8 *ss);
|
||||
|
||||
extern int hextoi(char *buf);
|
||||
extern int octtoi(char *buf);
|
||||
|
||||
extern unsigned int atou(char *buf);
|
||||
extern char *hex_str(char *buf, uint8 *s, int len);
|
||||
|
||||
extern int name_match(uint8 *s, uint8 *p);
|
||||
|
||||
extern int nw_debug;
|
||||
extern uint32 debug_mask;
|
||||
|
||||
extern int act_ncpsequence; /* for debugging */
|
||||
extern int act_connection; /* which connection (nwconn, nwbind) */
|
||||
extern time_t act_time; /* actual time */
|
||||
|
||||
#include "debmask.h"
|
||||
#if DO_DEBUG
|
||||
# define XDPRINTF(x) xdprintf x
|
||||
# define D() XDPRINTF((3, 0, "Z: %d" , __LINE__));
|
||||
# define MDEBUG(mask, x) if (mask & debug_mask) x
|
||||
#else
|
||||
# define XDPRINTF(x) /* */
|
||||
# define D() /* */
|
||||
# define MDEBUG(mask, x) /* */
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef LINUX
|
||||
extern int fixed_sprintf(char *buf, char *p, ...);
|
||||
#define sprintf fixed_sprintf
|
||||
#endif
|
||||
|
||||
extern int slprintf(char *buf, int bufsize, char *p, ...);
|
||||
|
||||
extern char *gettmpstr(char *qs, int len, int extralen);
|
||||
extern int is_filelink(char *fn);
|
||||
|
||||
#endif /* _TOOLS_H_ */
|
||||
|
||||
61
include/trustee.h
Normal file
61
include/trustee.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/* trustee.h 13-Apr-00 */
|
||||
#ifndef _TRUSTEE_H_
|
||||
#define _TRUSTEE_H_
|
||||
|
||||
/* some TRUSTEE defines */
|
||||
#define TRUSTEE_R 0x01 /* file Read rights */
|
||||
#define TRUSTEE_W 0x02 /* file Write rights */
|
||||
#define TRUSTEE_O 0x04 /* file Open rights */
|
||||
#define TRUSTEE_C 0x08 /* file/dir Creat rights */
|
||||
#define TRUSTEE_E 0x10 /* file/dir Erase rights */
|
||||
#define TRUSTEE_A 0x20 /* Access control,change trustees,inherited rights */
|
||||
#define TRUSTEE_F 0x40 /* File scan rights */
|
||||
#define TRUSTEE_M 0x80 /* Modify filename, attrib rights */
|
||||
/* ......extended Trustees ................. */
|
||||
#define TRUSTEE_S 0x100 /* Supervisor rights */
|
||||
|
||||
/* mars_nwe only, idea and patches from Christoph Scheeder */
|
||||
#define TRUSTEE_T 0x200 /* See this dir/file only */
|
||||
|
||||
#define MAX_TRUSTEE_MASK 0x1FF
|
||||
|
||||
typedef struct {
|
||||
uint32 id;
|
||||
int trustee;
|
||||
} NW_OIC;
|
||||
|
||||
extern void tru_free_cache(int volume);
|
||||
extern void tru_init_trustees(int count, uint32 *grps);
|
||||
|
||||
extern unsigned int tru_vol_sernum(int volume, int mode);
|
||||
|
||||
extern void tru_free_file_trustees_from_disk(int volume,
|
||||
int dev, ino_t inode);
|
||||
|
||||
extern int tru_del_trustee(int volume, uint8 *unixname,
|
||||
struct stat *stb, uint32 id);
|
||||
|
||||
extern int tru_get_id_trustee(int volume, uint8 *unixname,
|
||||
struct stat *stb, uint32 id);
|
||||
|
||||
extern int tru_add_trustee_set(int volume, uint8 *unixname,
|
||||
struct stat *stb,
|
||||
int count, NW_OIC *nwoic);
|
||||
|
||||
extern int tru_get_trustee_set(int volume, uint8 *unixname,
|
||||
struct stat *stb,
|
||||
int sequence,
|
||||
int maxcount, uint32 *ids, int *trustees);
|
||||
|
||||
extern int tru_set_inherited_mask(int volume, uint8 *unixname,
|
||||
struct stat *stb, int new_mask);
|
||||
|
||||
extern int tru_get_inherited_mask(int volume, uint8 *unixname,
|
||||
struct stat *stb);
|
||||
|
||||
extern int tru_get_eff_rights(int volume, uint8 *unixname, struct stat *stb);
|
||||
extern int tru_eff_rights_exists(int volume, uint8 *unixname, struct stat *stb,
|
||||
int lookfor);
|
||||
|
||||
|
||||
#endif
|
||||
42
include/unxfile.h
Normal file
42
include/unxfile.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* unxfile.h: 23-Jul-98 */
|
||||
/* (C)opyright (C) 1993,1998 Martin Stover, Marburg, Germany
|
||||
*
|
||||
* 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 _UNXFILE_H_
|
||||
#define _UNXFILE_H_ 1
|
||||
extern int unx_mvdir(uint8 *oldname, uint8 *newname);
|
||||
extern int unx_mvfile(uint8 *oldname, uint8 *newname);
|
||||
extern int unx_mvfile_or_dir(uint8 *oldname, uint8 *newname);
|
||||
extern int unx_xmkdir(char *unixname, int mode);
|
||||
extern int unx_add_x_rights(char *unixname, int mode);
|
||||
extern int unx_xrmdir(char *unixname);
|
||||
|
||||
extern int unx_ftruncate(int fd, uint32 size);
|
||||
|
||||
#ifdef FREEBSD
|
||||
# define SEEKDIR(dh,to) {\
|
||||
rewinddir(dh);\
|
||||
while(TELLDIR(dh)!=(to)) \
|
||||
if(readdir(dh)==NULL) break;\
|
||||
}
|
||||
# define TELLDIR(dh) ((dh)->dd_loc+(dh)->dd_seek)
|
||||
#else
|
||||
# define SEEKDIR(dh,to) seekdir((dh),(to))
|
||||
# define TELLDIR(dh) telldir((dh))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
5
include/unxlog.h
Normal file
5
include/unxlog.h
Normal file
@@ -0,0 +1,5 @@
|
||||
/* unxlog.h */
|
||||
extern void write_utmp(int dologin, int connection, int pid,
|
||||
ipxAddr_t *from_addr, uint8 *username);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user