/* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6mn_coa.h,v $ $Revision: 1.14.16.1 $ * $Source: /home/interpeak/CVSRoot/ipmip6mn/src/ipmip6mn_coa.h,v $ * $Author: jhorteli $ $Date: 2012-02-08 16:09:52 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Joel Hortelius ****************************************************************************** */ #ifndef IPMIP6MN_COA_H #define IPMIP6MN_COA_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include #include #include #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ enum { IPMIP6MN_COA_TYPE_LLOCAL, /* Link-Local CoA */ IPMIP6MN_COA_TYPE_INET, /* INET CoA */ IPMIP6MN_COA_TYPE_LCOA, /* Link CoA */ IPMIP6MN_COA_TYPE_RCOA, /* Regional CoA */ IPMIP6MN_COA_TYPE_HOME, /* Home CoA */ IPMIP6MN_COA_TYPE_MAX }; /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct Ipmip6mn_inetX; struct Ipmip6mn_node; struct Ipmip6mn_node_config; struct Ipmip6mn_context; struct Ipmip_proc; typedef struct Ipmip6mn_coa_nemo { Ipcom_list next; Ipmip6_address_t prefix; } Ipmip6mn_coa_nemo_t; typedef struct Ipmip6mn_coa_notify { Ipcom_list next; Ipmip6_if_notify_t ipmip6; /* Currently used addresses on this interface */ Ipcom_list inetX; struct Ipmip6mn_inetX *home; struct Ipmip6mn_node *node; Ip_u32 priority; Ip_bool detach; #ifdef IPMIP_USE_INET Ip_u32 preferred_inet; #endif /* Nud & Proxy */ Ipmip6_nd_nud_t nud; Ipmip6_nd_proxy_t proxy; } Ipmip6mn_coa_notify_t; enum { IPMIP6MN_COA_GLOBAL_PREFIX = IPMIP6_IF_RTR_MAX, IPMIP6MN_COA_HOME_FINALIZE, IPMIP6MN_COA_FAILED_DAD_HOST, IPMIP6MN_COA_FAILED_DAD_HOMEAGENT }; #define IPMIP6MN_COA_FAILED ((1 << IPMIP6MN_COA_FAILED_DAD_HOST) | (1 << IPMIP6MN_COA_FAILED_DAD_HOMEAGENT)) typedef struct Ipmip6mn_inet6 { /**/ Ipmip6_address_t address; /* Nexthop router for this address */ struct Ip_in6_addr nexthop; /* Global Router Address */ struct Ip_in6_addr global; /**/ Ip_time_t valid; } Ipmip6mn_inet6_t; typedef struct Ipmip6mn_inet { /**/ Ip_u32 address; } Ipmip6mn_inet_t; typedef struct Ipmip6mn_inetX { Ipcom_list next; Ipmip6mn_coa_notify_t *ifn; Ip_u32 addrcnt; Ip_u32 family; Ip_u32 mode; Ip_u32 type; union { Ipmip6mn_inet_t inet; Ipmip6mn_inet6_t inet6; } coa; } Ipmip6mn_inetX_t; /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ IP_GLOBAL void ipmip6mn_coa_notify_delete(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ipmip6mn_coa_notify_t *notify); IP_GLOBAL Ipmip6mn_coa_notify_t *ipmip6mn_coa_notify_alloc(struct Ipmip_proc *proc, struct Ipmip6mn_node *node, struct Ipmip6mn_node_config *config, const char *ifname); IP_GLOBAL void ipmip6mn_coa_reset_failed(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ip_u32 type, Ipmip6mn_coa_notify_t *notify); IP_GLOBAL void ipmip6mn_coa_set(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, struct Ipmip6mn_node *node, Ipmip6mn_inetX_t *coa); IP_GLOBAL void ipmip6mn_coa_verify_usability(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ipmip6mn_inetX_t *coa); IP_GLOBAL void ipmip6mn_coa_proxy_start(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ipmip6mn_inetX_t *coa); IP_GLOBAL void ipmip6mn_coa_nud_start(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ipmip6mn_inetX_t *coa); IP_GLOBAL void ipmip6mn_coa_notify_stop(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, Ipmip6mn_inetX_t *coa); IP_GLOBAL Ipmip6mn_inetX_t *ipmip6mn_coa_select(struct Ipmip6mn_context *ctx, struct Ipmip_proc *proc, struct Ipmip6mn_node *node); #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */