[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5872 - in GNUnet/src: applications/fs applications/fs/ecrs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5872 - in GNUnet/src: applications/fs applications/fs/ecrs applications/fs/lib applications/fs/module include transports util/crypto util/network util/network_client util/os util/threads |
Date: |
Tue, 11 Dec 2007 23:59:48 -0700 (MST) |
Author: grothoff
Date: 2007-12-11 23:59:46 -0700 (Tue, 11 Dec 2007)
New Revision: 5872
Modified:
GNUnet/src/applications/fs/ecrs/keyspace.c
GNUnet/src/applications/fs/ecrs/search.c
GNUnet/src/applications/fs/ecrs/unindex.c
GNUnet/src/applications/fs/ecrs/upload.c
GNUnet/src/applications/fs/ecrs_core.c
GNUnet/src/applications/fs/ecrs_core_test.c
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/lib/fslibtest.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/fs/module/ondemand.c
GNUnet/src/include/ecrs_core.h
GNUnet/src/include/gnunet_fs_lib.h
GNUnet/src/include/gnunet_util_network.h
GNUnet/src/transports/tcp.c
GNUnet/src/transports/tcp6.c
GNUnet/src/transports/udp.c
GNUnet/src/transports/udp6.c
GNUnet/src/util/crypto/crc32.c
GNUnet/src/util/crypto/hostkey_gcrypt.c
GNUnet/src/util/crypto/kblockkey.c
GNUnet/src/util/crypto/locking_gcrypt.c
GNUnet/src/util/crypto/locking_gcrypt.h
GNUnet/src/util/crypto/random.c
GNUnet/src/util/crypto/symcipher_gcrypt.c
GNUnet/src/util/network/dns.c
GNUnet/src/util/network/io.c
GNUnet/src/util/network/select.c
GNUnet/src/util/network/selecttest.c
GNUnet/src/util/network_client/tcpio.c
GNUnet/src/util/network_client/tcpiotest.c
GNUnet/src/util/os/cpustatus.c
GNUnet/src/util/os/dso.c
GNUnet/src/util/os/init.c
GNUnet/src/util/threads/pthread.c
GNUnet/src/util/threads/shutdown.c
Log:
more renaming stuff
Modified: GNUnet/src/applications/fs/ecrs/keyspace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/keyspace.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs/keyspace.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -66,7 +66,7 @@
type = ntohl (value->type);
size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
if (GNUNET_OK !=
- getQueryFor (size, (DBlock *) & value[1], GNUNET_YES, &query))
+ GNUNET_EC_file_block_check_and_get_query (size, (DBlock *) & value[1],
GNUNET_YES, &query))
return GNUNET_SYSERR;
GNUNET_GE_ASSERT (ectx, type == GNUNET_GNUNET_ECRS_BLOCKTYPE_KEYWORD);
@@ -237,7 +237,7 @@
#if EXTRA_CHECKS
/* extra check: verify sig */
GNUNET_GE_ASSERT (ectx,
- GNUNET_OK == getQueryFor (size, (DBlock *) kb,
+ GNUNET_OK == GNUNET_EC_file_block_check_and_get_query
(size, (DBlock *) kb,
GNUNET_YES, &hc));
#endif
GNUNET_RSA_free_key (pk);
Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs/search.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -338,7 +338,7 @@
size);
#endif
if (GNUNET_OK !=
- getQueryFor (size, (const DBlock *) &value[1], GNUNET_YES, &query))
+ GNUNET_EC_file_block_check_and_get_query (size, (const DBlock *)
&value[1], GNUNET_YES, &query))
return GNUNET_SYSERR;
for (i = 0; i < sqc->queryCount; i++)
{
@@ -347,7 +347,7 @@
&ps->keys[0], sizeof (GNUNET_HashCode))) &&
((ps->type == type) ||
(ps->type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)) &&
- (GNUNET_YES == isDatumApplicable (type,
+ (GNUNET_YES == GNUNET_EC_is_block_applicable_for_query (type,
size,
(const DBlock *) &value[1],
&query, ps->keyCount, ps->keys)))
Modified: GNUnet/src/applications/fs/ecrs/unindex.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/unindex.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs/unindex.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -68,14 +68,14 @@
db = (DBlock *) & iblocks[level][1];
if (present == CHK_PER_INODE)
{
- fileBlockGetKey (db, size, &ichk.key);
- fileBlockGetQuery (db, size, &ichk.query);
+ GNUNET_EC_file_block_get_key (db, size, &ichk.key);
+ GNUNET_EC_file_block_get_query (db, size, &ichk.query);
if (GNUNET_OK != pushBlock (sock, &ichk, level + 1, iblocks))
{
GNUNET_GE_BREAK (NULL, 0);
return GNUNET_SYSERR;
}
- fileBlockEncode (db, size, &ichk.query, &value);
+ GNUNET_EC_file_block_encode (db, size, &ichk.query, &value);
#if STRICT_CHECKS
if (GNUNET_SYSERR == GNUNET_FS_delete (sock, value))
{
@@ -282,8 +282,8 @@
if (tt != NULL)
if (GNUNET_OK != tt (ttClosure))
goto FAILURE;
- fileBlockGetKey (db, size + sizeof (DBlock), &chk.key);
- fileBlockGetQuery (db, size + sizeof (DBlock), &chk.query);
+ GNUNET_EC_file_block_get_key (db, size + sizeof (DBlock), &chk.key);
+ GNUNET_EC_file_block_get_query (db, size + sizeof (DBlock), &chk.query);
if (GNUNET_OK != pushBlock (sock, &chk, 0, /* dblocks are on
level 0 */
iblocks))
{
@@ -292,7 +292,7 @@
}
if (!wasIndexed)
{
- if (GNUNET_OK == fileBlockEncode (db, size, &chk.query, &value))
+ if (GNUNET_OK == GNUNET_EC_file_block_encode (db, size, &chk.query,
&value))
{
*value = *dblock; /* copy options! */
#if STRICT_CHECKS
@@ -325,14 +325,14 @@
{
size = ntohl (iblocks[i]->size) - sizeof (GNUNET_DatastoreValue);
db = (DBlock *) & iblocks[i][1];
- fileBlockGetKey (db, size, &chk.key);
- fileBlockGetQuery (db, size, &chk.query);
+ GNUNET_EC_file_block_get_key (db, size, &chk.key);
+ GNUNET_EC_file_block_get_query (db, size, &chk.query);
if (GNUNET_OK != pushBlock (sock, &chk, i + 1, iblocks))
{
GNUNET_GE_BREAK (ectx, 0);
goto FAILURE;
}
- fileBlockEncode (db, size, &chk.query, &value);
+ GNUNET_EC_file_block_encode (db, size, &chk.query, &value);
#if STRICT_CHECKS
if (GNUNET_OK != GNUNET_FS_delete (sock, value))
{
Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs/upload.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -70,13 +70,13 @@
db = (DBlock *) & iblocks[level][1];
if (present == CHK_PER_INODE)
{
- fileBlockGetKey (db, size, &ichk.key);
- fileBlockGetQuery (db, size, &ichk.query);
+ GNUNET_EC_file_block_get_key (db, size, &ichk.key);
+ GNUNET_EC_file_block_get_query (db, size, &ichk.query);
if (GNUNET_OK != pushBlock (sock,
&ichk, level + 1, iblocks, prio,
expirationTime))
return GNUNET_SYSERR;
- fileBlockEncode (db, size, &ichk.query, &value);
+ GNUNET_EC_file_block_encode (db, size, &ichk.query, &value);
if (value == NULL)
{
GNUNET_GE_BREAK (NULL, 0);
@@ -288,8 +288,8 @@
if (tt != NULL)
if (GNUNET_OK != tt (ttClosure))
goto FAILURE;
- fileBlockGetKey (db, size + sizeof (DBlock), &mchk.key);
- fileBlockGetQuery (db, size + sizeof (DBlock), &mchk.query);
+ GNUNET_EC_file_block_get_key (db, size + sizeof (DBlock), &mchk.key);
+ GNUNET_EC_file_block_get_query (db, size + sizeof (DBlock), &mchk.query);
#if DEBUG_UPLOAD
IF_GELOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
@@ -315,7 +315,7 @@
{
value = NULL;
if (GNUNET_OK !=
- fileBlockEncode (db,
+ GNUNET_EC_file_block_encode (db,
size + sizeof (DBlock), &mchk.query, &value))
{
GNUNET_GE_BREAK (ectx, 0);
@@ -366,13 +366,13 @@
continue;
}
db = (DBlock *) & iblocks[i][1];
- fileBlockGetKey (db, size, &mchk.key);
+ GNUNET_EC_file_block_get_key (db, size, &mchk.key);
#if DEBUG_UPLOAD
GNUNET_GE_LOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
"Computing query for %u bytes content.\n", size);
#endif
- fileBlockGetQuery (db, size, &mchk.query);
+ GNUNET_EC_file_block_get_query (db, size, &mchk.query);
#if DEBUG_UPLOAD
IF_GELOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST | GNUNET_GE_USER,
@@ -389,7 +389,7 @@
GNUNET_GE_BREAK (ectx, 0);
goto FAILURE;
}
- fileBlockEncode (db, size, &mchk.query, &value);
+ GNUNET_EC_file_block_encode (db, size, &mchk.query, &value);
if (value == NULL)
{
GNUNET_GE_BREAK (ectx, 0);
Modified: GNUnet/src/applications/fs/ecrs_core.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs_core.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -44,7 +44,7 @@
* match the query
*/
int
-fileBlockEncode (const DBlock * data,
+GNUNET_EC_file_block_encode (const DBlock * data,
unsigned int len,
const GNUNET_HashCode * query,
GNUNET_DatastoreValue ** value)
@@ -89,7 +89,7 @@
* a certain block of data.
*/
void
-fileBlockGetKey (const DBlock * data, unsigned int len, GNUNET_HashCode * key)
+GNUNET_EC_file_block_get_key (const DBlock * data, unsigned int len,
GNUNET_HashCode * key)
{
GNUNET_GE_ASSERT (NULL, len >= sizeof (DBlock));
GNUNET_hash (&data[1], len - sizeof (DBlock), key);
@@ -102,7 +102,7 @@
* @param db the block in plaintext
*/
void
-fileBlockGetQuery (const DBlock * db, unsigned int len,
+GNUNET_EC_file_block_get_query (const DBlock * db, unsigned int len,
GNUNET_HashCode * query)
{
char *tmp;
@@ -125,7 +125,7 @@
}
unsigned int
-getTypeOfBlock (unsigned int size, const DBlock * data)
+GNUNET_EC_file_block_get_type (unsigned int size, const DBlock * data)
{
if (size <= 4)
{
@@ -145,12 +145,12 @@
* the content type is not known
*/
int
-getQueryFor (unsigned int size,
+GNUNET_EC_file_block_check_and_get_query (unsigned int size,
const DBlock * data, int verify, GNUNET_HashCode * query)
{
unsigned int type;
- type = getTypeOfBlock (size, data);
+ type = GNUNET_EC_file_block_get_type (size, data);
if (type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY)
{
GNUNET_GE_BREAK (NULL, 0);
@@ -274,7 +274,7 @@
* @param type the type of the query
* @param size the size of the data
* @param data the encoded data
- * @param hc result of getQueryFor
+ * @param hc result of GNUNET_EC_file_block_check_and_get_query
* @param keyCount the number of keys in the query,
* use 0 to match only primary key
* @param keys the keys of the query
@@ -283,7 +283,7 @@
* query type
*/
int
-isDatumApplicable (unsigned int type,
+GNUNET_EC_is_block_applicable_for_query (unsigned int type,
unsigned int size,
const DBlock * data,
const GNUNET_HashCode * hc,
@@ -291,7 +291,7 @@
{
GNUNET_HashCode h;
- if (type != getTypeOfBlock (size, data))
+ if (type != GNUNET_EC_file_block_get_type (size, data))
{
GNUNET_GE_BREAK (NULL, 0);
return GNUNET_SYSERR; /* type mismatch */
Modified: GNUnet/src/applications/fs/ecrs_core_test.c
===================================================================
--- GNUnet/src/applications/fs/ecrs_core_test.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/ecrs_core_test.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -43,14 +43,14 @@
data = GNUNET_malloc (len);
memset (&data[1], rand (), len - sizeof (DBlock));
data->type = htonl (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA);
- CHECK (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA == getTypeOfBlock (len, data),
+ CHECK (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA == GNUNET_EC_file_block_get_type
(len, data),
data);
- fileBlockGetKey (data, len, &key);
- fileBlockGetQuery (data, len, &query);
- CHECK (GNUNET_OK == fileBlockEncode (data, len, &query, &value), data);
+ GNUNET_EC_file_block_get_key (data, len, &key);
+ GNUNET_EC_file_block_get_query (data, len, &query);
+ CHECK (GNUNET_OK == GNUNET_EC_file_block_encode (data, len, &query, &value),
data);
memcpy (data, &value[1], len);
GNUNET_free (value);
- CHECK (GNUNET_YES == isDatumApplicable (GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
+ CHECK (GNUNET_YES == GNUNET_EC_is_block_applicable_for_query
(GNUNET_GNUNET_ECRS_BLOCKTYPE_DATA,
len, data, &query, 1, &query),
data);
GNUNET_free (data);
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/lib/fslib.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -98,7 +98,7 @@
}
rep = (const CS_fs_reply_content_MESSAGE *) hdr;
size = ntohs (hdr->size) - sizeof (CS_fs_reply_content_MESSAGE);
- if (GNUNET_OK != getQueryFor (size, (DBlock *) & rep[1], GNUNET_NO,
/* gnunetd will have checked already */
+ if (GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
(DBlock *) & rep[1], GNUNET_NO, /* gnunetd will have checked already */
&query))
{
GNUNET_GE_BREAK (ctx->ectx, 0);
@@ -123,7 +123,7 @@
value->size =
htonl (size + sizeof (GNUNET_DatastoreValue));
value->type =
- htonl (getTypeOfBlock (size, (DBlock *) & rep[1]));
+ htonl (GNUNET_EC_file_block_get_type (size, (DBlock *)
& rep[1]));
value->prio = htonl (0);
value->anonymityLevel = rep->anonymityLevel;
value->expirationTime = rep->expirationTime;
Modified: GNUnet/src/applications/fs/lib/fslibtest.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslibtest.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/lib/fslibtest.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -125,11 +125,11 @@
int ret;
blk = makeBlock (cls->i);
- fileBlockGetQuery ((DBlock *) & blk[1],
+ GNUNET_EC_file_block_get_query ((DBlock *) & blk[1],
ntohl (blk->size) - sizeof (GNUNET_DatastoreValue),
&ekey);
GNUNET_GE_ASSERT (NULL,
- GNUNET_OK == fileBlockEncode ((DBlock *) & blk[1],
+ GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) &
blk[1],
ntohl (blk->size) -
sizeof
(GNUNET_DatastoreValue),
@@ -167,7 +167,7 @@
dv = makeBlock (i);
db = (DBlock *) & dv[1];
- fileBlockGetQuery (db, ntohl (dv->size) - sizeof (GNUNET_DatastoreValue),
+ GNUNET_EC_file_block_get_query (db, ntohl (dv->size) - sizeof
(GNUNET_DatastoreValue),
&query);
GNUNET_free (dv);
closure.found = GNUNET_NO;
@@ -247,10 +247,10 @@
{
fprintf (stderr, ".");
block = makeBlock (i);
- fileBlockGetQuery ((DBlock *) & block[1],
+ GNUNET_EC_file_block_get_query ((DBlock *) & block[1],
ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
&query);
- CHECK (GNUNET_OK == fileBlockEncode ((DBlock *) & block[1],
+ CHECK (GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) & block[1],
ntohl (block->size) -
sizeof (GNUNET_DatastoreValue),
&query, &eblock));
@@ -290,10 +290,10 @@
{
fprintf (stderr, ".");
block = makeBlock (i);
- fileBlockGetQuery ((DBlock *) & block[1],
+ GNUNET_EC_file_block_get_query ((DBlock *) & block[1],
ntohl (block->size) - sizeof (GNUNET_DatastoreValue),
&query);
- CHECK (GNUNET_OK == fileBlockEncode ((DBlock *) & block[1],
+ CHECK (GNUNET_OK == GNUNET_EC_file_block_encode ((DBlock *) & block[1],
ntohl (block->size) -
sizeof (GNUNET_DatastoreValue),
&query, &eblock));
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/applications/fs/module/fs.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -125,7 +125,7 @@
sizeof (GNUNET_DatastoreValue);
dv = GNUNET_malloc (size);
dv->size = htonl (size);
- dv->type = htonl (getTypeOfBlock (size - sizeof (GNUNET_DatastoreValue),
+ dv->type = htonl (GNUNET_EC_file_block_get_type (size - sizeof
(GNUNET_DatastoreValue),
(DBlock *) & gw[1]));
dv->prio = htonl (prio);
dv->anonymityLevel = htonl (0);
@@ -170,7 +170,7 @@
gw = (const GapWrapper *) value;
size = ntohl (gw->dc.size) - sizeof (GapWrapper);
- if ((GNUNET_OK != getQueryFor (size,
+ if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
(const DBlock *) &gw[1],
GNUNET_YES, &hc))
|| (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
@@ -184,7 +184,7 @@
GNUNET_GE_BREAK_OP (ectx, 0);
return GNUNET_SYSERR;
}
- if (GNUNET_YES != isDatumApplicable (ntohl (dv->type),
+ if (GNUNET_YES != GNUNET_EC_is_block_applicable_for_query (ntohl (dv->type),
ntohl (dv->size) -
sizeof (GNUNET_DatastoreValue),
(const DBlock *) &dv[1], &hc, 0,
@@ -247,7 +247,7 @@
#endif
gw = (const GapWrapper *) value;
size = ntohl (gw->dc.size) - sizeof (GapWrapper);
- if ((GNUNET_OK != getQueryFor (size,
+ if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size,
(const DBlock *) &gw[1],
GNUNET_YES, &hc))
|| (0 != memcmp (&hc, query, sizeof (GNUNET_HashCode))))
@@ -344,7 +344,7 @@
datum->prio = ri->prio;
datum->anonymityLevel = ri->anonymityLevel;
if (GNUNET_OK !=
- getQueryFor (ntohs (ri->header.size) -
+ GNUNET_EC_file_block_check_and_get_query (ntohs (ri->header.size) -
sizeof (CS_fs_request_insert_MESSAGE),
(const DBlock *) &ri[1], GNUNET_YES, &query))
{
@@ -355,7 +355,7 @@
return GNUNET_SYSERR;
}
type =
- getTypeOfBlock (ntohs (ri->header.size) -
+ GNUNET_EC_file_block_get_type (ntohs (ri->header.size) -
sizeof (CS_fs_request_insert_MESSAGE),
(const DBlock *) &ri[1]);
#if DEBUG_FS
@@ -402,7 +402,7 @@
gw->timeout = GNUNET_htonll (et);
memcpy (&gw[1], &ri[1], size - sizeof (GapWrapper));
/* sanity check */
- if ((GNUNET_OK != getQueryFor (size - sizeof (GapWrapper),
+ if ((GNUNET_OK != GNUNET_EC_file_block_check_and_get_query (size -
sizeof (GapWrapper),
(const DBlock *) &gw[1],
GNUNET_YES,
&hc))
@@ -591,14 +591,14 @@
ntohl (sizeof (GNUNET_DatastoreValue) + ntohs (req->size) -
sizeof (CS_fs_request_delete_MESSAGE));
type =
- getTypeOfBlock (ntohs (rd->header.size) -
+ GNUNET_EC_file_block_get_type (ntohs (rd->header.size) -
sizeof (CS_fs_request_delete_MESSAGE),
(const DBlock *) &rd[1]);
value->type = htonl (type);
memcpy (&value[1],
&rd[1], ntohs (req->size) - sizeof (CS_fs_request_delete_MESSAGE));
if (GNUNET_OK !=
- getQueryFor (ntohs (rd->header.size) -
+ GNUNET_EC_file_block_check_and_get_query (ntohs (rd->header.size) -
sizeof (CS_fs_request_delete_MESSAGE),
(const DBlock *) &rd[1], GNUNET_NO, &query))
{
@@ -776,7 +776,7 @@
}
#if EXTRA_CHECKS
if ((GNUNET_OK !=
- getQueryFor (ntohl (value->size) - sizeof (GNUNET_DatastoreValue),
+ GNUNET_EC_file_block_check_and_get_query (ntohl (value->size) - sizeof
(GNUNET_DatastoreValue),
(const DBlock *) &value[1], GNUNET_YES, &hc))
|| (!equalsGNUNET_HashCode (&hc, key)))
{
@@ -784,7 +784,7 @@
return GNUNET_SYSERR;
}
#endif
- ret = isDatumApplicable (ntohl (value->type),
+ ret = GNUNET_EC_is_block_applicable_for_query (ntohl (value->type),
ntohl (value->size) -
sizeof (GNUNET_DatastoreValue),
(const DBlock *) &value[1], key, ggc->keyCount,
@@ -967,14 +967,14 @@
return GNUNET_NO;
}
gw = (const GapWrapper *) content;
- if ((GNUNET_OK == getQueryFor (size - sizeof (GapWrapper),
+ if ((GNUNET_OK == GNUNET_EC_file_block_check_and_get_query (size - sizeof
(GapWrapper),
(const DBlock *) &gw[1],
verify,
&q)) &&
(0 == memcmp (&q,
primaryKey, sizeof (GNUNET_HashCode))) &&
((type == GNUNET_GNUNET_ECRS_BLOCKTYPE_ANY) ||
- (type == (t = getTypeOfBlock (size - sizeof (GapWrapper),
+ (type == (t = GNUNET_EC_file_block_get_type (size - sizeof (GapWrapper),
(const DBlock *) &gw[1])))))
{
switch (type)
Modified: GNUnet/src/applications/fs/module/ondemand.c
===================================================================
--- GNUnet/src/applications/fs/module/ondemand.c 2007-12-12 06:43:45 UTC
(rev 5871)
+++ GNUnet/src/applications/fs/module/ondemand.c 2007-12-12 06:59:46 UTC
(rev 5872)
@@ -250,11 +250,11 @@
odb.blockSize = htonl (size - sizeof (DBlock));
odb.fileId = *fileId;
/* compute the primary key */
- fileBlockGetQuery (content, size, &key);
+ GNUNET_EC_file_block_get_query (content, size, &key);
#if EXTRA_CHECKS
{
GNUNET_DatastoreValue *dsvalue;
- if (GNUNET_OK != fileBlockEncode (content, size, &key, &dsvalue))
+ if (GNUNET_OK != GNUNET_EC_file_block_encode (content, size, &key,
&dsvalue))
{
GNUNET_GE_BREAK (cectx, 0);
GNUNET_GE_BREAK (ectx, 0);
@@ -501,7 +501,7 @@
return GNUNET_SYSERR;
}
CLOSE (fileHandle);
- ret = fileBlockEncode (db,
+ ret = GNUNET_EC_file_block_encode (db,
ntohl (odb->blockSize) + sizeof (DBlock),
query, enc);
GNUNET_free (db);
@@ -652,7 +652,7 @@
odb.blockSize = htonl (delta);
odb.fileId = *fileId;
/* compute the primary key */
- fileBlockGetQuery (block, delta + sizeof (DBlock), &key);
+ GNUNET_EC_file_block_get_query (block, delta + sizeof (DBlock), &key);
if (GNUNET_SYSERR == datastore->get (&key,
GNUNET_GNUNET_ECRS_BLOCKTYPE_ONDEMAND, &completeValue, &odb.header)) /*
aborted == found! */
ret = datastore->del (&key, &odb.header);
else /* not found */
Modified: GNUnet/src/include/ecrs_core.h
===================================================================
--- GNUnet/src/include/ecrs_core.h 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/include/ecrs_core.h 2007-12-12 06:59:46 UTC (rev 5872)
@@ -239,7 +239,7 @@
* @return GNUNET_OK on success, GNUNET_SYSERR if data does not
* match the query
*/
-int fileBlockEncode (const DBlock * data,
+int GNUNET_EC_file_block_encode (const DBlock * data,
unsigned int len,
const GNUNET_HashCode * query,
GNUNET_DatastoreValue ** value);
@@ -248,7 +248,7 @@
* Get the query that will be used to query for
* a certain block of data.
*/
-void fileBlockGetQuery (const DBlock * data,
+void GNUNET_EC_file_block_get_query (const DBlock * data,
unsigned int len, GNUNET_HashCode * query);
@@ -256,13 +256,13 @@
* Get the key that will be used to decrypt
* a certain block of data.
*/
-void fileBlockGetKey (const DBlock * data,
+void GNUNET_EC_file_block_get_key (const DBlock * data,
unsigned int len, GNUNET_HashCode * key);
/**
* What is the type of the given block of data?
*/
-unsigned int getTypeOfBlock (unsigned int size, const DBlock * data);
+unsigned int GNUNET_EC_file_block_get_type (unsigned int size, const DBlock *
data);
/**
* What is the main query (the one that is used in
@@ -277,7 +277,7 @@
* @return GNUNET_SYSERR if the content is invalid or
* the content type is not known
*/
-int getQueryFor (unsigned int size,
+int GNUNET_EC_file_block_check_and_get_query (unsigned int size,
const DBlock * data, int verify, GNUNET_HashCode * query);
/**
@@ -287,14 +287,14 @@
* @param type the type of the queryo
* @param size the size of the data
* @param data the encoded data
- * @param knownDatumQuery result of getQueryFor
+ * @param knownDatumQuery result of GNUNET_EC_file_block_check_and_get_query
* @param keyCount the number of keys in the query
* @param keys the keys of the query
* @return GNUNET_YES if this data matches the query, otherwise
* GNUNET_NO; GNUNET_SYSERR if the keyCount does not match the
* query type
*/
-int isDatumApplicable (unsigned int type,
+int GNUNET_EC_is_block_applicable_for_query (unsigned int type,
unsigned int size,
const DBlock * data,
const GNUNET_HashCode * knownDatumQuery,
Modified: GNUnet/src/include/gnunet_fs_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fs_lib.h 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/include/gnunet_fs_lib.h 2007-12-12 06:59:46 UTC (rev 5872)
@@ -112,7 +112,7 @@
*
* @param block the block (properly encoded and all)
* @return GNUNET_OK on success, GNUNET_SYSERR on error
- * @see ecrs_core.h::fileBlockEncode
+ * @see ecrs_core.h::GNUNET_EC_file_block_encode
*/
int GNUNET_FS_insert (struct GNUNET_ClientServerConnection *sock,
const GNUNET_DatastoreValue * block);
Modified: GNUnet/src/include/gnunet_util_network.h
===================================================================
--- GNUnet/src/include/gnunet_util_network.h 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/include/gnunet_util_network.h 2007-12-12 06:59:46 UTC (rev
5872)
@@ -330,7 +330,7 @@
* The OS socket should henceforth be no longer used
* directly. GNUNET_socket_destroy will close it.
*/
-struct GNUNET_SocketHandle *socket_create (struct GNUNET_GE_Context *ectx,
+struct GNUNET_SocketHandle *GNUNET_socket_create (struct GNUNET_GE_Context
*ectx,
struct GNUNET_LoadMonitor *mon,
int osSocket);
Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/transports/tcp.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -374,7 +374,7 @@
GNUNET_GE_BULK, "socket");
return GNUNET_SYSERR;
}
- s = socket_create (ectx, coreAPI->load_monitor, sock);
+ s = GNUNET_socket_create (ectx, coreAPI->load_monitor, sock);
#if TCP_SYNCNT
/* only try a single packet to establish connection,
if that does not work, abort instantly */
Modified: GNUnet/src/transports/tcp6.c
===================================================================
--- GNUnet/src/transports/tcp6.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/transports/tcp6.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -344,7 +344,7 @@
sock = -1;
continue;
}
- s = socket_create (ectx, coreAPI->load_monitor, sock);
+ s = GNUNET_socket_create (ectx, coreAPI->load_monitor, sock);
if (-1 == GNUNET_socket_set_blocking (s, GNUNET_NO))
{
GNUNET_socket_destroy (s);
Modified: GNUnet/src/transports/udp.c
===================================================================
--- GNUnet/src/transports/udp.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/transports/udp.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -451,7 +451,7 @@
selector = NULL;
return GNUNET_SYSERR;
}
- udp_sock = socket_create (ectx, load_monitor, sock);
+ udp_sock = GNUNET_socket_create (ectx, load_monitor, sock);
GNUNET_GE_ASSERT (ectx, udp_sock != NULL);
return GNUNET_OK;
}
Modified: GNUnet/src/transports/udp6.c
===================================================================
--- GNUnet/src/transports/udp6.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/transports/udp6.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -404,7 +404,7 @@
selector = NULL;
return GNUNET_SYSERR;
}
- udp_sock = socket_create (ectx, load_monitor, sock);
+ udp_sock = GNUNET_socket_create (ectx, load_monitor, sock);
return GNUNET_OK;
}
Modified: GNUnet/src/util/crypto/crc32.c
===================================================================
--- GNUnet/src/util/crypto/crc32.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/crypto/crc32.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -52,7 +52,7 @@
* with the ccorrect final value. Thus, it is safe to call
* even on a table that someone else is using concurrently.
*/
-void __attribute__ ((constructor)) crc32_init (void)
+void __attribute__ ((constructor)) GNUNET_crc32_init ()
{
unsigned int i, j;
uLong h = 1;
Modified: GNUnet/src/util/crypto/hostkey_gcrypt.c
===================================================================
--- GNUnet/src/util/crypto/hostkey_gcrypt.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/crypto/hostkey_gcrypt.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -98,7 +98,7 @@
gcry_sexp_t s_keyparam;
int rc;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_sexp_build (&s_keyparam,
NULL,
"(genkey(rsa(nbits %d)(rsa-use-e 3:257)))",
@@ -106,7 +106,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_build", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
rc = gcry_pk_genkey (&s_key, s_keyparam);
@@ -114,7 +114,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_genkey", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
@@ -122,11 +122,11 @@
if ((rc = gcry_pk_testkey (s_key)))
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_testkey", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
#endif
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
ret = GNUNET_malloc (sizeof (struct GNUNET_RSA_PrivateKey));
ret->sexp = s_key;
return ret;
@@ -138,9 +138,9 @@
void
GNUNET_RSA_free_key (struct GNUNET_RSA_PrivateKey *hostkey)
{
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
gcry_sexp_release (hostkey->sexp);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
GNUNET_free (hostkey);
}
@@ -152,11 +152,11 @@
const char *s;
int i, idx;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
list = gcry_sexp_find_token (sexp, topname, 0);
if (!list)
{
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return 1;
}
l2 = gcry_sexp_cadr (list);
@@ -164,7 +164,7 @@
list = l2;
if (!list)
{
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return 2;
}
@@ -180,7 +180,7 @@
array[i] = NULL;
}
gcry_sexp_release (list);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return 3; /* required parameter not found */
}
array[idx] = gcry_sexp_nth_mpi (l2, 1, GCRYMPI_FMT_USG);
@@ -193,12 +193,12 @@
array[i] = NULL;
}
gcry_sexp_release (list);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return 4; /* required parameter is invalid */
}
}
gcry_sexp_release (list);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return 0;
}
@@ -215,7 +215,7 @@
size_t size;
int rc;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = key_from_sexp (skey, hostkey->sexp, "public-key", "ne");
if (rc)
rc = key_from_sexp (skey, hostkey->sexp, "private-key", "ne");
@@ -244,7 +244,7 @@
GNUNET_RSA_KEY_LEN - GNUNET_RSA_DATA_ENCODING_LEN);
gcry_mpi_release (skey[0]);
gcry_mpi_release (skey[1]);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
}
@@ -273,12 +273,12 @@
return NULL;
}
size = GNUNET_RSA_DATA_ENCODING_LEN;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_mpi_scan (&n, GCRYMPI_FMT_USG, &publicKey->key[0], size, &size);
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
size = GNUNET_RSA_KEY_LEN - GNUNET_RSA_DATA_ENCODING_LEN;
@@ -290,7 +290,7 @@
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
gcry_mpi_release (n);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
rc = gcry_sexp_build (&result,
@@ -300,10 +300,10 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_build", rc); /* erroff
gives more info */
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
ret = GNUNET_malloc (sizeof (struct GNUNET_RSA_PrivateKey));
ret->sexp = result;
return ret;
@@ -326,12 +326,12 @@
int i;
int size;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
#if EXTRA_CHECKS
if (gcry_pk_testkey (hostkey->sexp))
{
GNUNET_GE_BREAK (NULL, 0);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
#endif
@@ -351,7 +351,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "key_from_sexp", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
size = sizeof (GNUNET_RSA_PrivateKeyEncoded);
@@ -372,7 +372,7 @@
for (i = 0; i < 6; i++)
if (pkv[i] != NULL)
gcry_mpi_release (pkv[i]);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
}
@@ -412,7 +412,7 @@
if (pbu[i] != NULL)
free (pbu[i]);
}
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return retval;
}
@@ -432,7 +432,7 @@
pos = 0;
size = ntohs (encoding->sizen);
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_mpi_scan (&n,
GCRYMPI_FMT_USG,
&((const unsigned char *) (&encoding[1]))[pos],
@@ -441,7 +441,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
size = ntohs (encoding->sizee);
@@ -454,7 +454,7 @@
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
gcry_mpi_release (n);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
size = ntohs (encoding->sized);
@@ -468,7 +468,7 @@
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
gcry_mpi_release (n);
gcry_mpi_release (e);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
/* swap p and q! */
@@ -486,7 +486,7 @@
gcry_mpi_release (n);
gcry_mpi_release (e);
gcry_mpi_release (d);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
}
@@ -508,7 +508,7 @@
gcry_mpi_release (d);
if (q != NULL)
gcry_mpi_release (q);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
}
@@ -533,7 +533,7 @@
gcry_mpi_release (p);
if (q != NULL)
gcry_mpi_release (q);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
}
@@ -577,13 +577,13 @@
if (gcry_pk_testkey (res))
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_testkey", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return NULL;
}
#endif
ret = GNUNET_malloc (sizeof (struct GNUNET_RSA_PrivateKey));
ret->sexp = res;
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return ret;
}
@@ -615,13 +615,13 @@
GNUNET_GE_ASSERT (NULL, size <= sizeof (GNUNET_HashCode));
pubkey = public2PrivateKey (publicKey);
isize = size;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_mpi_scan (&val, GCRYMPI_FMT_USG, block, isize, &isize);
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
GNUNET_RSA_free_key (pubkey);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = gcry_sexp_build (&data,
@@ -631,7 +631,7 @@
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_build", rc); /* more info
in erroff */
GNUNET_RSA_free_key (pubkey);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
@@ -641,7 +641,7 @@
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_encrypt", rc);
gcry_sexp_release (data);
GNUNET_RSA_free_key (pubkey);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
gcry_sexp_release (data);
@@ -652,7 +652,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "key_from_sexp", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
isize = sizeof (GNUNET_RSA_EncryptedData);
@@ -662,11 +662,11 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_print", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
adjust (&target->encoding[0], isize, sizeof (GNUNET_RSA_EncryptedData));
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_OK;
}
@@ -694,13 +694,13 @@
unsigned char *endp;
unsigned char *tmp;
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
#if EXTRA_CHECKS
rc = gcry_pk_testkey (hostkey->sexp);
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_testkey", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
#endif
@@ -710,7 +710,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = gcry_sexp_build (&data, &erroff, "(enc-val(flags)(rsa(a %m)))", val);
@@ -718,7 +718,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_build", rc); /* more info
in erroff */
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = gcry_pk_decrypt (&resultsexp, data, hostkey->sexp);
@@ -726,7 +726,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_decrypt", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
@@ -736,7 +736,7 @@
if (val == NULL)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_nth_mpi", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
tmp = GNUNET_malloc (max + HOSTKEY_LEN / 8);
@@ -747,7 +747,7 @@
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_print", rc);
GNUNET_free (tmp);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
@@ -756,7 +756,7 @@
size = max;
memcpy (result, endp, size);
GNUNET_free (tmp);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return size;
}
@@ -793,13 +793,13 @@
strlen
("0123456789012345678901234567890123456789012345678901234567890123))")
- 1], &hc, sizeof (GNUNET_HashCode));
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_sexp_new (&data, buff, bufSize, 0);
GNUNET_free (buff);
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_new", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = gcry_pk_sign (&result, data, hostkey->sexp);
@@ -807,7 +807,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_pk_sign", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = key_from_sexp (&rval, result, "rsa", "s");
@@ -815,7 +815,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "key_from_sexp", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
ssize = sizeof (GNUNET_RSA_Signature);
@@ -825,11 +825,11 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_print", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
adjust (&sig->sig[0], ssize, sizeof (GNUNET_RSA_Signature));
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_OK;
}
@@ -860,14 +860,14 @@
int rc;
size = sizeof (GNUNET_RSA_Signature);
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_mpi_scan (&val,
GCRYMPI_FMT_USG,
(const unsigned char *) sig, size, &size);
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_mpi_scan", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
rc = gcry_sexp_build (&sigdata, &erroff, "(sig-val(rsa(s %m)))", val);
@@ -875,7 +875,7 @@
if (rc)
{
LOG_GCRY (NULL, LOG_ERROR, "gcry_sexp_build", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
GNUNET_hash (block, len, &hc);
@@ -906,12 +906,12 @@
GNUNET_GE_DEVELOPER,
_("RSA signature verification failed at %s:%d: %s\n"),
__FILE__, __LINE__, gcry_strerror (rc));
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_SYSERR;
}
else
{
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return GNUNET_OK;
}
}
Modified: GNUnet/src/util/crypto/kblockkey.c
===================================================================
--- GNUnet/src/util/crypto/kblockkey.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/crypto/kblockkey.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -558,12 +558,12 @@
return GNUNET_RSA_decode_key (line->pke);
}
-void __attribute__ ((constructor)) gnunet_crypto_kblock_ltdl_init (void)
+void __attribute__ ((constructor)) GNUNET_crypto_kblock_ltdl_init ()
{
lock = GNUNET_mutex_create (GNUNET_NO);
}
-void __attribute__ ((destructor)) gnunet_crypto_kblock_ltdl_fini (void)
+void __attribute__ ((destructor)) GNUNET_crypto_kblock_ltdl_fini ()
{
int i;
for (i = 0; i < cacheSize; i++)
Modified: GNUnet/src/util/crypto/locking_gcrypt.c
===================================================================
--- GNUnet/src/util/crypto/locking_gcrypt.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/crypto/locking_gcrypt.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -44,7 +44,7 @@
void
-lockGcrypt ()
+GNUNET_lock_gcrypt_ ()
{
#if USE_LOCK
GNUNET_mutex_lock (gcrypt_shared_lock);
@@ -52,7 +52,7 @@
}
void
-unlockGcrypt ()
+GNUNET_unlock_gcrypt_ ()
{
#if USE_LOCK
GNUNET_mutex_unlock (gcrypt_shared_lock);
@@ -65,7 +65,7 @@
/* do nothing -- ignore libgcyrpt errors */
}
-void __attribute__ ((constructor)) gnunet_crypto_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_crypto_ltdl_init ()
{
#if USE_LOCK
gcrypt_shared_lock = GNUNET_mutex_create (GNUNET_YES);
@@ -84,13 +84,13 @@
srand ((unsigned int) time (NULL));
gcry_set_log_handler (&dummy_logger, NULL);
#ifdef gcry_fast_random_poll
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
gcry_fast_random_poll ();
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
#endif
}
-void __attribute__ ((destructor)) gnunet_crypto_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_crypto_ltdl_fini ()
{
#if USE_LOCK
GNUNET_mutex_destroy (gcrypt_shared_lock);
Modified: GNUnet/src/util/crypto/locking_gcrypt.h
===================================================================
--- GNUnet/src/util/crypto/locking_gcrypt.h 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/crypto/locking_gcrypt.h 2007-12-12 06:59:46 UTC (rev
5872)
@@ -22,8 +22,8 @@
#ifndef LOCKING_GCRYPT_H
#define LOCKING_GCRYPT_H
-void lockGcrypt ();
+void GNUNET_lock_gcrypt_ (void);
-void unlockGcrypt ();
+void GNUNET_unlock_gcrypt_ (void);
#endif
Modified: GNUnet/src/util/crypto/random.c
===================================================================
--- GNUnet/src/util/crypto/random.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/crypto/random.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -45,7 +45,7 @@
if (mode == GNUNET_RANDOM_QUALITY_STRONG)
{
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
/* see
http://lists.gnupg.org/pipermail/gcrypt-devel/2004-May/000613.html */
#ifdef gcry_fast_random_poll
if ((invokeCount++ % 256) == 0)
@@ -56,7 +56,7 @@
random number this way */
gcry_randomize ((unsigned char *) &ret,
sizeof (unsigned int), GCRY_STRONG_RANDOM);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return ret % i;
}
else
@@ -109,10 +109,10 @@
GNUNET_GE_ASSERT (NULL, u > 0);
if (mode == GNUNET_RANDOM_QUALITY_STRONG)
{
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
gcry_randomize ((unsigned char *) &ret,
sizeof (unsigned long long), GCRY_STRONG_RANDOM);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return ret % u;
}
else
Modified: GNUnet/src/util/crypto/symcipher_gcrypt.c
===================================================================
--- GNUnet/src/util/crypto/symcipher_gcrypt.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/crypto/symcipher_gcrypt.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -59,9 +59,9 @@
void
GNUNET_AES_create_session_key (GNUNET_AES_SessionKey * key)
{
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
gcry_randomize (&key->key[0], GNUNET_SESSIONKEY_LEN, GCRY_STRONG_RANDOM);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
key->crc32 = htonl (GNUNET_crc32_n (key, GNUNET_SESSIONKEY_LEN));
}
@@ -91,7 +91,7 @@
GNUNET_GE_BREAK (NULL, 0);
return GNUNET_SYSERR;
}
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_cipher_open (&handle,
GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB, 0);
if (rc)
@@ -99,7 +99,7 @@
LOG_GCRY (NULL,
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_open", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
rc = gcry_cipher_setkey (handle, sessionkey, GNUNET_SESSIONKEY_LEN);
@@ -110,7 +110,7 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_setkey", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
rc =
@@ -121,7 +121,7 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_setiv", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
@@ -132,11 +132,11 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_encrypt", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return len;
}
@@ -165,7 +165,7 @@
GNUNET_GE_BREAK (NULL, 0);
return GNUNET_SYSERR;
}
- lockGcrypt ();
+ GNUNET_lock_gcrypt_ ();
rc = gcry_cipher_open (&handle,
GCRY_CIPHER_AES256, GCRY_CIPHER_MODE_CFB, 0);
if (rc)
@@ -173,7 +173,7 @@
LOG_GCRY (NULL,
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_open", rc);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
rc = gcry_cipher_setkey (handle, sessionkey, GNUNET_SESSIONKEY_LEN);
@@ -184,7 +184,7 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_setkey", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
rc =
@@ -196,7 +196,7 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_setiv", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
rc = gcry_cipher_decrypt (handle, result, size, block, size);
@@ -206,11 +206,11 @@
GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_DEVELOPER |
GNUNET_GE_BULK, "gcry_cipher_decrypt", rc);
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return -1;
}
gcry_cipher_close (handle);
- unlockGcrypt ();
+ GNUNET_unlock_gcrypt_ ();
return size;
}
Modified: GNUnet/src/util/network/dns.c
===================================================================
--- GNUnet/src/util/network/dns.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/network/dns.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -274,12 +274,12 @@
-void __attribute__ ((constructor)) gnunet_dns_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_dns_ltdl_init ()
{
lock = GNUNET_mutex_create (GNUNET_YES);
}
-void __attribute__ ((destructor)) gnunet_dns_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_dns_ltdl_fini ()
{
struct IPCache *pos;
GNUNET_mutex_destroy (lock);
Modified: GNUnet/src/util/network/io.c
===================================================================
--- GNUnet/src/util/network/io.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/network/io.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -44,7 +44,7 @@
}
#endif
-void __attribute__ ((constructor)) gnunet_network_io_init ()
+void __attribute__ ((constructor)) GNUNET_network_io_init ()
{
lock = GNUNET_mutex_create (GNUNET_NO);
#ifndef MINGW
@@ -54,7 +54,7 @@
#endif
}
-void __attribute__ ((destructor)) gnunet_network_io_fini ()
+void __attribute__ ((destructor)) GNUNET_network_io_fini ()
{
GNUNET_mutex_destroy (lock);
lock = NULL;
@@ -104,7 +104,7 @@
struct GNUNET_SocketHandle *
-socket_create (struct GNUNET_GE_Context *ectx, struct GNUNET_LoadMonitor *mon,
+GNUNET_socket_create (struct GNUNET_GE_Context *ectx, struct
GNUNET_LoadMonitor *mon,
int osSocket)
{
SocketHandle *ret;
Modified: GNUnet/src/util/network/select.c
===================================================================
--- GNUnet/src/util/network/select.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/network/select.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -583,7 +583,7 @@
"Select %p is accepting connection: %d\n", sh,
s);
#endif
- sock = socket_create (sh->ectx, sh->load_monitor, s);
+ sock = GNUNET_socket_create (sh->ectx, sh->load_monitor, s);
GNUNET_mutex_unlock (sh->lock);
sctx = sh->ah (sh->ah_cls,
sh, sock, clientAddr, lenOfIncomingAddr);
@@ -905,7 +905,7 @@
sh->timeout = timeout;
sh->lock = GNUNET_mutex_create (GNUNET_YES);
if (sock != -1)
- sh->listen_sock = socket_create (ectx, mon, sock);
+ sh->listen_sock = GNUNET_socket_create (ectx, mon, sock);
else
sh->listen_sock = NULL;
sh->thread = GNUNET_thread_create (&selectThread, sh, 256 * 1024);
Modified: GNUnet/src/util/network/selecttest.c
===================================================================
--- GNUnet/src/util/network/selecttest.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/network/selecttest.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -215,7 +215,7 @@
GNUNET_select_destroy (sh);
return 1;
}
- out = socket_create (NULL, NULL, write_sock);
+ out = GNUNET_socket_create (NULL, NULL, write_sock);
if (-1 == GNUNET_socket_set_blocking (out, GNUNET_NO))
{
GNUNET_socket_destroy (out);
Modified: GNUnet/src/util/network_client/tcpio.c
===================================================================
--- GNUnet/src/util/network_client/tcpio.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/network_client/tcpio.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -286,7 +286,7 @@
GNUNET_mutex_unlock (sock->destroylock);
return GNUNET_SYSERR;
}
- sock->sock = socket_create (sock->ectx, NULL, osock);
+ sock->sock = GNUNET_socket_create (sock->ectx, NULL, osock);
GNUNET_socket_set_blocking (sock->sock, GNUNET_NO);
memset (&soaddr, 0, sizeof (soaddr));
soaddr.sin_family = AF_INET;
Modified: GNUnet/src/util/network_client/tcpiotest.c
===================================================================
--- GNUnet/src/util/network_client/tcpiotest.c 2007-12-12 06:43:45 UTC (rev
5871)
+++ GNUnet/src/util/network_client/tcpiotest.c 2007-12-12 06:59:46 UTC (rev
5872)
@@ -208,7 +208,7 @@
ret = 43;
break;
}
- sh = socket_create (NULL, NULL, acceptSocket);
+ sh = GNUNET_socket_create (NULL, NULL, acceptSocket);
ret = ret | testTransmission (clientSocket, sh);
GNUNET_client_connection_close_temporarily (clientSocket);
GNUNET_socket_destroy (sh);
Modified: GNUnet/src/util/os/cpustatus.c
===================================================================
--- GNUnet/src/util/os/cpustatus.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/os/cpustatus.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -643,7 +643,7 @@
* routines. After that it is safe to call each of the status calls separately
* @return GNUNET_OK on success and GNUNET_SYSERR on error (or calls errexit).
*/
-void __attribute__ ((constructor)) gnunet_cpustats_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_cpustats_ltdl_init ()
{
statusMutex = GNUNET_mutex_create (GNUNET_NO);
#ifdef LINUX
@@ -664,7 +664,7 @@
/**
* Shutdown the status calls module.
*/
-void __attribute__ ((destructor)) gnunet_cpustats_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_cpustats_ltdl_fini ()
{
#ifdef LINUX
if (proc_stat != NULL)
Modified: GNUnet/src/util/os/dso.c
===================================================================
--- GNUnet/src/util/os/dso.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/os/dso.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -41,7 +41,7 @@
/* using libtool, needs init! */
-void __attribute__ ((constructor)) gnc_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_dso_ltdl_init ()
{
int err;
const char *opath;
@@ -84,7 +84,7 @@
}
}
-void __attribute__ ((destructor)) gnc_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_dso_ltdl_fini ()
{
lt_dlsetsearchpath (old_dlsearchpath);
if (old_dlsearchpath != NULL)
Modified: GNUnet/src/util/os/init.c
===================================================================
--- GNUnet/src/util/os/init.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/os/init.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -46,7 +46,7 @@
/**
* @brief Perform OS specific cleanup
*/
-void __attribute__ ((destructor)) os_fini ()
+void __attribute__ ((destructor)) GNUNET_os_fini ()
{
#ifdef MINGW
ShutdownWinEnv ();
Modified: GNUnet/src/util/threads/pthread.c
===================================================================
--- GNUnet/src/util/threads/pthread.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/threads/pthread.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -298,7 +298,7 @@
/**
* Initialize the signal handlers, etc.
*/
-void __attribute__ ((constructor)) pthread_handlers_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_pthread_handlers_ltdl_init ()
{
/* make sure SIGALRM does not kill us */
#ifndef MINGW
@@ -315,7 +315,7 @@
#endif
}
-void __attribute__ ((destructor)) pthread_handlers_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_pthread_handlers_ltdl_fini ()
{
#ifndef MINGW
if (0 != sigaction (SIGALRM, &old, &sig))
Modified: GNUnet/src/util/threads/shutdown.c
===================================================================
--- GNUnet/src/util/threads/shutdown.c 2007-12-12 06:43:45 UTC (rev 5871)
+++ GNUnet/src/util/threads/shutdown.c 2007-12-12 06:59:46 UTC (rev 5872)
@@ -96,7 +96,7 @@
/**
* Initialize the signal handlers, etc.
*/
-void __attribute__ ((constructor)) shutdown_handlers_ltdl_init ()
+void __attribute__ ((constructor)) GNUNET_shutdown_handlers_ltdl_init ()
{
GNUNET_GE_ASSERT (NULL, shutdown_signal == NULL);
GNUNET_GE_ASSERT (NULL, shutdown_active == GNUNET_NO);
@@ -110,7 +110,7 @@
#endif
}
-void __attribute__ ((destructor)) shutdown_handlers_ltdl_fini ()
+void __attribute__ ((destructor)) GNUNET_shutdown_handlers_ltdl_fini ()
{
#ifndef MINGW
GNUNET_signal_handler_uninstall (SIGINT, &run_shutdown, shc_int);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5872 - in GNUnet/src: applications/fs applications/fs/ecrs applications/fs/lib applications/fs/module include transports util/crypto util/network util/network_client util/os util/threads,
gnunet <=