]> arthur.barton.de Git - netatalk.git/blob - include/atalk/fce_api.h
Add FCE type names and adjust logtypes to new fce facility
[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 #define FCE_FIRST_EVENT     FCE_FILE_MODIFY /* keep in sync with last file event above */
26 #define FCE_LAST_EVENT      FCE_TM_SIZE     /* keep in sync with last file event above */
27
28 /* fce_packet.fce_magic */
29 #define FCE_PACKET_MAGIC  "at_fcapi"
30
31 /* This packet goes over the network, so we want to
32  * be shure about datastructs and type sizes between platforms.
33  * Format is network byte order.
34  */
35 #define FCE_PACKET_HEADER_SIZE 8+1+1+4+2
36 struct fce_packet
37 {
38     char magic[8];
39     unsigned char version;
40     unsigned char mode;
41     uint32_t event_id;
42     uint16_t datalen;
43     char data[MAXPATHLEN];
44 };
45
46 struct path;
47 struct ofork;
48
49 void fce_pending_events(AFPObj *obj);
50
51 int fce_register_delete_file( struct path *path );
52 int fce_register_delete_dir( char *name );
53 int fce_register_new_dir( struct path *path );
54 int fce_register_new_file( struct path *path );
55 int fce_register_file_modification( struct ofork *ofork );
56 int fce_register_tm_size(const char *vol, size_t used);
57
58 int fce_add_udp_socket(const char *target );  // IP or IP:Port
59 int fce_set_coalesce(const char *coalesce_opt ); // all|delete|create
60 int fce_set_events(const char *events);     /* fmod,fdel,ddel,fcre,dcre,tmsz (default is all except tmsz) */
61
62 #define FCE_DEFAULT_PORT 12250
63 #define FCE_DEFAULT_PORT_STRING "12250"
64
65 #endif  /* _FCE_API_H */
66