Changeset 416 for trunk/src/ocatv6conv.c


Ignore:
Timestamp:
Jan 4, 2009, 4:47:12 PM (8 years ago)
Author:
eagle
Message:

man page updated
support of random local addresses added (option -R)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ocatv6conv.c

    r398 r416  
    120120}
    121121
     122
     123/*! Generate a random onion-URL.
     124 *  @paran onion must be of at least ONION_URL_LEN + 1 (=17).
     125 */
     126void rand_onion(char *onion)
     127{
     128   int i;
     129
     130   if (RAND_MAX < 32)
     131      log_msg(LOG_WARNING, "weak randomness: RAND_MAX = %d < 32", RAND_MAX);
     132
     133   for (i = 0; i < ONION_URL_LEN; i++, onion++)
     134      *onion = BASE32[rand() & 0x1f];
     135   *onion = '\0';
     136}
     137
Note: See TracChangeset for help on using the changeset viewer.