315 lines
9.6 KiB
C
315 lines
9.6 KiB
C
/* ipmip6_if_router.h - ipmip6_if_router.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6_if_router.h,v $ $Revision: 1.9.10.1 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmip6/include/private/ipmip6_if_router.h,v $
|
|
* $Author: jhorteli $ $Date: 2012-02-08 16:09:27 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIP6_IF_ROUTER_H
|
|
#define IPMIP6_IF_ROUTER_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
DESCRIPTION
|
|
|
|
This module defines the basic IPMIP6 interface router management. The features
|
|
include keeping track of the routers advertising on the interface.
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include <private/ipmip6_if.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmip6_if;
|
|
struct Ipmip6_if_notify;
|
|
struct Ipmip6_context;
|
|
struct Ipmip6_pktbuf;
|
|
struct Ipmip_proc;
|
|
struct Ipmip_lladdr;
|
|
|
|
enum
|
|
{
|
|
IPMIP6_IF_RTR_GATEWAY,
|
|
IPMIP6_IF_RTR_HOMEAGENT,
|
|
IPMIP6_IF_RTR_MOBILE,
|
|
IPMIP6_IF_RTR_LOCAL,
|
|
IPMIP6_IF_RTR_MAX
|
|
};
|
|
|
|
/* Structure holding one router */
|
|
typedef struct Ipmip6_if_router
|
|
{
|
|
Ipcom_list next;
|
|
|
|
Ip_u32 ifr_type;
|
|
|
|
Ipcom_list prefixes; /* Prefix list */
|
|
|
|
struct Ip_in6_addr addr; /* Address of this router */
|
|
struct Ipmip6_if *ifp; /* Interface owning this router */
|
|
|
|
Ip_u32 radv_interval; /* Advertisement interval */
|
|
Ip_u32 lifetime; /* Lifetime */
|
|
|
|
Ip_u32 base_reachable; /* Base Reachable value */
|
|
Ip_u32 base_retransmit; /* Base Retransmit timeout */
|
|
|
|
Ip_u16 radv_timeouts; /* Number of timeouts */
|
|
Ip_u8 flags; /* Flags for this router */
|
|
Ip_u8 referenced; /* Referenced */
|
|
Ip_bool reachable; /* We've been verified as reachable */
|
|
Ipmip_lladdr_t *lladdr;
|
|
struct Ip_timeval timestamp; /* Accesstime */
|
|
|
|
Ipmip_timer_t to_timeout; /* Router timeout, solicit req. */
|
|
Ipmip_timer_t to_refresh; /* Advertisement interval+ */
|
|
Ipmip6_nd_nud_t nud; /* Neighbor unreachability */
|
|
}
|
|
Ipmip6_if_router_t;
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_if_router_radv_recv - ipmip6_if_router_radv_recv
|
|
*
|
|
* Process a received router advertisement.
|
|
*
|
|
*
|
|
* 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 pbuf
|
|
* The router advertisement.
|
|
* \ie
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
|
|
IP_GLOBAL void ipmip6_if_router_radv_recv
|
|
(
|
|
struct Ipmip6_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmip6_pktbuf *pbuf
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_if_router_delete_iflocked - ipmip6_if_router_delete_iflocked
|
|
*
|
|
* Delete a router from the interface.
|
|
*
|
|
* THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD.
|
|
*
|
|
* 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 rtr
|
|
* The router
|
|
* \ie
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipmip6_if_router_delete_iflocked
|
|
(
|
|
struct Ipmip6_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
Ipmip6_if_router_t *rtr
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_if_router_by_lladdr_iflocked - ipmip6_if_router_by_lladdr_iflocked
|
|
*
|
|
* Try locate a router by link-layer address
|
|
*
|
|
* THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i ifp
|
|
* The interface we're looking up in
|
|
* \i lladdr
|
|
* The routers link-layer address
|
|
* \ie
|
|
*
|
|
* RETURNS: The router if it exists.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL Ipmip6_if_router_t *ipmip6_if_router_by_lladdr_iflocked
|
|
(
|
|
struct Ipmip6_if *ifp,
|
|
struct Ipmip_lladdr *lladdr
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_if_router_reference_iflocked - ipmip6_if_router_reference_iflocked
|
|
*
|
|
* Reference the router. Do actively verify that it's still available
|
|
*
|
|
* THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD.
|
|
*
|
|
* 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 ife
|
|
* The interface
|
|
* \i nexthop
|
|
* The routers link-local address
|
|
* \ie
|
|
*
|
|
* RETURNS: The router if it exists.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipmip6_if_router_reference_iflocked
|
|
(
|
|
struct Ipmip6_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmip6_if *ife,
|
|
struct Ip_in6_addr *nexthop
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmip6_if_router_dereference_iflocked - ipmip6_if_router_dereference_iflocked
|
|
*
|
|
* Dereference the router.
|
|
*
|
|
* THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD.
|
|
*
|
|
* 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 ife
|
|
* The interface
|
|
* \i nexthop
|
|
* The routers link-local address
|
|
* \ie
|
|
*
|
|
* RETURNS:
|
|
*
|
|
* ERRNO:
|
|
*
|
|
*/
|
|
IP_GLOBAL void ipmip6_if_router_dereference_iflocked
|
|
(
|
|
struct Ipmip6_context *ctx,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmip6_if *ife,
|
|
struct Ip_in6_addr *nexthop
|
|
);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|