Mon, 16 Sep 2019 20:41:06 -0400
zephyr: Fix const-ness of variable loading.
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains global definitions | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of | |
| 7 | * Technology. For copying and distribution information, see the | |
| 8 | * file "mit-copyright.h". | |
| 9 | */ | |
| 10 | ||
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
11 | #ifndef PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
12 | #define PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H |
| 2086 | 13 | |
| 14 | #include <config.h> | |
| 15 | ||
|
14253
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
12424
diff
changeset
|
16 | #include <glib.h> |
|
b63ebf84c42b
This is a hand-crafted commit to migrate across subversion revisions
Ethan Blanton <elb@pidgin.im>
parents:
12424
diff
changeset
|
17 | |
| 2086 | 18 | #include <sys/types.h> |
| 19 | #include <sys/time.h> | |
| 20 | ||
| 10867 | 21 | #include <zephyr_err.h> |
| 2086 | 22 | |
| 23 | #ifndef IPPROTO_MAX /* Make sure not already included */ | |
| 10867 | 24 | #ifndef WIN32 |
| 2086 | 25 | #include <netinet/in.h> |
| 26 | #endif | |
| 10867 | 27 | #endif |
| 2086 | 28 | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
29 | #include <stdarg.h> |
| 2086 | 30 | |
| 10867 | 31 | #ifdef WIN32 |
| 32 | /* this really should be uint32_t */ | |
| 33 | /*typedef unsigned int in_addr_t; | |
| 34 | struct in_addr | |
| 35 | { | |
| 36 | in_addr_t s_addr; | |
| 37 | }; */ | |
| 38 | #include <winsock2.h> | |
| 39 | #endif | |
| 40 | ||
| 2086 | 41 | /* Service names */ |
| 42 | #define HM_SVCNAME "zephyr-hm" | |
| 43 | #define HM_SRV_SVCNAME "zephyr-hm-srv" | |
| 44 | #define SERVER_SVCNAME "zephyr-clt" | |
| 45 | #define SERVER_SERVICE "zephyr" | |
| 46 | #define SERVER_INSTANCE "zephyr" | |
| 47 | ||
| 48 | #define ZVERSIONHDR "ZEPH" | |
| 49 | #define ZVERSIONMAJOR 0 | |
| 50 | #define ZVERSIONMINOR 2 | |
| 51 | ||
| 52 | #define Z_MAXPKTLEN 1024 | |
| 53 | #define Z_MAXHEADERLEN 800 | |
| 54 | #define Z_MAXOTHERFIELDS 10 /* Max unknown fields in ZNotice_t */ | |
| 55 | #define Z_NUMFIELDS 17 | |
| 56 | ||
| 57 | /* Authentication levels returned by ZCheckAuthentication */ | |
| 58 | #define ZAUTH_FAILED (-1) | |
| 59 | #define ZAUTH_YES 1 | |
| 60 | #define ZAUTH_NO 0 | |
| 61 | ||
| 62 | typedef char ZPacket_t[Z_MAXPKTLEN]; | |
| 63 | ||
| 64 | /* Packet type */ | |
| 65 | typedef enum { | |
| 66 | UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT | |
| 67 | } ZNotice_Kind_t; | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
68 | extern const char *ZNoticeKinds[9]; |
| 2086 | 69 | |
| 70 | /* Unique ID format */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
71 | typedef struct { |
| 2086 | 72 | struct in_addr zuid_addr; |
| 73 | struct timeval tv; | |
| 74 | } ZUnique_Id_t; | |
| 75 | ||
| 76 | /* Checksum */ | |
| 77 | typedef unsigned long ZChecksum_t; | |
| 78 | ||
| 79 | /* Notice definition */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
80 | typedef struct { |
| 2086 | 81 | char *z_packet; |
| 82 | char *z_version; | |
| 83 | ZNotice_Kind_t z_kind; | |
| 84 | ZUnique_Id_t z_uid; | |
| 85 | #define z_sender_addr z_uid.zuid_addr | |
| 86 | struct timeval z_time; | |
| 87 | unsigned short z_port; | |
| 88 | int z_auth; | |
| 89 | int z_checked_auth; | |
| 90 | int z_authent_len; | |
| 91 | char *z_ascii_authent; | |
| 92 | char *z_class; | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
93 | const char *z_class_inst; |
| 2086 | 94 | char *z_opcode; |
| 95 | char *z_sender; | |
| 5136 | 96 | const char *z_recipient; |
| 2086 | 97 | char *z_default_format; |
| 98 | char *z_multinotice; | |
| 99 | ZUnique_Id_t z_multiuid; | |
| 100 | ZChecksum_t z_checksum; | |
| 101 | int z_num_other_fields; | |
| 102 | char *z_other_fields[Z_MAXOTHERFIELDS]; | |
|
17469
9b5eb283f01c
Another change from o_sukhodolsky:
Richard Laager <rlaager@pidgin.im>
parents:
15435
diff
changeset
|
103 | caddr_t z_message; |
| 2086 | 104 | int z_message_len; |
| 105 | } ZNotice_t; | |
| 106 | ||
| 107 | /* Subscription structure */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
108 | typedef struct { |
| 2086 | 109 | char *zsub_recipient; |
| 110 | char *zsub_class; | |
| 111 | char *zsub_classinst; | |
| 112 | } ZSubscription_t; | |
| 113 | ||
| 114 | /* Function return code */ | |
| 115 | typedef int Code_t; | |
| 116 | ||
| 117 | /* Locations structure */ | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
118 | typedef struct { |
| 2086 | 119 | char *host; |
| 120 | char *time; | |
| 121 | char *tty; | |
| 122 | } ZLocations_t; | |
| 123 | ||
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24672
diff
changeset
|
124 | typedef struct { |
| 2086 | 125 | char *user; |
| 126 | ZUnique_Id_t uid; | |
| 127 | char *version; | |
| 128 | } ZAsyncLocateData_t; | |
| 129 | ||
| 130 | /* for ZSetDebug */ | |
| 131 | #ifdef Z_DEBUG | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
132 | void (*__Z_debug_print)(const char *fmt, va_list args, void *closure); |
| 2086 | 133 | void *__Z_debug_print_closure; |
| 134 | #endif | |
| 135 | ||
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
136 | int ZCompareUIDPred(ZNotice_t *, void *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
137 | int ZCompareMultiUIDPred(ZNotice_t *, void *); |
| 2086 | 138 | |
| 139 | /* Defines for ZFormatNotice, et al. */ | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
140 | typedef Code_t (*Z_AuthProc)(ZNotice_t *, char *, int, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
141 | Code_t ZMakeAuthentication(ZNotice_t *, char *, int, int *); |
| 2086 | 142 | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
143 | char *ZGetSender(void); |
|
39831
c7e0d1617aae
zephyr: Fix const-ness of variable loading.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39829
diff
changeset
|
144 | const gchar *ZGetVariable(const gchar *); |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
145 | Code_t ZSetVariable(char *var, char *value); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
146 | Code_t ZUnsetVariable(char *var); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
147 | int ZGetWGPort(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
148 | Code_t ZSetDestAddr(struct sockaddr_in *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
149 | Code_t ZFormatNoticeList(ZNotice_t *, char **, int, char **, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
150 | Code_t ZParseNotice(char *, int, ZNotice_t *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
151 | Code_t ZReadAscii(char *, int, unsigned char *, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
152 | Code_t ZReadAscii32(char *, int, unsigned long *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
153 | Code_t ZReadAscii16(char *, int, unsigned short *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
154 | Code_t ZSendPacket(char *, int, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
155 | Code_t ZSendList(ZNotice_t *, char *[], int, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
156 | Code_t ZSrvSendList(ZNotice_t *, char *[], int, Z_AuthProc, Code_t (*)()); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
157 | Code_t ZSendNotice(ZNotice_t *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
158 | Code_t ZSrvSendNotice(ZNotice_t *, Z_AuthProc, Code_t (*)()); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
159 | Code_t ZFormatNotice(ZNotice_t *, char **, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
160 | Code_t ZFormatSmallNotice(ZNotice_t *, ZPacket_t, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
161 | Code_t ZFormatRawNoticeList(ZNotice_t *notice, char *list[], int nitems, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
162 | char **buffer, int *ret_len); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
163 | Code_t ZLocateUser(char *, int *, Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
164 | Code_t ZRequestLocations(const char *, ZAsyncLocateData_t *, ZNotice_Kind_t, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
165 | Z_AuthProc); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
166 | Code_t ZhmStat(struct in_addr *, ZNotice_t *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
167 | Code_t ZInitialize(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
168 | Code_t ZSetServerState(int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
169 | Code_t ZSetFD(int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
170 | Code_t ZFormatSmallRawNotice(ZNotice_t *, ZPacket_t, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
171 | int ZCompareUID(ZUnique_Id_t *, ZUnique_Id_t *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
172 | Code_t ZMakeAscii(char *, int, unsigned char *, int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
173 | Code_t ZMakeAscii32(char *, int, unsigned long); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
174 | Code_t ZMakeAscii16(char *, int, unsigned int); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
175 | Code_t ZReceivePacket(ZPacket_t, int *, struct sockaddr_in *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
176 | Code_t ZCheckAuthentication(ZNotice_t *, struct sockaddr_in *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
177 | Code_t ZSetLocation(char *exposure); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
178 | Code_t ZUnsetLocation(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
179 | Code_t ZFlushMyLocations(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
180 | Code_t ZFormatRawNotice(ZNotice_t *, char **, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
181 | Code_t ZRetrieveSubscriptions(unsigned short, int *); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
182 | Code_t ZOpenPort(unsigned short *port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
183 | Code_t ZClosePort(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
184 | Code_t ZFlushLocations(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
185 | Code_t ZFlushSubscriptions(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
186 | Code_t ZFreeNotice(ZNotice_t *notice); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
187 | Code_t ZParseLocations(register ZNotice_t *notice, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
188 | register ZAsyncLocateData_t *zald, int *nlocs, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
189 | char **user); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
190 | int ZCompareALDPred(ZNotice_t *notice, void *zald); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
191 | void ZFreeALD(register ZAsyncLocateData_t *zald); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
192 | Code_t ZCheckIfNotice(ZNotice_t *notice, struct sockaddr_in *from, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
193 | register int (*predicate)(ZNotice_t *, void *), |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
194 | void *args); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
195 | Code_t ZPeekPacket(char **buffer, int *ret_len, struct sockaddr_in *from); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
196 | Code_t ZPeekNotice(ZNotice_t *notice, struct sockaddr_in *from); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
197 | Code_t ZIfNotice(ZNotice_t *notice, struct sockaddr_in *from, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
198 | int (*predicate)(ZNotice_t *, void *), void *args); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
199 | Code_t ZSubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
200 | Code_t ZSubscribeToSansDefaults(ZSubscription_t *sublist, int nitems, |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
201 | unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
202 | Code_t ZUnsubscribeTo(ZSubscription_t *sublist, int nitems, unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
203 | Code_t ZCancelSubscriptions(unsigned int port); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
204 | int ZPending(void); |
|
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
205 | Code_t ZReceiveNotice(ZNotice_t *notice, struct sockaddr_in *from); |
| 2086 | 206 | #ifdef Z_DEBUG |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
207 | void Z_debug(const char *, ...); |
| 2086 | 208 | #endif |
| 209 | ||
| 210 | /* Compatibility */ | |
| 211 | #define ZNewLocateUser ZLocateUser | |
| 212 | ||
| 213 | /* Macros to retrieve Zephyr library values. */ | |
| 214 | extern int __Zephyr_fd; | |
| 215 | extern int __Q_CompleteLength; | |
| 216 | extern struct sockaddr_in __HM_addr; | |
| 217 | extern char __Zephyr_realm[]; | |
| 218 | #define ZGetFD() __Zephyr_fd | |
| 219 | #define ZQLength() __Q_CompleteLength | |
| 220 | #define ZGetDestAddr() __HM_addr | |
| 221 | #define ZGetRealm() __Zephyr_realm | |
| 222 | ||
| 223 | #ifdef Z_DEBUG | |
|
39829
ce056c64e426
zephyr: Remove support for compilers without __STDC__.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39819
diff
changeset
|
224 | void ZSetDebug(void (*)(const char *, va_list, void *), void *); |
| 2086 | 225 | #define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \ |
| 226 | __Z_debug_print_closure=(closure), \ | |
| 227 | (void) 0) | |
| 228 | #else | |
| 229 | #define ZSetDebug(proc,closure) | |
| 230 | #endif | |
| 231 | ||
| 232 | /* Maximum queue length */ | |
| 233 | #define Z_MAXQLEN 30 | |
| 234 | ||
| 235 | /* Successful function return */ | |
| 236 | #define ZERR_NONE 0 | |
| 237 | ||
| 238 | /* Hostmanager wait time (in secs) */ | |
| 10867 | 239 | #define HM_TIMEOUT 1 |
| 2086 | 240 | |
| 241 | /* Server wait time (in secs) */ | |
| 242 | #define SRV_TIMEOUT 30 | |
| 243 | ||
| 244 | #define ZAUTH (ZMakeAuthentication) | |
| 245 | #define ZNOAUTH ((Z_AuthProc)0) | |
| 246 | ||
| 247 | /* Packet strings */ | |
| 248 | #define ZSRVACK_SENT "SENT" /* SERVACK codes */ | |
| 249 | #define ZSRVACK_NOTSENT "LOST" | |
| 250 | #define ZSRVACK_FAIL "FAIL" | |
| 251 | ||
| 252 | /* Server internal class */ | |
| 253 | #define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */ | |
| 254 | ||
| 255 | /* Control codes sent to a server */ | |
| 256 | #define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */ | |
| 257 | ||
| 258 | #define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */ | |
| 259 | #define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */ | |
| 260 | #define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */ | |
| 261 | #define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */ | |
| 262 | #define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */ | |
| 263 | #define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */ | |
| 264 | #define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default | |
| 265 | * subscriptions */ | |
| 266 | ||
| 267 | #define ZEPHYR_CTL_HM "HM" /* Inst: From HM */ | |
| 268 | #define HM_BOOT "BOOT" /* Opcode: Boot msg */ | |
| 269 | #define HM_FLUSH "FLUSH" /* Opcode: Flush me */ | |
| 270 | #define HM_DETACH "DETACH" /* Opcode: Detach me */ | |
| 271 | #define HM_ATTACH "ATTACH" /* Opcode: Attach me */ | |
| 272 | ||
| 273 | /* Control codes send to a HostManager */ | |
| 274 | #define HM_CTL_CLASS "HM_CTL" /* Class */ | |
| 275 | ||
| 276 | #define HM_CTL_SERVER "SERVER" /* Inst: From server */ | |
| 277 | #define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */ | |
| 278 | #define SERVER_PING "PING" /* Opcode: PING */ | |
| 279 | ||
| 280 | #define HM_CTL_CLIENT "CLIENT" /* Inst: From client */ | |
| 281 | #define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */ | |
| 282 | #define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */ | |
| 283 | ||
| 284 | /* HM Statistics */ | |
| 285 | #define HM_STAT_CLASS "HM_STAT" /* Class */ | |
| 286 | ||
| 287 | #define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */ | |
| 288 | #define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */ | |
| 289 | ||
| 290 | /* Login class messages */ | |
| 291 | #define LOGIN_CLASS "LOGIN" /* Class */ | |
| 292 | ||
| 293 | /* Class Instance is principal of user who is logging in or logging out */ | |
| 294 | ||
| 295 | #define EXPOSE_NONE "NONE" /* Opcode: Not visible */ | |
| 296 | #define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */ | |
| 297 | #define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */ | |
| 298 | #define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */ | |
| 299 | #define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */ | |
| 300 | #define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */ | |
| 301 | #define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login | |
| 302 | (from server) */ | |
| 303 | #define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */ | |
| 304 | #define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */ | |
| 305 | ||
| 306 | /* Locate class messages */ | |
| 307 | #define LOCATE_CLASS "USER_LOCATE" /* Class */ | |
| 308 | ||
| 309 | #define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */ | |
| 310 | #define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */ | |
| 311 | ||
| 312 | /* Class Instance is principal of user to locate */ | |
| 313 | #define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */ | |
| 314 | ||
| 315 | /* WG_CTL class messages */ | |
| 316 | #define WG_CTL_CLASS "WG_CTL" /* Class */ | |
| 317 | ||
| 318 | #define WG_CTL_USER "USER" /* Inst: User request */ | |
| 319 | #define USER_REREAD "REREAD" /* Opcode: Reread desc file */ | |
| 320 | #define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */ | |
| 321 | #define USER_STARTUP "STARTUP" /* Opcode: Come out of it */ | |
| 2419 | 322 | #define USER_EXIT "EXIT" /* Opcode: Exit the client */ |
| 2086 | 323 | |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
324 | #endif /* PURPLE_ZEPHYR_ZEPHYR_INTERNAL_H */ |