cryptlib
3.4.1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
session
scorebrd.h
Go to the documentation of this file.
1
/****************************************************************************
2
* *
3
* cryptlib Session Scoreboard Header File *
4
* Copyright Peter Gutmann 1998-2004 *
5
* *
6
****************************************************************************/
7
8
#ifndef _SCOREBRD_DEFINED
9
10
#define _SCOREBRD_DEFINED
11
12
/****************************************************************************
13
* *
14
* Scoreboard Types and Structures *
15
* *
16
****************************************************************************/
17
18
/* The search key to use for a scoreboard lookup. We distinguish between
19
client and server sessionIDs in order to provide a logically distinct
20
namespace for client and server sessions */
21
22
typedef
enum
{
23
SCOREBOARD_KEY_NONE
,
24
SCOREBOARD_KEY_SESSIONID_CLI
,
/* Lookup by client session ID */
25
SCOREBOARD_KEY_SESSIONID_SVR
,
/* Lookup by server session ID */
26
SCOREBOARD_KEY_FQDN
,
/* Lookup by server FQDN */
27
SCOREBOARD_KEY_LAST
28
}
SCOREBOARD_KEY_TYPE
;
29
30
/* The search result from looking up an entry in the scoreboard */
31
32
typedef
struct
{
33
/* Scoreboard search key information */
34
BUFFER_OPT_FIXED
(
keySize
) \
35
const
void
*
key
;
36
int
keySize
;
37
38
/* The data stored with the scoreboard entry */
39
BUFFER_OPT_FIXED
(
dataSize
) \
40
const
void
*
data
;
41
int
dataSize
;
42
}
SCOREBOARD_LOOKUP_RESULT
;
43
44
/* Storage for the scoreboard state. When passed to scoreboard functions
45
it's declared as a void * because to the caller it's an opaque memory
46
block while to the scoreboard routines it's structured storage */
47
48
typedef
BYTE
SCOREBOARD_STATE
[ 64 ];
49
50
/****************************************************************************
51
* *
52
* Scoreboard Functions *
53
* *
54
****************************************************************************/
55
56
/* Session scoreboard management functions */
57
58
CHECK_RETVAL_RANGE
( 0,
MAX_INTLENGTH
)
CHECK_RETVAL
STDC_NONNULL_ARG
( ( 1, 3, 5 ) ) \
59
int
lookupScoreboardEntry
(
INOUT
void
*scoreboardInfoPtr,
60
IN_ENUM
( SCOREBOARD_KEY ) \
61
const
SCOREBOARD_KEY_TYPE
keyType
,
62
IN_BUFFER
(
keyLength
)
const
void
*
key
,
63
IN_LENGTH_SHORT_MIN
( 2 )
const
int
keyLength
,
64
OUT
SCOREBOARD_LOOKUP_RESULT
*lookupResult );
65
CHECK_RETVAL_RANGE
( 0,
MAX_INTLENGTH
) STDC_NONNULL_ARG( ( 1, 2, 4 ) ) \
66
int
addScoreboardEntry
(
INOUT
void
*scoreboardInfoPtr,
67
IN_BUFFER
( keyLength )
const
void
*key,
68
IN_LENGTH_SHORT_MIN
( 8 )
const
int
keyLength,
69
IN_BUFFER
(
valueLength
)
const
void
*
value
,
70
IN_LENGTH_SHORT
const
int
valueLength
);
71
CHECK_RETVAL_RANGE
( 0,
MAX_INTLENGTH
) STDC_NONNULL_ARG( ( 1, 2, 4, 6 ) ) \
72
int
addScoreboardEntryEx
(
INOUT
void
*scoreboardInfoPtr,
73
IN_BUFFER
( keyLength )
const
void
*key,
74
IN_LENGTH_SHORT_MIN
( 8 )
const
int
keyLength,
75
IN_BUFFER
( keyLength )
const
void
*altKey,
76
IN_LENGTH_SHORT_MIN
( 2 )
const
int
altKeyLength,
77
IN_BUFFER
( valueLength )
const
void
*value,
78
IN_LENGTH_SHORT
const
int
valueLength );
79
STDC_NONNULL_ARG( ( 1 ) ) \
80
void
deleteScoreboardEntry(
INOUT
void
*scoreboardInfoPtr,
81
IN_INT_Z
const
int
uniqueID
);
82
83
#ifdef USE_SSL
84
CHECK_RETVAL
STDC_NONNULL_ARG
( ( 1 ) ) \
85
int
initScoreboard
(
INOUT
void
*scoreboardInfoPtr,
86
IN_LENGTH_SHORT_MIN
( 16 )
const
int
scoreboardEntries );
87
STDC_NONNULL_ARG
( ( 1 ) ) \
88
void
endScoreboard
(
INOUT
void
*scoreboardInfoPtr );
89
#else
90
#define initScoreboard( scoreboardInfo, scoreboardSize ) CRYPT_OK
91
#define endScoreboard( scoreboardInfo )
92
#endif
/* USE_SSL */
93
#endif
/* _SCOREBRD_DEFINED */
Generated on Thu Jan 10 2013 10:00:52 for cryptlib by
1.8.2