41
41
* Toggle tracking URIs.
43
* @param onOff YES to enable tracking, NO to disable
43
* @param onOff GNUNET_YES to enable tracking, GNUNET_NO to disable
44
44
* disabling tracking
46
void URITRACK_trackURIS (struct GE_Context *ectx, struct GC_Configuration *cfg, int onOff); /* file_info.c */
46
void GNUNET_URITRACK_toggle_tracking (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, int onOff); /* file_info.c */
49
49
* Deletes all entries in the URITRACK tracking cache.
51
void URITRACK_clearTrackedURIS (struct GE_Context *ectx, struct GC_Configuration *cfg); /* file_info.c */
51
void GNUNET_URITRACK_clear (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg); /* file_info.c */
54
54
* Get the URITRACK URI tracking status.
56
* @return YES of tracking is enabled, NO if not
56
* @return GNUNET_YES of tracking is enabled, GNUNET_NO if not
58
int URITRACK_trackStatus (struct GE_Context *ectx, struct GC_Configuration *cfg); /* file_info.c */
58
int GNUNET_URITRACK_get_tracking_status (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg); /* file_info.c */
61
61
* Makes a URI available for directory building. This function is
62
62
* automatically called by all URITRACK functions and only in the
63
63
* interface for clients that call ECRS directly.
65
void URITRACK_trackURI (struct GE_Context *ectx, struct GC_Configuration *cfg, const ECRS_FileInfo * fi); /* file_info.c */
65
void GNUNET_URITRACK_track (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, const GNUNET_ECRS_FileInfo * fi); /* file_info.c */
70
* @param need_metadata YES if metadata should be
71
* provided, NO if metadata is not needed (faster)
70
* @param need_metadata GNUNET_YES if metadata should be
71
* provided, GNUNET_NO if metadata is not needed (faster)
73
int URITRACK_listURIs (struct GE_Context *ectx, struct GC_Configuration *cfg, int need_metadata, ECRS_SearchProgressCallback iterator, void *closure); /* file_info.c */
73
int GNUNET_URITRACK_list (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, int need_metadata, GNUNET_ECRS_SearchResultProcessor iterator, void *closure); /* file_info.c */
76
76
* Register a handler that is called whenever
78
78
* the database, the callback will be called
79
79
* for all existing URIs as well.
81
int URITRACK_registerTrackCallback (struct GE_Context *ectx, struct GC_Configuration *cfg, ECRS_SearchProgressCallback iterator, void *closure); /* callbacks.c */
81
int GNUNET_URITRACK_register_track_callback (struct GNUNET_GE_Context *ectx, struct GNUNET_GC_Configuration *cfg, GNUNET_ECRS_SearchResultProcessor iterator, void *closure); /* callbacks.c */
84
84
* Unregister a URI callback.
86
int URITRACK_unregisterTrackCallback (ECRS_SearchProgressCallback iterator, void *closure); /* callbacks.c */
86
int GNUNET_URITRACK_unregister_track_callback (GNUNET_ECRS_SearchResultProcessor iterator, void *closure); /* callbacks.c */
89
89
* Possible ways in which a given URI has been used or encountered.
90
90
* Note that we only have 8-bits when storing this on the disk,
91
91
* so do not add additional entries (without changing uri_info).
93
enum GNUNET_URITRACK_STATE
96
URITRACK_INSERTED = 1,
98
URITRACK_DIRECTORY_ADDED = 4,
99
URITRACK_DOWNLOAD_STARTED = 8,
100
URITRACK_DOWNLOAD_ABORTED = 16,
101
URITRACK_DOWNLOAD_COMPLETED = 32,
102
URITRACK_SEARCH_RESULT = 64,
103
URITRACK_DIRECTORY_FOUND = 128,
95
GNUNET_URITRACK_FRESH = 0,
96
GNUNET_URITRACK_INSERTED = 1,
97
GNUNET_URITRACK_INDEXED = 2,
98
GNUNET_URITRACK_DIRECTORY_ADDED = 4,
99
GNUNET_URITRACK_DOWNLOAD_STARTED = 8,
100
GNUNET_URITRACK_DOWNLOAD_ABORTED = 16,
101
GNUNET_URITRACK_DOWNLOAD_COMPLETED = 32,
102
GNUNET_URITRACK_SEARCH_RESULT = 64,
103
GNUNET_URITRACK_DIRECTORY_FOUND = 128,
107
107
* Find out what we know about a given URI's past. Note that we only
108
108
* track the states for a (finite) number of URIs and that the
109
109
* information that we give back maybe inaccurate (returning
110
* URITRACK_FRESH if the URI did not fit into our bounded-size map,
110
* GNUNET_URITRACK_FRESH if the URI did not fit into our bounded-size map,
111
111
* even if the URI is not fresh anymore; also, if the URI has a
112
* hash-collision in the map, there is a 1:256 chance that we will
112
* GNUNET_hash-collision in the map, there is a 1:256 chance that we will
113
113
* return information from the wrong URI without detecting it).
116
URITRACK_getState (struct GE_Context *ectx,
117
struct GC_Configuration *cfg, const struct ECRS_URI *uri);
115
enum GNUNET_URITRACK_STATE
116
GNUNET_URITRACK_get_state (struct GNUNET_GE_Context *ectx,
117
struct GNUNET_GC_Configuration *cfg,
118
const struct GNUNET_ECRS_URI *uri);
120
121
* Add additional information about a given URI's past.
122
void URITRACK_addState (struct GE_Context *ectx,
123
struct GC_Configuration *cfg,
124
const struct ECRS_URI *uri,
125
enum URITRACK_STATE state);
123
void GNUNET_URITRACK_add_state (struct GNUNET_GE_Context *ectx,
124
struct GNUNET_GC_Configuration *cfg,
125
const struct GNUNET_ECRS_URI *uri,
126
enum GNUNET_URITRACK_STATE state);
127
128
#if 0 /* keep Emacsens' auto-indent happy */