Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

session.h File Reference

#include "common.h"
#include <openssl/dh.h>
#include "transforms.h"

Go to the source code of this file.

Data Structures

struct  IKEv2Session
 IKEv2 Session data. This structure is also used as a element of linked list with all active IKEv2 sessions. More...
struct  ikev2_ctx
 IKEv2 context structure. Used for storing global configuration options and list of active IKEv2 sessions. More...

Defines

#define IKEv2_STY_INITIATOR   1
#define IKEv2_STY_RESPONDER   2
#define IKEv2_DEFAULT_DH_COUNTER_MAX   3
#define IKEv2_DEFAULT_DH_COUNTER_MAX_STR   TOSTRING(IKEv2_DEFAULT_DH_COUNTER_MAX)
#define IKEv2_DEFAULT_MAX_FRAGMENT_SIZE   1398
#define IKEv2_DEFAULT_MAX_FRAGMENT_SIZE_STR   TOSTRING(IKEv2_DEFAULT_MAX_FRAGMENT_SIZE)
#define IKEv2_DEFAULT_IDTYPE   IKEv2_IDT_KEY_ID
#define IKEv2_DEFAULT_IDTYPE_STR   "KEY_ID"
#define RAW_FASTID_LEN   20

Typedefs

typedef ikev2_ctx ikev2_ctx
 IKEv2 context structure. Used for storing global configuration options and list of active IKEv2 sessions.

Enumerations

enum  IKEv2_SST { IKEv2_SST_NORMAL = 0, IKEv2_SST_FAILED, IKEv2_SST_ESTABLISHED, IKEv2_SST_REKEYING }

Functions

IKEv2SessionNewSession (struct ikev2_ctx *i2, uint64_t iSPI, uint64_t rSPI, int Type)
 Begin new IKEv2 session.
IKEv2SessionFindISession (struct ikev2_ctx *i2, uint64_t iSPI)
 Search a session with a given initiator SPI.
IKEv2SessionFindRSession (struct ikev2_ctx *i2, uint64_t rSPI)
 Search a session with a given responder SPI.
IKEv2SessionFindSession (struct ikev2_ctx *i2, uint64_t SPI)
 Search a session with a given SPI.
IKEv2SessionFindSessionByFastid (struct ikev2_ctx *i2, const char *fastid)
 Find session with given fastID which is ready to fast reconnect.
void DeleteSession (struct ikev2_ctx *i2, struct IKEv2Session *s)
 Delete a session entry.
void ComputeSessionKeys (struct IKEv2Session *s)
 Compute all needed session keys.
void ComputeNewKeys (struct IKEv2Session *s, int dhex)
 Compute all needed session keys in case of rekeying.
ikev2_ctxCreate_ikev2_ctx (void)
 Create an empty IKEv2 context structure with initialized mutex variable.
void Free_ikev2_ctx (struct ikev2_ctx *i2)
 Free IKEv2 context data.
void FreeSession (struct IKEv2Session *s)
 Release all resources of IKEv2 session.
void FreeSessionList (struct IKEv2Session *s)
 Free whole session list.
int FreeSessionIfExpired (struct ikev2_ctx *i2, uint32_t currentTime)
 Free any session from list if last activity time was greater than ikev2_ctx.fastExpire.
void DumpIKEv2SessionKeys (const struct IKEv2Session *s)


Define Documentation

#define IKEv2_DEFAULT_DH_COUNTER_MAX   3
 

#define IKEv2_DEFAULT_DH_COUNTER_MAX_STR   TOSTRING(IKEv2_DEFAULT_DH_COUNTER_MAX)
 

#define IKEv2_DEFAULT_IDTYPE   IKEv2_IDT_KEY_ID
 

#define IKEv2_DEFAULT_IDTYPE_STR   "KEY_ID"
 

#define IKEv2_DEFAULT_MAX_FRAGMENT_SIZE   1398
 

#define IKEv2_DEFAULT_MAX_FRAGMENT_SIZE_STR   TOSTRING(IKEv2_DEFAULT_MAX_FRAGMENT_SIZE)
 

#define IKEv2_STY_INITIATOR   1
 

#define IKEv2_STY_RESPONDER   2
 

#define RAW_FASTID_LEN   20
 


Typedef Documentation

typedef struct ikev2_ctx ikev2_ctx
 

IKEv2 context structure. Used for storing global configuration options and list of active IKEv2 sessions.


Enumeration Type Documentation

enum IKEv2_SST
 

Enumerator:
IKEv2_SST_NORMAL 
IKEv2_SST_FAILED 
IKEv2_SST_ESTABLISHED 
IKEv2_SST_REKEYING 


Function Documentation

void ComputeNewKeys struct IKEv2Session s,
int  dhex
 

Compute all needed session keys in case of rekeying.

Parameters:
*s IKEv2 session data
dhex is there a new dh exchange?

void ComputeSessionKeys struct IKEv2Session s  ) 
 

Compute all needed session keys.

Parameters:
*s IKEv2 session data

struct ikev2_ctx* Create_ikev2_ctx void   ) 
 

Create an empty IKEv2 context structure with initialized mutex variable.

Returns:
ptr to created IKEv2 context structure

void DeleteSession struct ikev2_ctx i2,
struct IKEv2Session s
 

Delete a session entry.

Parameters:
*i2 IKEv2 context data
*s session to delete

void DumpIKEv2SessionKeys const struct IKEv2Session s  ) 
 

struct IKEv2Session* FindISession struct ikev2_ctx i2,
uint64_t  iSPI
 

Search a session with a given initiator SPI.

Parameters:
*i2 IKEv2 context data
iSPI initiator SPI
Returns:
founded IKEv2 session or NULL if not found

struct IKEv2Session* FindRSession struct ikev2_ctx i2,
uint64_t  rSPI
 

Search a session with a given responder SPI.

Parameters:
*i2 IKEv2 context data
rSPI responder SPI
Returns:
founded IKEv2 session or NULL if not found

struct IKEv2Session* FindSession struct ikev2_ctx i2,
uint64_t  SPI
 

Search a session with a given SPI.

Parameters:
*i2 IKEv2 context data
SPI SPI
Returns:
founded IKEv2 session or NULL if not found

struct IKEv2Session* FindSessionByFastid struct ikev2_ctx i2,
const char *  fastid
 

Find session with given fastID which is ready to fast reconnect.

Parameters:
*i2 IKEv2 context data
fastid fastID string received from respondent
Returns:
founded IKEv2 session or NULL if not found

void Free_ikev2_ctx struct ikev2_ctx i2  ) 
 

Free IKEv2 context data.

Parameters:
*i2 IKEv2 context data

void FreeSession struct IKEv2Session s  ) 
 

Release all resources of IKEv2 session.

Parameters:
*s session to free

int FreeSessionIfExpired struct ikev2_ctx i2,
uint32_t  currentTime
 

Free any session from list if last activity time was greater than ikev2_ctx.fastExpire.

Parameters:
*i2 IKEv2 context data
currentTime current timestamp (i.e. time() result)
Returns:
number of deleted sessions

void FreeSessionList struct IKEv2Session s  ) 
 

Free whole session list.

Parameters:
*s head of the session list

struct IKEv2Session* NewSession struct ikev2_ctx i2,
uint64_t  iSPI,
uint64_t  rSPI,
int  Type
 

Begin new IKEv2 session.

Parameters:
*i2 IKEv2 context data
iSPI initiator SPI
rSPI responder SPI
Type session type - initiator or responder
Returns:
new IKEv2 session struct


Project hosted by: SourceForge.net Logo