/* ipmip4_sysext.h - ipmip4_sysext.h */ /* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip4_sysext.h,v $ $Revision: 1.4 $ * $Source: /home/interpeak/CVSRoot/ipmip4/include/private/ipmip4_sysext.h,v $ * $Author: jhorteli $ $Date: 2010-12-07 09:55:10 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Joel Hortelius ****************************************************************************** */ #ifndef IPMIP4_SYSEXT_H #define IPMIP4_SYSEXT_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** * Extended system configuration utility functions. These functions provide * ease-of-use configuration retrieval mechanisms. */ /* DESCRIPTION Extended system configuration utility functions. These functions provide ease-of-use configuration retrieval mechanisms. */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct Ipmip4_auth_spi; extern Ipmip_sysvar_key_map_t ipmip4_sysext_spi_method[]; /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ /******************************************************************************* * * ipmip4_sysext_nvse_alloc - ipmip4_sysext_nvse_alloc * * Create an NVSE extension based on vendor, subtype and data * * Parameters: * \is * \i vendor * Vendor ID * \i subtype * Vendor NVSE subtype * \i data * The vendor value * \i size * The size of value * \ie * * RETURNS: The newly allocated NVSE structure * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_uhdr_t * ipmip4_sysext_nvse_alloc ( Ip_u32 vendor, Ip_u16 subtype, void *data, Ip_size_t size ); /******************************************************************************* * * ipmip4_sysext_cvse_alloc - ipmip4_sysext_cvse_alloc * * Create an CVSE extension based on vendor, subtype and data * * Parameters: * \is * \i vendor * Vendor ID * \i subtype * Vendor CVSE subtype * \i data * The vendor value * \i size * The size of value * \ie * * RETURNS: The newly allocated CVSE structure * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_uhdr_t * ipmip4_sysext_cvse_alloc ( Ip_u32 vendor, Ip_u16 subtype, void *data, Ip_size_t size ); /******************************************************************************* * * ipmip4_sysext_foreach_spi - ipmip4_sysext_foreach_spi * * Parse the configured SPI's * * Parameters: * \is * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i name * Name of the sysvar key * \i subkey * The matched subkey * \i value * The SPI value * \i spictx * The spi context * \ie * * RETURNS: No return value * * ERRNO: * */ IP_GLOBAL void ipmip4_sysext_foreach_spi ( struct Ipmip_proc *proc, char *name, char *subkey, const char *value, Ipmip4_auth_context_t *spictx ); /******************************************************************************* * * ipmip4_sysext_foreach_spiroute - ipmip4_sysext_foreach_spiroute * * Parse the configured SPI lookup definitions * * Parameters: * \is * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i name * Name of the sysvar key * \i subkey * The matched subkey * \i value * The SPI value * \i rtab * The route table * \ie * * RETURNS: No return value * * ERRNO: * */ IP_GLOBAL void ipmip4_sysext_foreach_spiroute(struct Ipmip_proc *proc, char *name, char *subkey, const char *value, Ipmip4_auth_spi_table_t *rtab); /******************************************************************************* * * ipmip4_sysext_foreach_spihash - ipmip4_sysext_foreach_spihash * * Parse the configured SPI lookup definitions regarding NAI's * * Parameters: * \is * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i name * Name of the sysvar key * \i subkey * The matched subkey * \i value * The SPI value * \i htable * The spu hash table * \ie * * RETURNS: No return value * * ERRNO: * */ IP_GLOBAL void ipmip4_sysext_foreach_spihash ( struct Ipmip_proc *proc, char *name, char *subkey, const char *value, Ipmip4_auth_spi_hash_t *htable ); /******************************************************************************* * * ipmip4_sysext_nai_aaah - ipmip4_sysext_nai_aaah * * Parse and create a NAI AAAH from a sysvar * * Parameters: * \is * \i format * The sysvar format key. * \i ... * Optional arguments * \ie * * RETURNS: The newly allocated AAAH NAI structure * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_shdr_t * ipmip4_sysext_nai_aaah ( const char *format, /* args */ ... ); /******************************************************************************* * * ipmip4_sysext_nai_ha - ipmip4_sysext_nai_ha * * Parse and create a NAI HA from a sysvar * * Parameters: * \is * \i format * The sysvar format key. * \i ... * Optional arguments * \ie * * RETURNS: The allocated HA NAI structure * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_shdr_t * ipmip4_sysext_nai_ha ( const char *format, /* args */ ... ); /******************************************************************************* * * ipmip4_sysext_nai_mn - ipmip4_sysext_nai_mn * * Parse and create a NAI MN from a sysvar * * Parameters: * \is * \i format * The sysvar format key. * \i ... * Optional arguments * \ie * * RETURNS: The allocated MN NAI structure * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_shdr_t * ipmip4_sysext_nai_mn ( const char *format, /* args */ ... ); /******************************************************************************* * * ipmip4_sysext_tunnel_type - ipmip4_sysext_tunnel_type * * Interpret a tunnel protocol to its tunnel type index * * Parameters: * \is * \i deftype * Default type index * \i format * The sysvar format string * \i ... * The optional arguments * \ie * * RETURNS: -1 on error, deftype on none, tunnel type index otherwise * * ERRNO: * */ IP_GLOBAL int ipmip4_sysext_tunnel_type ( int deftype, const char *format, /* args */ ... ); /******************************************************************************* * * ipmip4_sysext_spi_parse - ipmip4_sysext_spi_parse * * Parse a SPI definition defined in the format specification * provided in this function call. * * Parameters: * \is * \i proc * The process context associated with the currently executing thread. Each * thread and/or process in MIP must have its own unique process context. * If a process is started using ipmip_proc_start, the process context will * be allocated automatically by the IPMIP framework. Otherwise it must * be allocated using ipmip_proc_alloc(). * \i defspi * The default SPI used if spi is zero and no * * SPI is defined in the format context. * \i spi * The spi to use * \i secret * The secret to use. If not specified, will be * * parsed in the format context. * \i delim * Pre-delimitor to be prepended to all format * * context parsings. * \i format * Format string * \i ... * Format arguments * \ie * * RETURNS: The parsed security association. * * ERRNO: * */ IP_GLOBAL struct Ipmip4_auth_spi * ipmip4_sysext_spi_parse ( struct Ipmip_proc *proc, Ip_u32 defspi, Ip_u32 spi, const char *secret, const char *delim, const char *format, ... ); /******************************************************************************* * * ipmip4_sysext_nai_aaah_create - ipmip4_sysext_nai_aaah_create * * Create a AAAH nai based on provided data * * Parameters: * \is * \i data * The data * \i data_length * The length of data * \ie * * RETURNS: The AAAH Nai. * * ERRNO: * */ IP_GLOBAL Ipmip4_msgext_shdr_t * ipmip4_sysext_nai_aaah_create ( Ip_u8 *data, Ip_size_t data_length ); #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */