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

conf_utils.h File Reference

#include "common.h"

Go to the source code of this file.

Data Structures

struct  TransformConfigItem
 Structure which is used to map descriptive transform name to numeric ID and vice versa. This structure also contains information about kind of encryption key, which is used with sepceyfic algorithm. If variable key length is allowed, then last field, contains also default key length. More...
struct  IdTypeConfigItem
 Structure which is used to map descriptive ID type name to numeric ID and vice versa. More...

Functions

const char * GetTransformName (int type, int alg)
 Get human readable transform type string. The outut of this function is in format "%s/%s", where first part is transform type, and second part is used algorithm.
int TransformFromName (const char *name, uint8_t type, uint8_t *id, uint16_t *keylen)
 Get transform id from string, useful in configuration.
int IdTypeFromName (const char *name)
 Get type id from name string , useful in configuration.
int AuthtypeFromName (const char *authtype_name)
 Get authe type id from string literal.
uint16_t extractKeyLen (const char *alg)
 Extract key length from algorithm name saved in folowing form: alg_name:n where:
  • alg_name - descriptive name of the algorithm
  • n - integer value representing key length Useful for variable key length encryption algorithms.

const struct TransformConfigItemGetAvailableTransformsTypes (void)
 Get pointer to the array containing list of the available transforms types.
const struct IdTypeConfigItemGetAvailableIdTypes (void)
 Get pointer to the array contaning list of the available ID types.


Function Documentation

int AuthtypeFromName const char *  authtype  ) 
 

Get authe type id from string literal.

Parameters:
*authtype string literal of authtype
Returns:
auth type id

uint16_t extractKeyLen const char *  alg  ) 
 

Extract key length from algorithm name saved in folowing form: alg_name:n where:

  • alg_name - descriptive name of the algorithm
  • n - integer value representing key length Useful for variable key length encryption algorithms.

Parameters:
*alg string literal in form "alg_name:n"
Returns:
integer value of n (key length)

const struct IdTypeConfigItem* GetAvailableIdTypes void   ) 
 

Get pointer to the array contaning list of the available ID types.

Returns:
pointer to the array contaning list of available ID types

const struct TransformConfigItem* GetAvailableTransformsTypes void   ) 
 

Get pointer to the array containing list of the available transforms types.

Returns:
pointer to available transforms types

const char* GetTransformName int  type,
int  alg
 

Get human readable transform type string. The outut of this function is in format "%s/%s", where first part is transform type, and second part is used algorithm.

Parameters:
type transform type
alg used algorithm
Returns:
pointer to the static buffer which contains human readable transform type string

int IdTypeFromName const char *  name  ) 
 

Get type id from name string , useful in configuration.

Parameters:
name string idtype name
Returns:
-1 if fail,id on success;

int TransformFromName const char *  name,
uint8_t  type,
uint8_t *  id,
uint16_t *  keylen
 

Get transform id from string, useful in configuration.

Parameters:
name string transform name
type transform type (IKEv2_TRT_...)
id returned transform id
keylen result ptr for key length
Returns:
0 if succes, -1 if fail


Project hosted by: SourceForge.net Logo