240 lines
8.5 KiB
C
240 lines
8.5 KiB
C
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipl2tp_attr_h.h,v $ $Revision: 1.2 $
|
|
* $Source: /home/interpeak/CVSRoot/ipl2tp/src/ipl2tp_attr_h.h,v $
|
|
* $Author: joel $ $Date: 2006-01-30 10:47:45 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPL2TP_ATTR_H_H
|
|
#define IPL2TP_ATTR_H_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* Attribute object header */
|
|
typedef struct
|
|
{
|
|
Ip_u32 magic; /* Magic cookie */
|
|
Ip_u16 flags; /* Attribute object flags */
|
|
Ip_u16 pool_max; /* Max size of attribute pool */
|
|
Ip_u16 pool_size; /* Size of attribute pool */
|
|
Ip_u16 pool_last; /* Last entry in attribute pool */
|
|
char pool[1]; /* Attribute pool (can be extended) */
|
|
}
|
|
Ipl2tp_attribute_object;
|
|
|
|
typedef struct
|
|
{
|
|
Ip_u16 tag; /* Attribute tag */
|
|
Ip_u16 status; /* Status of operation */
|
|
Ip_u16 next; /* Size of this attribute */
|
|
Ip_u16 length; /* Length of payload */
|
|
}
|
|
Ipl2tp_attribute;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_global_set
|
|
*===========================================================================
|
|
* Description: Set global attributes.
|
|
* Parameters: attrobj - The attribute object.
|
|
* Returns: The status code.
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_global_set(Ipl2tp_attrobj attrobj);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_global_get
|
|
*===========================================================================
|
|
* Description: Get global attributes.
|
|
* Parameters: attrget - The attribute objects to get
|
|
* attreply - The replies.
|
|
* Returns: The status code.
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_global_get(Ipl2tp_attrobj attrobj,
|
|
Ipl2tp_attrobj *attreply);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_tunnel_set
|
|
*===========================================================================
|
|
* Description: Set tunnel attributes.
|
|
* Parameters: tunnel - The tunnel.
|
|
* attr - The tunnel attributes.
|
|
* attrobj - Attribute object.
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_tunnel_set(Ipl2tp_tunnel *tunnel,
|
|
Ipl2tp_tunnel_attributes *attr,
|
|
Ipl2tp_attrobj attrobj);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_tunnel_set
|
|
*===========================================================================
|
|
* Description: Set tunnel attributes.
|
|
* Parameters: tunnel - The tunnel.
|
|
* attr - The tunnel attributes.
|
|
* attrget - Attribute object.
|
|
* attreply - Reply object
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_tunnel_get(Ipl2tp_tunnel *tunnel,
|
|
Ipl2tp_tunnel_attributes *attr,
|
|
Ipl2tp_attrobj attrget,
|
|
Ipl2tp_attrobj *attreply);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_session_set
|
|
*===========================================================================
|
|
* Description: Set session attributes.
|
|
* Parameters: session - The session.
|
|
* attr - Session attributes
|
|
* attrobj - The attributes.
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_session_set(Ipl2tp_session *session,
|
|
Ipl2tp_session_attributes *attr,
|
|
Ipl2tp_attrobj attrobj);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_session_set
|
|
*===========================================================================
|
|
* Description: Set session attributes.
|
|
* Parameters: session - The session.
|
|
* attr - Session attributes
|
|
* attrget - The attributes.
|
|
* attreply - The attribute replies
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipl2tp_status ipl2tp_attr_session_get(Ipl2tp_session *session,
|
|
Ipl2tp_session_attributes *attr,
|
|
Ipl2tp_attrobj attrget,
|
|
Ipl2tp_attrobj *attreply);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_tunnel_attribute_copy
|
|
*===========================================================================
|
|
* Description: Copy tunnel attributes, allocate memory for those
|
|
* that are required.
|
|
* Parameters: dst - The destination
|
|
* src - The source.
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_attr_tunnel_attribute_copy(Ipl2tp_tunnel_attributes *dst,
|
|
Ipl2tp_tunnel_attributes *src);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_tunnel_attribute_copy
|
|
*===========================================================================
|
|
* Description: Free memory allocated for tunnel attributes.
|
|
* Parameters: attr - The Attributes
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_attr_tunnel_attribute_free(Ipl2tp_tunnel_attributes *attr);
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_tunnel_attribute_copy
|
|
*===========================================================================
|
|
* Description: Copy session attributes, allocate memory for those
|
|
* that are required.
|
|
* Parameters: dst - The destination
|
|
* src - The source.
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_attr_session_attribute_copy(Ipl2tp_session_attributes *dst,
|
|
Ipl2tp_session_attributes *src);
|
|
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipl2tp_attr_session_attribute_copy
|
|
*===========================================================================
|
|
* Description: Free memory allocated for session attributes.
|
|
* Parameters: attr - The Attributes
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipl2tp_attr_session_attribute_free(Ipl2tp_session_attributes *attr);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|