162 lines
5.3 KiB
C
162 lines
5.3 KiB
C
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipl2tp_util.h,v $ $Revision: 1.2 $
|
|
* $Source: /home/interpeak/CVSRoot/ipl2tp/src/ipl2tp_util.h,v $
|
|
* $Author: joel $ $Date: 2006-01-30 10:47:46 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPL2TP_UTIL_H
|
|
#define IPL2TP_UTIL_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* The various version strings */
|
|
extern const char *ipl2tp_versions[];
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_ntoa
|
|
*===========================================================================
|
|
* Description: Converts an IPvX address to string representation. Result
|
|
* ends up in a static buffer which is returned.
|
|
* Parameters: addr - The IPvX address.
|
|
* Returns: The address in string form.
|
|
*
|
|
*/
|
|
IP_GLOBAL const char *ipl2tp_util_ntoa(union Ip_sockaddr_union *addr);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_vector_random
|
|
*===========================================================================
|
|
* Description: Generate a random vector.
|
|
* Parameters: vector - vector to generate in; if no array
|
|
* is preset, it will be dynamically allocated.
|
|
* len - Length of data to generate.
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_util_vector_random(Ipl2tp_vector *vector,
|
|
Ip_size_t len);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_vector_dup
|
|
*===========================================================================
|
|
* Description: Duplicate a vector
|
|
* Parameters: dst - Destination vector
|
|
* src - Source vector
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_util_vector_dup(Ipl2tp_vector *dst,
|
|
Ipl2tp_vector *src);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_vector_create
|
|
*===========================================================================
|
|
* Description: Create a vector using variables
|
|
* Parameters: dst - Destination vector
|
|
* value - The value to use as vector
|
|
* length - The length of value
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_util_vector_create(Ipl2tp_vector *dst,
|
|
void *value,
|
|
Ip_size_t length);
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_memdup
|
|
*===========================================================================
|
|
* Description: Do a memory duplication.
|
|
* Parameters: m - Memory to duplicate.
|
|
* s - Size to allocate.
|
|
* l - Length to copy.
|
|
* Returns: The new memory block.
|
|
*
|
|
*/
|
|
IP_GLOBAL void *ipl2tp_util_memdup(CONST void *m,
|
|
int s,
|
|
int l);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_util_strdup
|
|
*===========================================================================
|
|
* Description: Do a string duplication.
|
|
* Parameters: m - Memory to duplicate.
|
|
* l - Length to copy.
|
|
* Returns: The new string
|
|
*
|
|
*/
|
|
IP_GLOBAL void *ipl2tp_util_strdup(CONST void *m,
|
|
int l);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|