5 * Created on 1. Oktober 2010, 21:35
7 * API calls for file change event api
13 #include <atalk/globals.h>
15 #define FCE_PACKET_VERSION 2
18 #define FCE_FILE_MODIFY 1
19 #define FCE_FILE_DELETE 2
20 #define FCE_DIR_DELETE 3
21 #define FCE_FILE_CREATE 4
22 #define FCE_DIR_CREATE 5
23 #define FCE_FILE_MOVE 6
24 #define FCE_DIR_MOVE 7
27 #define FCE_CONN_START 42
28 #define FCE_CONN_BROKEN 99
30 #define FCE_FIRST_EVENT FCE_FILE_MODIFY /* keep in sync with last file event above */
31 #define FCE_LAST_EVENT FCE_DIR_CREATE /* keep in sync with last file event above */
33 /* fce_packet.fce_magic */
34 #define FCE_PACKET_MAGIC "at_fcapi"
36 /* flags for "fce_ev_info" of additional info to send in events */
37 #define FCE_EV_INFO_PID (1 << 0)
38 #define FCE_EV_INFO_USER (1 << 1)
39 #define FCE_EV_INFO_SRCPATH (1 << 2)
42 * Network payload of an FCE packet, version 1
45 * +---------+---------+---------+---------+---------+---------+----------+----------+
47 * +---------+---------+---------+---------+---------+---------+----------+----------+
51 * +---------+-----------------------------+
53 * +-------------------+-------------------+ . . . .
55 * +-------------------+------ . . . . . . . . . . .
58 * Network payload of an FCE packet, version 2
61 * +---------+---------+---------+---------+---------+---------+----------+----------+
63 * +---------+---------+---------+---------+---------+---------+----------+----------+
71 * +---------+---------+---------+---------+---------+---------+----------+----------+
73 * +---------+---------+---------+---------+---------+---------+----------+----------+
75 * +---------+---------+---------+---------+
77 * +---------+---------+---------+---------+---------+---------+----------+----------+
79 * +---------+---------+---------+---------+---------+---------+----------+----------+
82 * +-------------------+---------- . . . .
83 * | username length | username
84 * +-------------------+---------- . . . .
86 * +-------------------+------ . . . . . .
88 * +-------------------+------ . . . . . .
90 * +-------------------+------------- . . .
91 * | pathlen | source path
92 * +-------------------+------------- . . .
98 * 2: source path present
100 * username = optional username
101 * source path = optional source path
106 unsigned char fcep_version;
107 unsigned char fcep_options;
108 unsigned char fcep_event;
109 uint32_t fcep_event_id;
111 uint16_t fcep_userlen;
112 char fcep_user[MAXPATHLEN];
113 uint16_t fcep_pathlen1;
114 char fcep_path1[MAXPATHLEN];
115 uint16_t fcep_pathlen2;
116 char fcep_path2[MAXPATHLEN];
119 typedef uint32_t fce_ev_t;
124 void fce_pending_events(const AFPObj *obj);
125 int fce_register(const AFPObj *obj, fce_ev_t event, const char *path, const char *oldpath);
126 int fce_add_udp_socket(const char *target ); // IP or IP:Port
127 int fce_set_coalesce(const char *coalesce_opt ); // all|delete|create
128 int fce_set_events(const char *events); /* fmod,fdel,ddel,fcre,dcre */
130 #define FCE_DEFAULT_PORT 12250
131 #define FCE_DEFAULT_PORT_STRING "12250"
133 #endif /* _FCE_API_H */