]> code.citadel.org Git - citadel.git/blobdiff - citadel/server.h
VIEW_ definitions are now in libcitadel.h
[citadel.git] / citadel / server.h
index 02b0de9c71b50e443490773ff541d1fa3d93222c..820bdb17e9dbcb97c7a6abc3d191b7ddb30f0b45 100644 (file)
 #include <openssl/ssl.h>
 #endif
 
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 /*
  * New format for a message in memory
  */
@@ -42,6 +53,7 @@ struct CtdlMessage {
 #define CTDLEXIT_HOME          103     /* Citadel home directory not found */
 #define CTDLEXIT_OOD           104     /* Out Of Date config - rerun setup */
 #define CTDLEXIT_DB            105     /* Unable to initialize database */
+#define CTDLEXIT_LIBCITADEL    106     /* Incorrect version of libcitadel */
 
 
 
@@ -78,6 +90,7 @@ struct CitContext {
        unsigned cs_flags;      /* miscellaneous flags */
        void (*h_command_function) (void) ;     /* service command function */
        void (*h_async_function) (void) ;       /* do async msgs function */
+       void (*h_greeting_function) (void) ;    /* service startup function */
        int is_async;           /* Nonzero if client accepts async msgs */
        int async_waiting;      /* Nonzero if there are async msgs waiting */
        int input_waiting;      /* Nonzero if there is client input waiting */
@@ -139,13 +152,12 @@ struct CitContext {
        int msg4_dont_decode;
 
        /* Dynamically allocated session data */
-       struct citimap *IMAP;
-       struct citpop3 *POP3;
-       struct citsmtp *SMTP;
-       struct citmgsve *MGSVE;                 /**< Managesieve Session struct */
+       char *session_specific_data;            /* Used by individual protocol modules */
        struct cit_ical *CIT_ICAL;              /* calendaring data */
        struct ma_info *ma;                     /* multipart/alternative data */
        const char* ServiceName;                /**< whats our actual purpose? */
+       
+       struct timeval client_expires_at;               /** When this client will expire */
 };
 
 typedef struct CitContext t_context;
@@ -162,6 +174,7 @@ typedef struct CitContext t_context;
  */
 enum {
        CON_IDLE,               /* This context is doing nothing */
+       CON_START,              /* This context is starting up */
        CON_READY,              /* This context needs attention */
        CON_EXECUTING           /* This context is bound to a thread */
 };
@@ -191,12 +204,12 @@ extern struct CitContext *ContextList;
 extern int ScheduledShutdown;
 extern struct CitControl CitControl;
 
-
 struct ExpressMessage {
        struct ExpressMessage *next;
        time_t timestamp;       /* When this message was sent */
        unsigned flags;         /* Special instructions */
-       char sender[64];        /* Name of sending user */
+       char sender[256];       /* Name of sending user */
+       char sender_email[256]; /* Email or JID of sending user */
        char *text;             /* Message text (if applicable) */
 };
 
@@ -226,7 +239,6 @@ enum {
        S_NETDB,
        S_SUPPMSGMAIN,
        S_CONFIG,
-       S_WORKER_LIST,
        S_HOUSEKEEPING,
        S_NTTLIST,
        S_DIRECTORY,
@@ -242,6 +254,9 @@ enum {
        S_CHKPWD,
        S_LOG,
        S_NETSPOOL,
+       S_THREAD_LIST,
+       S_XMPP_QUEUE,
+       S_SCHEDULE_LIST,
        MAX_SEMAPHORES
 };
 
@@ -310,6 +325,8 @@ struct cdbdata {
 #define EVT_CMD                6       /* Called after each server command */
 #define EVT_RWHO       7       /* An RWHO command is being executed */
 #define EVT_ASYNC      8       /* Doing asynchronous messages */
+#define EVT_STEALTH    9       /* Entering stealth mode */
+#define EVT_UNSTEALTH  10      /* Exiting stealth mode */
 
 #define EVT_TIMER      50      /* Timer events are called once per minute
                                   and are not tied to any session */