jpayne@69: /****************************************************************************** jpayne@69: jpayne@69: jpayne@69: Copyright 1993, 1998 The Open Group jpayne@69: jpayne@69: Permission to use, copy, modify, distribute, and sell this software and its jpayne@69: documentation for any purpose is hereby granted without fee, provided that jpayne@69: the above copyright notice appear in all copies and that both that jpayne@69: copyright notice and this permission notice appear in supporting jpayne@69: documentation. jpayne@69: jpayne@69: The above copyright notice and this permission notice shall be included in jpayne@69: all copies or substantial portions of the Software. jpayne@69: jpayne@69: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR jpayne@69: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, jpayne@69: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE jpayne@69: OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN jpayne@69: AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN jpayne@69: CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. jpayne@69: jpayne@69: Except as contained in this notice, the name of The Open Group shall not be jpayne@69: used in advertising or otherwise to promote the sale, use or other dealings jpayne@69: in this Software without prior written authorization from The Open Group. jpayne@69: jpayne@69: Author: Ralph Mor, X Consortium jpayne@69: ******************************************************************************/ jpayne@69: jpayne@69: #ifndef _ICEUTIL_H_ jpayne@69: #define _ICEUTIL_H_ jpayne@69: jpayne@69: #include jpayne@69: jpayne@69: #include jpayne@69: jpayne@69: _XFUNCPROTOBEGIN jpayne@69: jpayne@69: /* jpayne@69: * Data structure for entry in ICE authority file jpayne@69: */ jpayne@69: jpayne@69: typedef struct { jpayne@69: char *protocol_name; jpayne@69: unsigned short protocol_data_length; jpayne@69: char *protocol_data; jpayne@69: char *network_id; jpayne@69: char *auth_name; jpayne@69: unsigned short auth_data_length; jpayne@69: char *auth_data; jpayne@69: } IceAuthFileEntry; jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Authentication data maintained in memory. jpayne@69: */ jpayne@69: jpayne@69: typedef struct { jpayne@69: char *protocol_name; jpayne@69: char *network_id; jpayne@69: char *auth_name; jpayne@69: unsigned short auth_data_length; jpayne@69: char *auth_data; jpayne@69: } IceAuthDataEntry; jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Return values from IceLockAuthFile jpayne@69: */ jpayne@69: jpayne@69: #define IceAuthLockSuccess 0 /* lock succeeded */ jpayne@69: #define IceAuthLockError 1 /* lock unexpectedly failed, check errno */ jpayne@69: #define IceAuthLockTimeout 2 /* lock failed, timeouts expired */ jpayne@69: jpayne@69: jpayne@69: /* jpayne@69: * Function Prototypes jpayne@69: */ jpayne@69: jpayne@69: extern char *IceAuthFileName ( jpayne@69: void jpayne@69: ); jpayne@69: jpayne@69: extern int IceLockAuthFile ( jpayne@69: const char * /* file_name */, jpayne@69: int /* retries */, jpayne@69: int /* timeout */, jpayne@69: long /* dead */ jpayne@69: ); jpayne@69: jpayne@69: extern void IceUnlockAuthFile ( jpayne@69: const char * /* file_name */ jpayne@69: ); jpayne@69: jpayne@69: extern IceAuthFileEntry *IceReadAuthFileEntry ( jpayne@69: FILE * /* auth_file */ jpayne@69: ); jpayne@69: jpayne@69: extern void IceFreeAuthFileEntry ( jpayne@69: IceAuthFileEntry * /* auth */ jpayne@69: ); jpayne@69: jpayne@69: extern Status IceWriteAuthFileEntry ( jpayne@69: FILE * /* auth_file */, jpayne@69: IceAuthFileEntry * /* auth */ jpayne@69: ); jpayne@69: jpayne@69: extern IceAuthFileEntry *IceGetAuthFileEntry ( jpayne@69: const char * /* protocol_name */, jpayne@69: const char * /* network_id */, jpayne@69: const char * /* auth_name */ jpayne@69: ); jpayne@69: jpayne@69: extern char *IceGenerateMagicCookie ( jpayne@69: int /* len */ jpayne@69: ); jpayne@69: jpayne@69: extern void IceSetPaAuthData ( jpayne@69: int /* numEntries */, jpayne@69: IceAuthDataEntry * /* entries */ jpayne@69: ); jpayne@69: jpayne@69: _XFUNCPROTOEND jpayne@69: jpayne@69: #endif /* _ICEUTIL_H_ */