Rename the public NCP wrapper functions in c32ncp.c/c32ncp.h from c32_ncp* implementation-oriented names to protocol-oriented ncpXX_YY_* names. This prepares the code for a later c32ncp.c/c32ncp.h -> ncpapi.c/ncpapi.h file rename while keeping the current file names unchanged for now. The new names keep the NCP function/subfunction visible and describe the operation performed by each wrapper. Update all callers to use the new names. Transport-specific helpers such as c32_get_ncp_handle() are left unchanged. No behavior change.
195 lines
7.0 KiB
C
195 lines
7.0 KiB
C
/*
|
|
* mars-nwe-dosutils - NetWare/DOS utility tools.
|
|
*
|
|
* Copyright (C) 2026 Mario Fetka
|
|
*
|
|
* 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, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/*
|
|
* Purpose: Public declarations for namespace and file-system NCP API helpers.
|
|
* Depends on: net.h data types and c32ncp.c implementation; this file is planned to become ncpapi.h.
|
|
*/
|
|
|
|
|
|
/* c32ncp.h - namespace/file-system NCP API helpers for mars-dosutils */
|
|
|
|
#ifndef C32NCP_H
|
|
#define C32NCP_H
|
|
int c32_get_ncp_handle(uint16 *handle_lo, uint16 *handle_hi);
|
|
|
|
|
|
typedef struct c32_nwfile_handle6 {
|
|
uint8 h[6];
|
|
} C32_NWFILE_HANDLE6;
|
|
|
|
#define C32_OC_MODE_OPEN 0x01
|
|
#define C32_OC_MODE_TRUNCATE 0x02
|
|
#define C32_OC_MODE_CREATE 0x08
|
|
|
|
#define C32_DAR_READ 0x0001
|
|
#define C32_DAR_WRITE 0x0002
|
|
#define C32_DAR_DENY_READ 0x0004
|
|
#define C32_DAR_DENY_WRITE 0x0008
|
|
#define C32_DAR_COMPAT 0x0010
|
|
|
|
int ncp87_01_open_create_entry(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint8 open_create_mode,
|
|
uint32 create_attrs,
|
|
uint16 desired_access,
|
|
uint16 search_attrs,
|
|
C32_NWFILE_HANDLE6 *handle_out,
|
|
uint32 *file_size_out,
|
|
uint8 *open_create_action_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp74_file_server_copy(const C32_NWFILE_HANDLE6 *src,
|
|
const C32_NWFILE_HANDLE6 *dst,
|
|
uint32 src_offset,
|
|
uint32 dst_offset,
|
|
uint32 count,
|
|
uint32 *copied_out);
|
|
|
|
int ncp66_close_file(const C32_NWFILE_HANDLE6 *handle);
|
|
|
|
|
|
int ncp87_06_obtain_rim_attributes(const char *name,
|
|
uint16 dir_handle,
|
|
uint32 *attr_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
typedef struct c32_dos_modify_info {
|
|
uint32 attributes;
|
|
uint16 creation_time;
|
|
uint16 creation_date;
|
|
uint32 creator_id;
|
|
uint16 modify_time;
|
|
uint16 modify_date;
|
|
uint32 modifier_id;
|
|
uint16 last_access_date;
|
|
uint16 archive_time;
|
|
uint16 archive_date;
|
|
uint32 archiver_id;
|
|
uint16 inherited_rights;
|
|
uint32 maximum_space;
|
|
} C32_DOS_MODIFY_INFO;
|
|
|
|
typedef struct c32_ndir_info {
|
|
uint32 space_allocated;
|
|
uint32 attributes;
|
|
uint16 flags;
|
|
uint32 data_size;
|
|
uint32 total_size;
|
|
uint16 number_of_streams;
|
|
uint16 creation_time;
|
|
uint16 creation_date;
|
|
uint32 creator_id;
|
|
uint16 modify_time;
|
|
uint16 modify_date;
|
|
uint32 modifier_id;
|
|
uint16 last_access_date;
|
|
uint16 archive_time;
|
|
uint16 archive_date;
|
|
uint32 archiver_id;
|
|
uint16 inherited_rights;
|
|
uint32 dir_ent_num;
|
|
uint32 dos_dir_num;
|
|
uint32 vol_number;
|
|
uint32 ea_data_size;
|
|
uint32 ea_key_count;
|
|
uint32 ea_key_size;
|
|
uint32 ns_creator;
|
|
uint8 name_len;
|
|
char name[256];
|
|
} C32_NDIR_INFO;
|
|
|
|
int ncp87_06_obtain_ndir_info(const char *path_name,
|
|
uint16 dir_handle,
|
|
C32_NDIR_INFO *info_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
int ncp87_07_modify_dos_attributes(char *name,
|
|
uint16 dir_handle,
|
|
uint32 attrs,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp87_07_modify_dos_info(const char *name,
|
|
uint16 dir_handle,
|
|
uint32 change_mask,
|
|
C32_DOS_MODIFY_INFO *info,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp87_1d_get_effective_rights(const char *path,
|
|
uint16 dir_handle,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
|
|
int ncp87_1d_get_effective_rights_by_dirent(uint8 vol_number,
|
|
uint32 dos_dir_number,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp87_0a_add_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 rights,
|
|
uint16 rights_mask,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp22_27_set_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 rights);
|
|
|
|
int ncp22_2b_delete_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id);
|
|
|
|
int ncp87_05_find_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 *rights_out,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
int ncp87_0b_delete_trustee_rights(const char *path_name,
|
|
uint16 dir_handle,
|
|
uint32 object_id,
|
|
uint16 *actual_out,
|
|
uint16 *handle_lo_out,
|
|
uint16 *handle_hi_out);
|
|
|
|
#endif
|