]> code.citadel.org Git - citadel.git/blobdiff - citadel/server.h
* more merges
[citadel.git] / citadel / server.h
index e603a031271017469272a25b6635e9c5622ae47b..bfb95ccba49bfb391d78ba3f48efa87786df422e 100644 (file)
@@ -58,13 +58,14 @@ struct CitContext {
        int state;              /* thread state (see CON_ values below) */
        int kill_me;            /* Set to nonzero to flag for termination */
 
-       char curr_user[32];     /* name of current user */
+       char curr_user[USERNAME_SIZE];  /* name of current user */
        int logged_in;          /* logged in */
        int internal_pgm;       /* authenticated as internal program */
        char temp[32];          /* temp file name */
        int nologin;            /* not allowed to log in */
+       int is_local_socket;    /* set to 1 if client is on unix domain sock */
 
-       char net_node[32];
+       char net_node[32];      /* Is the client another Citadel server? */
        int client_socket;
        int cs_pid;             /* session ID */
        time_t cs_lastupdt;     /* time of last update */
@@ -72,7 +73,7 @@ struct CitContext {
        time_t lastidle;        /* For computing idle time */
        char lastcmdname[5];    /* name of last command executed */
        unsigned cs_flags;      /* miscellaneous flags */
-       int client_protocol;    /* Which protocol is this client speaking? */
+       void (*h_command_function) (void) ;     /* service command function */
 
        /* feeping creaturisms... */
        int cs_clientdev;       /* client developer ID */
@@ -81,24 +82,34 @@ struct CitContext {
        char cs_clientname[32]; /* name of client software */
        char cs_host[26];       /* host logged in from */
 
+       /* Beginning of cryptography - session nonce */
+       char cs_nonce[NONCE_SIZE];              /* The nonce for this session's next auth transaction */
+
        FILE *download_fp;      /* Fields relating to file transfer */
        FILE *upload_fp;
-       char upl_file[256];
-       char upl_path[256];
-       char upl_comment[256];
-       char upl_filedir[256];
-       char chat_room[20];     /* The chat room */
+       char upl_file[SIZ];
+       char upl_path[SIZ];
+       char upl_comment[SIZ];
+       char upl_filedir[SIZ];
        char dl_is_net;
        char upload_type;
 
+       /* Redirect this session's output to somewhere else? */
+       FILE *redirect_fp;
+       int redirect_sock;
+
+       /* A linked list of all express messages sent to us. */
        struct ExpressMessage *FirstExpressMessage;
+       int disable_exp;        /* Set to 1 to disable incoming pages */
 
-       char fake_username[32]; /* Fake username <bc>                */
-       char fake_postname[32]; /* Fake postname <bc>                */
+       /* Masquerade... */
+       char fake_username[USERNAME_SIZE];      /* Fake username <bc>                */
+       char fake_postname[USERNAME_SIZE];      /* Fake postname <bc>                */
        char fake_hostname[25]; /* Name of the fake hostname <bc>    */
        char fake_roomname[ROOMNAMELEN];        /* Name of the fake room <bc> */
+       
 
-       int FloorBeingSearched; /* This is used by cmd_lrms() etc.   */
+       /* Dynamically allocated session data */
        struct CtdlSessData *FirstSessData;
 };
 
@@ -139,9 +150,9 @@ struct ChatLine {
        struct ChatLine *next;
        int chat_seq;
        time_t chat_time;
-       char chat_text[256];
-       char chat_room[20];
-       char chat_username[32];
+       char chat_text[SIZ];
+       char chat_username[USERNAME_SIZE];
+       char chat_room[ROOMNAMELEN];
 };
 
 /*
@@ -162,6 +173,8 @@ enum {
        S_NETDB,
        S_SUPPMSGMAIN,
        S_I_WANNA_SELECT,
+       S_CONFIG,
+       S_WORKER_LIST,
        MAX_SEMAPHORES
 };
 
@@ -184,6 +197,13 @@ enum {
        MT_DOWNLOAD             /* Download a component */
 };
 
+/*
+ * Message format types in the database
+ */
+#define        FMT_CITADEL     0       /* Citadel vari-format (proprietary) */
+#define FMT_FIXED      1       /* Fixed format (proprietary)        */
+#define FMT_RFC822     4       /* Standard (headers are in M field) */
+
 
 /*
  * Citadel DataBases (define one for each cdb we need to open)
@@ -250,8 +270,8 @@ extern struct SessionFunctionHook *SessionHookTable;
 #define EVT_RWHO       7       /* An RWHO command is being executed */
 
 
-
-
+#define EVT_TIMER      50      /* Timer events are called once per minute
+                                  and are not tied to any session */
 
 /*
  * UserFunctionHook extensions are used for any type of hook which implements
@@ -315,8 +335,10 @@ enum {
 struct ServiceFunctionHook {
        struct ServiceFunctionHook *next;
        int tcp_port;
+       char *sockpath;
        void (*h_greeting_function) (void) ;
        void (*h_command_function) (void) ;
+       int msock;
 };
 extern struct ServiceFunctionHook *ServiceHookTable;
 
@@ -349,6 +371,7 @@ struct SuppMsgInfo {
        long smi_msgnum;        /* Message number in *local* message base */
        int smi_refcount;       /* Number of rooms which point to this msg */
        char smi_content_type[64];
+       char smi_mod;           /* Moderated to what level? */
        /* more stuff will be added to this record in the future */
 };
 
@@ -398,7 +421,7 @@ struct ser_ret {
 
 
 /* Preferred field order */
-/*               *********                     Important fields */
-/*                        ****************     Semi-important fields */
+/*               **********                    Important fields */
+/*                         ***************     Semi-important fields */
 /*                                        *    Message text (MUST be last) */
-#define FORDER "IPTAONHRDBCEFGJKLQSUVWXYZM"
+#define FORDER "IPTAFONHRDBCEGJKLQSUVWXYZM"