1 #ifndef CCAN_OSERVER_TYPES_H
2 #define CCAN_OSERVER_TYPES_H
4 #include <ccan/cdump/cdump.h>
6 CDUMP_SAVED enum state {
8 RECEIVING_USER_QUESTION,
9 SENDING_OTHER_QUESTION_PREFIX,
10 SENDING_OTHER_QUESTION,
11 RECEIVING_OTHER_ANSWER,
12 SENDING_ANSWER_PREFIX,
17 CDUMP_SAVED struct client {
18 /* What are we doing today, brain? */
20 /* Our event info, and the file descriptor. */
21 struct tevent_fd *fde CDUMP_IGNORE;
23 /* The question we read from client. */
25 /* The answer to the client. */
27 /* How many bytes of the reply we sent so far. */
30 struct oserver *oserver;
31 /* Whose question this client is answering. */
32 struct client *subclient;
33 /* Who is answering our question. */
34 struct client *oracle;
37 CDUMP_SAVED struct oserver {
38 /* 5 clients should be enough for anybody! */
39 struct client *clients[5];
41 struct tevent_fd *fde CDUMP_IGNORE;
43 #endif /* CCAN_OSERVER_TYPES_H */