+#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 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 calling delete_file() */
+#define DEL_NO_RECURSE (1<<1)
+#define DEL_FORCE_RECURSE (1<<2) /* recurse even w/o --force */
+#define DEL_TERSE (1<<3)
+
+/* For use by the itemize_changes code */
+#define ITEM_TRANSFER (1<<0)
+#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_IS_NEW (1<<7)
+#define ITEM_USING_ALT_BASIS (1<<8)
+#define ITEM_HARD_LINKED (1<<9)
+#define ITEM_LOCAL_CHANGE (1<<10)
+#define ITEM_REPORT_XATTRS (1<<11)
+/* 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_TRANSFER | ITEM_REPORT_CHECKSUM \
+ | ITEM_REPORT_SIZE | ITEM_REPORT_TIME | ITEM_REPORT_PERMS \
+ | ITEM_REPORT_OWNER | ITEM_REPORT_GROUP | ITEM_IS_NEW)
+
+
+/* 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 */
+};