708 lines
14 KiB
C
708 lines
14 KiB
C
/* ipmipfa_llh.h - ipmipfa_llh.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmipfa_llh.h,v $ $Revision: 1.15 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmipfa/src/ipmipfa_llh.h,v $
|
|
* $Author: jhorteli $ $Date: 2009-04-23 14:32:14 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIPFA_FA_H
|
|
#define IPMIPFA_FA_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
/*
|
|
DESCRIPTION
|
|
|
|
No description currently provided
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include "ipmipfa_agent.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmipfa_node;
|
|
struct Ipmipfa_conf;
|
|
struct Ipmipfa_data;
|
|
struct Ipmip4_msgext_array;
|
|
struct Ipmipfa_pktbuf;
|
|
struct Ipmip_cli_message;
|
|
|
|
typedef struct Ipmipfa_llh_agent
|
|
{
|
|
Ip_u32 addr;
|
|
Ipmipfa_iff_t *iff;
|
|
Ipmip_lladdr_t *lladdr;
|
|
} Ipmipfa_llh_agent_t;
|
|
|
|
|
|
/* Low Latency Handoff, the node's entering. We're nFA */
|
|
struct Ipmipfa_llh_pre_registration_TT
|
|
{
|
|
struct Ipmipfa_pktbuf *nFA_pbuf;
|
|
};
|
|
|
|
/* Low Latency Handoff, the node's entering. We're nFA */
|
|
struct Ipmipfa_llh_post_registration
|
|
{
|
|
Ip_u32 faVisitorRegIDLow; /* */
|
|
Ip_u32 faVisitorHomeAgentAddress; /* */
|
|
Ip_u16 faVisitorTimeGranted; /* The agreed upon lifetime */
|
|
Ip_u8 done; /* Received the wanted signal? */
|
|
Ip_u8 type; /* Type of message sent */
|
|
};
|
|
|
|
|
|
/* Low Latency Handoff, Pre Registration ST/MT/TT information for oFA/nFA */
|
|
union Ipmipfa_llh_pending
|
|
{
|
|
struct Ipmipfa_llh_pre_registration_TT pre_tt;
|
|
struct Ipmipfa_llh_post_registration post;
|
|
};
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_advert_input - ipmipfa_llh_advert_input
|
|
*
|
|
* Process a received advertisement.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Data
|
|
* \i proc
|
|
* Process
|
|
* \i pbuf
|
|
* Packet buffer.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_advert_input
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_pktbuf *pbuf
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_solicit_input - ipmipfa_llh_solicit_input
|
|
*
|
|
* Feed a PrRtSol into the LLH system.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Data
|
|
* \i proc
|
|
* Process
|
|
* \i node
|
|
* Node if found, otherwise IP_NULL
|
|
* \i pbuf
|
|
* Packet buffer
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_solicit_input
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
struct Ipmipfa_pktbuf *pbuf
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_clear - ipmipfa_llh_clear
|
|
*
|
|
* Delete any fast handover data belonging to the node.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i node
|
|
* The node
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_FALSE
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmipfa_llh_clear
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node
|
|
);
|
|
|
|
|
|
/* Low-Latency Handoff; PRE REGISTRATION Methods */
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_registration_received - ipmipfa_llh_registration_received
|
|
*
|
|
* We've just received a registration request with the
|
|
* following data
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i node
|
|
* The node we're processing
|
|
* \i iff
|
|
* The interface
|
|
* \i lladdr
|
|
* Optional mobile node LLA
|
|
* \i ext
|
|
* Found LLA extensions.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_registration_received
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
struct Ipmipfa_iff *iff,
|
|
Ipmip_lladdr_t *lladdr,
|
|
struct Ipmip4_msgext_array *ext
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_registration_complete - ipmipfa_llh_registration_complete
|
|
*
|
|
* Registration has been completed
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i node
|
|
* The node we're processing
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_registration_complete
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_L2_LU - ipmipfa_llh_L2_LU
|
|
*
|
|
* This is a L2-LU trigger for a mobile node. This means
|
|
* that a mobile node has become active on our network.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data entity.
|
|
* \i proc
|
|
* Process.
|
|
* \i node
|
|
* The node that received the L2-LU.
|
|
* \i home_addr
|
|
* Home address
|
|
* \i iff
|
|
* The interface it received the L2-LU on.
|
|
* \i lladdr
|
|
* The node's LLA identifier.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_L2_LU
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
Ip_addr4 home_addr,
|
|
struct Ipmipfa_iff *iff,
|
|
Ipmip_lladdr_t *lladdr
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_L2_LD - ipmipfa_llh_L2_LD
|
|
*
|
|
* This is a L2-LD trigger for a mobile node. This means
|
|
* that a mobile node has become inactive on our network.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data entity.
|
|
* \i proc
|
|
* Process.
|
|
* \i node
|
|
* The node that received the L2-LD.
|
|
* \i lla
|
|
* The node's LLA identifier.
|
|
* \ie
|
|
*
|
|
* RETURNS: A timer code.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL int ipmipfa_llh_L2_LD
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
Ipmip_lladdr_t *lladdr
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_pre_registration_reply - ipmipfa_llh_pre_registration_reply
|
|
*
|
|
* Store a response to a mobile node PRE REGISTRATION request.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* FA data struct
|
|
* \i proc
|
|
* Process.
|
|
* \i node
|
|
* The node we're processing
|
|
* \i pbuf
|
|
* Packet buffer
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE if stored.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmipfa_llh_pre_registration_reply
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
struct Ipmipfa_pktbuf *pbuf
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_hrqst_hrply_error - ipmipfa_llh_hrqst_hrply_error
|
|
*
|
|
* Error stage
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i pbuf
|
|
* The packet buffer
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL int ipmipfa_llh_hrqst_hrply_error
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_pktbuf *pbuf,
|
|
Ip_u8 code
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_post_registration_hrqst_input - ipmipfa_llh_post_registration_hrqst_input
|
|
*
|
|
* Parse a HRQST input.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i event
|
|
* Event to run
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i pbuf
|
|
* Packet buffer
|
|
* \i node
|
|
* Node
|
|
* \ie
|
|
*
|
|
* RETURNS: One of the timer result values.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL int ipmipfa_llh_post_registration_hrqst_input
|
|
(
|
|
int event,
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_pktbuf *pbuf,
|
|
struct Ipmipfa_node *node
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_post_registration_hrply_input - ipmipfa_llh_post_registration_hrply_input
|
|
*
|
|
* Parse a HRPLY input.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i event
|
|
* The event
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i pbuf
|
|
* Packet buffer
|
|
* \i node
|
|
* The mobile node
|
|
* \ie
|
|
*
|
|
* RETURNS: One of the defined timer result codes-
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL int ipmipfa_llh_post_registration_hrply_input
|
|
(
|
|
int event,
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_pktbuf *pbuf,
|
|
struct Ipmipfa_node *node
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_config_read - ipmipfa_llh_config_read
|
|
*
|
|
* Read configuration variables
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i iff
|
|
* Interface pointer
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_config_read
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
Ipmipfa_iff_t *iff
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_config_exit - ipmipfa_llh_config_exit
|
|
*
|
|
* Free configuration variables
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i iff
|
|
* Interface pointer
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_config_exit
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
Ipmipfa_iff_t *iff
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_config_dump - ipmipfa_llh_config_dump
|
|
*
|
|
* Dump configuration variables
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i iff
|
|
* Interface pointer
|
|
* \i request
|
|
* Request
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_config_dump
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
Ipmipfa_iff_t *iff,
|
|
struct Ipmip_cli_message *request
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_ip_to_agent - ipmipfa_llh_ip_to_agent
|
|
*
|
|
* Convert an IP address to an agent structure
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i iff
|
|
* Interface
|
|
* \i ip
|
|
* Agent address
|
|
* \ie
|
|
*
|
|
* RETURNS: Agent structure if successful.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ipmipfa_llh_agent_t *ipmipfa_llh_ip_to_agent
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_iff *iff,
|
|
Ip_addr4 ip
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_L2_ST - ipmipfa_llh_L2_ST
|
|
*
|
|
* An ST LLH Trigger
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i node
|
|
* Node
|
|
* \i agent
|
|
* Agent structure
|
|
* \i lladdr
|
|
* Link Layer address
|
|
* \i iff
|
|
* Interface
|
|
* \i type
|
|
* Type
|
|
* \i regtype
|
|
* Registration type
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_L2_ST
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipfa_node *node,
|
|
Ipmipfa_llh_agent_t *agent,
|
|
struct Ipmip_lladdr *lladdr,
|
|
struct Ipmipfa_iff *iff,
|
|
int type,
|
|
int regtype
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipfa_llh_L2_TT - ipmipfa_llh_L2_TT
|
|
*
|
|
* An TT LLH Trigger
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA data structure
|
|
* \i proc
|
|
* Current process
|
|
* \i home_addr
|
|
* Node's home address
|
|
* \i home_agent
|
|
* Node's home agent
|
|
* \i lladdr
|
|
* Link Layer address
|
|
* \i iff
|
|
* Interface
|
|
* \i node
|
|
* Node
|
|
* \i agent
|
|
* Agent structure
|
|
* \i post
|
|
* IP_TRUE if POST LLH.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipfa_llh_L2_TT
|
|
(
|
|
struct Ipmipfa_data *data,
|
|
struct Ipmip_proc *proc,
|
|
Ip_u32 home_addr,
|
|
Ip_u32 home_agent,
|
|
struct Ipmip_lladdr *lladdr,
|
|
struct Ipmipfa_iff *iff,
|
|
struct Ipmipfa_node *node,
|
|
Ipmipfa_llh_agent_t *agent,
|
|
Ip_bool post
|
|
);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|