645 lines
13 KiB
C
645 lines
13 KiB
C
/* ipmipmn_route.h - ipmipmn_route.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmipmn_route.h,v $ $Revision: 1.12 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmipmn/src/ipmipmn_route.h,v $
|
|
* $Author: jhorteli $ $Date: 2010-10-15 11:28:41 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIPMN_ROUTE_H
|
|
#define IPMIPMN_ROUTE_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
/*
|
|
DESCRIPTION
|
|
|
|
No description currently provided
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
#define IPMIPMN_ROUTE_TYPE_NONE 0
|
|
#define IPMIPMN_ROUTE_TYPE_BLACKHOLE 1
|
|
#define IPMIPMN_ROUTE_TYPE_SKIP 2
|
|
#define IPMIPMN_ROUTE_TYPE_TUNNEL 3
|
|
#define IPMIPMN_ROUTE_TYPE_FA 4
|
|
#define IPMIPMN_ROUTE_TYPE_HOME 5
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmipmn_context;
|
|
struct Ipmip_proc;
|
|
struct Ipmipmn_route_node;
|
|
struct Ipmipmn_node;
|
|
struct Ip_nlmsghdr;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_context_alloc - ipmipmn_route_context_alloc
|
|
*
|
|
* Allocate a route context
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA context
|
|
* \i proc
|
|
* Current process
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmipmn_route_context_alloc
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_context_destroy - ipmipmn_route_context_destroy
|
|
*
|
|
* Destroy a route context
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_context_destroy
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_context_start - ipmipmn_route_context_start
|
|
*
|
|
* Start the route context
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The mobile node context
|
|
* \i proc
|
|
* Process context
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE on success.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmipmn_route_context_start
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_context_stop - ipmipmn_route_context_stop
|
|
*
|
|
* Stops the route thread.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The mobile node context
|
|
* \i proc
|
|
* The process
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_context_stop
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_alloc - ipmipmn_route_node_alloc
|
|
*
|
|
* Allocate an opaque route node context for this node.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Current process
|
|
* \i lock
|
|
* The node's lock
|
|
* \i name
|
|
* Name of this node.
|
|
* \ie
|
|
*
|
|
* RETURNS: The node context
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL struct Ipmipmn_route_node * ipmipmn_route_node_alloc
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
Ipmip_timer_lock_t *lock,
|
|
struct Ipmipmn_node *node
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_destroy - ipmipmn_route_node_destroy
|
|
*
|
|
* Destroy a previously allocated route node
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Current process
|
|
* \i rt
|
|
* Route node
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_destroy
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rt
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_tunnel_type - ipmipmn_route_node_tunnel_type
|
|
*
|
|
* Set tunnel type of the mobile node.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i route
|
|
* Route
|
|
* \i tunnel_type
|
|
* Type of tunnel
|
|
* \i reorder
|
|
* Enable reordering (if supported)
|
|
* \i mtu
|
|
* MTU reduction
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_tunnel_type
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *route,
|
|
Ip_u8 tunnel_type,
|
|
Ip_u8 reorder,
|
|
Ip_u16 mtu
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_tunnel_nat - ipmipmn_route_node_tunnel_nat
|
|
*
|
|
* Set tunnel NAT of the mobile node.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i route
|
|
* Route
|
|
* \i tunnel_type
|
|
* \i nat_t
|
|
* NAT-T Enabled or not.
|
|
* \i nat_t_alive
|
|
* NAT-T Keep Alive.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_tunnel_nat
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *route,
|
|
Ip_bool nat_t,
|
|
Ip_u16 nat_t_alive
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_home_address - ipmipmn_route_node_home_address
|
|
*
|
|
* Set new home address of mobile node
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i route
|
|
* Route
|
|
* \i hoa
|
|
* Home Address
|
|
* \i netmask
|
|
* Netmask
|
|
* \i gw
|
|
* Gateway
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_home_address
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *route,
|
|
Ip_u32 hoa,
|
|
Ip_u32 netmask,
|
|
Ip_u32 gw
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_home_agent - ipmipmn_route_node_home_agent
|
|
*
|
|
* Set new home agent of mobile node
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i rtn
|
|
* Route node context
|
|
* \i ha
|
|
* Home Agent
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_home_agent
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
Ip_u32 ha
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_local_address - ipmipmn_route_node_local_address
|
|
*
|
|
* Set local address
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i rtn
|
|
* Route node context
|
|
* \i local
|
|
* Local Address
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_local_address
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
Ip_u32 local
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_ifindex - ipmipmn_route_node_ifindex
|
|
*
|
|
* Set current interface index
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i rtn
|
|
* Route node context
|
|
* \i ifindex
|
|
* Current ifindex
|
|
* \i group
|
|
* Mobile Agent group
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_ifindex
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
Ip_u32 ifindex,
|
|
Ip_u32 group
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_lla - ipmipmn_route_node_lla
|
|
*
|
|
* Set lla
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i rtn
|
|
* Route node context
|
|
* \i lladdr
|
|
* Link Local Nexthop
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_lla
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
Ipmip_lladdr_t *lladdr
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_kickstart - ipmipmn_route_node_kickstart
|
|
*
|
|
* Kickstart any paused connections
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process context
|
|
* \i rtn
|
|
* Route node context
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_kickstart
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_upgrade - ipmipmn_route_node_upgrade
|
|
*
|
|
* Upgrade the route to a more explicit route type.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The context
|
|
* \i proc
|
|
* The process
|
|
* \i rtn
|
|
* Route information
|
|
* \i type
|
|
* Type of route.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_upgrade
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
int type
|
|
);
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_downgrade - ipmipmn_route_node_downgrade
|
|
*
|
|
* Downgrade the current type of route.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The context
|
|
* \i proc
|
|
* The process
|
|
* \i rtn
|
|
* The route
|
|
* \i type
|
|
* Type of route.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipmn_route_node_downgrade
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn,
|
|
int type
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipmn_route_node_get_tunnel_index - ipmipmn_route_node_get_tunnel_index
|
|
*
|
|
* Return the currently used MIP index.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* Context
|
|
* \i proc
|
|
* Process
|
|
* \i rtn
|
|
* Node Route context
|
|
* \ie
|
|
*
|
|
* RETURNS: index of the current MIP.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_u32 ipmipmn_route_node_get_tunnel_index
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn
|
|
);
|
|
|
|
IP_GLOBAL const char *ipmipmn_route_node_get_tunnel_ifname
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipmn_route_node *rtn
|
|
);
|
|
|
|
IP_GLOBAL void ipmipmn_netlink_process
|
|
(
|
|
struct Ipmipmn_context *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ip_nlmsghdr *hdr
|
|
);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|