7 #include <zephyr/zephyr.h>
9 #include <zephyr_internal.h>
20 #ifndef MAXHOSTNAMELEN
21 #define MAXHOSTNAMELEN 512
24 #define ETIMEDOUT WSAETIMEDOUT
25 #define EADDRINUSE WSAEADDRINUSE
28 #ifndef MAXHOSTNAMELEN
29 #define MAXHOSTNAMELEN 4096
34 #ifdef ZEPHYR_USES_HESIOD
38 #ifndef ZEPHYR_USES_KERBEROS
39 #define REALM_SZ MAXHOSTNAMELEN
40 #define INST_SZ 0 /* no instances w/o Kerberos */
41 #define ANAME_SZ 9 /* size of a username + null */
42 #define CLOCK_SKEW 300 /* max time to cache packet ids */
45 #define SERVER_SVC_FALLBACK htons((unsigned short) 2103)
46 #define HM_SVC_FALLBACK htons((unsigned short) 2104)
47 #define HM_SRV_SVC_FALLBACK htons((unsigned short) 2105)
49 #define ZAUTH_CKSUM_FAILED (-2) /* Used only by server. */
50 #define ZAUTH_UNSET (-3) /* Internal to client library. */
51 #define Z_MAXFRAGS 500 /* Max number of packet fragments */
52 #define Z_MAXNOTICESIZE 400000 /* Max size of incoming notice */
53 #define Z_MAXQUEUESIZE 1500000 /* Max size of input queue notices */
54 #define Z_FRAGFUDGE 13 /* Room to for multinotice field */
55 #define Z_NOTICETIMELIMIT 30 /* Time to wait for fragments */
56 #define Z_INITFILTERSIZE 30 /* Starting size of uid filter */
65 struct _Z_InputQ
*next
;
66 struct _Z_InputQ
*prev
;
68 unsigned ZEPHYR_INT32 timep
;
72 struct sockaddr_in from
;
73 struct _Z_Hole
*holelist
;
82 extern struct _Z_InputQ
*__Q_Head
, *__Q_Tail
;
84 extern int __Zephyr_open
; /* 0 if FD opened, 1 otherwise */
85 extern int __HM_set
; /* 0 if dest addr set, 1 otherwise */
86 extern int __Zephyr_server
; /* 0 if normal client, 1 if server or zhm */
88 extern ZLocations_t
*__locate_list
;
89 extern int __locate_num
;
90 extern int __locate_next
;
92 extern ZSubscription_t
*__subscriptions_list
;
93 extern int __subscriptions_num
;
94 extern int __subscriptions_next
;
96 extern int __Zephyr_port
; /* Port number */
97 extern struct in_addr __My_addr
;
99 typedef Code_t (*Z_SendProc
) __P((ZNotice_t
*, char *, int, int));
101 struct _Z_InputQ
*Z_GetFirstComplete
__P((void));
102 struct _Z_InputQ
*Z_GetNextComplete
__P((struct _Z_InputQ
*));
103 Code_t Z_XmitFragment
__P((ZNotice_t
*, char *,int,int));
104 void Z_RemQueue
__P((struct _Z_InputQ
*));
105 Code_t Z_AddNoticeToEntry
__P((struct _Z_InputQ
*, ZNotice_t
*, int));
106 Code_t Z_FormatAuthHeader
__P((ZNotice_t
*, char *, int, int *, Z_AuthProc
));
107 Code_t Z_FormatHeader
__P((ZNotice_t
*, char *, int, int *, Z_AuthProc
));
108 Code_t Z_FormatRawHeader
__P((ZNotice_t
*, char*, gsize
,
109 int*, char **, char **));
110 Code_t Z_ReadEnqueue
__P((void));
111 Code_t Z_ReadWait
__P((void));
112 Code_t Z_SendLocation
__P((char*, char*, Z_AuthProc
, char*));
113 Code_t Z_SendFragmentedNotice
__P((ZNotice_t
*notice
, int len
,
114 Z_AuthProc cert_func
,
115 Z_SendProc send_func
));
116 Code_t Z_WaitForComplete
__P((void));
117 Code_t Z_WaitForNotice
__P((ZNotice_t
*notice
,
118 int (*pred
) __P((ZNotice_t
*, void *)), void *arg
,
121 #endif /* __INTERNAL_H__ */