* added type definitions translating the structure information back into c-structs
* added type definitions for serializing / deserializing our structurse to artv.
* added code to serv_vanderley to auto dump our datastructurse
* incremented the EXPORT_REV_MIN because of the sequence of config is changed to be similar to our storage backend.
* added include flags to the makefiles.
AUTOCONF=@AUTOCONF@
chkpwd_LIBS=@chkpwd_LIBS@
CC=@CC@
-CFLAGS=@CFLAGS@
-CPPFLAGS=@CPPFLAGS@ -I.
+CFLAGS=@CFLAGS@ -I ./include/
+CPPFLAGS=@CPPFLAGS@ -I. -I ./include/
DATABASE=@DATABASE@
DEFS=@DEFS@
LDFLAGS=@LDFLAGS@
*/
#define REV_LEVEL 705 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
-#define EXPORT_REV_MIN 704 /* Oldest compatible export files */
+#define EXPORT_REV_MIN 705 /* Oldest compatible export files */
#define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
obtain SERVER_TYPE codes for your implementations */
* Message expiration policy stuff
*/
struct ExpirePolicy {
+/*
+#include "datadefinitions.h"
+#include "dtds/expirepolicy-defs.h"
+#include "undef_data.h"
+*/
int expire_mode;
int expire_value;
};
* relevant rooms without having to ask the server each time where to go next.
*/
struct march {
+/*
+#include "datadefinitions.h"
+#include "dtds/march-defs.h"
+#include "undef_data.h"
+*/
struct march *next;
char march_name[ROOMNAMELEN];
unsigned int march_flags;
* User records.
*/
struct ctdluser { /* User record */
+/*
+#include "datadefinitions.h"
+#include "dtds/user-defs.h"
+#include "undef_data.h"
+*/
int version; /* Cit vers. which created this rec */
uid_t uid; /* Associate with a unix account? */
char password[32]; /* password (for Citadel-only users)*/
* Room records.
*/
struct ctdlroom {
- char QRname[ROOMNAMELEN]; /* Name of room */
- char QRpasswd[10]; /* Only valid if it's a private rm */
- long QRroomaide; /* User number of room aide */
- long QRhighest; /* Highest message NUMBER in room */
- time_t QRgen; /* Generation number of room */
- unsigned QRflags; /* See flag values below */
- char QRdirname[15]; /* Directory name, if applicable */
- long QRinfo; /* Info file update relative to msgs*/
- char QRfloor; /* Which floor this room is on */
- time_t QRmtime; /* Date/time of last post */
- struct ExpirePolicy QRep; /* Message expiration policy */
- long QRnumber; /* Globally unique room number */
- char QRorder; /* Sort key for room listing order */
- unsigned QRflags2; /* Additional flags */
- int QRdefaultview; /* How to display the contents */
+/*
+#include "datadefinitions.h"
+#include "dtds/room-defs.h"
+#include "undef_data.h"
+*/
+ char QRname[ROOMNAMELEN]; /* Name of room */
+ char QRpasswd[10]; /* Only valid if it's a private rm */
+ long QRroomaide; /* User number of room aide */
+ long QRhighest; /* Highest message NUMBER in room */
+ time_t QRgen; /* Generation number of room */
+ unsigned QRflags; /* See flag values below */
+ char QRdirname[15]; /* Directory name, if applicable */
+ long QRinfo; /* Info file update relative to msgs*/
+ char QRfloor; /* Which floor this room is on */
+ time_t QRmtime; /* Date/time of last post */
+ struct ExpirePolicy QRep; /* Message expiration policy */
+ long QRnumber; /* Globally unique room number */
+ char QRorder; /* Sort key for room listing order */
+ unsigned QRflags2; /* Additional flags */
+ int QRdefaultview; /* How to display the contents */
};
/* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
* Floor record. The floor number is implicit in its location in the file.
*/
struct floor {
+/*
+#include "datadefinitions.h"
+#include "dtds/floor-defs.h"
+#include "undef_data.h"
+*/
unsigned short f_flags; /* flags */
char f_name[256]; /* name of floor */
int f_ref_count; /* reference count */
* free to do so, as long as the sizes are kept identical.
*/
struct config {
- char c_nodename[16]; /* Unqualified "short" nodename */
- char c_fqdn[64]; /* Fully Qualified Domain Name */
- char c_humannode[21]; /* Long name of system */
- char c_phonenum[16]; /* Dialup number of system */
- uid_t c_ctdluid; /* UID under which we run Citadel */
- char c_creataide; /* room creator = room aide flag */
- int c_sleeping; /* watchdog timer setting */
- char c_initax; /* initial access level */
- char c_regiscall; /* call number to register on */
- char c_twitdetect; /* twit detect flag */
- char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
- char c_moreprompt[80]; /* paginator prompt */
- char c_restrict; /* restrict Internet mail flag */
- long c_niu_1; /* (not in use) */
- char c_site_location[32]; /* physical location of server */
- char c_sysadm[26]; /* name of system administrator */
- char c_niu_2[15]; /* (not in use) */
- int c_setup_level; /* what rev level we've setup to */
- int c_maxsessions; /* maximum concurrent sessions */
- char c_ip_addr[20]; /* IP address to listen on */
- int c_port_number; /* Cit listener port (usually 504) */
- int c_ipgm_secret; /* Internal program authentication */
- struct ExpirePolicy c_ep; /* System default msg expire policy */
- int c_userpurge; /* System default user purge (days) */
- int c_roompurge; /* System default room purge (days) */
- char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
- char c_createax; /* Axlevel required to create rooms */
- long c_maxmsglen; /* Maximum message length */
- int c_min_workers; /* Lower limit on number of threads */
- int c_max_workers; /* Upper limit on number of threads */
- int c_pop3_port; /* POP3 listener port (usually 110) */
- int c_smtp_port; /* SMTP listener port (usually 25) */
- int c_rfc822_strict_from; /* 1 = don't correct From: forgeries*/
- int c_aide_zap; /* Are Aides allowed to zap rooms? */
- int c_imap_port; /* IMAP listener port (usually 143) */
- time_t c_net_freq; /* how often to run the networker */
- char c_disable_newu; /* disable NEWU command */
- char c_enable_fulltext; /* enable full text indexing */
- char c_baseroom[ROOMNAMELEN]; /* Name of baseroom (Lobby) */
- char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
- int c_purge_hour; /* Hour during which db purges run */
- struct ExpirePolicy c_mbxep; /* Expire policy for mailbox rooms */
- char c_ldap_host[128]; /* Host where LDAP service lives */
- int c_ldap_port; /* Port on host where LDAP lives */
- char c_ldap_base_dn[256]; /* LDAP base DN */
- char c_ldap_bind_dn[256]; /* LDAP bind DN */
- char c_ldap_bind_pw[256]; /* LDAP bind password */
- int c_msa_port; /* SMTP MSA listener port (usu 587) */
- int c_imaps_port; /* IMAPS listener port (usually 993)*/
- int c_pop3s_port; /* POP3S listener port (usually 995)*/
- int c_smtps_port; /* SMTPS listener port (usually 465)*/
- char c_auto_cull; /* Cull db logs automatically? */
- char c_instant_expunge; /* IMAP instant expunge deleted msgs*/
- char c_allow_spoofing; /* SMTP allow spoofing of my domains*/
- char c_journal_email; /* Perform journaling of email */
- char c_journal_pubmsgs; /* Perform journaling of non-email */
- char c_journal_dest[128]; /* Where to send journalized msgs */
- char c_default_cal_zone[128]; /* Default calendar time zone */
- int c_pftcpdict_port; /* postfix tcptable support, see http://www.postfix.org/tcp_table.5.html */
- int c_managesieve_port; /* managesieve port. */
- int c_auth_mode; /* 0 = built-in Citadel auth; 1 = underlying host system auth */
- char c_funambol_host[256]; /* Funambol host. Blank to disable */
- int c_funambol_port; /* Funambol port */
- char c_funambol_source[256]; /* Funambol sync source */
- char c_funambol_auth[256]; /* Funambol auth details */
- char c_rbl_at_greeting; /* Check RBL's at connect instead of after RCPT */
+#include "datadefinitions.h"
+#include "dtds/config-defs.h"
+#include "undef_data.h"
+
+/// char c_nodename[16]; /* Unqualified "short" nodename */
+/// char c_fqdn[64]; /* Fully Qualified Domain Name */
+/// char c_humannode[21]; /* Long name of system */
+/// char c_phonenum[16]; /* Dialup number of system */
+/// uid_t c_ctdluid; /* UID under which we run Citadel */
+/// char c_creataide; /* room creator = room aide flag */
+/// int c_sleeping; /* watchdog timer setting */
+/// char c_initax; /* initial access level */
+/// char c_regiscall; /* call number to register on */
+/// char c_twitdetect; /* twit detect flag */
+/// char c_twitroom[ROOMNAMELEN]; /* twit detect msg move to room */
+/// char c_moreprompt[80]; /* paginator prompt */
+/// char c_restrict; /* restrict Internet mail flag */
+/// long c_niu_1; /* (not in use) */
+/// char c_site_location[32]; /* physical location of server */
+/// char c_sysadm[26]; /* name of system administrator */
+/// char c_niu_2[15]; /* (not in use) */
+/// int c_setup_level; /* what rev level we've setup to */
+/// int c_maxsessions; /* maximum concurrent sessions */
+/// char c_ip_addr[20]; /* IP address to listen on */
+/// int c_port_number; /* Cit listener port (usually 504) */
+/// int c_ipgm_secret; /* Internal program authentication */
+/// struct ExpirePolicy c_ep; /* System default msg expire policy */
+/// int c_userpurge; /* System default user purge (days) */
+/// int c_roompurge; /* System default room purge (days) */
+/// char c_logpages[ROOMNAMELEN]; /* Room to log pages to (or not) */
+/// char c_createax; /* Axlevel required to create rooms */
+/// long c_maxmsglen; /* Maximum message length */
+/// int c_min_workers; /* Lower limit on number of threads */
+/// int c_max_workers; /* Upper limit on number of threads */
+/// int c_pop3_port; /* POP3 listener port (usually 110) */
+/// int c_smtp_port; /* SMTP listener port (usually 25) */
+/// int c_rfc822_strict_from; /* 1 = don't correct From: forgeries*/
+/// int c_aide_zap; /* Are Aides allowed to zap rooms? */
+/// int c_imap_port; /* IMAP listener port (usually 143) */
+/// time_t c_net_freq; /* how often to run the networker */
+/// char c_disable_newu; /* disable NEWU command */
+/// char c_enable_fulltext; /* enable full text indexing */
+/// char c_baseroom[ROOMNAMELEN]; /* Name of baseroom (Lobby) */
+/// char c_aideroom[ROOMNAMELEN]; /* Name of aideroom (Aide) */
+/// int c_purge_hour; /* Hour during which db purges run */
+/// struct ExpirePolicy c_mbxep; /* Expire policy for mailbox rooms */
+/// char c_ldap_host[128]; /* Host where LDAP service lives */
+/// int c_ldap_port; /* Port on host where LDAP lives */
+/// char c_ldap_base_dn[256]; /* LDAP base DN */
+/// char c_ldap_bind_dn[256]; /* LDAP bind DN */
+/// char c_ldap_bind_pw[256]; /* LDAP bind password */
+/// int c_msa_port; /* SMTP MSA listener port (usu 587) */
+/// int c_imaps_port; /* IMAPS listener port (usually 993)*/
+/// int c_pop3s_port; /* POP3S listener port (usually 995)*/
+/// int c_smtps_port; /* SMTPS listener port (usually 465)*/
+/// char c_auto_cull; /* Cull db logs automatically? */
+/// char c_instant_expunge; /* IMAP instant expunge deleted msgs*/
+/// char c_allow_spoofing; /* SMTP allow spoofing of my domains*/
+/// char c_journal_email; /* Perform journaling of email */
+/// char c_journal_pubmsgs; /* Perform journaling of non-email */
+/// char c_journal_dest[128]; /* Where to send journalized msgs */
+/// char c_default_cal_zone[128]; /* Default calendar time zone */
+/// int c_pftcpdict_port; /* postfix tcptable support, see http://www.postfix.org/tcp_table.5.html */
+/// int c_managesieve_port; /* managesieve port. */
+/// int c_auth_mode; /* 0 = built-in Citadel auth; 1 = underlying host system auth */
+/// char c_funambol_host[256]; /* Funambol host. Blank to disable */
+/// int c_funambol_port; /* Funambol port */
+/// char c_funambol_source[256]; /* Funambol sync source */
+/// char c_funambol_auth[256]; /* Funambol auth details */
+/// char c_rbl_at_greeting; /* Check RBL's at connect instead of after RCPT */
+///
};
* Citadel 7.05 release
- -- Art Cancro <ajc@uncensored.citadel.org> Thu, 22 Feb 2007 06:12:00 -0500
+ -- Art Cancro <ajc@uncensored.citadel.org> Thu, 22 Feb 2007 06:12:00 -0500
citadel (7.03-7) unstable; urgency=high
--- /dev/null
+
+/**
+ * this file contains the defines that cause our x-macros to serialize for artv export
+ */
+#define CFG_VALUE(a,b) a
+#define PROTOCOL_ONLY(a)
+#define SERVER_PRIVATE(a) a
+#define NO_ARTV(a)
+#define SUBSTRUCT(a)
+#define SUBSTRUCT_ELEMENT(a) a
+
+#define UNSIGNED(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+#define UNSIGNED_INT(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+#define INTEGER(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+#define LONG(a) client_getln(cbuf, sizeof cbuf); buf->a = atol(cbuf)
+#define UINT8(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+#define UNSIGNED_SHORT(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+#define CHAR(a) client_getln(cbuf, sizeof cbuf); buf->a = atoi(cbuf)
+
+#define TIME(a) client_getln(cbuf, sizeof cbuf); buf->a = atol(cbuf)
+#define UID_T(a) client_getln(cbuf, sizeof cbuf); buf->a = atol(cbuf)
+
+
+
+#define STRING_BUF(a, b) client_getln(buf->a, b)
+#define STRING(a) client_getln(buf->a, sizeof buf->a)
--- /dev/null
+
+/**
+ * this file contains the defines that cause our x-macros to serialize for artv export
+ */
+
+#define CFG_VALUE(a,b) a
+#define NO_ARTV(a)
+#define PROTOCOL_ONLY(a)
+#define SERVER_PRIVATE(a) a
+#define SUBSTRUCT(a)
+#define SUBSTRUCT_ELEMENT(a) a
+
+#define UNSIGNED(a) cprintf("%u\n", buf->a)
+#define UNSIGNED_INT(a) cprintf("%u\n", buf->a)
+#define INTEGER(a) cprintf("%d\n", buf->a)
+#define LONG(a) cprintf("%ld\n", buf->a)
+#define UINT8(a) cprintf("%d\n", buf->a)
+#define UNSIGNED_SHORT(a) cprintf("%u\n", buf->a)
+#define CHAR(a) cprintf("%d\n", buf->a)
+
+#define TIME(a) cprintf("%ld\n", (long)buf->a)
+#define UID_T(a) cprintf("%ld\n", (long)buf->a)
+
+
+
+#define STRING_BUF(a, b) cprintf("%s\n", buf->a)
+#define STRING(a) cprintf("%s\n", buf->a)
--- /dev/null
+
+
+/**
+ * this file contains the defines that convert our x-macros to datatypes
+ */
+#define CFG_VALUE(a,b) a
+#define SUBSTRUCT(a) a
+#define SUBSTRUCT_ELEMENT(a)
+#define PROTOCOL_ONLY(a)
+#define SERVER_PRIVATE(a) a
+#define NO_ARTV(a) a
+
+#define LONG(a) long a
+#define UNSIGNED(a) unsigned a
+#define UNSIGNED_INT(a) unsigned int a
+#define INTEGER(a) int a
+
+#define UNSIGNED_SHORT(a) unsigned short a
+#define UINT8(a) cit_uint8_t a
+#define CHAR(a) char a
+
+#define TIME(a) time_t a
+#define UID_T(a) uid_t a
+
+
+
+#define STRING_BUF(a, b) char a[b]
+#define STRING(a) char *a
+
--- /dev/null
+CFG_VALUE(STRING_BUF(c_nodename, 16), " Unqualified \"short\" nodename ");
+CFG_VALUE(STRING_BUF(c_fqdn, 64), " Fully Qualified Domain Name ");
+CFG_VALUE(STRING_BUF(c_humannode, 21), " long name of system ");
+CFG_VALUE(STRING_BUF(c_phonenum, 16), " Dialup number of system ");
+CFG_VALUE(UID_T(c_ctdluid), " UID under which we run Citadel ");
+CFG_VALUE(CHAR(c_creataide), " room creator = room aide flag ");
+CFG_VALUE(INTEGER(c_sleeping), " watchdog timer setting ");
+CFG_VALUE(CHAR(c_initax), " initial access level ");
+CFG_VALUE(CHAR(c_regiscall), " call number to register on ");
+CFG_VALUE(CHAR(c_twitdetect), " twit detect flag ");
+CFG_VALUE(STRING_BUF(c_twitroom, ROOMNAMELEN), " twit detect msg move to room ");
+CFG_VALUE(STRING_BUF(c_moreprompt, 80), " paginator prompt ");
+CFG_VALUE(CHAR(c_restrict), " restrict internet mail flag ");
+NO_ARTV(CFG_VALUE(LONG(c_niu_1), " (not in use) ")); ///////
+CFG_VALUE(STRING_BUF(c_site_location, 32), " physical location of server ");
+CFG_VALUE(STRING_BUF(c_sysadm, 26), " name of system administrator ");
+NO_ARTV(CFG_VALUE(STRING_BUF(c_niu_2, 15), " (not in use) "));
+CFG_VALUE(INTEGER(c_setup_level), " what rev level we've setup to ");
+CFG_VALUE(INTEGER(c_maxsessions), " maximum concurrent sessions ");
+/* c_ip_addr is out of sortorder; its located after c_ldap_bind_pw in the old export */
+CFG_VALUE(STRING_BUF(c_ip_addr, 20), " IP address to listen on ");
+CFG_VALUE(INTEGER(c_port_number), " Cit listener port (usually 504) ");
+NO_ARTV(CFG_VALUE(INTEGER(c_ipgm_secret), " internal program authentication "));
+CFG_VALUE(SUBSTRUCT(struct ExpirePolicy c_ep), " System default msg expire policy ");
+SUBSTRUCT_ELEMENT(INTEGER(c_ep.expire_mode));
+SUBSTRUCT_ELEMENT(INTEGER(c_ep.expire_value));
+CFG_VALUE(INTEGER(c_userpurge), " System default user purge (days) ");
+CFG_VALUE(INTEGER(c_roompurge), " System default room purge (days) ");
+CFG_VALUE(STRING_BUF(c_logpages, ROOMNAMELEN), " Room to log pages to (or not) ");
+CFG_VALUE(CHAR(c_createax), " Axlevel required to create rooms ");
+CFG_VALUE(LONG(c_maxmsglen), " Maximum message length ");
+CFG_VALUE(INTEGER(c_min_workers), " Lower limit on number of threads ");
+CFG_VALUE(INTEGER(c_max_workers), " Upper limit on number of threads ");
+CFG_VALUE(INTEGER(c_pop3_port), " POP3 listener port (usually 110) ");
+CFG_VALUE(INTEGER(c_smtp_port), " SMTP listener port (usually 25) ");
+////purge_hour? mbxexp? ldap_host? ldap_port?
+CFG_VALUE(INTEGER(c_rfc822_strict_from), " 1 = don't correct From: forgeries");
+CFG_VALUE(INTEGER(c_aide_zap), " Are Aides allowed to zap rooms? ");
+CFG_VALUE(INTEGER(c_imap_port), " IMAP listener port (usually 143) ");
+CFG_VALUE(TIME(c_net_freq), " how often to run the networker ");
+CFG_VALUE(CHAR(c_disable_newu), " disable NEWU command ");
+CFG_VALUE(CHAR(c_enable_fulltext), " enable full text indexing ");
+CFG_VALUE(STRING_BUF(c_baseroom, ROOMNAMELEN), " Name of baseroom (Lobby) ");
+CFG_VALUE(STRING_BUF(c_aideroom, ROOMNAMELEN), " Name of aideroom (Aide) ");
+CFG_VALUE(INTEGER(c_purge_hour), " Hour during which db purges run ");
+CFG_VALUE(SUBSTRUCT(struct ExpirePolicy c_mbxep), " Expire policy for mailbox rooms ");
+SUBSTRUCT_ELEMENT(INTEGER(c_mbxep.expire_mode));
+SUBSTRUCT_ELEMENT(INTEGER(c_mbxep.expire_value));
+CFG_VALUE(STRING_BUF(c_ldap_host, 128), " Host where LDAP service lives ");
+CFG_VALUE(INTEGER(c_ldap_port), " Port on host where LDAP lives ");
+CFG_VALUE(STRING_BUF(c_ldap_base_dn, 256), " LDAP base DN ");
+CFG_VALUE(STRING_BUF(c_ldap_bind_dn, 256), " LDAP bind DN ");
+CFG_VALUE(STRING_BUF(c_ldap_bind_pw, 256), " LDAP bind password ");
+CFG_VALUE(INTEGER(c_msa_port), " SMTP MSA listener port (usu 587) ");
+CFG_VALUE(INTEGER(c_imaps_port), " IMAPS listener port (usually 993)");
+CFG_VALUE(INTEGER(c_pop3s_port), " POP3S listener port (usually 995)");
+CFG_VALUE(INTEGER(c_smtps_port), " SMTPS listener port (usually 465)");
+CFG_VALUE(CHAR(c_auto_cull), " Cull db logs automatically? ");
+CFG_VALUE(CHAR(c_instant_expunge), " IMAP instant expunge deleted msgs");
+CFG_VALUE(CHAR(c_allow_spoofing), " SMTP allow spoofing of my domains");
+CFG_VALUE(CHAR(c_journal_email), " Perform journaling of email ");
+CFG_VALUE(CHAR(c_journal_pubmsgs), " Perform journaling of non-email ");
+CFG_VALUE(STRING_BUF(c_journal_dest, 128), " Where to send journalized msgs ");
+CFG_VALUE(STRING_BUF(c_default_cal_zone, 128), " Default calendar time zone ");
+CFG_VALUE(INTEGER(c_pftcpdict_port), " postfix tcptable support, see http://www.postfix.org/tcp_table.5.html ");
+CFG_VALUE(INTEGER(c_managesieve_port), " managesieve port. ");
+CFG_VALUE(INTEGER(c_auth_mode), " 0 = built-in Citadel auth), 1 = underlying host system auth ");
+CFG_VALUE(STRING_BUF(c_funambol_host, 256), " Funambol host. Blank to disable ");
+CFG_VALUE(INTEGER(c_funambol_port), " Funambol port ");
+CFG_VALUE(STRING_BUF(c_funambol_source, 256), " Funambol sync source ");
+CFG_VALUE(STRING_BUF(c_funambol_auth, 256), " Funambol auth details ");
+CFG_VALUE(CHAR(c_rbl_at_greeting), " Check RBL's at connect instead of after RCPT ");
--- /dev/null
+INTEGER(expire_mode);
+INTEGER(expire_value);
--- /dev/null
+/**
+ * this file contains the definitions for the floors transmitted via the citadel protocol.
+ */
+
+SERVER_PRIVATE(UNSIGNED_SHORT(f_flags)); /* flags */
+PROTOCOL_ONLY(INTEGER(id)); /* the floor id. its implicit in its location in the file, but here once more for the protocol. */
+STRING_BUF(f_name, 256); /* our name. */
+INTEGER(f_ref_count); /* how many sub elements do we contain? */
+
+SUBSTRUCT(struct ExpirePolicy f_ep); /* Message expiration policy */
+SUBSTRUCT_ELEMENT(INTEGER(f_ep.expire_mode));
+SUBSTRUCT_ELEMENT(INTEGER(f_ep.expire_value));
--- /dev/null
+SERVER_PRIVATE(struct march *next);
+STRING_BUF(march_name, ROOMNAMELEN);
+UNSIGNED_INT(march_flags); /// todo: this was unsigned int; is this the same as uint?
+CHAR(march_floor);
+CHAR(march_order);
+UNSIGNED_INT(march_flags2);
+INTEGER(march_access);
--- /dev/null
+/*
+ * Room records.
+ */
+
+STRING_BUF(QRname,ROOMNAMELEN); /* Name of room */
+STRING_BUF(QRpasswd,10); /* Only valid if it's a private rm */
+LONG(QRroomaide); /* User number of room aide */
+LONG(QRhighest); /* Highest message NUMBER in room */
+TIME(QRgen); /* Generation number of room */
+UNSIGNED(QRflags); /* See flag values below */
+STRING_BUF(QRdirname,15); /* Directory name, if applicable */
+LONG(QRinfo); /* Info file update relative to msgs*/
+CHAR(QRfloor); /* Which floor this room is on */
+TIME(QRmtime); /* Date/time of last post */
+SUBSTRUCT(struct ExpirePolicy QRep); /* Message expiration policy */
+SUBSTRUCT_ELEMENT(INTEGER(QRep.expire_mode));
+SUBSTRUCT_ELEMENT(INTEGER(QRep.expire_value));
+LONG(QRnumber); /* Globally unique room number */
+CHAR(QRorder); /* Sort key for room listing order */
+UNSIGNED(QRflags2); /* Additional flags */
+INTEGER(QRdefaultview); /* How to display the contents */
--- /dev/null
+/* User record */
+
+INTEGER(version); /* Cit vers. which created this rec */
+UID_T(uid); /* Associate with a unix account? */
+STRING_BUF(password,32); /* password (for Citadel-only users)*/
+UNSIGNED(flags); /* See US_ flags below TODO: is this really the same? */
+LONG(timescalled); /* Total number of logins */
+LONG(posted); /* Number of messages posted (ever) */
+UINT8(axlevel); /* Access level */
+LONG(usernum); /* User number (never recycled) */
+TIME(lastcall); /* Last time the user called */
+INTEGER(USuserpurge); /* Purge time (in days) for user */
+STRING_BUF(fullname,64); /* Name for Citadel messages & mail */
+UINT8(USscreenwidth); /* Screen width (for textmode users)*/
+UINT8(USscreenheight); /* Screen height(for textmode users)*/
--- /dev/null
+
+
+/**
+ * this file contains the defines that convert our x-macros to datatypes
+ */
+
+#define PROTOCOL_ONLY(a) a
+#define SERVER_PRIVATE(a)
+
+#define UNSIGNED_SHORT(a) $data[a] = array_unshift($inarray)
+#define INTEGER(a) $data[a] = array_unshift($inarray)
+
+#define STRING_BUF(a, b) $data[a] = array_unshift($inarray)
+#define STRING(a) $data[a] = array_unshift($inarray)
+
--- /dev/null
+
+
+/**
+ * this file contains the defines that convert our x-macros to datatypes
+ */
+
+#undef SUBSTRUCT
+#undef SUBSTRUCT_ELEMENT
+#undef CFG_VALUE
+#undef PROTOCOL_ONLY
+#undef SERVER_PRIVATE
+#undef NO_ARTV
+
+#undef UNSIGNED
+#undef UNSIGNED_INT
+#undef LONG
+#undef INTEGER
+#undef UINT8
+#undef UNSIGNED_SHORT
+#undef CHAR
+
+#undef TIME
+#undef UID_T
+
+
+#undef STRING_BUF
+#undef STRING
+
+
+
char artv_tempfilename2[PATH_MAX];
FILE *artv_global_message_list;
-void artv_export_users_backend(struct ctdluser *usbuf, void *data) {
+void artv_export_users_backend(struct ctdluser *buf, void *data) {
cprintf("user\n");
- cprintf("%d\n", usbuf->version);
- cprintf("%ld\n", (long)usbuf->uid);
- cprintf("%s\n", usbuf->password);
- cprintf("%u\n", usbuf->flags);
- cprintf("%ld\n", usbuf->timescalled);
- cprintf("%ld\n", usbuf->posted);
- cprintf("%d\n", usbuf->axlevel);
- cprintf("%ld\n", usbuf->usernum);
- cprintf("%ld\n", (long)usbuf->lastcall);
- cprintf("%d\n", usbuf->USuserpurge);
- cprintf("%s\n", usbuf->fullname);
- cprintf("%d\n", usbuf->USscreenwidth);
- cprintf("%d\n", usbuf->USscreenheight);
+/*
+#include "artv_serialize.h"
+#include "dtds/user-defs.h"
+#include "undef_data.h"
+*/
+ cprintf("%d\n", buf->version);
+ cprintf("%ld\n", (long)buf->uid);
+ cprintf("%s\n", buf->password);
+ cprintf("%u\n", buf->flags);
+ cprintf("%ld\n", buf->timescalled);
+ cprintf("%ld\n", buf->posted);
+ cprintf("%d\n", buf->axlevel);
+ cprintf("%ld\n", buf->usernum);
+ cprintf("%ld\n", (long)buf->lastcall);
+ cprintf("%d\n", buf->USuserpurge);
+ cprintf("%s\n", buf->fullname);
+ cprintf("%d\n", buf->USscreenwidth);
+ cprintf("%d\n", buf->USscreenheight);
}
}
-void artv_export_rooms_backend(struct ctdlroom *qrbuf, void *data) {
+void artv_export_rooms_backend(struct ctdlroom *buf, void *data) {
cprintf("room\n");
- cprintf("%s\n", qrbuf->QRname);
- cprintf("%s\n", qrbuf->QRpasswd);
- cprintf("%ld\n", qrbuf->QRroomaide);
- cprintf("%ld\n", qrbuf->QRhighest);
- cprintf("%ld\n", (long)qrbuf->QRgen);
- cprintf("%u\n", qrbuf->QRflags);
- cprintf("%s\n", qrbuf->QRdirname);
- cprintf("%ld\n", qrbuf->QRinfo);
- cprintf("%d\n", qrbuf->QRfloor);
- cprintf("%ld\n", (long)qrbuf->QRmtime);
- cprintf("%d\n", qrbuf->QRep.expire_mode);
- cprintf("%d\n", qrbuf->QRep.expire_value);
- cprintf("%ld\n", qrbuf->QRnumber);
- cprintf("%d\n", qrbuf->QRorder);
- cprintf("%u\n", qrbuf->QRflags2);
- cprintf("%d\n", qrbuf->QRdefaultview);
-
- getroom(&CC->room, qrbuf->QRname);
+/*
+#include "artv_serialize.h"
+#include "dtds/room-defs.h"
+#include "undef_data.h"
+*/
+ cprintf("%s\n", buf->QRname);
+ cprintf("%s\n", buf->QRpasswd);
+ cprintf("%ld\n", buf->QRroomaide);
+ cprintf("%ld\n", buf->QRhighest);
+ cprintf("%ld\n", (long)buf->QRgen);
+ cprintf("%u\n", buf->QRflags);
+ cprintf("%s\n", buf->QRdirname);
+ cprintf("%ld\n", buf->QRinfo);
+ cprintf("%d\n", buf->QRfloor);
+ cprintf("%ld\n", (long)buf->QRmtime);
+ cprintf("%d\n", buf->QRep.expire_mode);
+ cprintf("%d\n", buf->QRep.expire_value);
+ cprintf("%ld\n", buf->QRnumber);
+ cprintf("%d\n", buf->QRorder);
+ cprintf("%u\n", buf->QRflags2);
+ cprintf("%d\n", buf->QRdefaultview);
+
+ getroom(&CC->room, buf->QRname);
+ /* format of message list export is all message numbers output
+ * one per line terminated by a 0.
+ */
+//*/
+ getroom(&CC->room, buf->QRname);
/* format of message list export is all message numbers output
* one per line terminated by a 0.
*/
void artv_export_floors(void) {
- struct floor flbuf;
+ struct floor qfbuf, *buf;
int i;
for (i=0; i < MAXFLOORS; ++i) {
cprintf("floor\n");
cprintf("%d\n", i);
- getfloor(&flbuf, i);
- cprintf("%u\n", flbuf.f_flags);
- cprintf("%s\n", flbuf.f_name);
- cprintf("%d\n", flbuf.f_ref_count);
- cprintf("%d\n", flbuf.f_ep.expire_mode);
- cprintf("%d\n", flbuf.f_ep.expire_value);
+ getfloor(&qfbuf, i);
+ buf = &qfbuf;
+/*
+#include "artv_serialize.h"
+#include "dtds/floor-defs.h"
+#include "undef_data.h"
+/*/
+ cprintf("%u\n", buf->f_flags);
+ cprintf("%s\n", buf->f_name);
+ cprintf("%d\n", buf->f_ref_count);
+ cprintf("%d\n", buf->f_ep.expire_mode);
+ cprintf("%d\n", buf->f_ep.expire_value);
+//*/
}
}
/* write it in base64 */
CtdlMakeTempFileName(tempfile, sizeof tempfile);
- snprintf(buf, sizeof buf, "./base64 -e >%s", tempfile);
+ snprintf(buf, sizeof buf, "%sbase64 -e >%s", ctdl_sbin_dir, tempfile);
fp = popen(buf, "w");
fwrite(smr.ser, smr.len, 1, fp);
pclose(fp);
void artv_do_export(void) {
+ struct config *buf;
+ buf = &config;
cprintf("%d Exporting all Citadel databases.\n", LISTING_FOLLOWS);
cprintf("version\n%d\n", REV_LEVEL);
/* export the config file */
cprintf("config\n");
+
+#include "artv_serialize.h"
+#include "dtds/config-defs.h"
+#include "undef_data.h"
+
+/*
cprintf("%s\n", config.c_nodename);
cprintf("%s\n", config.c_fqdn);
cprintf("%s\n", config.c_humannode);
cprintf("%s\n", config.c_funambol_source);
cprintf("%s\n", config.c_funambol_auth);
cprintf("%d\n", config.c_rbl_at_greeting);
-
+*/
/* Export the control file */
get_control();
cprintf("control\n");
void artv_import_config(void) {
- char buf[SIZ];
+ char cbuf[SIZ];
+ struct config *buf;
+ buf = &config;
lprintf(CTDL_DEBUG, "Importing config file\n");
+
+#include "artv_deserialize.h"
+#include "dtds/config-defs.h"
+#include "undef_data.h"
+
+/*
client_getln(config.c_nodename, sizeof config.c_nodename);
client_getln(config.c_fqdn, sizeof config.c_fqdn);
client_getln(config.c_humannode, sizeof config.c_humannode);
client_getln(config.c_funambol_source, sizeof config.c_funambol_source);
client_getln(config.c_funambol_auth, sizeof config.c_funambol_auth);
client_getln(buf, sizeof buf); config.c_rbl_at_greeting = atoi(buf);
-
+*/
config.c_enable_fulltext = 0; /* always disable */
put_config();
lprintf(CTDL_INFO, "Imported config file\n");
void artv_import_user(void) {
- char buf[SIZ];
- struct ctdluser usbuf;
-
- client_getln(buf, sizeof buf); usbuf.version = atoi(buf);
- client_getln(buf, sizeof buf); usbuf.uid = atoi(buf);
- client_getln(usbuf.password, sizeof usbuf.password);
- client_getln(buf, sizeof buf); usbuf.flags = atoi(buf);
- client_getln(buf, sizeof buf); usbuf.timescalled = atol(buf);
- client_getln(buf, sizeof buf); usbuf.posted = atol(buf);
- client_getln(buf, sizeof buf); usbuf.axlevel = atoi(buf);
- client_getln(buf, sizeof buf); usbuf.usernum = atol(buf);
- client_getln(buf, sizeof buf); usbuf.lastcall = atol(buf);
- client_getln(buf, sizeof buf); usbuf.USuserpurge = atoi(buf);
- client_getln(usbuf.fullname, sizeof usbuf.fullname);
- client_getln(buf, sizeof buf); usbuf.USscreenwidth = atoi(buf);
- client_getln(buf, sizeof buf); usbuf.USscreenheight = atoi(buf);
- putuser(&usbuf);
+ char cbuf[SIZ];
+ struct ctdluser usbuf, *buf;
+ buf = &usbuf;
+/*
+#include "artv_deserialize.h"
+#include "dtds/user-defs.h"
+#include "undef_data.h"
+
+/*/
+ client_getln(cbuf, sizeof cbuf); buf->version = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->uid = atoi(cbuf);
+ client_getln(buf->password, sizeof buf->password);
+ client_getln(cbuf, sizeof cbuf); buf->flags = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->timescalled = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->posted = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->axlevel = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->usernum = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->lastcall = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->USuserpurge = atoi(cbuf);
+ client_getln(buf->fullname, sizeof buf->fullname);
+ client_getln(cbuf, sizeof cbuf); buf->USscreenwidth = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->USscreenheight = atoi(cbuf);
+//*/
+ putuser(buf);
}
void artv_import_room(void) {
- char buf[SIZ];
- struct ctdlroom qrbuf;
+ char cbuf[SIZ];
+ struct ctdlroom qrbuf, *buf;
long msgnum;
int msgcount = 0;
- client_getln(qrbuf.QRname, sizeof qrbuf.QRname);
- client_getln(qrbuf.QRpasswd, sizeof qrbuf.QRpasswd);
- client_getln(buf, sizeof buf); qrbuf.QRroomaide = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRhighest = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRgen = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRflags = atoi(buf);
- client_getln(qrbuf.QRdirname, sizeof qrbuf.QRdirname);
- client_getln(buf, sizeof buf); qrbuf.QRinfo = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRfloor = atoi(buf);
- client_getln(buf, sizeof buf); qrbuf.QRmtime = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRep.expire_mode = atoi(buf);
- client_getln(buf, sizeof buf); qrbuf.QRep.expire_value = atoi(buf);
- client_getln(buf, sizeof buf); qrbuf.QRnumber = atol(buf);
- client_getln(buf, sizeof buf); qrbuf.QRorder = atoi(buf);
- client_getln(buf, sizeof buf); qrbuf.QRflags2 = atoi(buf);
- client_getln(buf, sizeof buf); qrbuf.QRdefaultview = atoi(buf);
- putroom(&qrbuf);
+ buf = &qrbuf;
+/*
+#include "artv_deserialize.h"
+#include "dtds/room-defs.h"
+#include "undef_data.h"
+
+/*/
+ client_getln(buf->QRname, sizeof buf->QRname);
+ client_getln(buf->QRpasswd, sizeof buf->QRpasswd);
+ client_getln(cbuf, sizeof cbuf); buf->QRroomaide = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRhighest = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRgen = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRflags = atoi(cbuf);
+ client_getln(buf->QRdirname, sizeof buf->QRdirname);
+ client_getln(cbuf, sizeof cbuf); buf->QRinfo = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRfloor = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRmtime = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRep.expire_mode = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRep.expire_value = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRnumber = atol(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRorder = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRflags2 = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->QRdefaultview = atoi(cbuf);
+//*/
+ putroom(buf);
lprintf(CTDL_INFO, "Imported room <%s>\n", qrbuf.QRname);
/* format of message list export is all message numbers output
* one per line terminated by a 0.
*/
- while (client_getln(buf, sizeof buf), msgnum = atol(buf), msgnum > 0) {
+ while (client_getln(cbuf, sizeof cbuf), msgnum = atol(cbuf), msgnum > 0) {
CtdlSaveMsgPointerInRoom(qrbuf.QRname, msgnum, 0, NULL);
++msgcount;
}
void artv_import_floor(void) {
- struct floor flbuf;
+ struct floor flbuf, *buf;
int i;
- char buf[SIZ];
+ char cbuf[SIZ];
- client_getln(buf, sizeof buf); i = atoi(buf);
- client_getln(buf, sizeof buf); flbuf.f_flags = atoi(buf);
- client_getln(flbuf.f_name, sizeof flbuf.f_name);
- client_getln(buf, sizeof buf); flbuf.f_ref_count = atoi(buf);
- client_getln(buf, sizeof buf); flbuf.f_ep.expire_mode = atoi(buf);
- client_getln(buf, sizeof buf); flbuf.f_ep.expire_value = atoi(buf);
- putfloor(&flbuf, i);
+ buf = & flbuf;
+ memset(buf, 0, sizeof(buf));
+ client_getln(cbuf, sizeof cbuf); i = atoi(cbuf);
+/*
+#include "artv_deserialize.h"
+#include "dtds/floor-defs.h"
+#include "undef_data.h"
+/*/
+ client_getln(cbuf, sizeof cbuf); buf->f_flags = atoi(cbuf);
+ client_getln(buf->f_name, sizeof buf->f_name);
+ client_getln(cbuf, sizeof cbuf); buf->f_ref_count = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->f_ep.expire_mode = atoi(cbuf);
+ client_getln(cbuf, sizeof cbuf); buf->f_ep.expire_value = atoi(cbuf);
+//*/
+ putfloor(buf, i);
lprintf(CTDL_INFO, "Imported floor #%d (%s)\n", i, flbuf.f_name);
}
/* decode base64 message text */
CtdlMakeTempFileName(tempfile, sizeof tempfile);
- snprintf(buf, sizeof buf, "./base64 -d >%s", tempfile);
+ snprintf(buf, sizeof buf, "%sbase64 -d >%s", ctdl_sbin_dir, tempfile);
fp = popen(buf, "w");
while (client_getln(buf, sizeof buf), strcasecmp(buf, END_OF_MESSAGE)) {
fprintf(fp, "%s\n", buf);