From ac16f380e349fa39ec7e26bccb5456cb300006a5 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sun, 14 Sep 1997 17:50:06 +0000 Subject: Pull in sources from zephyr locker. See /mit/zephyr/repository for detailed change information. --- h/zephyr/Imakefile | 34 ----- h/zephyr/acl.h | 27 ---- h/zephyr/mit-copyright.h | 2 +- h/zephyr/zephyr.h | 362 --------------------------------------------- h/zephyr/zephyr.h.in | 355 ++++++++++++++++++++++++++++++++++++++++++++ h/zephyr/zephyr_conf.h | 97 ------------ h/zephyr/zephyr_internal.h | 96 ------------ h/zephyr/zsyslog.h | 22 --- 8 files changed, 356 insertions(+), 639 deletions(-) delete mode 100644 h/zephyr/Imakefile delete mode 100644 h/zephyr/acl.h delete mode 100644 h/zephyr/zephyr.h create mode 100644 h/zephyr/zephyr.h.in delete mode 100644 h/zephyr/zephyr_conf.h delete mode 100644 h/zephyr/zephyr_internal.h delete mode 100644 h/zephyr/zsyslog.h (limited to 'h/zephyr') diff --git a/h/zephyr/Imakefile b/h/zephyr/Imakefile deleted file mode 100644 index cfe36e4..0000000 --- a/h/zephyr/Imakefile +++ /dev/null @@ -1,34 +0,0 @@ -/**/# Copyright 1988,1991 Massachusetts Institute of Technology. -/**/# -/**/# For copying and distribution information, see the file -/**/# "mit-copyright.h". -/**/# -/**/# $Source$ -/**/# $Author$ -/**/# $Zephyr: /mit/zephyr/src/include/zephyr/RCS/Imakefile,v 1.4 91/03/21 12:16:56 raeburn Exp $ -/**/# - -HDRS= acl.h mit-copyright.h zephyr.h zephyr_conf.h zephyr_internal.h zsyslog.h -CODE= ${HDRS} Imakefile - -all depend:: zephyr_paths.h - -clean:: - $(RM) zephyr_paths.h - -#ifdef KERBEROS -HaveKerberos=yes -#endif -#ifdef HESIOD -HaveHesiod=yes -#endif - -#define export_as(var,name) name=$(var) ; export name -#define export_var(var) export_as(var,var) - -zephyr_paths.h: Makefile - export_as(ZLIBDIR,LIBDIR) ; \ - export_as(ATHBINDIR,CLIENTDIR) ; \ - export_var(HaveKerberos) ; \ - export_var(HaveHesiod) ; \ - $(PTOP)/tools/makepaths > zephyr_paths.h diff --git a/h/zephyr/acl.h b/h/zephyr/acl.h deleted file mode 100644 index a196ed1..0000000 --- a/h/zephyr/acl.h +++ /dev/null @@ -1,27 +0,0 @@ -/* This file is part of the Project Athena Zephyr Notification System. - * It contains definitions for the ACL library - * - * Created by: John T. Kohl - * - * $Source$ - * $Author$ - * $Header$ - * - * Copyright (c) 1987 by the Massachusetts Institute of Technology. - * For copying and distribution information, see the file - * "mit-copyright.h". - */ - -#include - -#ifndef __ACL__ -#define __ACL__ -#if defined(__STDC_) - extern int acl_add ( char *, char *); - extern int acl_check ( char *, char *); - extern int acl_delete ( char *, char *); - extern int acl_initialize ( char *, int); -#else /* not STDC */ -extern int acl_check(), acl_add(), acl_delete(), acl_initialize(); -#endif -#endif /* __ACL__ */ diff --git a/h/zephyr/mit-copyright.h b/h/zephyr/mit-copyright.h index 73059b3..9b39b21 100644 --- a/h/zephyr/mit-copyright.h +++ b/h/zephyr/mit-copyright.h @@ -1,6 +1,6 @@ /* -Copyright 1987,1988 by the Massachusetts Institute of Technology +Copyright 1987,1988,1995 by the Massachusetts Institute of Technology All rights reserved. diff --git a/h/zephyr/zephyr.h b/h/zephyr/zephyr.h deleted file mode 100644 index 50c6b43..0000000 --- a/h/zephyr/zephyr.h +++ /dev/null @@ -1,362 +0,0 @@ -/* This file is part of the Project Athena Zephyr Notification System. - * It contains global definitions - * - * Created by: Robert French - * - * $Source$ - * $Author$ - * $Id$ - * - * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of - * Technology. For copying and distribution information, see the - * file "mit-copyright.h". - */ - -#ifndef __ZEPHYR_H__ -#define __ZEPHYR_H__ - -#include -#include - -#include -#include -#include -#include -#include - -#ifndef va_start /* guaranteed to be a macro */ -#if defined(__STDC__) && !defined(ibm032) &&!defined(SABER) -#include -#else -#include -#define Z_varargs -#endif -#endif - -#ifdef Z_HaveKerberos -#include -#endif - -#ifndef IPPROTO_MAX /* Make sure not already included */ -#include -#endif - -#if defined(__STDC__) -#define Zproto(X) X -#define Zconst const -#else -#define Zproto(X) () -#define Zconst /* const */ -#endif - -#define ZVERSIONHDR "ZEPH" -#define ZVERSIONMAJOR 0 -#define ZVERSIONMINOR 2 - - /* Types */ - - /* Maximum size packet we can send */ -#define Z_MAXPKTLEN 1024 - - /* Packet */ - typedef char ZPacket_t[Z_MAXPKTLEN]; - - /* Maximum size for a notice header */ -#define Z_MAXHEADERLEN 800 - - /* Maximum number of unknown fields in ZNotice_t */ -#define Z_MAXOTHERFIELDS 10 - - /* Authentication levels returned by ZCheckAuthentication */ -#define ZAUTH_FAILED (-1) -#define ZAUTH_YES 1 -#define ZAUTH_NO 0 -#define ZAUTH_CKSUM_FAILED (-2) /* Used only by server. */ -#define ZAUTH_UNSET (-3) /* Internal to client library. */ - - /* Packet type */ - typedef enum { UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, - CLIENTACK, STAT } ZNotice_Kind_t; - extern Zconst char *ZNoticeKinds[9]; - - /* Unique ID format */ - typedef struct _ZUnique_Id_t { - struct in_addr zuid_addr; - struct timeval tv; - } ZUnique_Id_t; - - /* Checksum */ - typedef u_long ZChecksum_t; - -#define ZNUMFIELDS 17 - - /* Notice definition */ - typedef struct _ZNotice_t { - char *z_packet; - char *z_version; - ZNotice_Kind_t z_kind; - ZUnique_Id_t z_uid; -#define z_sender_addr z_uid.zuid_addr - struct timeval z_time; - u_short z_port; - int z_auth; - int z_checked_auth; - int z_authent_len; - char *z_ascii_authent; - char *z_class; - char *z_class_inst; - char *z_opcode; - char *z_sender; - char *z_recipient; - char *z_default_format; - char *z_multinotice; - ZUnique_Id_t z_multiuid; - ZChecksum_t z_checksum; - int z_num_other_fields; - char *z_other_fields[Z_MAXOTHERFIELDS]; - caddr_t z_message; - int z_message_len; - } ZNotice_t; - - /* Subscription structure */ - typedef struct _ZSubscriptions_t { - char *zsub_recipient; - /* The following field used to be named "class", but that - conflicts with C++ */ - char *zsub_class; - char *zsub_classinst; - } ZSubscription_t; - - /* Function return code */ - typedef int Code_t; - - /* Locations structure */ - typedef struct _ZLocations_t { - char *host; - char *time; - char *tty; - } ZLocations_t; - - typedef struct _ZAsyncLocateData_t { - char *user; - ZUnique_Id_t uid; - char *version; - } ZAsyncLocateData_t; - - /* Predicate for async locate */ - extern int ZCompareALDPred Zproto((ZNotice_t *, char *)); - - /* Socket file descriptor */ - extern int __Zephyr_fd; - - /* Port number */ - extern int __Zephyr_port; - - /* Destination (hostmanager, usually) addr */ - extern struct sockaddr_in __HM_addr; - - /* for ZQLength */ - extern int __Q_CompleteLength; - - /* UNIX error codes */ - extern int errno; - - /* for ZSetDebug */ -#ifdef Z_DEBUG - extern void (*__Z_debug_print) Zproto((const char *fmt, va_list args, - void *closure)); - extern void *__Z_debug_print_closure; -#endif - -#ifdef Z_HaveKerberos - /* Kerberos error table base */ - extern int krb_err_base; - - /* for ZGetRealm */ - extern char __Zephyr_realm[]; - - /* Session key for last parsed packet - server only */ - extern C_Block __Zephyr_session; -#else - /* for ZGetRealm -- you can change this, if you care... */ -#define __Zephyr_realm ("local-realm") -#endif - - /* ZCompareUIDPred definition */ - extern int ZCompareUIDPred Zproto((ZNotice_t *, ZUnique_Id_t *)), - ZCompareMultiUIDPred Zproto((ZNotice_t *, ZUnique_Id_t *)); - - /* Defines for ZFormatNotice, et al. */ - typedef Code_t (*Z_AuthProc) Zproto((ZNotice_t*, char *, int, int *)); - extern Code_t ZMakeAuthentication Zproto((ZNotice_t*, char *,int, int*)); - - /* Random declarations */ - extern char *ZGetSender Zproto((void)), *ZGetVariable Zproto((char *)); - extern int ZGetWGPort Zproto((void)); - extern Code_t ZSetDestAddr Zproto ((struct sockaddr_in *)); - extern Code_t ZFormatNoticeList Zproto((ZNotice_t*, char**, int, - char **, int*, Z_AuthProc)); - extern Code_t ZParseNotice Zproto((char*, int, ZNotice_t *)); - extern Code_t ZReadAscii Zproto((char*, int, unsigned char*, int)); - extern Code_t ZSendPacket Zproto((char*, int, int)); - extern Code_t ZSendList Zproto((ZNotice_t*, char *[], int, Z_AuthProc)); - extern Code_t ZFormatNotice Zproto((ZNotice_t*, char**, int*, Z_AuthProc)); - extern Code_t ZFormatSmallNotice Zproto ((ZNotice_t*, ZPacket_t, int*, - Z_AuthProc)); - extern Code_t ZLocateUser Zproto((char *, int *, Z_AuthProc)); - extern Code_t ZRequestLocations Zproto((char *, ZAsyncLocateData_t *, ZNotice_Kind_t, Z_AuthProc)); - extern Code_t ZInitialize Zproto ((void)); - extern Code_t ZSetServerState Zproto((int)); - extern Code_t ZSetFD Zproto ((int)); - extern Code_t ZFormatSmallRawNotice Zproto ((ZNotice_t*, ZPacket_t, int*)); - extern int ZCompareUID Zproto ((ZUnique_Id_t*, ZUnique_Id_t*)); - extern Code_t ZSrvSendRawList Zproto ((ZNotice_t*, char*[], int, - Code_t (*)(ZNotice_t *, char *, - int, int))); - extern Code_t ZMakeAscii Zproto ((char*, int, unsigned char*, int)); - extern Code_t ZReceivePacket Zproto ((ZPacket_t, int*, - struct sockaddr_in*)); - extern Code_t ZCheckAuthentication Zproto ((ZNotice_t*, - struct sockaddr_in*)); -#ifdef Z_HaveKerberos - extern Code_t ZFormatAuthenticNotice Zproto ((ZNotice_t*, char*, int, - int*, C_Block)); -#endif - extern Code_t ZFormatRawNotice Zproto ((ZNotice_t *, char**, int *)); -#ifdef Z_DEBUG -#ifndef Z_varargs - extern void Z_debug Zproto ((const char *, ...)); -#else - extern void Z_debug (); -#endif -#endif - - /* Compatibility */ -#define ZNewLocateUser ZLocateUser - -#ifdef Z_HaveKerberos - /* ZGetSession() macro */ -#define ZGetSession() (__Zephyr_session) -#endif - - /* ZGetFD() macro */ - extern int ZGetFD (); -#define ZGetFD() __Zephyr_fd - - /* ZQLength macro */ - extern int ZQLength (); -#define ZQLength() __Q_CompleteLength - - /* ZGetDestAddr() macro */ - extern struct sockaddr_in ZGetDestAddr (); -#define ZGetDestAddr() __HM_addr - - /* ZGetRealm() macro */ - extern Zconst char * ZGetRealm (); -#define ZGetRealm() __Zephyr_realm - - /* ZSetDebug() macro */ -#ifdef Z_DEBUG - extern void ZSetDebug Zproto ((void (*)(const char *, va_list, void *), - void *)); -#define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \ - __Z_debug_print_closure=(closure), \ - (void) 0) -#else -#define ZSetDebug(proc,closure) -#endif - - /* Maximum queue length */ -#define Z_MAXQLEN 30 - - /* Successful function return */ -#define ZERR_NONE 0 - - /* Hostmanager wait time (in secs) */ -#define HM_TIMEOUT 10 - - /* Server wait time (in secs) */ -#define SRV_TIMEOUT 30 - -#define ZAUTH (ZMakeAuthentication) -#define ZNOAUTH ((Z_AuthProc)0) - - /* Packet strings */ - -#define ZSRVACK_SENT "SENT" /* SERVACK codes */ -#define ZSRVACK_NOTSENT "LOST" -#define ZSRVACK_FAIL "FAIL" - - /* Server internal class */ -#define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */ - - /* Control codes sent to a server */ -#define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */ - -#define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */ -#define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */ -#define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */ -#define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */ -#define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */ -#define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */ -#define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default - * subscriptions */ - -#define ZEPHYR_CTL_HM "HM" /* Inst: From HM */ -#define HM_BOOT "BOOT" /* Opcode: Boot msg */ -#define HM_FLUSH "FLUSH" /* Opcode: Flush me */ -#define HM_DETACH "DETACH" /* Opcode: Detach me */ -#define HM_ATTACH "ATTACH" /* Opcode: Attach me */ - - /* Control codes send to a HostManager */ -#define HM_CTL_CLASS "HM_CTL" /* Class */ - -#define HM_CTL_SERVER "SERVER" /* Inst: From server */ -#define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */ -#define SERVER_PING "PING" /* Opcode: PING */ - -#define HM_CTL_CLIENT "CLIENT" /* Inst: From client */ -#define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */ -#define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */ - - /* HM Statistics */ -#define HM_STAT_CLASS "HM_STAT" /* Class */ - -#define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */ -#define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */ - - /* Login class messages */ -#define LOGIN_CLASS "LOGIN" /* Class */ - - /* Class Instance is principal of user who is logging in or logging out */ - -#define EXPOSE_NONE "NONE" /* Opcode: Not visible */ -#define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */ -#define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */ -#define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */ -#define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */ -#define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */ -#define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login - (from server) */ -#define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */ -#define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */ - - /* Locate class messages */ -#define LOCATE_CLASS "USER_LOCATE" /* Class */ - -#define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */ -#define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */ - - /* Class Instance is principal of user to locate */ - -#define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */ - - /* WG_CTL class messages */ -#define WG_CTL_CLASS "WG_CTL" /* Class */ - -#define WG_CTL_USER "USER" /* Inst: User request */ -#define USER_REREAD "REREAD" /* Opcode: Reread desc file */ -#define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */ -#define USER_STARTUP "STARTUP" /* Opcode: Come out of it */ - -#endif diff --git a/h/zephyr/zephyr.h.in b/h/zephyr/zephyr.h.in new file mode 100644 index 0000000..c1bd5f8 --- /dev/null +++ b/h/zephyr/zephyr.h.in @@ -0,0 +1,355 @@ +/* This file is part of the Project Athena Zephyr Notification System. + * It contains global definitions + * + * Created by: Robert French + * + * $Source$ + * $Author$ + * $Id$ + * + * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of + * Technology. For copying and distribution information, see the + * file "mit-copyright.h". + */ + +#ifndef __ZEPHYR_H__ +#define __ZEPHYR_H__ + +/* Define if Zephyr uses Kerberos support. */ +#undef ZEPHYR_USES_KERBEROS + +#include +#include + +#include +#ifdef ZEPHYR_USES_KERBEROS +#include +#endif + +#ifndef IPPROTO_MAX /* Make sure not already included */ +#include +#endif + +/* Use __STDC__ to guess whether we can use stdarg, prototypes, and const. + * This is a public header file, so autoconf can't help us here. */ +#ifdef __STDC__ +# include +# define ZP(x) x +# define ZCONST const +#else +# define ZP(x) () +# define ZCONST +#endif + +/* Service names */ +#define HM_SVCNAME "zephyr-hm" +#define HM_SRV_SVCNAME "zephyr-hm-srv" +#define SERVER_SVCNAME "zephyr-clt" +#define SERVER_SERVICE "zephyr" +#define SERVER_INSTANCE "zephyr" + +#define ZVERSIONHDR "ZEPH" +#define ZVERSIONMAJOR 0 +#define ZVERSIONMINOR 2 + +#define Z_MAXPKTLEN 1024 +#define Z_MAXHEADERLEN 800 +#define Z_MAXOTHERFIELDS 10 /* Max unknown fields in ZNotice_t */ +#define Z_NUMFIELDS 17 + +/* Authentication levels returned by ZCheckAuthentication */ +#define ZAUTH_FAILED (-1) +#define ZAUTH_YES 1 +#define ZAUTH_NO 0 + +typedef char ZPacket_t[Z_MAXPKTLEN]; + +/* Packet type */ +typedef enum { + UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT +} ZNotice_Kind_t; +extern ZCONST char *ZNoticeKinds[9]; + +/* Unique ID format */ +typedef struct _ZUnique_Id_t { + struct in_addr zuid_addr; + struct timeval tv; +} ZUnique_Id_t; + +/* Checksum */ +typedef unsigned long ZChecksum_t; + +/* Notice definition */ +typedef struct _ZNotice_t { + char *z_packet; + char *z_version; + ZNotice_Kind_t z_kind; + ZUnique_Id_t z_uid; +#define z_sender_addr z_uid.zuid_addr + struct timeval z_time; + unsigned short z_port; + int z_auth; + int z_checked_auth; + int z_authent_len; + char *z_ascii_authent; + char *z_class; + char *z_class_inst; + char *z_opcode; + char *z_sender; + char *z_recipient; + char *z_default_format; + char *z_multinotice; + ZUnique_Id_t z_multiuid; + ZChecksum_t z_checksum; + int z_num_other_fields; + char *z_other_fields[Z_MAXOTHERFIELDS]; + caddr_t z_message; + int z_message_len; +} ZNotice_t; + +/* Subscription structure */ +typedef struct _ZSubscriptions_t { + char *zsub_recipient; + char *zsub_class; + char *zsub_classinst; +} ZSubscription_t; + +/* Function return code */ +typedef int Code_t; + +/* Locations structure */ +typedef struct _ZLocations_t { + char *host; + char *time; + char *tty; +} ZLocations_t; + +typedef struct _ZAsyncLocateData_t { + char *user; + ZUnique_Id_t uid; + char *version; +} ZAsyncLocateData_t; + +/* for ZSetDebug */ +#ifdef Z_DEBUG +void (*__Z_debug_print) ZP((ZCONST char *fmt, va_list args, void *closure)); +void *__Z_debug_print_closure; +#endif + +int ZCompareUIDPred ZP((ZNotice_t *, void *)); +int ZCompareMultiUIDPred ZP((ZNotice_t *, void *)); + +/* Defines for ZFormatNotice, et al. */ +typedef Code_t (*Z_AuthProc) ZP((ZNotice_t*, char *, int, int *)); +Code_t ZMakeAuthentication ZP((ZNotice_t*, char *,int, int*)); + +char *ZGetSender ZP((void)); +char *ZGetVariable ZP((char *)); +Code_t ZSetVariable ZP((char *var, char *value)); +Code_t ZUnsetVariable ZP((char *var)); +int ZGetWGPort ZP((void)); +Code_t ZSetDestAddr ZP((struct sockaddr_in *)); +Code_t ZFormatNoticeList ZP((ZNotice_t*, char**, int, + char **, int*, Z_AuthProc)); +Code_t ZParseNotice ZP((char*, int, ZNotice_t *)); +Code_t ZReadAscii ZP((char*, int, unsigned char*, int)); +Code_t ZReadAscii32 ZP((char *, int, unsigned long *)); +Code_t ZReadAscii16 ZP((char *, int, unsigned short *)); +Code_t ZSendPacket ZP((char*, int, int)); +Code_t ZSendList ZP((ZNotice_t*, char *[], int, Z_AuthProc)); +Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Code_t (*)())); +Code_t ZSendNotice ZP((ZNotice_t *, Z_AuthProc)); +Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Code_t (*)())); +Code_t ZFormatNotice ZP((ZNotice_t*, char**, int*, Z_AuthProc)); +Code_t ZFormatSmallNotice ZP((ZNotice_t*, ZPacket_t, int*, Z_AuthProc)); +Code_t ZFormatRawNoticeList ZP((ZNotice_t *notice, char *list[], int nitems, + char **buffer, int *ret_len)); +Code_t ZLocateUser ZP((char *, int *, Z_AuthProc)); +Code_t ZRequestLocations ZP((char *, ZAsyncLocateData_t *, + ZNotice_Kind_t, Z_AuthProc)); +Code_t ZhmStat ZP((struct in_addr *, ZNotice_t *)); +Code_t ZInitialize ZP((void)); +Code_t ZSetServerState ZP((int)); +Code_t ZSetFD ZP((int)); +Code_t ZFormatSmallRawNotice ZP((ZNotice_t*, ZPacket_t, int*)); +int ZCompareUID ZP((ZUnique_Id_t*, ZUnique_Id_t*)); +Code_t ZSrvSendRawList ZP((ZNotice_t*, char*[], int, + Code_t (*)(ZNotice_t *, char *, int, int))); +Code_t ZMakeAscii ZP((char*, int, unsigned char*, int)); +Code_t ZMakeAscii32 ZP((char *, int, unsigned long)); +Code_t ZMakeAscii16 ZP((char *, int, unsigned int)); +Code_t ZReceivePacket ZP((ZPacket_t, int*, struct sockaddr_in*)); +Code_t ZCheckAuthentication ZP((ZNotice_t*, struct sockaddr_in*)); +Code_t ZInitLocationInfo ZP((char *hostname, char *tty)); +Code_t ZSetLocation ZP((char *exposure)); +Code_t ZUnsetLocation ZP((void)); +Code_t ZFlushMyLocations ZP((void)); +char *ZParseExposureLevel ZP((char *text)); +#ifdef ZEPHYR_USES_KERBEROS +Code_t ZFormatAuthenticNotice ZP((ZNotice_t*, char*, int, int*, C_Block)); +#endif +Code_t ZFormatRawNotice ZP((ZNotice_t *, char**, int *)); +Code_t ZRetrieveSubscriptions ZP((unsigned short, int*)); +Code_t ZOpenPort ZP((unsigned short *port)); +Code_t ZClosePort ZP((void)); +Code_t ZFlushLocations ZP((void)); +Code_t ZFlushSubscriptions ZP((void)); +Code_t ZFreeNotice ZP((ZNotice_t *notice)); +Code_t ZParseLocations ZP((register ZNotice_t *notice, + register ZAsyncLocateData_t *zald, int *nlocs, + char **user)); +int ZCompareALDPred ZP((ZNotice_t *notice, void *zald)); +void ZFreeALD ZP((register ZAsyncLocateData_t *zald)); +Code_t ZCheckIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from, + register int (*predicate) ZP((ZNotice_t *,void *)), + void *args)); +Code_t ZPeekPacket ZP((char **buffer, int *ret_len, + struct sockaddr_in *from)); +Code_t ZPeekNotice ZP((ZNotice_t *notice, struct sockaddr_in *from)); +Code_t ZIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from, + int (*predicate) ZP((ZNotice_t *, void *)), void *args)); +Code_t ZSubscribeTo ZP((ZSubscription_t *sublist, int nitems, + unsigned int port)); +Code_t ZSubscribeToSansDefaults ZP((ZSubscription_t *sublist, int nitems, + unsigned int port)); +Code_t ZUnsubscribeTo ZP((ZSubscription_t *sublist, int nitems, + unsigned int port)); +Code_t ZCancelSubscriptions ZP((unsigned int port)); +int ZPending ZP((void)); +Code_t ZReceiveNotice ZP((ZNotice_t *notice, struct sockaddr_in *from)); +#ifdef Z_DEBUG +void Z_debug ZP((ZCONST char *, ...)); +#endif + +#undef ZP + +/* Compatibility */ +#define ZNewLocateUser ZLocateUser + +/* Macros to retrieve Zephyr library values. */ +extern int __Zephyr_fd; +extern int __Q_CompleteLength; +extern struct sockaddr_in __HM_addr; +extern char __Zephyr_realm[]; +#define ZGetFD() __Zephyr_fd +#define ZQLength() __Q_CompleteLength +#define ZGetDestAddr() __HM_addr +#define ZGetRealm() __Zephyr_realm + +#ifdef ZEPHYR_USES_KERBEROS +/* Session key for last parsed packet - server only */ +extern C_Block __Zephyr_session; +#define ZGetSession() (__Zephyr_session) +#else +#define __Zephyr_realm ("local-realm") +#endif + + +#ifdef Z_DEBUG +void ZSetDebug ZP((void (*)(ZCONST char *, va_list, void *), void *)); +#define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \ + __Z_debug_print_closure=(closure), \ + (void) 0) +#else +#define ZSetDebug(proc,closure) +#endif + +/* Maximum queue length */ +#define Z_MAXQLEN 30 + +/* Successful function return */ +#define ZERR_NONE 0 + +/* Hostmanager wait time (in secs) */ +#define HM_TIMEOUT 10 + +/* Server wait time (in secs) */ +#define SRV_TIMEOUT 30 + +#define ZAUTH (ZMakeAuthentication) +#define ZNOAUTH ((Z_AuthProc)0) + +/* Packet strings */ +#define ZSRVACK_SENT "SENT" /* SERVACK codes */ +#define ZSRVACK_NOTSENT "LOST" +#define ZSRVACK_FAIL "FAIL" + +/* Server internal class */ +#define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */ + +/* Control codes sent to a server */ +#define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */ + +#define ZEPHYR_CTL_REALM "REALM" /* Inst: From realm */ +#define REALM_ADD_SUBSCRIBE "ADD_SUBSCRIBE" /* Opcode: Add subs */ +#define REALM_REQ_SUBSCRIBE "REQ_SUBSCRIBE" /* Opcode: Request subs */ +#define REALM_SUBSCRIBE "RLM_SUBSCRIBE" /* Opcode: Subscribe realm */ +#define REALM_UNSUBSCRIBE "RLM_UNSUBSCRIBE" /* Opcode: Unsub realm */ + +#define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */ +#define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */ +#define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */ +#define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */ +#define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */ +#define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */ +#define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default + * subscriptions */ + +#define ZEPHYR_CTL_HM "HM" /* Inst: From HM */ +#define HM_BOOT "BOOT" /* Opcode: Boot msg */ +#define HM_FLUSH "FLUSH" /* Opcode: Flush me */ +#define HM_DETACH "DETACH" /* Opcode: Detach me */ +#define HM_ATTACH "ATTACH" /* Opcode: Attach me */ + +/* Control codes send to a HostManager */ +#define HM_CTL_CLASS "HM_CTL" /* Class */ + +#define HM_CTL_SERVER "SERVER" /* Inst: From server */ +#define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */ +#define SERVER_PING "PING" /* Opcode: PING */ + +#define HM_CTL_CLIENT "CLIENT" /* Inst: From client */ +#define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */ +#define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */ + +/* HM Statistics */ +#define HM_STAT_CLASS "HM_STAT" /* Class */ + +#define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */ +#define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */ + +/* Login class messages */ +#define LOGIN_CLASS "LOGIN" /* Class */ + +/* Class Instance is principal of user who is logging in or logging out */ + +#define EXPOSE_NONE "NONE" /* Opcode: Not visible */ +#define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */ +#define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */ +#define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */ +#define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */ +#define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */ +#define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login + (from server) */ +#define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */ +#define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */ + +/* Locate class messages */ +#define LOCATE_CLASS "USER_LOCATE" /* Class */ + +#define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */ +#define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */ + +/* Class Instance is principal of user to locate */ +#define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */ + +/* WG_CTL class messages */ +#define WG_CTL_CLASS "WG_CTL" /* Class */ + +#define WG_CTL_USER "USER" /* Inst: User request */ +#define USER_REREAD "REREAD" /* Opcode: Reread desc file */ +#define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */ +#define USER_STARTUP "STARTUP" /* Opcode: Come out of it */ +#define USER_EXIT "EXIT" /* Opcode: Exit the client */ + +#endif /* __ZEPHYR_H__ */ diff --git a/h/zephyr/zephyr_conf.h b/h/zephyr/zephyr_conf.h deleted file mode 100644 index a0d8d83..0000000 --- a/h/zephyr/zephyr_conf.h +++ /dev/null @@ -1,97 +0,0 @@ -/* This file is part of the Project Athena Zephyr Notification System. - * It contains configuration definitions. - * - * Created by: John T. Kohl - * - * $Source$ - * $Author$ - * $Zephyr: /mit/zephyr/src/include/zephyr/RCS/zephyr_conf.h,v 1.8 90/12/21 17:40:40 raeburn Exp $ - * - * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology. - * For copying and distribution information, see the file - * "mit-copyright.h". - */ - -#ifndef __ZEPHYR_CONF_H__ -#define __ZEPHYR_CONF_H__ - -#ifdef POSIX -#define POSIX_FLOCK -#define POSIX_SIGNALS -#define HAVE_UNISTD_H -#define HAVE_STDLIB_H -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#include -#include - -#ifdef Z_HaveKerberos -#define SERVER_SERVICE "zephyr" -#define SERVER_INSTANCE "zephyr" -#define SERVER_SRVTAB "/etc/athena/zephyr/srvtab" -#endif - -/* General filenames */ -#define DEFAULT_VARS_FILE "/etc/athena/zephyr.vars" - -/* Service names */ -#define HM_SVCNAME "zephyr-hm" -#define SERVER_SVCNAME "zephyr-clt" - -#if defined(vax) || defined(ibm032) -#define memset(a,b,c) bzero(a,c) -#define memmove(a,b,c) bcopy(b,a,c) -#define memcmp(a,b,c) bcmp(a,b,c) -#define strchr index -#define strrchr rindex -#endif - -#ifdef SUNOS -extern char *sys_errlist[]; - -#ifndef memmove -#define memmove(a,b,c) bcopy(b,a,c) -#endif - -#ifndef strerror -#define strerror(e) (sys_errlist[e]) -#endif -#endif - -#ifdef ultrix -/* If you are using Ultrix versions prior to 3.0, uncomment the following - * three lines so that users don't need to specify -DULTRIX22 on their - * compile lines. */ - -/* #ifndef ULTRIX22 */ -/* #define ULTRIX22 */ -/* #endif */ - -#ifdef ULTRIX22 -#define MAXHOSTNAMELEN 64 -typedef int uid_t; -typedef int gid_t; -#endif -#endif - -#if defined(macII) || defined(ULTRIX22) -#define FD_ZERO(p) ((p)->fds_bits[0] = 0) -#define FD_SET(n, p) ((p)->fds_bits[0] |= (1 << (n))) -#define FD_ISSET(n, p) ((p)->fds_bits[0] & (1 << (n))) -#define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1 << (n))) -#endif - -#ifndef Z_HaveKerberos -#define REALM_SZ MAXHOSTNAMELEN -#define INST_SZ 0 /* no instances w/o Kerberos */ -#define ANAME_SZ 9 /* size of a username + null */ -#endif - -#endif /* __ZEPHYR_CONF_H__ */ diff --git a/h/zephyr/zephyr_internal.h b/h/zephyr/zephyr_internal.h deleted file mode 100644 index 34d3eee..0000000 --- a/h/zephyr/zephyr_internal.h +++ /dev/null @@ -1,96 +0,0 @@ -/* This file is part of the Project Athena Zephyr Notification System. - * It contains internal definitions for the client library. - * - * Created by: Robert French - * - * $Source$ - * $Author$ - * - * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. - * For copying and distribution information, see the file - * "mit-copyright.h". - */ -/* $Header$ */ - -#ifndef __ZINTERNAL_H__ -#define __ZINTERNAL_H__ - -#include -#include -#include /* for time_t, uid_t, etc */ - -#ifdef lint -#include /* to make lint shut up about struct/union iovec */ -#endif - -struct _Z_Hole { - struct _Z_Hole *next; - int first; - int last; -}; - -struct _Z_InputQ { - struct _Z_InputQ *next; - struct _Z_InputQ *prev; - ZNotice_Kind_t kind; - unsigned long timep; - int packet_len; - char *packet; - int complete; - struct sockaddr_in from; - struct _Z_Hole *holelist; - ZUnique_Id_t uid; - int auth; - int header_len; - char *header; - int msg_len; - char *msg; -}; - -extern struct _Z_InputQ *__Q_Head, *__Q_Tail; - - /* Maximum number of packet fragments */ -#define Z_MAXFRAGS 500 /* Probably around 350K */ - - /* Maximum allowable size of an incoming notice */ -#define Z_MAXNOTICESIZE 400000 - - /* Maximum allowable size of all notices in the input queue */ - /* This is more of a ballpark figure than a hard limit */ -#define Z_MAXQUEUESIZE 1500000 - - /* Amount of room to leave for multinotice field */ -#define Z_FRAGFUDGE 13 /* 999999/999999 */ - - /* Amount of time a notice can stay in the queue without being - * touched by an incoming fragment */ -#define Z_NOTICETIMELIMIT 30 /* seconds */ - - /* Initial size of old uid buffer. */ -#define Z_INITFILTERSIZE 30 /* uid's */ - -extern int __Zephyr_open; /* 0 if the library opened the FD, 1 otherwise */ -extern int __HM_set; /* 0 if the library set the dest addr, 1 otherwise */ -extern int __Zephyr_server; /* 0 if normal client, 1 if server */ - -extern ZLocations_t *__locate_list; -extern int __locate_num; -extern int __locate_next; - -extern ZSubscription_t *__subscriptions_list; -extern int __subscriptions_num; -extern int __subscriptions_next; - -#ifdef Z_HaveKerberos -extern int krb_err_base; -#endif - -extern time_t time Zproto((time_t *)); -extern long random(); - -extern struct _Z_InputQ *Z_GetFirstComplete(); -extern struct _Z_InputQ *Z_GetNextComplete(); -extern Code_t Z_XmitFragment Zproto((ZNotice_t*, char *,int,int)); -extern void Z_RemQueue Zproto ((struct _Z_InputQ *)); - -#endif /* !__ZINTERNAL_H__ */ diff --git a/h/zephyr/zsyslog.h b/h/zephyr/zsyslog.h deleted file mode 100644 index 1b09c4a..0000000 --- a/h/zephyr/zsyslog.h +++ /dev/null @@ -1,22 +0,0 @@ -/* This file is part of the Project Athena Zephyr Notification System. - * It contains definitions to deal with old 4.2-style syslog functions. - * - * Created by: John T. Kohl - * - * $Source$ - * $Author$ - * - * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. - * For copying and distribution information, see the file - * "mit-copyright.h". - */ -/* $Header$ */ - -#include -#ifndef LOG_AUTH -/* Probably a 4.2-type syslog */ -#define OPENLOG(str, opts, facility) openlog(str, opts) -#else -/* A decent syslog */ -#define OPENLOG(str, opts, facility) openlog(str, opts, facility) -#endif -- cgit v1.2.3