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