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_CONN_START 42 22#define FCE_CONN_BROKEN 99 23 24#define FCE_FIRST_EVENT FCE_FILE_MODIFY /* keep in sync with last file event above */ 25#define FCE_LAST_EVENT FCE_DIR_CREATE /* keep in sync with last file event above */ 26 27/* fce_packet.fce_magic */ 28#define FCE_PACKET_MAGIC "at_fcapi" 29 30/* This packet goes over the network, so we want to 31 * be shure about datastructs and type sizes between platforms. 32 * Format is network byte order. 33 */ 34#define FCE_PACKET_HEADER_SIZE 8+1+1+4+2 35 36struct 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 46typedef uint32_t fce_ev_t; 47typedef enum { fce_file, fce_dir } fce_obj_t; 48 49struct path; 50struct ofork; 51 52void fce_pending_events(AFPObj *obj); 53int fce_register(fce_ev_t event, const char *path, const char *oldpath, fce_obj_t type); 54int fce_add_udp_socket(const char *target ); // IP or IP:Port 55int fce_set_coalesce(const char *coalesce_opt ); // all|delete|create 56int fce_set_events(const char *events); /* fmod,fdel,ddel,fcre,dcre */ 57 58#define FCE_DEFAULT_PORT 12250 59#define FCE_DEFAULT_PORT_STRING "12250" 60 61#endif /* _FCE_API_H */ 62 63