301 lines
9.3 KiB
C
301 lines
9.3 KiB
C
/* ipdhcpc6.h - Public API of Wind River DHCPv6 Client */
|
|
|
|
/*
|
|
******************************************************************************
|
|
* INTERPEAK API HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpc6.h,v $ $Revision: 1.12.12.3 $
|
|
* $Source: /home/interpeak/CVSRoot/ipdhcpc6/include/ipdhcpc6.h,v $
|
|
* $Author: zluo0 $ $Date: 2013-09-26 02:33:16 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Kenneth Jonsson <kenneth@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPDHCPC6_H
|
|
#define IPDHCPC6_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
DESCRIPTION
|
|
This library contains the APIs used for configuration of Wind River DHCPv6
|
|
Client.
|
|
INCLUDE FILES: ipcom_type.h, ipcom_cstyle.h
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "ipdhcpc6_config.h"
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include <ipcom_type.h>
|
|
#include <ipcom_cstyle.h>
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* IPDHCPC6 release XYyZz,
|
|
X = major version
|
|
Yy = minor version (two different versions might be incompatible)
|
|
Zz = patch version (two different versions are always compatible) */
|
|
#define IPDHCPC6_RELEASE 60600
|
|
#define IPDHCPC6_IPD_EVENT_REFRESH 100
|
|
|
|
#define IPDHCPC6_IA_TYPE_NA 0
|
|
#define IPDHCPC6_IA_TYPE_PD 1
|
|
|
|
#if !defined(IPDHCPC6_IA_TA_SUPPORT)
|
|
#define IPDHCPC6_IA_TYPE_MAX 2
|
|
#else
|
|
#define IPDHCPC6_IA_TYPE_TA 2
|
|
#define IPDHCPC6_IA_TYPE_MAX 3
|
|
#endif
|
|
|
|
#define IPDHCPC6_MODE_UNINITIALIZED 0
|
|
#define IPDHCPC6_MODE_DISABLED 1
|
|
#define IPDHCPC6_MODE_ENABLED 2
|
|
#define IPDHCPC6_MODE_AUTOMATIC 3
|
|
|
|
#define IPDHCPC6_IF_STATE_UNINITIALIZED 0
|
|
#define IPDHCPC6_IF_STATE_DETACHED 1
|
|
#define IPDHCPC6_IF_STATE_DOWN 2
|
|
#define IPDHCPC6_IF_STATE_UP 3
|
|
#define IPDHCPC6_IF_STATE_MAX 4
|
|
|
|
#define IPDHCPC6_IA_ADDRESS_UNBOUND 0
|
|
#define IPDHCPC6_IA_ADDRESS_BOUND 1
|
|
|
|
/* The max number of binding downlink interfaces */
|
|
#define IPDHCPC6_IAPD_MAX_BOUND_IFNUM 20
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
/* dhcpc6 API common arguments */
|
|
typedef struct Ipdhcpc6_common_args
|
|
{
|
|
char *if_name; /* interface name */
|
|
char *ia_type_name; /* IA type name like "ia_na","ia_pd" or "ia_ta" */
|
|
char *ia_name; /* IA name */
|
|
} Ipdhcpc6_common_args_t;
|
|
|
|
/* dhcpc6 API bind specific arguments */
|
|
typedef struct Ipdhcpc6_bound_args
|
|
{
|
|
Ip_u32 ifnum; /* The number of downlink interfaces which are bound to uplink interface */
|
|
char *ifnames[IPDHCPC6_IAPD_MAX_BOUND_IFNUM]; /* Name array for all down link interfaces */
|
|
} Ipdhcpc6_bound_args_t;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
/*******************************************************************************
|
|
*
|
|
* ipdhcpc6_refresh - Refresh the IA.
|
|
*
|
|
* This routine requests confirmation of current configuration information.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <refresh_args>
|
|
* A pointer to an 'Ipdhcpc6_common_args_t' structure to which we will apply to the refresh process.
|
|
* Please refer to the definition of Ipdhcpc6_common_args_t.
|
|
* Argument rules for Ipdhcpc6_common_args_t elements if you define or ignore some of them:
|
|
* \i [if_name,ia_type_name,ia_name]: The specific IA will be refreshed.
|
|
* \i [if_name,ia_type_name,NULL]: All IA for interface named if_name with ia_type_name type will be refreshed.
|
|
* \i [if_name,NULL,NULL]: All IA for interface named if_name with all IA type supported will be refreshed.
|
|
* \i [NULL,NULL,NULL]: All existing IA will be refreshed.
|
|
* \ie
|
|
*
|
|
* RETURNS: Either 'IPCOM_SUCCESS', if the call was successful, or one of the
|
|
* following errors:
|
|
* \is
|
|
* \i 'IPCOM_ERR_INVALID_ARG'
|
|
* If the parameter is incorrect.
|
|
* \i 'IPCOM_ERR_SOCKCALLFAILED'
|
|
* If the call to socket related API fails.
|
|
* \i 'IPCOM_ERR_INVALID_TAG_VALUE'
|
|
* If the parse for tag is incorrect.
|
|
* \ie
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
IP_PUBLIC int ipdhcpc6_refresh
|
|
(
|
|
Ipdhcpc6_common_args_t *refresh_args
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipdhcpc6_release - Release the IA.
|
|
*
|
|
* This routine releases current configuration information.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <release_args>
|
|
* A pointer to an 'Ipdhcpc6_common_args_t' structure to which we will apply to the release process.
|
|
* Please refer to the definition of Ipdhcpc6_common_args_t.
|
|
* Argument rules for Ipdhcpc6_common_args_t elements if you define or ignore some of them:
|
|
* \i [if_name,ia_type_name,ia_name]: The specific IA will be released.
|
|
* \i [if_name,ia_type_name,NULL]: All IA for interface named if_name with ia_type_name type will be released.
|
|
* \i [if_name,NULL,NULL]: All IA for interface named if_name with all IA type supported will be released.
|
|
* \i [NULL,NULL,NULL]: All existing IA will be released.
|
|
* \ie
|
|
*
|
|
* RETURNS: Either 'IPCOM_SUCCESS', if the call was successful, or one of the
|
|
* following errors:
|
|
* \is
|
|
* \i 'IPCOM_ERR_INVALID_ARG'
|
|
* If the parameter is incorrect.
|
|
* \i 'IPCOM_ERR_SOCKCALLFAILED'
|
|
* If the call to socket related API fails.
|
|
* \i 'IPCOM_ERR_INVALID_TAG_VALUE'
|
|
* If the parsing for tag is incorrect.
|
|
* \ie
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
IP_PUBLIC int ipdhcpc6_release
|
|
(
|
|
Ipdhcpc6_common_args_t *release_args
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipdhcpc6_iapd_bind_add - Add interface(s) to an interface binding (IA_PD only).
|
|
*
|
|
* This routine adds the downstream interface(s) to the binding configuration for an IA_PD.
|
|
* This binding associates a distinct IA_PD with each of its downstream network interfaces
|
|
* and use that IA_PD to obtain a prefix for the interface(s) from the delegating router
|
|
* interface.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <bind_args>
|
|
* A pointer to an 'Ipdhcpc6_common_args_t' structure to which we will apply to the binding process.
|
|
* All the elements in Ipdhcpc6_common_args_t must be filled.
|
|
* \i <down_ifs>
|
|
* A pointer to an 'Ipdhcpc6_bound_args_t' structure to which we will config the binding relationship.
|
|
* \ie
|
|
*
|
|
* RETURNS: Either 'IPCOM_SUCCESS', if the call was successful, or one of the
|
|
* following errors:
|
|
* \is
|
|
* \i 'IPCOM_ERR_INVALID_ARG'
|
|
* If the parameter is incorrect.
|
|
* \i 'IPCOM_ERR_SOCKCALLFAILED'
|
|
* If the call to socket related API fails.
|
|
* \i 'IPCOM_ERR_INVALID_TAG_VALUE'
|
|
* If the parsing for tag is incorrect.
|
|
* \ie
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
|
|
IP_PUBLIC int ipdhcpc6_iapd_bind_add
|
|
(
|
|
Ipdhcpc6_common_args_t *bind_args,
|
|
Ipdhcpc6_bound_args_t *down_ifs
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipdhcpc6_iapd_bind_delete - Remove interface(s) from an interface binding(IA_PD only).
|
|
*
|
|
* This routine removes the downstream interface(s) from an binding configuration for an IA_PD.
|
|
* This binding associates a distinct IA_PD with each of its downstream network interfaces
|
|
* and use that IA_PD to obtain a prefix for the interface(s) from the delegating router
|
|
* interface.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i <bind_args>
|
|
* A pointer to an 'Ipdhcpc6_common_args_t' structure to which we will apply to the binding process.
|
|
* All the elements in Ipdhcpc6_common_args_t must be filled.
|
|
* \i <down_ifs>
|
|
* A pointer to an 'Ipdhcpc6_bound_args_t' structure to which we will config the binding relationship.
|
|
* \ie
|
|
*
|
|
* RETURNS: Either 'IPCOM_SUCCESS', if the call was successful, or one of the
|
|
* following errors:
|
|
* \is
|
|
* \i 'IPCOM_ERR_INVALID_ARG'
|
|
* If the parameter is incorrect.
|
|
* \i 'IPCOM_ERR_SOCKCALLFAILED'
|
|
* If the call to socket related API fails.
|
|
* \i 'IPCOM_ERR_INVALID_TAG_VALUE'
|
|
* If the parsing for tag is incorrect.
|
|
* \ie
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
|
|
IP_PUBLIC int ipdhcpc6_iapd_bind_delete
|
|
(
|
|
Ipdhcpc6_common_args_t *bind_args,
|
|
Ipdhcpc6_bound_args_t *down_ifs
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipdhcpc6_reply_callback - apply user-defined actions based on DHCPv6 reply
|
|
*
|
|
* This callback routine examines each DHCPv6 reply returned by a DHCP server and
|
|
* can execute user-defined operations for specific replies.
|
|
*
|
|
*
|
|
* Parameter:
|
|
* \is
|
|
* \i <event>
|
|
* The type of event
|
|
* \ie
|
|
* RETURNS: Either 'IP_TRUE' or 'IP_FALSE'
|
|
*
|
|
* ERRNO:
|
|
*/
|
|
IP_PUBLIC Ip_err ipdhcpc6_reply_callback
|
|
(
|
|
int event
|
|
);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|