/* ipmip6_if_prefix.h - ipmip6_if_prefix.h */ /* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6_if_prefix.h,v $ $Revision: 1.7 $ * $Source: /home/interpeak/CVSRoot/ipmip6/include/private/ipmip6_if_prefix.h,v $ * $Author: jhorteli $ $Date: 2010-12-07 09:55:18 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Joel Hortelius ****************************************************************************** */ #ifndef IPMIP6_IF_PREFIX_H #define IPMIP6_IF_PREFIX_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* DESCRIPTION This module defines the basic IPMIP6 interface prefix management. The features include keeping track of the prefixes published on the interface. */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct Ipmip6_if_router; struct Ipmip6_if_prefix; struct Ipmip6_if_notify; struct Ipmip6_context; struct Ipmip_proc; /* Added prefixes */ typedef struct Ipmip6_if_prefix_route { Ipcom_list next; Ipmip6_address_t pdata; Ip_u32 prefixes; } Ipmip6_if_prefix_route_t; /* Structure holding one prefix */ typedef struct Ipmip6_if_prefix { Ipcom_list next; /* Linkage */ /**/ Ip_bool requested; /* Address request issued */ Ipmip6_address_t prefix; /* Prefix data */ struct Ipmip6_if_router *router; /* Router owning this prefix */ Ip_u8 flags; /* Flags for this prefix */ Ip_u8 type; /* Type of prefix */ Ip_time_t valid; /* Validity time */ Ip_time_t preferred; /* Preferred time */ Ip_time_t stamp; /* Stamp time */ Ipmip_timer_t timeout; Ipmip6_if_prefix_route_t *prefix_route; /* Prefix route */ /* OLD */ Ipcom_list attached; /* Attached addresses */ Ipmip6_nd_nud_t nud; /* Neighbor unreachability */ } Ipmip6_if_prefix_t; /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ /******************************************************************************* * * ipmip6_if_prefix_restart_iflocked - ipmip6_if_prefix_restart_iflocked * * Restart timeout calculations for a prefix. The prefix has most likely been * refreshed by a router advertisement. * * 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 prefix * The prefix to restart timeout calculations for. * \ie * * RETURNS: * * ERRNO: * */ IP_GLOBAL Ip_bool ipmip6_if_prefix_restart_iflocked ( struct Ipmip6_context *ctx, struct Ipmip_proc *proc, Ipmip6_if_prefix_t *prefix ); /******************************************************************************* * * ipmip6_if_prefix_delete_iflocked - ipmip6_if_prefix_delete_iflocked * * Deletes a prefix from an 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 prefix * The prefix * \ie * * RETURNS: * * ERRNO: * */ IP_GLOBAL void ipmip6_if_prefix_delete_iflocked ( struct Ipmip6_context *ctx, struct Ipmip_proc *proc, Ipmip6_if_prefix_t *prefix ); /******************************************************************************* * * ipmip6_if_prefix_create_iflocked - ipmip6_if_prefix_create_iflocked * * Create a router prefix owned by the provided router. * Link it into the interface owning the router. * * THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD. * * Parameters: * \is * \i rtr * The router * \i prefix * The prefix * \i prefix_len * The bit length of the prefix * \ie * * RETURNS: The newly allocated prefix * * ERRNO: * */ IP_GLOBAL Ipmip6_if_prefix_t *ipmip6_if_prefix_create_iflocked ( struct Ipmip6_if_router *rtr, struct Ip_in6_addr *prefix, Ip_u8 prefix_len ); /******************************************************************************* * * ipmip6_if_prefix_lookup_iflocked - ipmip6_if_prefix_lookup_iflocked * * Lookup an asked for prefix in a router * * THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD. * * Parameters: * \is * \i rtr * The router * \i addr * The prefix * \i len * The bit length of the prefix * \ie * * RETURNS: The prefix if it exists. * * ERRNO: * */ IP_GLOBAL Ipmip6_if_prefix_t *ipmip6_if_prefix_lookup_iflocked ( struct Ipmip6_if_router *rtr, struct Ip_in6_addr *addr, Ip_u8 len ); /******************************************************************************* * * ipmip6_if_prefix_install_iflocked - ipmip6_if_prefix_install_iflocked * * Install a prefix route. * * 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 prefix * The prefix route to install. * \ie * * RETURNS: IP_TRUE on success. * * ERRNO: * */ IP_GLOBAL Ip_bool ipmip6_if_prefix_install_iflocked ( struct Ipmip6_context *ctx, struct Ipmip_proc *proc, Ipmip6_if_prefix_t *prefix ); /******************************************************************************* * * ipmip6_if_prefix_valid_iflocked - ipmip6_if_prefix_valid_iflocked * * Determines whether or not this prefix is valid * * THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD. * * Parameters: * \is * \i prefix * The prefix to validate * \ie * * RETURNS: IP_TRUE on success. * * ERRNO: * */ IP_GLOBAL Ip_bool ipmip6_if_prefix_valid_iflocked ( Ipmip6_if_prefix_t *prefix ); /******************************************************************************* * * ipmip6_if_prefix_nud_query_iflocked - ipmip6_if_prefix_nud_query_iflocked * * Do a NUD query on the current global prefix. * * 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 prefix * The prefix route to install. * \ie * * RETURNS: * * ERRNO: * */ IP_GLOBAL void ipmip6_if_prefix_nud_query_iflocked ( struct Ipmip6_context *ctx, struct Ipmip_proc *proc, Ipmip6_if_prefix_t *prefix ); /******************************************************************************* * * ipmip6_if_prefix_lookup_global - ipmip6_if_prefix_lookup_global * * Try lookup a global prefix in the specified router. * * THIS FUNCTION REQUIRES THAT THE INTERFACE LOCK IS HELD. * * Parameters: * \is * \i prefix * The prefix to validate * \ie * * RETURNS: The prefix if it exists. * * ERRNO: * */ IP_GLOBAL Ipmip6_if_prefix_t *ipmip6_if_prefix_lookup_global ( struct Ipmip6_if_router *rtr ); #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */