+
+#define NO_FILTERS 0
+#define SERVER_FILTERS 1
+#define ALL_FILTERS 2
+
+#define XFLG_FATAL_ERRORS (1<<0)
+#define XFLG_OLD_PREFIXES (1<<1)
+#define XFLG_ANCHORED2ABS (1<<2)
+#define XFLG_ABS_IF_SLASH (1<<3)
+
+#define PERMS_REPORT (1<<0)
+#define PERMS_SKIP_MTIME (1<<1)
+
+#define FULL_FLUSH 1
+#define NORMAL_FLUSH 0
+
+#define PDIR_CREATE 1
+#define PDIR_DELETE 0
+
+/* Note: 0x00 - 0x7F are used for basis_dir[] indexes! */
+#define FNAMECMP_BASIS_DIR_LOW 0x00 /* Must remain 0! */
+#define FNAMECMP_BASIS_DIR_HIGH 0x7F
+#define FNAMECMP_FNAME 0x80
+#define FNAMECMP_PARTIAL_DIR 0x81
+#define FNAMECMP_BACKUP 0x82
+#define FNAMECMP_FUZZY 0x83
+
+/* For use by the itemize_changes code */
+#define ITEM_REPORT_CHECKSUM (1<<1)
+#define ITEM_REPORT_SIZE (1<<2)
+#define ITEM_REPORT_TIME (1<<3)
+#define ITEM_REPORT_PERMS (1<<4)
+#define ITEM_REPORT_OWNER (1<<5)
+#define ITEM_REPORT_GROUP (1<<6)
+#define ITEM_REPORT_XATTRS (1<<7)
+#define ITEM_BASIS_TYPE_FOLLOWS (1<<11)
+#define ITEM_XNAME_FOLLOWS (1<<12)
+#define ITEM_IS_NEW (1<<13)
+#define ITEM_LOCAL_CHANGE (1<<14)
+#define ITEM_TRANSFER (1<<15)
+/* These are outside the range of the transmitted flags. */
+#define ITEM_NO_DEST_AND_NO_UPDATE (1<<16) /* used by itemize() */
+#define ITEM_MISSING_DATA (1<<16) /* used by log_formatted() */
+#define ITEM_DELETED (1<<17) /* used by log_formatted() */
+
+#define SIGNIFICANT_ITEM_FLAGS (~(\
+ ITEM_BASIS_TYPE_FOLLOWS | ITEM_XNAME_FOLLOWS | ITEM_LOCAL_CHANGE))
+
+
+/* Log-message categories. FLOG and FCLIENT are only used on the daemon
+ * side for custom logging -- they don't get sent over the socket. */
+enum logcode { FERROR=1, FINFO=2, FLOG=3, FCLIENT=4 };
+
+/* Messages types that are sent over the message channel. The logcode
+ * values must all be present here with identical numbers. */
+enum msgcode {
+ MSG_DATA=0, /* raw data on the multiplexed stream */
+ MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
+ MSG_LOG=FLOG, MSG_FCLIENT=FCLIENT, /* sibling logging */
+ MSG_REDO=9, /* reprocess indicated flist index */
+ MSG_SUCCESS=100,/* successfully updated indicated flist index */
+ MSG_DELETED=101,/* successfully deleted a file on receiving side */
+ MSG_DONE=86 /* current phase is done */
+};