aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-08-30 19:05:29 +0000
committerChristian Grothoff <christian@grothoff.org>2009-08-30 19:05:29 +0000
commit365afdb913c3446f358d3a13fcdaad4ae76334b3 (patch)
treed59a148f8e59798374ec68a931141d5432ea7145 /src
parent0ed78fc783399971276412dc48130ec5e7256512 (diff)
downloadgnunet-365afdb913c3446f358d3a13fcdaad4ae76334b3.tar.gz
gnunet-365afdb913c3446f358d3a13fcdaad4ae76334b3.zip
sblocks
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_publish.c1
-rw-r--r--src/include/gnunet_fs_service.h55
-rw-r--r--src/include/gnunet_signatures.h15
3 files changed, 62 insertions, 9 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 55541fc33..1445c98d5 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -30,6 +30,7 @@
30 * - code-sharing with unindex (can wait) 30 * - code-sharing with unindex (can wait)
31 * - persistence support (can wait) 31 * - persistence support (can wait)
32 * - datastore reservation support (optimization) 32 * - datastore reservation support (optimization)
33 * - location URIs (publish with anonymity-level zero)
33 */ 34 */
34 35
35#include "platform.h" 36#include "platform.h"
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index 2b0880f0d..d0032f72d 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -1770,6 +1770,24 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
1770 1770
1771 1771
1772/** 1772/**
1773 * Options for publishing. Compatible options
1774 * can be OR'ed together.
1775 */
1776enum GNUNET_FS_PublishOptions
1777 {
1778 /**
1779 * No options (use defaults for everything).
1780 */
1781 GNUNET_FS_PUBLISH_OPTION_NONE = 0,
1782
1783 /**
1784 * Simulate publishing. With this option, no data will be stored
1785 * in the datastore. Useful for computing URIs from files.
1786 */
1787 GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY = 1
1788 };
1789
1790/**
1773 * Publish a file or directory. 1791 * Publish a file or directory.
1774 * 1792 *
1775 * @param h handle to the file sharing subsystem 1793 * @param h handle to the file sharing subsystem
@@ -1781,6 +1799,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
1781 * (can be NULL, must be NULL if namespace is NULL) 1799 * (can be NULL, must be NULL if namespace is NULL)
1782 * @param nuid update-identifier that will be used for future updates 1800 * @param nuid update-identifier that will be used for future updates
1783 * (can be NULL, must be NULL if namespace or nid is NULL) 1801 * (can be NULL, must be NULL if namespace or nid is NULL)
1802 * @param options options for the publication
1784 * @return context that can be used to control the publish operation 1803 * @return context that can be used to control the publish operation
1785 */ 1804 */
1786struct GNUNET_FS_PublishContext * 1805struct GNUNET_FS_PublishContext *
@@ -1789,7 +1808,8 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1789 struct GNUNET_FS_FileInformation *fi, 1808 struct GNUNET_FS_FileInformation *fi,
1790 struct GNUNET_FS_Namespace *namespace, 1809 struct GNUNET_FS_Namespace *namespace,
1791 const char *nid, 1810 const char *nid,
1792 const char *nuid); 1811 const char *nuid,
1812 enum GNUNET_FS_PublishOptions options);
1793 1813
1794 1814
1795/** 1815/**
@@ -1804,25 +1824,42 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *sc);
1804 1824
1805 1825
1806/** 1826/**
1827 * Signature of a function called as the continuation of a KBlock or
1828 * SBlock publication.
1829 *
1830 * @param cls closure
1831 * @param uri URI under which the block is now available, NULL on error
1832 * @param emsg error message, NULL on success
1833 */
1834typedef void (*GNUNET_FS_PublishContinuation)(void *cls,
1835 const struct GNUNET_FS_Uri *uri,
1836 const char *emsg);
1837
1838
1839/**
1807 * Publish a KBlock on GNUnet. 1840 * Publish a KBlock on GNUnet.
1808 * 1841 *
1809 * @param h handle to the file sharing subsystem 1842 * @param h handle to the file sharing subsystem
1810 * @param keyword keyword to use 1843 * @param keywords keywords to use
1811 * @param meta metadata to use 1844 * @param meta metadata to use
1812 * @param uri URI to refer to in the KBlock 1845 * @param uri URI to refer to in the KBlock
1813 * @param expirationTime when the KBlock expires 1846 * @param expirationTime when the KBlock expires
1814 * @param anonymity anonymity level for the KBlock 1847 * @param anonymity anonymity level for the KBlock
1815 * @param priority priority for the KBlock 1848 * @param priority priority for the KBlock
1849 * @param cont continuation
1850 * @param cont_cls closure for cont
1816 */ 1851 */
1817// FIXME: CPS this one..
1818void 1852void
1819GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, 1853GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1820 const char *keyword, 1854 struct GNUNET_FS_Uri *keywords,
1821 struct GNUNET_CONTAINER_MetaData *meta, 1855 struct GNUNET_CONTAINER_MetaData *meta,
1822 struct GNUNET_FS_Uri *uri, 1856 struct GNUNET_FS_Uri *uri,
1823 struct GNUNET_TIME_Absolute expirationTime, 1857 struct GNUNET_TIME_Absolute expirationTime,
1824 unsigned int anonymity, 1858 unsigned int anonymity,
1825 unsigned int priority); 1859 unsigned int priority,
1860 enum GNUNET_FS_PublishOptions options,
1861 GNUNET_FS_PublishContinuation cont,
1862 void *cont_cls);
1826 1863
1827 1864
1828/** 1865/**
@@ -1837,8 +1874,9 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
1837 * @param expirationTime when the SBlock expires 1874 * @param expirationTime when the SBlock expires
1838 * @param anonymity anonymity level for the SBlock 1875 * @param anonymity anonymity level for the SBlock
1839 * @param priority priority for the SBlock 1876 * @param priority priority for the SBlock
1877 * @param cont continuation
1878 * @param cont_cls closure for cont
1840 */ 1879 */
1841// FIXME: CPS this one..
1842void 1880void
1843GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, 1881GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
1844 struct GNUNET_FS_Namespace *namespace, 1882 struct GNUNET_FS_Namespace *namespace,
@@ -1848,7 +1886,10 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h,
1848 struct GNUNET_FS_Uri *uri, 1886 struct GNUNET_FS_Uri *uri,
1849 struct GNUNET_TIME_Absolute expirationTime, 1887 struct GNUNET_TIME_Absolute expirationTime,
1850 unsigned int anonymity, 1888 unsigned int anonymity,
1851 unsigned int priority); 1889 unsigned int priority,
1890 enum GNUNET_FS_PublishOptions options,
1891 GNUNET_FS_PublishContinuation cont,
1892 void *cont_cls);
1852 1893
1853 1894
1854/** 1895/**
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h
index 6e4b0dc42..29aa36811 100644
--- a/src/include/gnunet_signatures.h
+++ b/src/include/gnunet_signatures.h
@@ -59,16 +59,27 @@ extern "C"
59 */ 59 */
60#define GNUNET_SIGNATURE_PURPOSE_NAMESPACE_ADVERTISEMENT 3 60#define GNUNET_SIGNATURE_PURPOSE_NAMESPACE_ADVERTISEMENT 3
61 61
62/**
63 * Signature by which a peer affirms that it is
64 * providing a certain bit of content (used
65 * in LOCation URIs).
66 */
67#define GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT 4
68
69/**
70 * Signature in a KBlock of the FS module.
71 */
72#define GNUNET_SIGNATURE_PURPOSE_FS_KBLOCK 5
62 73
63/** 74/**
64 * Signature of content URI placed into a namespace. 75 * Signature of content URI placed into a namespace.
65 */ 76 */
66#define GNUNET_SIGNATURE_PURPOSE_NAMESPACE_PLACEMENT 4 77#define GNUNET_SIGNATURE_PURPOSE_FS_SBLOCK 6
67 78
68/** 79/**
69 * 80 *
70 */ 81 */
71#define GNUNET_SIGNATURE_PURPOSE_RESOLVER_RESPONSE 5 82#define GNUNET_SIGNATURE_PURPOSE_RESOLVER_RESPONSE 7
72 83
73 84
74#if 0 /* keep Emacsens' auto-indent happy */ 85#if 0 /* keep Emacsens' auto-indent happy */