NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions
ncbi_lbsm.h File Reference
#include "ncbi_comm.h"
#include "ncbi_config.h"
#include <connect/ncbi_heapmgr.h>
#include <connect/ncbi_service.h>
#include <math.h>
+ Include dependency graph for ncbi_lbsm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SLBSM_HostLoad
 
struct  SLBSM_HostData
 
struct  SLBSM_Entry
 
struct  SLBSM_Version
 
struct  SLBSM_Sysinfo
 
struct  SLBSM_Host
 
struct  SLBSM_Service
 
struct  SLBSM_Config
 

Macros

#define LBSM_DEFAULT_CFGFILE   DISPATCHER_CFGPATH DISPATCHER_CFGFILE
 
#define LBSM_DEFAULT_LOGFILE   "/var/log/lbsmd"
 
#define LBSM_DEFAULT_HOMEDIR   "/opt/machine/lbsm/"
 
#define LBSM_DEFAULT_RUNFILE   LBSM_DEFAULT_HOMEDIR "run/lbsmd.pid"
 
#define LBSM_DEFAULT_FEEDFILE   LBSM_DEFAULT_HOMEDIR "run/.lbsmd"
 
#define LBSM_DEFAULT_INFOFILE   LBSM_DEFAULT_HOMEDIR "run/lbsmd"
 
#define LBSM_HEAP_VERSION_MAJ   1
 
#define LBSM_HEAP_VERSION_MIN   3
 
#define LBSM_HEAP_VERSION_MAJ_CRC32   1
 
#define LBSM_HEAP_VERSION_MIN_CRC32   2
 
#define LBSM_MISC_MASK   0xF000
 
#define LBSM_MISC_UNUSED   0x8000/*reserved*/
 
#define LBSM_MISC_INERT   0x4000
 
#define LBSM_MISC_JUMBO   0x2000
 
#define LBSM_MISC_x64   0x1000
 
#define LBSM_KERNELID_SVPKBIT   0x8000
 
#define LBSM_KERNELID_SVPKDIV   10
 
#define LBSM_PACKED   /* */
 
#define LBSM_RERATE_SPECIAL   1e9
 
#define LBSM_RERATE_RESERVE   (-LBSM_RERATE_SPECIAL)
 
#define LBSM_RERATE_DEFAULT   ( LBSM_RERATE_SPECIAL)
 

Enumerations

enum  ELBSM_Type {
  eLBSM_Invalid = 0 , eLBSM_Host , eLBSM_Service , eLBSM_Version ,
  eLBSM_Pending , eLBSM_Config
}
 

Functions

const SLBSM_VersionLBSM_GetVersion (HEAP heap)
 
const char * LBSM_GetConfig (HEAP heap)
 
const SLBSM_ServiceLBSM_LookupServiceEx (HEAP heap, const char *name, int mask, const SLBSM_Entry **prev)
 
const SLBSM_ServiceLBSM_LookupService (HEAP heap, const char *name, int mask, const SLBSM_Service *prev)
 
const SLBSM_HostLBSM_LookupHost (HEAP heap, unsigned addr, const SLBSM_Entry *hint)
 
double LBSM_CalculateStatus (double rate, double fine, ESERV_Algo algo, const SLBSM_HostLoad *load)
 
int LBSM_SubmitPenaltyOrRerate (const char *name, ESERV_Type type, double rate, TNCBI_Time fine, unsigned int host, unsigned short port, const char *path)
 

Macro Definition Documentation

◆ LBSM_DEFAULT_CFGFILE

#define LBSM_DEFAULT_CFGFILE   DISPATCHER_CFGPATH DISPATCHER_CFGFILE

Definition at line 48 of file ncbi_lbsm.h.

◆ LBSM_DEFAULT_FEEDFILE

#define LBSM_DEFAULT_FEEDFILE   LBSM_DEFAULT_HOMEDIR "run/.lbsmd"

Definition at line 52 of file ncbi_lbsm.h.

◆ LBSM_DEFAULT_HOMEDIR

#define LBSM_DEFAULT_HOMEDIR   "/opt/machine/lbsm/"

Definition at line 50 of file ncbi_lbsm.h.

◆ LBSM_DEFAULT_INFOFILE

#define LBSM_DEFAULT_INFOFILE   LBSM_DEFAULT_HOMEDIR "run/lbsmd"

Definition at line 53 of file ncbi_lbsm.h.

◆ LBSM_DEFAULT_LOGFILE

#define LBSM_DEFAULT_LOGFILE   "/var/log/lbsmd"

Definition at line 49 of file ncbi_lbsm.h.

◆ LBSM_DEFAULT_RUNFILE

#define LBSM_DEFAULT_RUNFILE   LBSM_DEFAULT_HOMEDIR "run/lbsmd.pid"

Definition at line 51 of file ncbi_lbsm.h.

◆ LBSM_HEAP_VERSION_MAJ

#define LBSM_HEAP_VERSION_MAJ   1

Definition at line 57 of file ncbi_lbsm.h.

◆ LBSM_HEAP_VERSION_MAJ_CRC32

#define LBSM_HEAP_VERSION_MAJ_CRC32   1

Definition at line 61 of file ncbi_lbsm.h.

◆ LBSM_HEAP_VERSION_MIN

#define LBSM_HEAP_VERSION_MIN   3

Definition at line 58 of file ncbi_lbsm.h.

◆ LBSM_HEAP_VERSION_MIN_CRC32

#define LBSM_HEAP_VERSION_MIN_CRC32   2

Definition at line 62 of file ncbi_lbsm.h.

◆ LBSM_KERNELID_SVPKBIT

#define LBSM_KERNELID_SVPKBIT   0x8000

Definition at line 72 of file ncbi_lbsm.h.

◆ LBSM_KERNELID_SVPKDIV

#define LBSM_KERNELID_SVPKDIV   10

Definition at line 73 of file ncbi_lbsm.h.

◆ LBSM_MISC_INERT

#define LBSM_MISC_INERT   0x4000

Definition at line 67 of file ncbi_lbsm.h.

◆ LBSM_MISC_JUMBO

#define LBSM_MISC_JUMBO   0x2000

Definition at line 68 of file ncbi_lbsm.h.

◆ LBSM_MISC_MASK

#define LBSM_MISC_MASK   0xF000

Definition at line 65 of file ncbi_lbsm.h.

◆ LBSM_MISC_UNUSED

#define LBSM_MISC_UNUSED   0x8000/*reserved*/

Definition at line 66 of file ncbi_lbsm.h.

◆ LBSM_MISC_x64

#define LBSM_MISC_x64   0x1000

Definition at line 69 of file ncbi_lbsm.h.

◆ LBSM_PACKED

#define LBSM_PACKED   /* */

Definition at line 82 of file ncbi_lbsm.h.

◆ LBSM_RERATE_DEFAULT

#define LBSM_RERATE_DEFAULT   ( LBSM_RERATE_SPECIAL)

Definition at line 300 of file ncbi_lbsm.h.

◆ LBSM_RERATE_RESERVE

#define LBSM_RERATE_RESERVE   (-LBSM_RERATE_SPECIAL)

Definition at line 299 of file ncbi_lbsm.h.

◆ LBSM_RERATE_SPECIAL

#define LBSM_RERATE_SPECIAL   1e9

Definition at line 296 of file ncbi_lbsm.h.

Enumeration Type Documentation

◆ ELBSM_Type

enum ELBSM_Type
Enumerator
eLBSM_Invalid 
eLBSM_Host 
eLBSM_Service 
eLBSM_Version 
eLBSM_Pending 
eLBSM_Config 

Definition at line 139 of file ncbi_lbsm.h.

Function Documentation

◆ LBSM_CalculateStatus()

double LBSM_CalculateStatus ( double  rate,
double  fine,
ESERV_Algo  algo,
const SLBSM_HostLoad load 
)

◆ LBSM_GetConfig()

const char* LBSM_GetConfig ( HEAP  heap)

◆ LBSM_GetVersion()

const SLBSM_Version* LBSM_GetVersion ( HEAP  heap)

Definition at line 58 of file ncbi_lbsm.c.

References assert, eLBSM_Version, heap, HEAP_Base(), HEAP_Next(), and SLBSM_Entry::type.

Referenced by s_GetHeapCopy(), and s_VerifyChecksum().

◆ LBSM_LookupHost()

const SLBSM_Host* LBSM_LookupHost ( HEAP  heap,
unsigned  addr,
const SLBSM_Entry hint 
)

◆ LBSM_LookupService()

const SLBSM_Service* LBSM_LookupService ( HEAP  heap,
const char *  name,
int  mask,
const SLBSM_Service prev 
)

◆ LBSM_LookupServiceEx()

const SLBSM_Service* LBSM_LookupServiceEx ( HEAP  heap,
const char *  name,
int  mask,
const SLBSM_Entry **  prev 
)

◆ LBSM_SubmitPenaltyOrRerate()

int LBSM_SubmitPenaltyOrRerate ( const char *  name,
ESERV_Type  type,
double  rate,
TNCBI_Time  fine,
unsigned int  host,
unsigned short  port,
const char *  path 
)
Modified on Fri Feb 23 11:49:21 2024 by modify_doxy.py rev. 669887