]> arthur.barton.de Git - netatalk.git/blob - include/atalk/fce_api.h
Add a configurable hold time option to FCE file modification event generation, defaul...
[netatalk.git] / include / atalk / fce_api.h
1 /* 
2  * File:   fce_api.h
3  * Author: mw
4  *
5  * Created on 1. Oktober 2010, 21:35
6  *
7  * API calls for file change event api
8  */
9
10 #ifndef _FCE_API_H
11 #define _FCE_API_H
12
13 #include <atalk/globals.h>
14
15 /* fce_packet.mode */
16 #define FCE_FILE_MODIFY     1
17 #define FCE_FILE_DELETE     2
18 #define FCE_DIR_DELETE      3
19 #define FCE_FILE_CREATE     4
20 #define FCE_DIR_CREATE      5
21 #define FCE_TM_SIZE         6
22 #define FCE_CONN_START     42
23 #define FCE_CONN_BROKEN    99
24
25
26 /* fce_packet.fce_magic */
27 #define FCE_PACKET_MAGIC  "at_fcapi"
28
29 /* This packet goes over the network, so we want to
30  * be shure about datastructs and type sizes between platforms.
31  * Format is network byte order.
32  */
33 #define FCE_PACKET_HEADER_SIZE 8+1+1+4+2
34 struct fce_packet
35 {
36     char magic[8];
37     unsigned char version;
38     unsigned char mode;
39     uint32_t event_id;
40     uint16_t datalen;
41     char data[MAXPATHLEN];
42 };
43
44 struct path;
45 struct ofork;
46
47 void fce_pending_events(AFPObj *obj);
48
49 int fce_register_delete_file( struct path *path );
50 int fce_register_delete_dir( char *name );
51 int fce_register_new_dir( struct path *path );
52 int fce_register_new_file( struct path *path );
53 int fce_register_file_modification( struct ofork *ofork );
54 int fce_register_tm_size(const char *vol, size_t used);
55
56 int fce_add_udp_socket(const char *target );  // IP or IP:Port
57 int fce_set_coalesce( char *coalesce_opt ); // all|delete|create
58 int fce_set_events(const char *events);     /* fmod,fdel,ddel,fcre,dcre,tmsz (default is all except tmsz) */
59
60 #define FCE_DEFAULT_PORT 12250
61 #define FCE_DEFAULT_PORT_STRING "12250"
62
63 #endif  /* _FCE_API_H */
64