MagickCore 6.9.11-60
Convert, Edit, Or Compose Bitmap Images
distribute-cache.c File Reference
Include dependency graph for distribute-cache.c:

Macros

#define CLOSE_SOCKET(socket)
 
#define HANDLER_RETURN_TYPE   void *
 
#define HANDLER_RETURN_VALUE   (void *) NULL
 
#define SOCKET_TYPE   int
 
#define LENGTH_TYPE   size_t
 
#define send(file, buffer, length, flags)   0
 
#define recv(file, buffer, length, flags)   0
 
#define DPCHostname   "127.0.0.1"
 
#define DPCPendingConnections   10
 
#define DPCPort   6668
 
#define DPCSessionKeyLength   8
 
#define MSG_NOSIGNAL   0
 
#define magick_fallthrough   /* nothing */
 

Functions

static MagickOffsetType dpc_read (int file, const MagickSizeType length, unsigned char *magick_restrict message)
 
static uint64_t ROTL (uint64_t x, int b)
 
static uint64_t U8TO64_LE (const uint8_t *p)
 
static uint64_t SIPHash24 (const uint8_t key[16], const uint8_t *message, const size_t length)
 
static void DeriveSipKeyFromSecret (const char *shared_secret, uint8_t key[16])
 
static uint64_t GenerateSessionKey (const char *shared_secret, const unsigned char *nonce, size_t length)
 
static int ConnectPixelCacheServer (const char *hostname, const int port, uint64_t *session_key, ExceptionInfo *exception)
 
static char * GetHostname (int *port, ExceptionInfo *exception)
 
MagickPrivate DistributeCacheInfoAcquireDistributeCacheInfo (ExceptionInfo *exception)
 
MagickPrivate DistributeCacheInfoDestroyDistributeCacheInfo (DistributeCacheInfo *server_info)
 
static MagickBooleanType DestroyDistributeCache (SplayTreeInfo *registry, const uint64_t session_key)
 
static MagickOffsetType dpc_send (int file, const MagickSizeType length, const void *magick_restrict message)
 
static MagickBooleanType OpenDistributeCache (SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
 
static MagickBooleanType ValidateDistributedPixelCache (const RectangleInfo *region, const size_t per_pixel, const MagickSizeType length)
 
static MagickBooleanType ReadDistributeCacheIndexes (SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
 
static MagickBooleanType ReadDistributeCachePixels (SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
 
static void * RelinquishImageRegistry (void *image)
 
static MagickBooleanType WriteDistributeCacheIndexes (SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
 
static MagickBooleanType WriteDistributeCachePixels (SplayTreeInfo *registry, int file, const uint64_t session_key, ExceptionInfo *exception)
 
static HANDLER_RETURN_TYPE DistributePixelCacheClient (void *socket_arg)
 
MagickExport void DistributePixelCacheServer (const int port, ExceptionInfo *exception)
 
MagickPrivate int GetDistributeCacheFile (const DistributeCacheInfo *server_info)
 
MagickPrivate const char * GetDistributeCacheHostname (const DistributeCacheInfo *server_info)
 
MagickPrivate int GetDistributeCachePort (const DistributeCacheInfo *server_info)
 
MagickPrivate MagickBooleanType OpenDistributePixelCache (DistributeCacheInfo *server_info, Image *image)
 
MagickPrivate MagickOffsetType ReadDistributePixelCacheIndexes (DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, unsigned char *indexes)
 
MagickPrivate MagickOffsetType ReadDistributePixelCachePixels (DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, unsigned char *magick_restrict pixels)
 
MagickPrivate MagickBooleanType RelinquishDistributePixelCache (DistributeCacheInfo *server_info)
 
MagickPrivate MagickOffsetType WriteDistributePixelCacheIndexes (DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, const unsigned char *indexes)
 
MagickPrivate MagickOffsetType WriteDistributePixelCachePixels (DistributeCacheInfo *server_info, const RectangleInfo *region, const MagickSizeType length, const unsigned char *magick_restrict pixels)
 

Macro Definition Documentation

◆ CLOSE_SOCKET

#define CLOSE_SOCKET (   socket)

◆ DPCHostname

#define DPCHostname   "127.0.0.1"

◆ DPCPendingConnections

#define DPCPendingConnections   10

◆ DPCPort

#define DPCPort   6668

◆ DPCSessionKeyLength

#define DPCSessionKeyLength   8

◆ HANDLER_RETURN_TYPE

#define HANDLER_RETURN_TYPE   void *

◆ HANDLER_RETURN_VALUE

#define HANDLER_RETURN_VALUE   (void *) NULL

◆ LENGTH_TYPE

#define LENGTH_TYPE   size_t

◆ magick_fallthrough

#define magick_fallthrough   /* nothing */

◆ MSG_NOSIGNAL

#define MSG_NOSIGNAL   0

◆ recv

#define recv (   file,
  buffer,
  length,
  flags 
)    0

◆ send

#define send (   file,
  buffer,
  length,
  flags 
)    0

◆ SOCKET_TYPE

#define SOCKET_TYPE   int

Function Documentation

◆ AcquireDistributeCacheInfo()

◆ ConnectPixelCacheServer()

static int ConnectPixelCacheServer ( const char *  hostname,
const int  port,
uint64_t *  session_key,
ExceptionInfo exception 
)
static

◆ DeriveSipKeyFromSecret()

static void DeriveSipKeyFromSecret ( const char *  shared_secret,
uint8_t  key[16] 
)
inlinestatic

Referenced by GenerateSessionKey().

◆ DestroyDistributeCache()

static MagickBooleanType DestroyDistributeCache ( SplayTreeInfo registry,
const uint64_t  session_key 
)
static

◆ DestroyDistributeCacheInfo()

◆ DistributePixelCacheClient()

◆ DistributePixelCacheServer()

◆ dpc_read()

◆ dpc_send()

◆ GenerateSessionKey()

static uint64_t GenerateSessionKey ( const char *  shared_secret,
const unsigned char *  nonce,
size_t  length 
)
inlinestatic

◆ GetDistributeCacheFile()

MagickPrivate int GetDistributeCacheFile ( const DistributeCacheInfo server_info)

◆ GetDistributeCacheHostname()

MagickPrivate const char * GetDistributeCacheHostname ( const DistributeCacheInfo server_info)

◆ GetDistributeCachePort()

MagickPrivate int GetDistributeCachePort ( const DistributeCacheInfo server_info)

◆ GetHostname()

◆ OpenDistributeCache()

◆ OpenDistributePixelCache()

◆ ReadDistributeCacheIndexes()

◆ ReadDistributeCachePixels()

◆ ReadDistributePixelCacheIndexes()

◆ ReadDistributePixelCachePixels()

◆ RelinquishDistributePixelCache()

◆ RelinquishImageRegistry()

static void * RelinquishImageRegistry ( void *  image)
static

◆ ROTL()

static uint64_t ROTL ( uint64_t  x,
int  b 
)
inlinestatic

Referenced by SIPHash24().

◆ SIPHash24()

static uint64_t SIPHash24 ( const uint8_t  key[16],
const uint8_t *  message,
const size_t  length 
)
inlinestatic

References magick_fallthrough, ROTL(), and U8TO64_LE().

Referenced by GenerateSessionKey().

◆ U8TO64_LE()

static uint64_t U8TO64_LE ( const uint8_t *  p)
inlinestatic

Referenced by SIPHash24().

◆ ValidateDistributedPixelCache()

static MagickBooleanType ValidateDistributedPixelCache ( const RectangleInfo region,
const size_t  per_pixel,
const MagickSizeType  length 
)
inlinestatic

◆ WriteDistributeCacheIndexes()

◆ WriteDistributeCachePixels()

◆ WriteDistributePixelCacheIndexes()

◆ WriteDistributePixelCachePixels()