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