OverSim
OverlayKey.h File Reference
#include <gmp.h>
#include <stdint.h>

Go to the source code of this file.

Classes

class  OverlayKey
 A common overlay key class. More...
class  OverlayKeyBit
 An auxiliary class for single bits in OverlayKey. More...

Functions

void omnet_random (mp_limb_t *r1p, mp_size_t r1n)
 replacement function for mpn_random() using omnet's rng
void doPacking (cCommBuffer *b, OverlayKey &obj)
 netPack for OverlayKey
void doUnpacking (cCommBuffer *b, OverlayKey &obj)
 netUnpack for OverlayKey

Detailed Description

Author
Sebastian Mies, Ingmar Baumgart

Definition in file OverlayKey.h.

Function Documentation

void doPacking ( cCommBuffer *  b,
OverlayKey obj 
)
inline

netPack for OverlayKey

Parameters
bthe buffer
objthe OverlayKey to serialise

Definition at line 576 of file OverlayKey.h.

{obj.netPack(b);}
void doUnpacking ( cCommBuffer *  b,
OverlayKey obj 
)
inline

netUnpack for OverlayKey

Parameters
bthe buffer
objthe OverlayKey to unserialise

Definition at line 584 of file OverlayKey.h.

{obj.netUnpack(b);}
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);
}
}