Defines | Functions | Variables

OverlayKey.cc File Reference

#include <omnetpp.h>
#include "OverlayKey.h"
#include "Comparator.h"
#include <BinaryValue.h>
#include "SHA1.h"

Go to the source code of this file.

Defines

#define GMP_TYPE   unsigned long int

Functions

std::ostream & operator<< (std::ostream &os, const OverlayKey &c)
void omnet_random (mp_limb_t *r1p, mp_size_t r1n)
 replacement function for mpn_random() using omnet's rng

Variables

const char * HEX = "0123456789abcdef"

Detailed Description

Author:
Sebastian Mies, Ingmar Baumgart

Definition in file OverlayKey.cc.


Define Documentation

#define GMP_TYPE   unsigned long int

Definition at line 837 of file OverlayKey.cc.


Function Documentation

void omnet_random ( mp_limb_t *  r1p,
mp_size_t  r1n 
) [inline]

replacement function for mpn_random() using omnet's rng

Definition at line 821 of file OverlayKey.cc.

Referenced by OverlayKey::random(), OverlayKey::randomPrefix(), and OverlayKey::randomSuffix().

{
    // fill in 32 bit chunks
    uint32_t* chunkPtr = (uint32_t*)r1p;

    for (uint32_t i=0; i < ((r1n*sizeof(mp_limb_t) + 3) / 4); i++) {
        chunkPtr[i] = intuniform(0, 0xFFFFFFFF);
    }
}

std::ostream& operator<< ( std::ostream &  os,
const OverlayKey c 
)

Definition at line 618 of file OverlayKey.cc.

{
    os << c.toString(16);
    return os;
};


Variable Documentation

const char* HEX = "0123456789abcdef"

Definition at line 60 of file OverlayKey.cc.

Referenced by OverlayKey::toString().