diff --git a/build_deb b/build_deb new file mode 100755 index 0000000..9b30b07 --- /dev/null +++ b/build_deb @@ -0,0 +1,5 @@ +#!/bin/sh + +sudo dpkg-buildpackage -uc -us -F +rm -R debian/libvtapi-c/usr/local/lib +sudo make clean diff --git a/debian/.debhelper/generated/libvtapi-c/installed-by-dh_install b/debian/.debhelper/generated/libvtapi-c/installed-by-dh_install new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/libvtapi-c/installed-by-dh_installdocs b/debian/.debhelper/generated/libvtapi-c/installed-by-dh_installdocs new file mode 100644 index 0000000..e69de29 diff --git a/debian/.debhelper/generated/libvtapi-c/triggers b/debian/.debhelper/generated/libvtapi-c/triggers new file mode 100644 index 0000000..fb05319 --- /dev/null +++ b/debian/.debhelper/generated/libvtapi-c/triggers @@ -0,0 +1,2 @@ +# Triggers added by dh_makeshlibs/12.1.1 +activate-noawait ldconfig diff --git a/debian/.debhelper/libvtapi-c/dbgsym-build-ids b/debian/.debhelper/libvtapi-c/dbgsym-build-ids new file mode 100644 index 0000000..781ea56 --- /dev/null +++ b/debian/.debhelper/libvtapi-c/dbgsym-build-ids @@ -0,0 +1 @@ +0ab7728f5eea9ca175900e3e6acb5340ec2141e5 \ No newline at end of file diff --git a/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/control b/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/control new file mode 100644 index 0000000..506b117 --- /dev/null +++ b/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/control @@ -0,0 +1,12 @@ +Package: libvtapi-c-dbgsym +Source: libvtapi-c +Version: 0.1 +Auto-Built-Package: debug-symbols +Architecture: amd64 +Maintainer: Aurora of Earth +Installed-Size: 131 +Depends: libvtapi-c (= 0.1) +Section: debug +Priority: optional +Description: debug symbols for libvtapi-c +Build-Ids: 0ab7728f5eea9ca175900e3e6acb5340ec2141e5 diff --git a/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/md5sums b/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/md5sums new file mode 100644 index 0000000..88caaf0 --- /dev/null +++ b/debian/.debhelper/libvtapi-c/dbgsym-root/DEBIAN/md5sums @@ -0,0 +1 @@ +97f665fbd148389272776f662c88ce66 usr/lib/debug/.build-id/0a/b7728f5eea9ca175900e3e6acb5340ec2141e5.debug diff --git a/debian/.debhelper/libvtapi-c/dbgsym-root/usr/lib/debug/.build-id/0a/b7728f5eea9ca175900e3e6acb5340ec2141e5.debug b/debian/.debhelper/libvtapi-c/dbgsym-root/usr/lib/debug/.build-id/0a/b7728f5eea9ca175900e3e6acb5340ec2141e5.debug new file mode 100644 index 0000000..f10446d Binary files /dev/null and b/debian/.debhelper/libvtapi-c/dbgsym-root/usr/lib/debug/.build-id/0a/b7728f5eea9ca175900e3e6acb5340ec2141e5.debug differ diff --git a/debian/autoreconf.after b/debian/autoreconf.after new file mode 100644 index 0000000..7e08d30 --- /dev/null +++ b/debian/autoreconf.after @@ -0,0 +1,70 @@ +symlink ./README.md +b6f67e405acdcf1fc23705e31d2c5f7a ./configure +280df9506d82ca3e485d1798483a1350 ./examples/Makefile.in +b066cadcd3a1ebe350fd57d3ea0d29d6 ./examples/Makefile.am +767d30e1aee50e470320da904e04277a ./examples/c/ip.c +21b6f83e4e39ef5e1bb7cdd458495ec8 ./examples/c/url_dist.c +325fa4b3e7c138b9e19e34085bd9258d ./examples/c/Makefile.in +fbf92d610ce6176013ff5212ab1096c0 ./examples/c/search.c +2502f94d9d4983a863ffbf00cecd0655 ./examples/c/url.c +57a80bd686324ecd40f7de350cc024a6 ./examples/c/Makefile.am +fb66f98fd4888023e18574174ba52975 ./examples/c/scan.c +e8289a477673dba3eb9a67b50ab7fd00 ./examples/c/comments.c +80f1c6a5e95064d0f14d3962c3e143c4 ./examples/c/file_dist.c +aaa5dfdab7ea35aab16612546b30dec0 ./examples/c/domain_report.c +6d10c42d896822d2090450e7ac8ffd3e ./Makefile.in +2367a4baf61f8a25240ceda86cf6c9e9 ./c-vtapi.pro +d7a6ad533cc5e0da4cc9718aa14d3840 ./NEWS +b4b5d2153cdab7e08ada541aa13fef51 ./Makefile.am +6529939861910a154e883d4085c17c46 ./configure.ac +59e8e846fba4f1dc868ce074cfe2f05f ./.travis.yml +74fea8184339ea97c982b2415ea30134 ./CONTRIBUTORS +5346b18652b13f7b957e2e3ad6e4857d ./lib/Makefile.in +2fea93158c6884f5bac4a43a31f9439a ./lib/VtFile.c +41224a3df3bd742c1fff54992c492a57 ./lib/VtApiPage.h +208e7be393122d10caa4300b53d97347 ./lib/VtFileDist.h +e0270498422f2f898bde4107ee942e1e ./lib/VtUrl.h +2fb8cf1b10fb5a7abee8d1e75fd47d11 ./lib/Makefile.am +89782e64438c7954ebb89117f4166a06 ./lib/VtIpAddr.h +fcf462102ef741399f1b74a558e9e127 ./lib/VtDebug.c +24cbdc66fc586af0ab34294b9f1a8a8e ./lib/VtUrlDist.c +86782da239f166270d0e8211628851e7 ./lib/VtUrl.c +88ab45e6ec6b1f574cde777ff38db1d8 ./lib/VtApiPage.c +078559159bea65a96de9f98efb6f91a7 ./lib/VtIpAddr.c +5cfe5b2e411bdbbd26bcf941abf7f06a ./lib/vtcapi_common.h +217a4fe97149dcfddeed64536eb91f5b ./lib/VtComments.c +ea02cca85e89e1b29c2fc0068bf776c3 ./lib/VtDomain.c +970632bf9e2005d89f06690428e7daa8 ./lib/VtObject.c +8339d607de2c96c0b2992175c66e0dcf ./lib/VtResponse.c +02f445f75bc1ff2ce204480e22d1726a ./lib/lib.pro +3e5249607977db488bd97c14927205a1 ./lib/VtFileDist.c +c2bc02ce3276ae2f4bc3fcd76d61f3aa ./lib/VtObject.h +d6546f011add5ffb21d881375244321c ./lib/VtUrlDist.h +ea1dda8194b071a218d1600730691a92 ./lib/VtFile.h +6af754d16800812bab64eaea1585a07d ./lib/VtResponse.h +76725e7bb0cbec8c9d0d00a3c45c1fde ./lib/VtDomain.h +277e6082091bf29de92b32c4f40ba82c ./lib/VtComments.h +f3189403da6193d752e6913b1c3b64eb ./lib/VtDebug.h +e9006d0869ef8a3e2caa485f8156a541 ./c-vtapi_config.h.in +f2766448e74c24bd1c1c5d12466093ae ./INSTALL +0c3ad9c787227319d64604ad68e4b8f7 ./ChangeLog +d61bde2326f7cc1a9ec5d5e81a4cce87 ./AUTHORS +7159820d07db517b34a696ed875c925e ./build_deb +22aa295bf5320aec7fba6756ff11058a ./m4/lt~obsolete.m4 +fa2891f9060865871cbbaa1c6e2d96f4 ./m4/ltsugar.m4 +7eba0509738b301eeccc0b36744fef97 ./m4/libtool.m4 +db61eba6c2d924f0a36dec1d8f51e7f3 ./m4/ax_prog_doxygen.m4 +064af1799febaa676203302bbf359180 ./m4/ltoptions.m4 +d936fd6b2025c9b5322f826117d7f30c ./m4/ltversion.m4 +1c80be294a94494b833d77b3e4d71f8d ./aminclude.am +bebfa215a0ab8b5620e82c9a9af65b93 ./README +dd34a25e2e3d2879316e387106a0b3f5 ./COPYING +e9006d0869ef8a3e2caa485f8156a541 ./c-vtapi_config.h.in~ +7d7720da1a863779983b4cd0c81c138a ./.gitignore +434395632af19ccca2bb6ffec4288499 ./autom4te.cache/output.0 +84be8abfc356112a1ebcfb4dc6e6c5ca ./autom4te.cache/traces.0 +434395632af19ccca2bb6ffec4288499 ./autom4te.cache/output.1 +cdff3149fde48ef049f0abd624f5bc92 ./autom4te.cache/traces.1 +4d71670e4d848625998e3c1066c87f7a ./autom4te.cache/requests +997241f8f41a247f5687b52725239592 ./aclocal.m4 +bb767e42c6efa2600658e2d48cd59659 ./Doxyfile.in diff --git a/debian/autoreconf.before b/debian/autoreconf.before new file mode 100644 index 0000000..3ea5381 --- /dev/null +++ b/debian/autoreconf.before @@ -0,0 +1,64 @@ +symlink ./README.md +b6f67e405acdcf1fc23705e31d2c5f7a ./configure +280df9506d82ca3e485d1798483a1350 ./examples/Makefile.in +b066cadcd3a1ebe350fd57d3ea0d29d6 ./examples/Makefile.am +767d30e1aee50e470320da904e04277a ./examples/c/ip.c +21b6f83e4e39ef5e1bb7cdd458495ec8 ./examples/c/url_dist.c +325fa4b3e7c138b9e19e34085bd9258d ./examples/c/Makefile.in +fbf92d610ce6176013ff5212ab1096c0 ./examples/c/search.c +2502f94d9d4983a863ffbf00cecd0655 ./examples/c/url.c +57a80bd686324ecd40f7de350cc024a6 ./examples/c/Makefile.am +fb66f98fd4888023e18574174ba52975 ./examples/c/scan.c +e8289a477673dba3eb9a67b50ab7fd00 ./examples/c/comments.c +80f1c6a5e95064d0f14d3962c3e143c4 ./examples/c/file_dist.c +aaa5dfdab7ea35aab16612546b30dec0 ./examples/c/domain_report.c +6d10c42d896822d2090450e7ac8ffd3e ./Makefile.in +2367a4baf61f8a25240ceda86cf6c9e9 ./c-vtapi.pro +d7a6ad533cc5e0da4cc9718aa14d3840 ./NEWS +b4b5d2153cdab7e08ada541aa13fef51 ./Makefile.am +6529939861910a154e883d4085c17c46 ./configure.ac +59e8e846fba4f1dc868ce074cfe2f05f ./.travis.yml +74fea8184339ea97c982b2415ea30134 ./CONTRIBUTORS +5346b18652b13f7b957e2e3ad6e4857d ./lib/Makefile.in +2fea93158c6884f5bac4a43a31f9439a ./lib/VtFile.c +41224a3df3bd742c1fff54992c492a57 ./lib/VtApiPage.h +208e7be393122d10caa4300b53d97347 ./lib/VtFileDist.h +e0270498422f2f898bde4107ee942e1e ./lib/VtUrl.h +2fb8cf1b10fb5a7abee8d1e75fd47d11 ./lib/Makefile.am +89782e64438c7954ebb89117f4166a06 ./lib/VtIpAddr.h +fcf462102ef741399f1b74a558e9e127 ./lib/VtDebug.c +24cbdc66fc586af0ab34294b9f1a8a8e ./lib/VtUrlDist.c +86782da239f166270d0e8211628851e7 ./lib/VtUrl.c +88ab45e6ec6b1f574cde777ff38db1d8 ./lib/VtApiPage.c +078559159bea65a96de9f98efb6f91a7 ./lib/VtIpAddr.c +5cfe5b2e411bdbbd26bcf941abf7f06a ./lib/vtcapi_common.h +217a4fe97149dcfddeed64536eb91f5b ./lib/VtComments.c +ea02cca85e89e1b29c2fc0068bf776c3 ./lib/VtDomain.c +970632bf9e2005d89f06690428e7daa8 ./lib/VtObject.c +8339d607de2c96c0b2992175c66e0dcf ./lib/VtResponse.c +02f445f75bc1ff2ce204480e22d1726a ./lib/lib.pro +3e5249607977db488bd97c14927205a1 ./lib/VtFileDist.c +c2bc02ce3276ae2f4bc3fcd76d61f3aa ./lib/VtObject.h +d6546f011add5ffb21d881375244321c ./lib/VtUrlDist.h +ea1dda8194b071a218d1600730691a92 ./lib/VtFile.h +6af754d16800812bab64eaea1585a07d ./lib/VtResponse.h +76725e7bb0cbec8c9d0d00a3c45c1fde ./lib/VtDomain.h +277e6082091bf29de92b32c4f40ba82c ./lib/VtComments.h +f3189403da6193d752e6913b1c3b64eb ./lib/VtDebug.h +e9006d0869ef8a3e2caa485f8156a541 ./c-vtapi_config.h.in +f2766448e74c24bd1c1c5d12466093ae ./INSTALL +0c3ad9c787227319d64604ad68e4b8f7 ./ChangeLog +d61bde2326f7cc1a9ec5d5e81a4cce87 ./AUTHORS +7159820d07db517b34a696ed875c925e ./build_deb +22aa295bf5320aec7fba6756ff11058a ./m4/lt~obsolete.m4 +fa2891f9060865871cbbaa1c6e2d96f4 ./m4/ltsugar.m4 +7eba0509738b301eeccc0b36744fef97 ./m4/libtool.m4 +db61eba6c2d924f0a36dec1d8f51e7f3 ./m4/ax_prog_doxygen.m4 +064af1799febaa676203302bbf359180 ./m4/ltoptions.m4 +d936fd6b2025c9b5322f826117d7f30c ./m4/ltversion.m4 +1c80be294a94494b833d77b3e4d71f8d ./aminclude.am +bebfa215a0ab8b5620e82c9a9af65b93 ./README +dd34a25e2e3d2879316e387106a0b3f5 ./COPYING +7d7720da1a863779983b4cd0c81c138a ./.gitignore +997241f8f41a247f5687b52725239592 ./aclocal.m4 +bb767e42c6efa2600658e2d48cd59659 ./Doxyfile.in diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..97bde15 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +libvtapi-c (0.1) experimental; urgency=medium + + * Initial release + + -- Aurora of Earth Tue, 09 Jul 2019 19:54:00 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ca7bf83 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +13 \ No newline at end of file diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..aa5a3d8 --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: libvtapi-c +Section: security +Priority: standard +Maintainer: Aurora of Earth +Build-Depends: automake, doxygen, autoconf, libtool, libjansson-dev, libcurl4-openssl-dev, make, debhelper +Homepage: https://github.com/VirusTotal/c-vtapi +Vcs-Browser: https://github.com/VirusTotal/c-vtapi +Vcs-Git: https://github.com/VirusTotal/c-vtapi.git + +Package: libvtapi-c +Architecture: any +Depends: libc6 +Description: Official VirusTotal C library diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..6be0657 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,13 @@ +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. diff --git a/debian/debhelper-build-stamp b/debian/debhelper-build-stamp new file mode 100644 index 0000000..abb537d --- /dev/null +++ b/debian/debhelper-build-stamp @@ -0,0 +1 @@ +libvtapi-c diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..1bebcd1 --- /dev/null +++ b/debian/files @@ -0,0 +1,3 @@ +libvtapi-c-dbgsym_0.1_amd64.deb debug optional automatic=yes +libvtapi-c_0.1_amd64.buildinfo security standard +libvtapi-c_0.1_amd64.deb security standard diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..e69de29 diff --git a/debian/libvtapi-c.substvars b/debian/libvtapi-c.substvars new file mode 100644 index 0000000..0c603d0 --- /dev/null +++ b/debian/libvtapi-c.substvars @@ -0,0 +1,3 @@ +shlibs:Depends=libc6 (>= 2.4), libcurl4 (>= 7.16.2), libjansson4 (>= 2.0.1) +misc:Depends= +misc:Pre-Depends= diff --git a/debian/libvtapi-c/DEBIAN/control b/debian/libvtapi-c/DEBIAN/control new file mode 100644 index 0000000..47fadf0 --- /dev/null +++ b/debian/libvtapi-c/DEBIAN/control @@ -0,0 +1,10 @@ +Package: libvtapi-c +Version: 0.1 +Architecture: amd64 +Maintainer: Aurora of Earth +Installed-Size: 232 +Depends: libc6 +Section: security +Priority: standard +Homepage: https://github.com/VirusTotal/c-vtapi +Description: Official VirusTotal C library diff --git a/debian/libvtapi-c/DEBIAN/md5sums b/debian/libvtapi-c/DEBIAN/md5sums new file mode 100644 index 0000000..7acb8a4 --- /dev/null +++ b/debian/libvtapi-c/DEBIAN/md5sums @@ -0,0 +1,14 @@ +41224a3df3bd742c1fff54992c492a57 usr/include/VtApiPage.h +277e6082091bf29de92b32c4f40ba82c usr/include/VtComments.h +76725e7bb0cbec8c9d0d00a3c45c1fde usr/include/VtDomain.h +ea1dda8194b071a218d1600730691a92 usr/include/VtFile.h +208e7be393122d10caa4300b53d97347 usr/include/VtFileDist.h +89782e64438c7954ebb89117f4166a06 usr/include/VtIpAddr.h +6af754d16800812bab64eaea1585a07d usr/include/VtResponse.h +e0270498422f2f898bde4107ee942e1e usr/include/VtUrl.h +d6546f011add5ffb21d881375244321c usr/include/VtUrlDist.h +5e63c5e4fa8db02a0241caefa691a1d0 usr/lib/x86_64-linux-gnu/libcvtapi.a +0b4545e5df10a772a9f83fd743942372 usr/lib/x86_64-linux-gnu/libcvtapi.la +521a23eb783fc35b3e7ca9922107fcb9 usr/lib/x86_64-linux-gnu/libcvtapi.so.1.0.0 +e0c189c3d9663809ae854d812b7426f3 usr/share/doc/libvtapi-c/changelog.gz +dd34a25e2e3d2879316e387106a0b3f5 usr/share/doc/libvtapi-c/copyright diff --git a/debian/libvtapi-c/DEBIAN/shlibs b/debian/libvtapi-c/DEBIAN/shlibs new file mode 100644 index 0000000..0cf72d8 --- /dev/null +++ b/debian/libvtapi-c/DEBIAN/shlibs @@ -0,0 +1 @@ +libcvtapi 1 libvtapi-c (>= 0.1) diff --git a/debian/libvtapi-c/DEBIAN/triggers b/debian/libvtapi-c/DEBIAN/triggers new file mode 100644 index 0000000..fb05319 --- /dev/null +++ b/debian/libvtapi-c/DEBIAN/triggers @@ -0,0 +1,2 @@ +# Triggers added by dh_makeshlibs/12.1.1 +activate-noawait ldconfig diff --git a/debian/libvtapi-c/usr/include/VtApiPage.h b/debian/libvtapi-c/usr/include/VtApiPage.h new file mode 100644 index 0000000..ea1d35f --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtApiPage.h @@ -0,0 +1,136 @@ +/* + C o*pyright 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_API_PAGE_H +#define VT_API_PAGE_H 1 + +#ifdef __cplusplus + +class VpPageHandler_ops; +extern "C" { +#endif + +#include + +#include "VtObject.h" + + +/** +* @ingroup VtObject +* @defgroup VtApiPage VtApiPage object for other API interfaces to inherit +* @{ +*/ + + + +/** + * Common Page Handler Header + * This macro must be included as first member in every object, + * that inherits this VtApiPage + */ +#define API_OBJECT_COMMON \ + VT_OBJECT_COMMON; \ + struct VpPageHandler_ops *ph_ops;\ + char *buffer; \ + unsigned int buffer_size; \ + struct VtResponse *response; \ + char *api_key + + + +struct Session; + + +/** +* @struct VtApiPage +* @brief A generic filter object that other more specialized handler objects will inherit. +* @brief This will give us a kind of polymorphism. +*/ +struct VtApiPage { + API_OBJECT_COMMON; + +}; + +struct VtApiPage_ops { + struct VtObject_ops *obj_ops; /// Parent Ops + +}; + +/** + * @brief Destructor. This is only used internally not for use by users. + * + * @param obj object to be freed + * @return int. O for OK + */ +int VtApiPage_destructor(struct VtObject *obj); + +struct VtApiPage* VtApiPage_alloc(struct VtApiPage_ops *ops); + +struct VtApiPage* VtApiPage_new(void); + + +/** + * @brief Relase a reference counter. If reaches 0, object freed + * + * @param Pointer to object pointer + * @return void + */ +void VtApiPage_put(struct VtApiPage **); + + +/** + * @brief Get a reference counter + * + * @param API object pointer + * @return void + */ +void VtApiPage_get(struct VtApiPage *); + +/** + * @brief Set the API key + * + * @param api object + * @param key API KEY + * @return void + */ +void VtApiPage_setApiKey(struct VtApiPage *api, const char *key); + +/** + * @brief Common callback for curl library. Different functions within this libary use this. + * + * @param ptr pointer to data from curl + * @param size ... + * @param nmemb ... + * @param userdata must be struct VtApiPage + * @return size_t + */ +size_t __VtApiPage_WriteCb( char *ptr, size_t size, size_t nmemb, void *userdata); + +/** + * @brief Reset receive buffers + * + * @param api pointer to object + * @return void + */ +void VtApiPage_resetBuffer(struct VtApiPage *api); + + +/** @} */ + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtComments.h b/debian/libvtapi-c/usr/include/VtComments.h new file mode 100644 index 0000000..9eadb45 --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtComments.h @@ -0,0 +1,114 @@ +/* +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_COMMENTS_H +#define VT_COMMENTS_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +// forward declarations +struct VtComments; +struct VtResponse; + +/** + * @brief Create new Comments object + * + * @param ... + * @return VtComments* pointer to object, or NULL if error occurred + */ +struct VtComments* VtComments_new(void); + +/** + * @brief Get a reference counter. + * + * @param vt_comments ... + * @return void + */ +void VtComments_get(struct VtComments *vt_comments); + + +/** + * @brief Put a reference counter + * + * @param vt_comments object + * @return void + */ +void VtComments_put(struct VtComments **vt_comments); + +/** + * @brief Set API key + * + * @param vt_comments object to set API key + * @param api_key the key + * @return void + */ +void VtComments_setApiKey(struct VtComments *vt_comments, const char *api_key); + + +/** + * @brief Set the Datetime token. Allows you to iterate over all comments + * on a specific item whenever it has been commented on more than 25 times. + * + * @param vt_comments comments object + * @param value ... + * @return void + */ +void VtComments_setBefore(struct VtComments *vt_comments, const char *value); + +/** + * @brief set the resource for which we will get/put comments + * + * @param vt_comments ... + * @param value ... + * @return int + */ + +int VtComments_setResource(struct VtComments *vt_comments, const char *value); + + +/** + * @brief Get the response object + * + * @param vt_comments comments object + * @return VtResponse* response pointer or NULL with no response + */ +struct VtResponse * VtComments_getResponse(struct VtComments *vt_comments); + +/** + * @brief Add a comment. Must 1st set the resource and API key to use this. + * + * @param vt_comments .comments object + * @param comment comment text. A valid ASCII or UTF-8 string. + * @return int + */ +int VtComments_add(struct VtComments *vt_comments, const char *comment); + + +/** + * @brief retrieve comments + * + * @param vt_comments comments object + * @return int + */ +int VtComments_retrieve(struct VtComments *vt_comments); + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtDomain.h b/debian/libvtapi-c/usr/include/VtDomain.h new file mode 100644 index 0000000..4eaf0c4 --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtDomain.h @@ -0,0 +1,87 @@ +/* +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_DOMAIN_H +#define VT_DOMAIN_H 1 + + +#ifdef __cplusplus +extern "C" { +#endif + +struct VtDomain; +struct VtResponse; + +/** +* @ingroup VtApiPage +* @defgroup VtDomain VtDomain checking service +* @{ +*/ +struct VtDomain* VtDomain_new(void); + + +/** + * @brief Get a reference pointer + * + * @param obj Domain object + * @return void + */ +void VtDomain_get(struct VtDomain *obj); + +/** + * @brief Put a reference counter + * + * @param obj ... + * @return void + */ +void VtDomain_put(struct VtDomain **obj); + + +/** + * @brief Set API key + * + * @param vt_domain VtDomain object + * @param api_key your API key + * @return void + */ +void VtDomain_setApiKey(struct VtDomain *vt_domain, const char *api_key); + +/** + * @brief Get response object + * + * @param vt_domain ... + * @return VtResponse* + */ +struct VtResponse * VtDomain_getResponse(struct VtDomain *vt_domain); + +/** + * @brief get the report on a domain + * + * @param vt_domain ... + * @param domain_name_str Domain Name to get report on + * @return int. 0 for OK, or + */ +int VtDomain_report(struct VtDomain *vt_domain, const char *domain_name_str); + +/** +* @} +*/ + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtFile.h b/debian/libvtapi-c/usr/include/VtFile.h new file mode 100644 index 0000000..57eec73 --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtFile.h @@ -0,0 +1,259 @@ +/* +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_SCAN_H +#define VT_FILE_SCAN_H 1 + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// forward declarations +struct VtFile; +struct VtObject; +typedef void (*progress_changed_cb)(struct VtFile *, void *); + +/** +* @ingroup VtApiPage +* @defgroup VtFile VtFile object for scanning files. +* @{ +*/ + + +/** + * @brief Create a new file object + * + * @param ... + * @return VtFile* object pointer. or NULL on error allocating + */ +struct VtFile* VtFile_new(void); + + +/** + * @brief Get a reference counter + * + * @param FileScan ... + * @return void + */ +void VtFile_get(struct VtFile *FileScan); + + + +/** + * @brief Put a reference counter + * + * @param FileScan ... + * @return void + */ +void VtFile_put(struct VtFile **FileScan); + +/** + * @brief Set API Key + * + * @param file_obj VtFile object pointer + * @param api_key Your API key + * @return void + */ +void VtFile_setApiKey(struct VtFile *file_obj, const char *api_key); + + +/** + * @brief Set the offset for the file/search API. + * + * @param file_obj Object pointer + * @param offset Offset string returned by virustotal. + * @return void + */ +void VtFile_setOffset(struct VtFile *file_obj, const char *offset); + + +/** + * @brief Set a callback function for progress changes. + * + * @param file VtFile object + * @param progress_changed_cb callback function + * @param data user data to be passed to callback + * @return void + */ +void VtFile_setProgressCallback(struct VtFile *file, + progress_changed_cb, void *data); + +/** + * @brief Get progress of upload/download + * + * @param file VTFil pointer + * @param dltotal total download size + * @param dlnow downloaded now + * @param ul_total upload total + * @param ul_now uploaded now + * @return void + */ +void VtFile_getProgress(struct VtFile *file, int64_t *dltotal, int64_t *dlnow, int64_t *ul_total, int64_t *ul_now); + +/** + * @brief Cancel current upload/download + * + * @param file ... + * @return int + */ + +void VtFile_cancelOperation(struct VtFile* file); + + +/** + * @brief Scan a file + * + * @param file_obj file object + * @param file_path path to file for scanning + * @param notify_url POST to your server at this URL the report when scan is done. set to NULL if by default if not wanted + * @return int + */ +int VtFile_scan(struct VtFile *file_obj, const char *file_path, const char *notify_url); + + +/** + * @brief Scan a file that is already buffered in memory + * + * @param file_scan file object + * @param filename file name that shows in VirusTotal report. Required paramter + * @param memory_buffer memory buffer where the file is stored. + * This must me unmodified until the function returns + * @param buffer_length length of the file + * @param notify_url POST to your server at this URL the report + * when scan is done. set to NULL if by default if not wanted. + * @return int + */ +int VtFile_scanMemBuf(struct VtFile *file_scan, const char *filename, + const unsigned char *memory_buffer, + unsigned int buffer_length, + const char *notify_url); + +/** + * @brief Rescan a previously submitted file or schedule a scan to be performed in the future. + * + * @param file_obj File scan object + * @param hash resouce to rescan + * @param date default to 0, as not specified. If not specified, rescan immediately. + * If specifed, it will be performed at the desired date. + * Private API permissions are required to specify this parameter + * @param period default 0, as not specified. If specified period in days file + * to be rescaned. Private API permissions are required to specify this parameter + * @param repeat default 0, as not specified. If specified, file will be rescanned + * every PERIOD paramater days, for REPEAT times. + * @param notify_url default NULL, as not specified. If specified, a POST will be sent to URL. + * Private API permissions are required to specify this parameter + * @param notify_changes_only if notify_url set, only notify of changes + * @return int + */ +int VtFile_rescanHash(struct VtFile *file_obj, const char *hash, + time_t date, int period, int repeat, const char *notify_url, bool notify_changes_only); + +/** + * @brief Delete a scheduled rescan task + * + * @param file_obj VtFile object pointer + * @param hash resoruce to remove + * @return int + */ + +int VtFile_rescanDelete(struct VtFile *file_obj, + const char *hash); + +/** + * @brief Fetch Report on a resource + * + * @param file_obj file object + * @param resource Hash, scan_id, or resource to fetch + * @return int + */ +int VtFile_report(struct VtFile *file_obj, const char *resource); + +struct VtResponse * VtFile_getResponse(struct VtFile *file_obj); + + +/** + * @brief Search API + * + * @param file_obj file object + * @param query Search query + * @param cb Callback function pointer. Will return hashes + * @param user_data pointer to data pass to callback function. + * @return int + */ +int VtFile_search(struct VtFile *file_obj, const char *query, + void (*cb)(const char *resource, void *data), + void *user_data); + +#ifdef JANSSON_H + + + +/** + * @brief Get the clustering data + * @brief Requires private-api permissions + * + * @param file_obj File object + * @param cluster_date Clustering report date + * @param cb write callback. will return a json_t object that you will need to parse + * @param user_data user callback data + * @return int. 0 for OK or error code + */ +int VtFile_clusters(struct VtFile *file_obj, const char *cluster_date, + void (*cb)(json_t *cluster_json, void *data), + void *user_data); +#endif + + +/** + * @brief Download a file. callback function to write to memory, disk, network, etc + * @brief Requires private-api permissions + * + * @param file_obj File object + * @param hash hash to download + * @param cb write callback. Theis function will be called muliiple + * @param user_data user callback data + * @return int. 0 for OK or error code + */ +int VtFile_download(struct VtFile *file_obj, const char *hash, + size_t (*cb)(char *ptr, size_t size, size_t nmemb, void *userdata), void *user_data); + +/** + * @brief Download and save to a file + * + * @param file_obj object + * @param hash of file to download + * @param out_file path to output file + * @return int + */ +int VtFile_downloadToFile(struct VtFile *file_obj, const char *hash, const char *out_file); + + + +int VtFile_uploadUrl(struct VtFile *file, char **url); + +int VtFile_scanBigFile(struct VtFile *file_scan, const char * path); + + +/** @} */ + + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtFileDist.h b/debian/libvtapi-c/usr/include/VtFileDist.h new file mode 100644 index 0000000..342785f --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtFileDist.h @@ -0,0 +1,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 diff --git a/debian/libvtapi-c/usr/include/VtIpAddr.h b/debian/libvtapi-c/usr/include/VtIpAddr.h new file mode 100644 index 0000000..de5954f --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtIpAddr.h @@ -0,0 +1,96 @@ +/* +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_IP_ADDR_H +#define VT_IP_ADDR_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +struct VtIpAddr; +struct VtResponse; + +/** +* @ingroup VtApiPage +* @defgroup VtIpAddr VtIpAddr object for getting reports on IP addresses. +* @{ +*/ + + +/** + * @brief Create new Object + * + * @return VtIpAddr object pointer. or null on erro + */ +struct VtIpAddr* VtIpAddr_new(void); + + +/** + * @brief Get a reference counter + * + * @param obj VtIpAddr object + * @return void + */ +void VtIpAddr_get(struct VtIpAddr *obj); + + +/** + * @brief Put a reference counter + * + * @param obj ... + * @return void + */ +void VtIpAddr_put(struct VtIpAddr **obj); + +/** + * @brief Set API KEY + * + * @param vt_ip_addr ... + * @param api_key Your API Kety + * @return void + */ +void VtIpAddr_setApiKey(struct VtIpAddr *vt_ip_addr, const char *api_key); + + + +/** + * @brief Get the respose object + * + * @param vt_ip_addr VtIpAddr object + * @return VtResponse* + */ +struct VtResponse * VtIpAddr_getResponse(struct VtIpAddr *vt_ip_addr); + +/** + * @brief Get the report on a IP address + * + * @param vt_ip_addr ... + * @param ip_addr_str ... + * @return int. 0 for OK, or error code + */ +int VtIpAddr_report(struct VtIpAddr *vt_ip_addr, const char *ip_addr_str); + + +/** +* @} +*/ + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtResponse.h b/debian/libvtapi-c/usr/include/VtResponse.h new file mode 100644 index 0000000..76fe10e --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtResponse.h @@ -0,0 +1,136 @@ +/* +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_RESPONSE_H +#define VT_RESPONSE_H 1 + + +#ifdef __cplusplus +extern "C" { +#endif + +/** +* @ingroup VtObject +* @defgroup VtResponse VtResponse object. All API responses stored here. +* @{ +*/ + + +/// Flag to include debug info in JSON if necessary +#define VT_JSON_FLAG_DEBUG 1 << 0 + +/// Indent JSON +#define VT_JSON_FLAG_INDENT 1 << 1 + +struct VtResponse; + +struct VtResponse* VtResponse_new(void); + + +/** + * @brief Get a reference counter. + * + * @param VtResponse Response object + * @return void + */ +void VtResponse_get(struct VtResponse *VtResponse); + + +/** + * @brief put a reference counter + * + * @param VtResponse ... + * @return void + */ +void VtResponse_put(struct VtResponse **VtResponse); + +/** + * @brief get the _verbose_msg field of the JSON response + * + * @param response VTResponse object + * @param buf buffer to write the response into + * @param buf_siz size of the buffer + * @return char* + */ + +char * VtResponse_getVerboseMsg(struct VtResponse *response, char *buf, int buf_siz); + +/** + * @brief Get the response code in the JSON response + * + * @param response VtResponse object + * @param response_code response code + * @return int 0 if OK. -1 if not found. + */ +int VtResponse_getResponseCode(struct VtResponse *response, int *response_code); + +/** + * @brief Get the raw JSON response. The caller must free the returned string + * + * @param response VtResponse object + * @param flags set to 0, or VT_JSON_FLAG_INDENT to indent the json for a human to read + * @return char* NULL if no response. The caller must free the returned pointer to avoid a leak. + */ +char * VtResponse_toJSONstr(struct VtResponse *response, int flags); + + + +/** + * @brief Fill the response object from the JSON string + * + * @param response VtResponse object + * @param json_str ... + * @return int + */ +int VtResponse_fromJSONstr(struct VtResponse *response, const char *json_str); + + +/** + * @brief Get an integer key/value pair within the JSON response + * + * @param response VtResponse object + * @param key Key value to read + * @param value integer value returned + * @return int + */ +int VtResponse_getIntValue(struct VtResponse *response, const char *key, int *value); + +/** + * @brief Get a string key/value pair in the JSON response + * + * @param response VtResponse object + * @param key key to read + * @return char* string returned. user must free this pointer to avoid a leak. Will return NULL if not found. + */ +char *VtResponse_getString(struct VtResponse *response, const char *key); + + +/** + * @brief Get raw jansson response object + * + * @param response borrowed json_t pointer. + * @return json_t* + */ +json_t * VtResponse_getJanssonObj(struct VtResponse *response); + +/** @} */ + + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtUrl.h b/debian/libvtapi-c/usr/include/VtUrl.h new file mode 100644 index 0000000..2be3a9a --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtUrl.h @@ -0,0 +1,109 @@ +/* +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_URL_H +#define VT_URL_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +// forward declarations +struct VtUrl; +struct VtResponse; +struct VtObject; + +/** +* @ingroup VtApiPage +* @defgroup VtUrl VtUrl URL scanning object +* @{ +*/ + +/** + * @brief Create new URL object + * + * @param void + * @return VtUrl* + */ +struct VtUrl* VtUrl_new(void); + +/** + * @brief Get a reference counter + * + * @param VtUrl object + * @return void + */ + +void VtUrl_get(struct VtUrl *); + + +/** + * @brief Put a reference counter + * + * @param Pointer to VtUrl pointer + * @return void + */ +void VtUrl_put(struct VtUrl **); + +/** + * @brief Stet tha API key + * + * @param url_scan VtUrl Object + * @param api_key your api key + * @return void + */ +void VtUrl_setApiKey(struct VtUrl *url_scan, const char *api_key); + +/** + * @brief Scan URL + * + * @param VtUrl Url scan object + * @param url URL to scan + * @return int 0 if OK or error code + */ + +int VtUrl_scan(struct VtUrl *, const char *url); + + +/** + * @brief get the report of the URL scan + * + * @param VtUrl scan object + * @param url URL to get report on + * @param scan set to true if you wish to rescan + * @param all_info set true if you wall aditional info. (Private API Key Only) + * @return int + */ +int VtUrl_report(struct VtUrl *, const char *url, bool scan, bool all_info); + + +/** + * @brief Get response object + * + * @param url_scan VtUrl Object + * @return VtResponse* + */ +struct VtResponse * VtUrl_getResponse(struct VtUrl *url_scan); + +/** +* @} +*/ + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/include/VtUrlDist.h b/debian/libvtapi-c/usr/include/VtUrlDist.h new file mode 100644 index 0000000..9818099 --- /dev/null +++ b/debian/libvtapi-c/usr/include/VtUrlDist.h @@ -0,0 +1,128 @@ +/* +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_URL_DIST +#define VT_URL_DIST 1 + +#ifdef __cplusplus +extern "C" { +#endif + +// forward declarations +struct VtUrlDist; +struct VtResponse; +typedef void (VtUrlDistCb)(const char *url, unsigned long long timestamp, int total, int positives, json_t *raw_json, void *data); +/** +* @ingroup VtApiPage +* @defgroup VtUrlDist VtUrlDist URL Distribution service. Requires private-API with permissions +* @{ +*/ +struct VtUrlDist* VtUrlDist_new(void); + +/** Get a reference counter */ +void VtUrlDist_get(struct VtUrlDist *FileScan); + +/** put a reference counter */ +void VtUrlDist_put(struct VtUrlDist **FileScan); + +/** + * @brief ... + * + * @param vt_udist ... + * @param api_key ... + * @return void + */ +void VtUrlDist_setApiKey(struct VtUrlDist *vt_udist, const char *api_key); + + +/** + * @brief set all info flag + * + * @param vt_udist ... + * @param value true/false + * @return void + */ +void VtUrlDist_setAllInfo(struct VtUrlDist *vt_udist, bool value); + +/** + * @brief set after time + * + * @param vt_udist VtUrlDist ojbect pointer + * @param value time sinc epoch in miliseconds + * @return void + */ +void VtUrlDist_setAfter(struct VtUrlDist *vt_udist, unsigned long long value); + + +/** + * @brief set the before time paramater + * + * @param vt_udist ... + * @param value time since epoch in miniseconds + * @return void + */ +void VtUrlDist_setBefore(struct VtUrlDist *vt_udist, unsigned long long value); + + + +/** + * @brief set limit of results + * + * @param vt_udist VtUrlDist ojbect pointer + * @param value ... + * @return void + */ +void VtUrlDist_setLimit(struct VtUrlDist *vt_udist, int value); + +struct VtResponse * VtUrlDist_getResponse(struct VtUrlDist *vt_udist); +/** + * @brief Get the distribution feed. + * + * @param vt_udist ... + * @return int + */ + +int VtUrlDist_getDistribution(struct VtUrlDist *vt_udist); + +/** + * @brief parse the URL dist results and for each results call the callback function. + * + * @param url_dist VtUrlDist object + * @param VtUrlDistCb URL distribution callback function pointer + * @param user_data user data to be passed to callback + * @return int + */ +int VtUrlDist_parse(struct VtUrlDist* url_dist, VtUrlDistCb, void *user_data); + + +/** + * @brief wraper to combind VtUrlDist_getResponse() and VtUrlDist_parse() + * + * @param VtUrlDist callback + * @param VtUrlDistCb callback function pointer + * @param user_data user data to be passed to callback + * @return int + */ +int VtUrlDist_process(struct VtUrlDist* url_dist, VtUrlDistCb, void *user_data); + +/** +* @} +*/ + +#ifdef __cplusplus +} +#endif /*cplusplus*/ + +#endif diff --git a/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.a b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.a new file mode 100644 index 0000000..55a0f13 Binary files /dev/null and b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.a differ diff --git a/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so new file mode 120000 index 0000000..a5026f3 --- /dev/null +++ b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so @@ -0,0 +1 @@ +libcvtapi.so.1.0.0 \ No newline at end of file diff --git a/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1 b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1 new file mode 120000 index 0000000..a5026f3 --- /dev/null +++ b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1 @@ -0,0 +1 @@ +libcvtapi.so.1.0.0 \ No newline at end of file diff --git a/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1.0.0 b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1.0.0 new file mode 100644 index 0000000..23985d9 Binary files /dev/null and b/debian/libvtapi-c/usr/lib/x86_64-linux-gnu/libcvtapi.so.1.0.0 differ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..0a4f3fd --- /dev/null +++ b/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +%: + dh $@ + +build: + mkdir -p debian/libvtapi-c/usr/local/lib + autoreconf -fi + ./configure --configure debian/libvtapi-c/usr/local + make + make install + +clean: + rm -R debian/libvtapi-c/usr/local/lib + make clean + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..9f67427 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) \ No newline at end of file