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 34struct 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 44struct path; 45struct ofork; 46 47void fce_pending_events(AFPObj *obj); 48 49int fce_register_delete_file( struct path *path ); 50int fce_register_delete_dir( char *name ); 51int fce_register_new_dir( struct path *path ); 52int fce_register_new_file( struct path *path ); 53int fce_register_file_modification( struct ofork *ofork ); 54int fce_register_tm_size(const char *vol, size_t used); 55 56int fce_add_udp_socket(const char *target ); // IP or IP:Port 57int fce_set_coalesce( char *coalesce_opt ); // all|delete|create 58int 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 65