Files
mars-nwe/include/nwnss/comnSA/pssConnection.h
2026-06-15 18:48:18 +02:00

182 lines
6.6 KiB
C

/****************************************************************************
|
| (C) Copyright 1985, 1991, 1993, 1996-1999 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: 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 NSS portion of the connection
| structure.
|
| 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 _PSSCONNECTION_H_
#define _PSSCONNECTION_H_
#ifndef _OMNI_H_
#include <omni.h>
#endif
#ifndef _QUE_H_
#include <que.h>
#endif
#ifndef _MSGGEN_H_
#include <msgGen.h>
#endif
#ifndef _CONTEXTHANDLE_H_
#include "contextHandle.h"
#endif
#ifndef _FILEHANDLE_H_
#include "fileHandle.h"
#endif
#ifndef _SEARCHMAP_H_
#include "searchMap.h"
#endif
#ifndef _COMNPUBLICS_H_
#include <comnPublics.h>
#endif
#ifndef _SAGENTHANDLE_H_
#include "sAgentHandle.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*-------------------------------------------------------------------------
* Externals
*-------------------------------------------------------------------------*/
extern NINT CNCT_LatchingConnection;
/*-------------------------------------------------------------------------
* This goes in the NSS connection structure and controls access to the
* list of authenticated IDs.
*-------------------------------------------------------------------------*/
typedef struct AuthCtrl_s {
Latch_s authListLatch; /* latch */
NINT numAuthenticatedIDs; /* The number of IDs in the authenticated ID array */
NINT numOriginalIDs; /* Number of IDs in the original connection structure */
UserID_t *authenticatedIDs; /* The NDS authenticated IDs for this connection */
LONG *originalIDs; /* Original 32 bit NetWare IDs */
} AuthCtrl_s;
/**************************************************************************
* This is attached to the connection structure and keeps track of all
* NSS things associated with connections.
***************************************************************************/
struct NSSConnection_s
{
DQlink_t link; /* list of NSSConnection structures*/
ContextHandleCtrl_s contextHandles; /* context handles*/
SearchMapCtrl_s searchMaps; /* search maps*/
SAgentHandleCtrl_s sAgentHandles; /* generic semantic agent handles*/
AuthCtrl_s authInfo; /* authentication information */
DQhead_t masters; /* Masters for tasks belonging to connection */
struct Master_s *defaultMaster; /* Master used by traditional APIs */
Latch_s shutDownLatch; /* latch used for shutting down connection */
WORD flags; /* connection flags (defined below) */
WORD connUseCount; /* connection ptr is in use. */
LONG connectionNumber; /* From NW conneciton strucutre: connection number */
VolumeID_t macVol; /* volume of temp MAC value */
OneShot_s macAlarm; /* timer for reseting tempMacValue */
NINT tempMACAccess; /* saved MAC value (kind'a cashed) */
};
extern DQhead_t CNCT_PSSConnectionList; /* list of ALL NSS connection structures*/
/*---------------------------------------------------------------------------
* Definition of flags in NSSConnection_s
*---------------------------------------------------------------------------*/
#define CNCTFL_CONNECTION_SHUTTING_DOWN 0x0001 /* Set when the connection is being aborted */
#define CNCTFL_SECURE_ACCESS 0x0002 /* Set if this connection is connection zero equivelent */
#define CNCTFL_LINK_AWARE 0x0004 /* Set if this connection has used "Link Aware" NCPs or NLM APIs */
#define CNCTFL_NEED_NEW_MAC_VALUE 0x0008 /* Set if this connection needs to change the MAC value */
/*---------------------------------------------------------------------------
* Internal Common Layer macros for working with connections
*---------------------------------------------------------------------------*/
/*
* We are now resolving the connection at the time we init the gen message so
* that we can avoid deadlocks in the resolve connection from NDS trying to
* access things on SYS while we have the root of SYS locked.
* The assert is here so we can tell if there are places that are not getting
* resolved.
*
* See msgGen.h (COMN_GENMSG_RESOLVE_CONNECTION) to see when connections
* should be resolved.
*/
#define CNCT_RESOLVE_CONNECTION(genMsg) \
(((genMsg)->pssConn.ptr != NULL) ? (genMsg)->pssConn.ptr : COMN_DoResolveConnection((genMsg)))
/*---------------------------------------------------------------------------
* Internal Common Layer prototypes for working with connections
*---------------------------------------------------------------------------*/
extern STATUS CNCT_PSSConnectionStartup();
extern void CNCT_PSSConnectionShutdown();
extern void CNCT_CleanupPSSConnectionsOnVolume(
Volume_s *vol);
extern void CNCT_CleanupSAgentPSSConnectionsOnVolume(
GeneralMsg_s *genMsg,
Volume_s *vol);
#if zLINUX
extern STATUS COMN_GetAuthenticatedIDs(
GeneralMsg_s *genMsg,
UserID_t **retGUIDArray,
NINT *retGUIDCount);
extern STATUS COMN_UpdatePSSConnection(
NSSConnection_s *pssConn);
extern LONG IsSupervisor(
LONG connectionNumber);
extern LONG ConnectionIsLoggedIn(
LONG connectionNumber);
/* This one is a global structure with pointers to registered functions */
extern LinuxConnectionCallbackFunctions_s LinuxConnFuncs;
#endif
#ifdef __cplusplus
}
#endif
#endif /* _PSSCONNECTION_H_ */