aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-15 09:59:33 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-15 09:59:33 +0000
commit35885b75d0d876cb20a68706d909ad2657be2c2b (patch)
tree5faf5b44628ca3060ceffb47c1aa329f163fa3d0 /src/fs/gnunet-service-fs.h
parentea844835472d3a60037757a17d840f09c29d1bd3 (diff)
downloadgnunet-35885b75d0d876cb20a68706d909ad2657be2c2b.tar.gz
gnunet-35885b75d0d876cb20a68706d909ad2657be2c2b.zip
moving P2P messages out of fs.h
Diffstat (limited to 'src/fs/gnunet-service-fs.h')
-rw-r--r--src/fs/gnunet-service-fs.h109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h
index 7efeedd5f..5a275c5ff 100644
--- a/src/fs/gnunet-service-fs.h
+++ b/src/fs/gnunet-service-fs.h
@@ -52,6 +52,115 @@
52 */ 52 */
53#define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250) 53#define DATASTORE_LOAD_AUTODECLINE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 250)
54 54
55/**
56 * Only the (mandatory) query is included.
57 */
58#define GET_MESSAGE_BIT_QUERY_ONLY 0
59
60/**
61 * The peer identity of a peer waiting for the
62 * reply is included (used if the response
63 * should be transmitted to someone other than
64 * the sender of the GET).
65 */
66#define GET_MESSAGE_BIT_RETURN_TO 1
67
68/**
69 * The hash of the public key of the target
70 * namespace is included (for SKS queries).
71 */
72#define GET_MESSAGE_BIT_SKS_NAMESPACE 2
73
74/**
75 * The peer identity of a peer that had claimed to have the content
76 * previously is included (can be used if responder-anonymity is not
77 * desired; note that the precursor presumably lacked a direct
78 * connection to the specified peer; still, the receiver is in no way
79 * required to limit forwarding only to the specified peer, it should
80 * only prefer it somewhat if possible).
81 */
82#define GET_MESSAGE_BIT_TRANSMIT_TO 4
83
84
85/**
86 * Message sent between peers asking for FS-content.
87 */
88struct GetMessage
89{
90
91 /**
92 * Message type will be GNUNET_MESSAGE_TYPE_FS_GET.
93 */
94 struct GNUNET_MessageHeader header;
95
96 /**
97 * Type of the query (block type).
98 */
99 uint32_t type GNUNET_PACKED;
100
101 /**
102 * How important is this request (network byte order)
103 */
104 uint32_t priority GNUNET_PACKED;
105
106 /**
107 * Relative time to live in MILLISECONDS (network byte order)
108 */
109 int32_t ttl GNUNET_PACKED;
110
111 /**
112 * The content hash should be mutated using this value
113 * before checking against the bloomfilter (used to
114 * get many different filters for the same hash codes).
115 * The number should be in big-endian format when used
116 * for mingling.
117 */
118 uint32_t filter_mutator GNUNET_PACKED;
119
120 /**
121 * Which of the optional hash codes are present at the end of the
122 * message? See GET_MESSAGE_BIT_xx constants. For each bit that is
123 * set, an additional GNUNET_HashCode with the respective content
124 * (in order of the bits) will be appended to the end of the GET
125 * message.
126 */
127 uint32_t hash_bitmap GNUNET_PACKED;
128
129 /**
130 * Hashcodes of the file(s) we're looking for.
131 * Details depend on the query type.
132 */
133 GNUNET_HashCode query GNUNET_PACKED;
134
135 /* this is followed by hash codes as specified in the "hash_bitmap";
136 * after that, an optional bloomfilter (with bits set for replies
137 * that should be suppressed) can be present */
138};
139
140
141/**
142 * Message send by a peer that wants to be excluded
143 * from migration for a while.
144 */
145struct MigrationStopMessage
146{
147 /**
148 * Message type will be
149 * GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP.
150 */
151 struct GNUNET_MessageHeader header;
152
153 /**
154 * Always zero.
155 */
156 uint32_t reserved GNUNET_PACKED;
157
158 /**
159 * How long should the block last?
160 */
161 struct GNUNET_TIME_RelativeNBO duration;
162
163};
55 164
56 165
57/** 166/**