diff options
Diffstat (limited to 'src/include/gnunet_fs_service.h')
-rw-r--r-- | src/include/gnunet_fs_service.h | 146 |
1 files changed, 70 insertions, 76 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 52cd8bd78..8238083b1 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -1574,6 +1574,52 @@ enum GNUNET_FS_OPTIONS | |||
1574 | 1574 | ||
1575 | 1575 | ||
1576 | /** | 1576 | /** |
1577 | * Settings for publishing a block (which may of course also | ||
1578 | * apply to an entire directory or file). | ||
1579 | */ | ||
1580 | struct GNUNET_FS_BlockOptions | ||
1581 | { | ||
1582 | |||
1583 | /** | ||
1584 | * At what time should the block expire? Data blocks (DBLOCKS and | ||
1585 | * IBLOCKS) may still be used even if they are expired (however, | ||
1586 | * they'd be removed quickly from the datastore if we are short on | ||
1587 | * space), all other types of blocks will no longer be returned | ||
1588 | * after they expire. | ||
1589 | */ | ||
1590 | struct GNUNET_TIME_Absolute expiration_time; | ||
1591 | |||
1592 | /** | ||
1593 | * At which anonymity level should the block be shared? | ||
1594 | * (0: no anonymity, 1: normal GAP, >1: with cover traffic). | ||
1595 | */ | ||
1596 | uint32_t anonymity_level; | ||
1597 | |||
1598 | /** | ||
1599 | * How important is it for us to store the block? If we run | ||
1600 | * out of space, the highest-priority, non-expired blocks will | ||
1601 | * be kept. | ||
1602 | */ | ||
1603 | uint32_t content_priority; | ||
1604 | |||
1605 | /** | ||
1606 | * How often should we try to migrate the block to other peers? | ||
1607 | * Only used if "CONTENT_PUSHING" is set to YES, in which case we | ||
1608 | * first push each block to other peers according to their | ||
1609 | * replication levels. Once each block has been pushed that many | ||
1610 | * times to other peers, blocks are chosen for migration at random. | ||
1611 | * Naturally, there is no guarantee that the other peers will keep | ||
1612 | * these blocks for any period of time (since they won't have any | ||
1613 | * priority or might be too busy to even store the block in the | ||
1614 | * first place). | ||
1615 | */ | ||
1616 | uint32_t replication_level; | ||
1617 | |||
1618 | }; | ||
1619 | |||
1620 | |||
1621 | |||
1622 | /** | ||
1577 | * Handle to the file-sharing service. | 1623 | * Handle to the file-sharing service. |
1578 | */ | 1624 | */ |
1579 | struct GNUNET_FS_Handle; | 1625 | struct GNUNET_FS_Handle; |
@@ -1635,10 +1681,8 @@ GNUNET_FS_meta_data_extract_from_file (struct | |||
1635 | * @param length length of the file or directory | 1681 | * @param length length of the file or directory |
1636 | * @param meta metadata for the file or directory (can be modified) | 1682 | * @param meta metadata for the file or directory (can be modified) |
1637 | * @param uri pointer to the keywords that will be used for this entry (can be modified) | 1683 | * @param uri pointer to the keywords that will be used for this entry (can be modified) |
1638 | * @param anonymity pointer to selected anonymity level (can be modified) | 1684 | * @param bo block options (can be modified) |
1639 | * @param priority pointer to selected priority (can be modified) | ||
1640 | * @param do_index should we index (can be modified) | 1685 | * @param do_index should we index (can be modified) |
1641 | * @param expirationTime pointer to selected expiration time (can be modified) | ||
1642 | * @param client_info pointer to client context set upon creation (can be modified) | 1686 | * @param client_info pointer to client context set upon creation (can be modified) |
1643 | * @return GNUNET_OK to continue, GNUNET_NO to remove | 1687 | * @return GNUNET_OK to continue, GNUNET_NO to remove |
1644 | * this entry from the directory, GNUNET_SYSERR | 1688 | * this entry from the directory, GNUNET_SYSERR |
@@ -1649,10 +1693,8 @@ typedef int (*GNUNET_FS_FileInformationProcessor)(void *cls, | |||
1649 | uint64_t length, | 1693 | uint64_t length, |
1650 | struct GNUNET_CONTAINER_MetaData *meta, | 1694 | struct GNUNET_CONTAINER_MetaData *meta, |
1651 | struct GNUNET_FS_Uri **uri, | 1695 | struct GNUNET_FS_Uri **uri, |
1652 | uint32_t *anonymity, | 1696 | struct GNUNET_FS_BlockOptions *bo, |
1653 | uint32_t *priority, | ||
1654 | int *do_index, | 1697 | int *do_index, |
1655 | struct GNUNET_TIME_Absolute *expirationTime, | ||
1656 | void **client_info); | 1698 | void **client_info); |
1657 | 1699 | ||
1658 | 1700 | ||
@@ -1682,11 +1724,7 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); | |||
1682 | * @param meta metadata for the file | 1724 | * @param meta metadata for the file |
1683 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, | 1725 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, |
1684 | * GNUNET_SYSERR for simulation | 1726 | * GNUNET_SYSERR for simulation |
1685 | * @param anonymity what is the desired anonymity level for sharing? | 1727 | * @param bo block options |
1686 | * @param priority what is the priority for OUR node to | ||
1687 | * keep this file available? Use 0 for maximum anonymity and | ||
1688 | * minimum reliability... | ||
1689 | * @param expirationTime when should this content expire? | ||
1690 | * @return publish structure entry for the file | 1728 | * @return publish structure entry for the file |
1691 | */ | 1729 | */ |
1692 | struct GNUNET_FS_FileInformation * | 1730 | struct GNUNET_FS_FileInformation * |
@@ -1696,9 +1734,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | |||
1696 | const struct GNUNET_FS_Uri *keywords, | 1734 | const struct GNUNET_FS_Uri *keywords, |
1697 | const struct GNUNET_CONTAINER_MetaData *meta, | 1735 | const struct GNUNET_CONTAINER_MetaData *meta, |
1698 | int do_index, | 1736 | int do_index, |
1699 | uint32_t anonymity, | 1737 | const struct GNUNET_FS_BlockOptions *bo); |
1700 | uint32_t priority, | ||
1701 | struct GNUNET_TIME_Absolute expirationTime); | ||
1702 | 1738 | ||
1703 | 1739 | ||
1704 | /** | 1740 | /** |
@@ -1714,11 +1750,7 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | |||
1714 | * @param meta metadata for the file | 1750 | * @param meta metadata for the file |
1715 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, | 1751 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, |
1716 | * GNUNET_SYSERR for simulation | 1752 | * GNUNET_SYSERR for simulation |
1717 | * @param anonymity what is the desired anonymity level for sharing? | 1753 | * @param bo block options |
1718 | * @param priority what is the priority for OUR node to | ||
1719 | * keep this file available? Use 0 for maximum anonymity and | ||
1720 | * minimum reliability... | ||
1721 | * @param expirationTime when should this content expire? | ||
1722 | * @return publish structure entry for the file | 1754 | * @return publish structure entry for the file |
1723 | */ | 1755 | */ |
1724 | struct GNUNET_FS_FileInformation * | 1756 | struct GNUNET_FS_FileInformation * |
@@ -1729,9 +1761,7 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, | |||
1729 | const struct GNUNET_FS_Uri *keywords, | 1761 | const struct GNUNET_FS_Uri *keywords, |
1730 | const struct GNUNET_CONTAINER_MetaData *meta, | 1762 | const struct GNUNET_CONTAINER_MetaData *meta, |
1731 | int do_index, | 1763 | int do_index, |
1732 | uint32_t anonymity, | 1764 | const struct GNUNET_FS_BlockOptions *bo); |
1733 | uint32_t priority, | ||
1734 | struct GNUNET_TIME_Absolute expirationTime); | ||
1735 | 1765 | ||
1736 | 1766 | ||
1737 | /** | 1767 | /** |
@@ -1770,11 +1800,7 @@ typedef size_t (*GNUNET_FS_DataReader)(void *cls, | |||
1770 | * @param meta metadata for the file | 1800 | * @param meta metadata for the file |
1771 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, | 1801 | * @param do_index GNUNET_YES for index, GNUNET_NO for insertion, |
1772 | * GNUNET_SYSERR for simulation | 1802 | * GNUNET_SYSERR for simulation |
1773 | * @param anonymity what is the desired anonymity level for sharing? | 1803 | * @param bo block options |
1774 | * @param priority what is the priority for OUR node to | ||
1775 | * keep this file available? Use 0 for maximum anonymity and | ||
1776 | * minimum reliability... | ||
1777 | * @param expirationTime when should this content expire? | ||
1778 | * @return publish structure entry for the file | 1804 | * @return publish structure entry for the file |
1779 | */ | 1805 | */ |
1780 | struct GNUNET_FS_FileInformation * | 1806 | struct GNUNET_FS_FileInformation * |
@@ -1786,9 +1812,7 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | |||
1786 | const struct GNUNET_FS_Uri *keywords, | 1812 | const struct GNUNET_FS_Uri *keywords, |
1787 | const struct GNUNET_CONTAINER_MetaData *meta, | 1813 | const struct GNUNET_CONTAINER_MetaData *meta, |
1788 | int do_index, | 1814 | int do_index, |
1789 | uint32_t anonymity, | 1815 | const struct GNUNET_FS_BlockOptions *bo); |
1790 | uint32_t priority, | ||
1791 | struct GNUNET_TIME_Absolute expirationTime); | ||
1792 | 1816 | ||
1793 | 1817 | ||
1794 | /** | 1818 | /** |
@@ -1813,9 +1837,7 @@ typedef void (*GNUNET_FS_FileProcessor)(void *cls, | |||
1813 | * @param h handle to the file sharing subsystem | 1837 | * @param h handle to the file sharing subsystem |
1814 | * @param dirname name of the directory to scan | 1838 | * @param dirname name of the directory to scan |
1815 | * @param do_index should files be indexed or inserted | 1839 | * @param do_index should files be indexed or inserted |
1816 | * @param anonymity desired anonymity level | 1840 | * @param bo block options |
1817 | * @param priority priority for publishing | ||
1818 | * @param expirationTime expiration for publication | ||
1819 | * @param proc function to call on each entry | 1841 | * @param proc function to call on each entry |
1820 | * @param proc_cls closure for proc | 1842 | * @param proc_cls closure for proc |
1821 | * @param emsg where to store an error message (on errors) | 1843 | * @param emsg where to store an error message (on errors) |
@@ -1825,9 +1847,7 @@ typedef int (*GNUNET_FS_DirectoryScanner)(void *cls, | |||
1825 | struct GNUNET_FS_Handle *h, | 1847 | struct GNUNET_FS_Handle *h, |
1826 | const char *dirname, | 1848 | const char *dirname, |
1827 | int do_index, | 1849 | int do_index, |
1828 | uint32_t anonymity, | 1850 | const struct GNUNET_FS_BlockOptions *bo, |
1829 | uint32_t priority, | ||
1830 | struct GNUNET_TIME_Absolute expirationTime, | ||
1831 | GNUNET_FS_FileProcessor proc, | 1851 | GNUNET_FS_FileProcessor proc, |
1832 | void *proc_cls, | 1852 | void *proc_cls, |
1833 | char **emsg); | 1853 | char **emsg); |
@@ -1849,9 +1869,7 @@ typedef int (*GNUNET_FS_DirectoryScanner)(void *cls, | |||
1849 | * @param h handle to the file sharing subsystem | 1869 | * @param h handle to the file sharing subsystem |
1850 | * @param dirname name of the directory to scan | 1870 | * @param dirname name of the directory to scan |
1851 | * @param do_index should files be indexed or inserted | 1871 | * @param do_index should files be indexed or inserted |
1852 | * @param anonymity desired anonymity level | 1872 | * @param bo block options |
1853 | * @param priority priority for publishing | ||
1854 | * @param expirationTime expiration for publication | ||
1855 | * @param proc function called on each entry | 1873 | * @param proc function called on each entry |
1856 | * @param proc_cls closure for proc | 1874 | * @param proc_cls closure for proc |
1857 | * @param emsg where to store an error message (on errors) | 1875 | * @param emsg where to store an error message (on errors) |
@@ -1862,9 +1880,7 @@ GNUNET_FS_directory_scanner_default (void *cls, | |||
1862 | struct GNUNET_FS_Handle *h, | 1880 | struct GNUNET_FS_Handle *h, |
1863 | const char *dirname, | 1881 | const char *dirname, |
1864 | int do_index, | 1882 | int do_index, |
1865 | uint32_t anonymity, | 1883 | const struct GNUNET_FS_BlockOptions *bo, |
1866 | uint32_t priority, | ||
1867 | struct GNUNET_TIME_Absolute expirationTime, | ||
1868 | GNUNET_FS_FileProcessor proc, | 1884 | GNUNET_FS_FileProcessor proc, |
1869 | void *proc_cls, | 1885 | void *proc_cls, |
1870 | char **emsg); | 1886 | char **emsg); |
@@ -1886,11 +1902,7 @@ GNUNET_FS_directory_scanner_default (void *cls, | |||
1886 | * @param scanner function used to get a list of files in a directory | 1902 | * @param scanner function used to get a list of files in a directory |
1887 | * @param scanner_cls closure for scanner | 1903 | * @param scanner_cls closure for scanner |
1888 | * @param do_index should files in the hierarchy be indexed? | 1904 | * @param do_index should files in the hierarchy be indexed? |
1889 | * @param anonymity what is the desired anonymity level for sharing? | 1905 | * @param bo block options |
1890 | * @param priority what is the priority for OUR node to | ||
1891 | * keep this file available? Use 0 for maximum anonymity and | ||
1892 | * minimum reliability... | ||
1893 | * @param expirationTime when should this content expire? | ||
1894 | * @param emsg where to store an error message | 1906 | * @param emsg where to store an error message |
1895 | * @return publish structure entry for the directory, NULL on error | 1907 | * @return publish structure entry for the directory, NULL on error |
1896 | */ | 1908 | */ |
@@ -1901,9 +1913,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, | |||
1901 | GNUNET_FS_DirectoryScanner scanner, | 1913 | GNUNET_FS_DirectoryScanner scanner, |
1902 | void *scanner_cls, | 1914 | void *scanner_cls, |
1903 | int do_index, | 1915 | int do_index, |
1904 | uint32_t anonymity, | 1916 | const struct GNUNET_FS_BlockOptions *bo, |
1905 | uint32_t priority, | ||
1906 | struct GNUNET_TIME_Absolute expirationTime, | ||
1907 | char **emsg); | 1917 | char **emsg); |
1908 | 1918 | ||
1909 | 1919 | ||
@@ -1918,11 +1928,7 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, | |||
1918 | * @param keywords under which keywords should this directory be available | 1928 | * @param keywords under which keywords should this directory be available |
1919 | * directly; can be NULL | 1929 | * directly; can be NULL |
1920 | * @param meta metadata for the directory | 1930 | * @param meta metadata for the directory |
1921 | * @param anonymity what is the desired anonymity level for sharing? | 1931 | * @param bo block options |
1922 | * @param priority what is the priority for OUR node to | ||
1923 | * keep this file available? Use 0 for maximum anonymity and | ||
1924 | * minimum reliability... | ||
1925 | * @param expirationTime when should this content expire? | ||
1926 | * @return publish structure entry for the directory , NULL on error | 1932 | * @return publish structure entry for the directory , NULL on error |
1927 | */ | 1933 | */ |
1928 | struct GNUNET_FS_FileInformation * | 1934 | struct GNUNET_FS_FileInformation * |
@@ -1930,9 +1936,7 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, | |||
1930 | void *client_info, | 1936 | void *client_info, |
1931 | const struct GNUNET_FS_Uri *keywords, | 1937 | const struct GNUNET_FS_Uri *keywords, |
1932 | const struct GNUNET_CONTAINER_MetaData *meta, | 1938 | const struct GNUNET_CONTAINER_MetaData *meta, |
1933 | uint32_t anonymity, | 1939 | const struct GNUNET_FS_BlockOptions *bo); |
1934 | uint32_t priority, | ||
1935 | struct GNUNET_TIME_Absolute expirationTime); | ||
1936 | 1940 | ||
1937 | 1941 | ||
1938 | /** | 1942 | /** |
@@ -2069,9 +2073,8 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *cls, | |||
2069 | * @param ksk_uri keywords to use | 2073 | * @param ksk_uri keywords to use |
2070 | * @param meta metadata to use | 2074 | * @param meta metadata to use |
2071 | * @param uri URI to refer to in the KBlock | 2075 | * @param uri URI to refer to in the KBlock |
2072 | * @param expirationTime when the KBlock expires | 2076 | * @param bo block options |
2073 | * @param anonymity anonymity level for the KBlock | 2077 | * @param options publication options |
2074 | * @param priority priority for the KBlock | ||
2075 | * @param cont continuation | 2078 | * @param cont continuation |
2076 | * @param cont_cls closure for cont | 2079 | * @param cont_cls closure for cont |
2077 | */ | 2080 | */ |
@@ -2080,9 +2083,7 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2080 | const struct GNUNET_FS_Uri *ksk_uri, | 2083 | const struct GNUNET_FS_Uri *ksk_uri, |
2081 | const struct GNUNET_CONTAINER_MetaData *meta, | 2084 | const struct GNUNET_CONTAINER_MetaData *meta, |
2082 | const struct GNUNET_FS_Uri *uri, | 2085 | const struct GNUNET_FS_Uri *uri, |
2083 | struct GNUNET_TIME_Absolute expirationTime, | 2086 | const struct GNUNET_FS_BlockOptions *bo, |
2084 | uint32_t anonymity, | ||
2085 | uint32_t priority, | ||
2086 | enum GNUNET_FS_PublishOptions options, | 2087 | enum GNUNET_FS_PublishOptions options, |
2087 | GNUNET_FS_PublishContinuation cont, | 2088 | GNUNET_FS_PublishContinuation cont, |
2088 | void *cont_cls); | 2089 | void *cont_cls); |
@@ -2097,9 +2098,8 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2097 | * @param update update identifier to use | 2098 | * @param update update identifier to use |
2098 | * @param meta metadata to use | 2099 | * @param meta metadata to use |
2099 | * @param uri URI to refer to in the SBlock | 2100 | * @param uri URI to refer to in the SBlock |
2100 | * @param expirationTime when the SBlock expires | 2101 | * @param bo block options |
2101 | * @param anonymity anonymity level for the SBlock | 2102 | * @param options publication options |
2102 | * @param priority priority for the SBlock | ||
2103 | * @param cont continuation | 2103 | * @param cont continuation |
2104 | * @param cont_cls closure for cont | 2104 | * @param cont_cls closure for cont |
2105 | */ | 2105 | */ |
@@ -2110,9 +2110,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
2110 | const char *update, | 2110 | const char *update, |
2111 | const struct GNUNET_CONTAINER_MetaData *meta, | 2111 | const struct GNUNET_CONTAINER_MetaData *meta, |
2112 | const struct GNUNET_FS_Uri *uri, | 2112 | const struct GNUNET_FS_Uri *uri, |
2113 | struct GNUNET_TIME_Absolute expirationTime, | 2113 | const struct GNUNET_FS_BlockOptions *bo, |
2114 | uint32_t anonymity, | ||
2115 | uint32_t priority, | ||
2116 | enum GNUNET_FS_PublishOptions options, | 2114 | enum GNUNET_FS_PublishOptions options, |
2117 | GNUNET_FS_PublishContinuation cont, | 2115 | GNUNET_FS_PublishContinuation cont, |
2118 | void *cont_cls); | 2116 | void *cont_cls); |
@@ -2180,9 +2178,7 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2180 | * @param ksk_uri keywords to use for advertisment | 2178 | * @param ksk_uri keywords to use for advertisment |
2181 | * @param namespace handle for the namespace that should be advertised | 2179 | * @param namespace handle for the namespace that should be advertised |
2182 | * @param meta meta-data for the namespace advertisement | 2180 | * @param meta meta-data for the namespace advertisement |
2183 | * @param anonymity for the namespace advertismement | 2181 | * @param bo block options |
2184 | * @param priority for the namespace advertisement | ||
2185 | * @param expiration for the namespace advertisement | ||
2186 | * @param rootEntry name of the root of the namespace | 2182 | * @param rootEntry name of the root of the namespace |
2187 | * @param cont continuation | 2183 | * @param cont continuation |
2188 | * @param cont_cls closure for cont | 2184 | * @param cont_cls closure for cont |
@@ -2192,9 +2188,7 @@ GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | |||
2192 | struct GNUNET_FS_Uri *ksk_uri, | 2188 | struct GNUNET_FS_Uri *ksk_uri, |
2193 | struct GNUNET_FS_Namespace *namespace, | 2189 | struct GNUNET_FS_Namespace *namespace, |
2194 | const struct GNUNET_CONTAINER_MetaData *meta, | 2190 | const struct GNUNET_CONTAINER_MetaData *meta, |
2195 | uint32_t anonymity, | 2191 | const struct GNUNET_FS_BlockOptions *bo, |
2196 | uint32_t priority, | ||
2197 | struct GNUNET_TIME_Absolute expiration, | ||
2198 | const char *rootEntry, | 2192 | const char *rootEntry, |
2199 | GNUNET_FS_PublishContinuation cont, | 2193 | GNUNET_FS_PublishContinuation cont, |
2200 | void *cont_cls); | 2194 | void *cont_cls); |