0547 nwnss: import COMN lookup structural headers

This commit is contained in:
Mario Fetka
2026-06-15 12:54:36 +00:00
parent 4b075e1db9
commit 09730edb30
5 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
/****************************************************************************
|
| (C) Copyright 2004 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public
| License as published by the Free Software Foundation.
|
| 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, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
|
| NetWare Advance File Services (NSS) Initialization module
|
|---------------------------------------------------------------------------
|
| $Author: taysom $
| $Date: 2005-05-20 23:31:33 +0530 (Fri, 20 May 2005) $
|
| $RCSfile$
| $Revision: 1000 $
|
|---------------------------------------------------------------------------
| This module is used to:
| Share functions to create mangled Mac names (31 char names) from
| extended Mac names and to find a zid embedded in a mangled Mac
| file name.
+-------------------------------------------------------------------------*/
#ifndef _COMN_MAC_SHORT_NAME_H_
#define _COMN_MAC_SHORT_NAME_H_
#ifdef __cplusplus
extern "C" {
#endif
extern STATUS COMN_MakeShortMacFileName (
zInfo_s * zSrcInfo,
unicode_t * shortFileName,
BYTE * MacByteName);
extern LONG COMN_GetZidFromMangledName (
unicode_t * fileName);
extern BOOL COMN_VerifyMangledMacName (
unicode_t * mangledName,
unicode_t * fileName);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,76 @@
/****************************************************************************
|
| (C) Copyright 1985, 1991, 1993, 1996 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public
| License as published by the Free Software Foundation.
|
| 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, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
|
| NetWare Advance File Services (NSS) module
|
|---------------------------------------------------------------------------
|
| $Author: blarsen $
| $Date: 2006-01-21 04:09:53 +0530 (Sat, 21 Jan 2006) $
|
| $RCSfile$
| $Revision: 1315 $
|
|---------------------------------------------------------------------------
| This module is used to:
| This defines the interface into name spaces.
|
| WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
| This header file should ONLY be used for NSS internal development.
| This includes Semantic Agents (SA) and Loadable Storage Services (LSS).
| Any other use may cause conflicts which NSS will NOT fix.
+-------------------------------------------------------------------------*/
#ifndef _FULLDIRECTORYINFO_H_
#define _FULLDIRECTORYINFO_H_
#include <xUnicode.h>
#ifndef _OMNI_H_
#include <omni.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*-------------------------------------------------------------------------
* There are times when we need to ask directories for their FULL
* information. This structure is used to return that full information
*-------------------------------------------------------------------------*/
typedef struct FullDirectoryInfo_s
{
Zid_t zid;
NINT nameSpaceMask;
WORD nameType;
WORD flagsAndLen;
WORD oldNameUniquifier; /* Not used on version three beasts */
BYTE matchAttributes;
BYTE miscFlags;
unicode_t name[zMAX_COMPONENT_NAME];
} FullDirectoryInfo_s;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,138 @@
/****************************************************************************
|
| (C) Copyright 2001 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public
| License as published by the Free Software Foundation.
|
| 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, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
|
| Novell Storage Services (NSS) module
|
|---------------------------------------------------------------------------
|
| $Author: randys $
| $Date: 2006-11-16 04:42:23 +0530 (Thu, 16 Nov 2006) $
|
| $RCSfile$
| $Revision: 1657 $
|
|---------------------------------------------------------------------------
| This module is used to:
+-------------------------------------------------------------------------*/
#ifndef _OBJECTIDSTORE_H_
#define _OBJECTIDSTORE_H_
/****************************************************************************
* Main object ID caching structure
*****************************************************************************/
typedef struct ObjectIDCacheCtrl_s
{
QUAD gets; /* number of times we did gets on the cache */
QUAD hits; /* number of cache hits */
Latch_s latch; /* latch to control changes in this structure */
NINT numHashEntries; /* number of entries in the has table */
DQhead_t (*hash)[]; /* pointer to hash array */
DQhead_t LRUqueue; /* head of the Least Recently Used queue */
DQhead_t unusedQueue; /* head of the unused cache packets queue */
NINT maxEntries; /* max allowed entries in the cache */
NINT numEntries; /* number of entries in the cache */
NINT numUnusedEntries; /* number of unused cache entries */
NINT numAdded; /* incremented each time an entry is added */
NINT numRemoved; /* number of entries removed (not victom selected) */
NINT numVictimSelected; /* number of entries that have been victim selected */
NINT unusedEntryHit; /* number of time we found an unused entry when adding */
NINT dupAdds; /* number of times same add occured while adding */
} ObjectIDCacheCtrl_s;
extern ObjectIDCacheCtrl_s ObjectIDCache;
#define DEFAULT_OID_CACHE_SIZE 4096
typedef struct ObjectIDCacheNode_s
{
DQlink_t hashLink; /* hash list link field */
DQlink_t LRUlink; /* LRU link field */
Zid_t volume; /* volume for the entry */
UserID_t objectID; /* the ID for the object */
} ObjectIDCacheNode_s;
/****************************************************************************
* Event queue structures
*****************************************************************************/
typedef struct EventEntry_s
{
SQlink_t next;
NINT type;
union {
struct
{
unicode_t *oldName;
unicode_t *newName;
} ren;
struct
{
// NDSid_t ndsID;
unicode_t *name;
} del;
} u;
} EventEntry_s;
#define NDS_RENAME 0
#define NDS_DELETE 1
/****************************************************************************
*
* Function Prototypes
*
****************************************************************************/
STATUS OID_Startup(void);
void OID_Shutdown(void);
STATUS OID_AddEntryIfNotThere(
struct GeneralMsg_s *genMsg,
struct Volume_s *vol,
UserID_t *objectID);
void OID_SaveObjectID(
struct Volume_s *vol,
UserID_t *objectID);
STATUS OID_GetObjectName(
struct GeneralMsg_s *genMsg,
struct Volume_s *vol,
UserID_t *objectID,
unicode_t *name);
void OID_InitObjectIDStoreByName(
struct GeneralMsg_s *genMsg,
unicode_t *name,
BOOL reset,
BOOL scan);
STATUS OID_InitObjectInfo(
struct GeneralMsg_s *genMsg,
struct Volume_s *vol);
void OID_InvalidateObjectIDCache(
Volume_s *volume);
void OID_ExportVolGUIDsToLinux(
struct GeneralMsg_s *genMsg,
struct Volume_s *volume);
#endif

71
src/nwnss/comn/nameScan.h Normal file
View File

@@ -0,0 +1,71 @@
/****************************************************************************
|
| (C) Copyright 1985, 1991, 1993, 1996 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public
| License as published by the Free Software Foundation.
|
| 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, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
|
| NetWare Advance File Services (NSS) module
|
|---------------------------------------------------------------------------
|
| $Author: taysom $
| $Date: 2004-12-31 01:10:58 +0530 (Fri, 31 Dec 2004) $
|
| $RCSfile$
| $Revision: 465 $
|
|---------------------------------------------------------------------------
| This module is used to:
| This defines the interfaces into the PSS portion of the connection
| structure.
+-------------------------------------------------------------------------*/
#ifndef _NAMESCAN_H_
#define _NAMESCAN_H_
/*---------------------------------------------------------------------------
* Internal Common Layer Prototypes for working with name messages
*---------------------------------------------------------------------------*/
extern STATUS NMSG_ScanNextComponent(
GeneralMsg_s *genMsg,
NamingMsg_s *nameMsg);
extern STATUS NMSG_ValidateNameMsg(
GeneralMsg_s *genMsg,
NamingMsg_s *nameMsg);
extern STATUS NMSG_ReparseNameMsgDOSComponent(
GeneralMsg_s *genMsg,
NamingMsg_s *nameMsg);
extern void NMSG_ShutdownWorkBufferMemory(void);
STATUS TestScanComponents(
NINT nameSpaceID,
NINT pathFormat,
void *path,
NINT parseFlags,
NINT scanFlags,
NINT sizeRetPath,
unicode_t *ret_path,
NINT *ret_parseFlags,
NINT *ret_scanFlags,
NINT *ret_numComponents);
#endif /* _NAMESCAN_H_ */

View File

@@ -8,6 +8,10 @@
#include <name.h>
#include <adminVolume.h>
#include <comnBeastClass.h>
#include <fullDirectoryInfo.h>
#include <comnMacShortName.h>
#include <objectIDStore.h>
#include <nCache.h>
#include <volume.h>
#include "dosNSpace.h"
@@ -45,6 +49,10 @@ int main(void)
CHECK(COMN_RegisterNameSpace == COMN_RegisterNameSpace);
CHECK(sizeof(AdminVolume_s) >= sizeof(Volume_s));
CHECK(sizeof(BeastClass_s *) == sizeof(void *));
CHECK(sizeof(FullDirectoryInfo_s) >= sizeof(unicode_t));
CHECK(COMN_MakeShortMacFileName == COMN_MakeShortMacFileName);
CHECK(sizeof(ObjectIDCacheCtrl_s) >= sizeof(DQhead_t));
CHECK(CACHE_Startup == CACHE_Startup);
memset(answer, 0, sizeof(answer));
CHECK(DOSNS_wildReplace(NULL, src_pattern, src_name, replace_pattern, answer) == zOK);