288 lines
6.5 KiB
C
288 lines
6.5 KiB
C
/* ipmip6_mh.h - ipmip6_mh.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6_mh.h,v $ $Revision: 1.10 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmip6/include/private/ipmip6_mh.h,v $
|
|
* $Author: jhorteli $ $Date: 2011-01-21 15:31:47 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIP6_MH_H
|
|
#define IPMIP6_MH_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
/*
|
|
DESCRIPTION
|
|
|
|
This module defines the Mobile Header utility functions, such as
|
|
converting error codes to human readable strings, sending binding errors
|
|
etc.
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include <private/ipmip6_mh_pkt.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
#define IPMIP6_MH_MAX_UPDATE_RATE 3
|
|
#define IPMIP6_MH_INITIAL_BINDACK_TIMEOUT 1000
|
|
#define IPMIP6_MH_MAX_BINDACK_TIMEOUT 32000
|
|
#define IPMIP6_MH_INITIAL_SOLICIT_TIMER 3000
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmip6_context;
|
|
struct Ipmip_proc;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_send_binding_error - ipmip6_mh_send_binding_error
|
|
*
|
|
* Send a binding error with the indicated parameters
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ctx
|
|
* The generic mobility singleton context for IPMIP6. For each started mobility
|
|
* entity, there exists a mobility context which tracks configuration, system
|
|
* events, available features and started processes. The mobility context is
|
|
* created using ipmip6_context_create(). See ipmip6_context.h for
|
|
* more information regarding the mobility entity context singleton.
|
|
* \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 home
|
|
* Home Adress [OPTIONAL]
|
|
* \i src
|
|
* Source address
|
|
* \i dst
|
|
* Destination address
|
|
* \i status
|
|
* Error code
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip6_mh_send_binding_error
|
|
(
|
|
struct Ipmip6_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
struct Ip_in6_addr *home,
|
|
struct Ip_in6_addr *src,
|
|
struct Ip_in6_addr *dst,
|
|
Ip_u8 status
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_error_str - ipmip6_mh_error_str
|
|
*
|
|
* Convert a status value to a human readable error code.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i status
|
|
* Error code
|
|
* \ie
|
|
*
|
|
* RETURNS: Human readable error code.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL const char *ipmip6_mh_error_str
|
|
(
|
|
Ip_u8 status
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_bri_trigger_str - ipmip6_mh_bri_trigger_str
|
|
*
|
|
* Convert a binding revocation trigger value to a human readable description
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i trigger
|
|
* trigger code
|
|
* \ie
|
|
*
|
|
* RETURNS: Human readable trigger string
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL const char *ipmip6_mh_bri_trigger_str
|
|
(
|
|
Ip_u8 trigger
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_bra_error_str - ipmip6_mh_bra_error_str
|
|
*
|
|
* Convert a binding revocation accept error value to a human readable description
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i status
|
|
* status code
|
|
* \ie
|
|
*
|
|
* RETURNS: Human readable error code.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL const char *ipmip6_mh_bra_error_str
|
|
(
|
|
Ip_u8 status
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_opt_next - ipmip6_mh_opt_next
|
|
*
|
|
* Return the next Mobile Header option.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i extbuf
|
|
* Buffer holding the extension values
|
|
* \i extlen
|
|
* Len of extbus
|
|
* \i offset
|
|
* Current offset
|
|
* \i typep
|
|
* Where to store the type of the next option
|
|
* \i lenp
|
|
* Where to store the length of the next option
|
|
* \i datap
|
|
* Where to store the data of the next option
|
|
* \ie
|
|
*
|
|
* RETURNS: The offset value to the next option.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL int ipmip6_mh_opt_next
|
|
(
|
|
void *extbuf,
|
|
Ip_socklen_t extlen,
|
|
int offset,
|
|
Ip_u8 *typep,
|
|
Ip_socklen_t *lenp,
|
|
void **databufp
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_mo_cmp - ipmip6_mh_mo_cmp
|
|
*
|
|
* Compare two mobile options.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i mo1
|
|
* Option 1
|
|
* \i mo2
|
|
* Option 2
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE if equal, IP_FALSE otherwise.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmip6_mh_mo_cmp
|
|
(
|
|
Ipmip6_mh_mo_hdr_t *mo1,
|
|
Ipmip6_mh_mo_hdr_t *mo2
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_mh_mo_dup - ipmip6_mh_mo_dup
|
|
*
|
|
* Duplicate a mobile option
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i mo
|
|
* Option to duplicate
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE if equal, IP_FALSE otherwise.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipmip6_mh_mo_hdr_t *ipmip6_mh_mo_dup
|
|
(
|
|
Ipmip6_mh_mo_hdr_t *mo
|
|
);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|