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 32struct 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 42struct path; 43struct ofork; 44 45int fce_register_delete_file( struct path *path ); 46int fce_register_delete_dir( char *name ); 47int fce_register_new_dir( struct path *path ); 48int fce_register_new_file( struct path *path ); 49int fce_register_file_modification( struct ofork *ofork ); 50int fce_register_tm_size(const char *vol, size_t used); 51 52int fce_add_udp_socket(const char *target ); // IP or IP:Port 53int fce_set_coalesce( char *coalesce_opt ); // all|delete|create 54int 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 61