summaryrefslogtreecommitdiff
path: root/h
diff options
context:
space:
mode:
authorGravatar Robert S. French <rfrench@mit.edu>1988-06-15 13:54:07 +0000
committerGravatar Robert S. French <rfrench@mit.edu>1988-06-15 13:54:07 +0000
commit9ba6c6b6762c7546d12a5cf9657bab92bd117838 (patch)
tree3ef4c8ecf24484258fdfe494fbc6c7ff6f44b66d /h
parent32fd0e1605c20406fcb5dad6f9619d6b5d747c8e (diff)
For John
Diffstat (limited to 'h')
-rw-r--r--h/zephyr/zephyr.h87
-rw-r--r--h/zephyr/zephyr_internal.h51
2 files changed, 95 insertions, 43 deletions
diff --git a/h/zephyr/zephyr.h b/h/zephyr/zephyr.h
index afa2cd3..8bcb462 100644
--- a/h/zephyr/zephyr.h
+++ b/h/zephyr/zephyr.h
@@ -20,65 +20,80 @@
#include <errno.h>
#include <sys/types.h>
+#ifndef IPPROTO_MAX /* Make sure not already included */
#include <netinet/in.h>
+#endif
#include <sys/time.h>
#include <stdio.h>
+#ifdef KERBEROS
#include <krb.h>
+#endif
#define ZVERSIONHDR "ZEPH"
#define ZVERSIONMAJOR 0
-#define ZVERSIONMINOR 1
+#define ZVERSIONMINOR 2
/* Types */
- /* Maximum packet length */
-#define Z_MAXPKTLEN 1024
+ /* 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
+
/* Packet type */
typedef enum { UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK,
- CLIENTACK, STAT } ZNotice_Kind_t;
+ CLIENTACK, STAT } ZNotice_Kind_t;
/* Unique ID format */
typedef struct _ZUnique_Id_t {
- struct in_addr zuid_addr;
- struct timeval tv;
+ struct in_addr zuid_addr;
+ struct timeval tv;
} ZUnique_Id_t;
/* Checksum */
typedef u_long ZChecksum_t;
-#define ZNUMFIELDS 15
+#define ZNUMFIELDS 17
/* Notice definition */
typedef struct _ZNotice_t {
- char *z_version;
- ZNotice_Kind_t z_kind;
- ZUnique_Id_t z_uid;
+ 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_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;
- ZChecksum_t z_checksum;
- caddr_t z_message;
- int z_message_len;
+ struct timeval z_time;
+ u_short z_port;
+ int z_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 _ZSubscription_t {
- char *recipient;
- char *class;
- char *classinst;
+typedef struct _ZSubscriptions_t {
+ char *recipient;
+ char *class;
+ char *classinst;
} ZSubscription_t;
/* Function return code */
@@ -86,9 +101,9 @@ typedef int Code_t;
/* Locations structure */
typedef struct _ZLocations_t {
- char *host;
- char *time;
- char *tty;
+ char *host;
+ char *time;
+ char *tty;
} ZLocations_t;
/* Socket file descriptor */
@@ -103,8 +118,10 @@ extern struct sockaddr_in __HM_addr;
/* Kerberos error table base */
extern int krb_err_base;
+#ifdef KERBEROS
/* Session key for last parsed packet - server only */
extern C_Block __Zephyr_session;
+#endif
/* ZCompareUIDPred definition */
extern int ZCompareUIDPred();
@@ -116,8 +133,8 @@ extern int ZCompareUIDPred();
#define ZGetFD() (__Zephyr_fd)
/* ZQLength macro */
-extern int __Q_Length;
-#define ZQLength() (__Q_Length)
+extern int __Q_CompleteLength;
+#define ZQLength() (__Q_CompleteLength)
/* ZGetDestAddr() macro */
#define ZGetDestAddr() (__HM_addr)
@@ -127,13 +144,13 @@ extern char __Zephyr_realm[];
#define ZGetRealm() (__Zephyr_realm)
/* Maximum queue length */
-#define Z_MAXQLEN 30
+#define Z_MAXQLEN 30
/* UNIX error codes */
extern int errno;
/* Random declarations */
-extern char *ZGetSender(),*ZGetVariable();
+extern char *ZGetSender(), *ZGetVariable();
/* Successful function return */
#define ZERR_NONE 0
diff --git a/h/zephyr/zephyr_internal.h b/h/zephyr/zephyr_internal.h
index 16c5a71..8d377b0 100644
--- a/h/zephyr/zephyr_internal.h
+++ b/h/zephyr/zephyr_internal.h
@@ -19,19 +19,51 @@
#include <strings.h> /* for strcpy, etc. */
#include <sys/types.h> /* for time_t, uid_t, etc */
+struct _Z_Hole {
+ struct _Z_Hole *next;
+ int first;
+ int last;
+};
+
struct _Z_InputQ {
- struct _Z_InputQ *next;
- struct _Z_InputQ *prev;
- int packet_len;
- struct sockaddr_in from;
- ZPacket_t packet;
+ 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 header_len;
+ char *header;
+ int msg_len;
+ char *msg;
};
extern struct _Z_InputQ *__Q_Head, *__Q_Tail;
-extern int __Zephyr_open;
-extern int __HM_set;
-extern int __Zephyr_server;
+ /* 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 */
+
+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;
@@ -47,4 +79,7 @@ extern char *malloc();
extern time_t time();
extern long random();
+extern struct _Z_InputQ *Z_GetFirstCompelte();
+extern struct _Z_InputQ *Z_GetNextComplete();
+
#endif !__ZINTERNAL_H__