1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
/*
Copyright 2014 VirusTotal S.L. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef VT_FILE_DIST
#define VT_FILE_DIST 1
#ifdef __cplusplus
extern "C" {
#endif
struct VtResponse;
struct VtFileDist;
typedef void (*VtFileDistCb)(const char *url, unsigned long long timestamp,
const char *sha256hash, const char *name, json_t *raw_json, void *data);
/**
* @ingroup VtApiPage
* @defgroup VtFileDist VtFileDist File Distribution service. Requires private-API with permissions
* @{
*/
struct VtFileDist* VtFileDist_new(void);
/**
* @brief Get a reference counter
*
* @param obj FileDist object
* @return void
*/
void VtFileDist_get(struct VtFileDist *obj);
/**
* @brief Put a reference counter
*
* @param obj ...
* @return void
*/
void VtFileDist_put(struct VtFileDist **obj);
/**
* @brief Set the API key
*
* @param vt_dist FileDist object
* @param api_key api key
* @return void
*/
void VtFileDist_setApiKey(struct VtFileDist *vt_dist, const char *api_key);
/**
* @brief Set the reports flag. If set true, reports returned
*
* @param vt_dist FileDist object
* @param value true to enable. false to disable
* @return void
*/
void VtFileDist_setReports(struct VtFileDist *vt_dist, bool value);
/**
* @brief Set the after time. To recieve reports after X time. used to page over results
*
* @param vt_dist VtFileDist object
* @param value unixtime
* @return void
*/
void VtFileDist_setAfter(struct VtFileDist *vt_dist, unsigned long long value);
/**
* @brief Set the before time parameter.
*
* @param vt_dist VtFileDist object
* @param value unixtime
* @return void
*/
void VtFileDist_setBefore(struct VtFileDist *vt_dist, unsigned long long value);
/**
* @brief Set max limit of results to return
*
* @param vt_dist VtFileDist
* @param value 1 to 1000 results
* @return void
*/
void VtFileDist_setLimit(struct VtFileDist *vt_dist, int value);
/**
* @brief Get response object
*
* @param vt_dist VtFileDist object
* @return VtResponse*
*/
struct VtResponse * VtFileDist_getResponse(struct VtFileDist *vt_dist);
/**
* @brief Get the distrubution feed. Then parse the results with VtFileDist_getResponse
*
* @param vt_dist VtFileDist object
* @return int
*/
int VtFileDist_getDistribution(struct VtFileDist *vt_dist);
/**
* @brief Process file distribution. Internally calls VtFileDist_getDistribution
*
* @param vt_dist VtFileDist object
* @param VtFileDistCb callback function, called on every result
* @param user_data user data passed to callback function
* @return int 0 for OK, or error code
*/
int VtFileDist_process(struct VtFileDist* vt_dist, VtFileDistCb, void *user_data);
/**
* @}
*/
#ifdef __cplusplus
}
#endif /*cplusplus*/
#endif
|