245 lines
6.3 KiB
C
245 lines
6.3 KiB
C
/* ipmipha_if.h - ipmipha_if.h */
|
|
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmipha_if.h,v $ $Revision: 1.13 $
|
|
* $Source: /home/interpeak/CVSRoot/ipmipha/src/ipmipha_if.h,v $
|
|
* $Author: ulf $ $Date: 2009-06-08 11:05:50 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef IPMIPHA_IFF_H
|
|
#define IPMIPHA_IFF_H
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
/*
|
|
DESCRIPTION
|
|
|
|
No description currently provided
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include <private/ipmip4_if.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
#define IPMIPHA_IFF_IDENTITY_HA (0)
|
|
#define IPMIPHA_IFF_IDENTITY_HA_TUNNEL (1)
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
struct Ipmipha_data;
|
|
struct Ipmip_proc;
|
|
struct Ipmipha_node_context;
|
|
|
|
typedef struct Ipmipha_iff_tunnel
|
|
{
|
|
Ipmip4_if_t iff;
|
|
}
|
|
Ipmipha_iff_tunnel_t;
|
|
|
|
|
|
typedef struct Ipmipha_iff_tunnel_conf
|
|
{
|
|
Ip_u8 reverse; /* 0: Disabled; 1: Optional; 2: Required */
|
|
Ip_bool enabled[IPMIP_TUNNELTYPE_MAX + 1];
|
|
}
|
|
Ipmipha_iff_tunnel_conf_t;
|
|
|
|
typedef struct Ipmipha_iff_security_conf
|
|
{
|
|
/* SPI lookup tables */
|
|
Ipmip4_auth_context_t *spi_ctx;
|
|
Ipmip4_auth_spi_table_t *spi_fa; /* FA SPI */
|
|
Ipmip4_auth_spi_table_t *spi_mn; /* MN SPI */
|
|
Ipmip4_auth_spi_hash_t *spi_nai; /* MN SPI NAI */
|
|
|
|
/* Required verifications */
|
|
Ip_bool spi_mn_lookup_required;
|
|
Ip_bool spi_fa_lookup_required;
|
|
int *spi_mn_lookup_order;
|
|
} Ipmipha_iff_security_conf_t;
|
|
|
|
struct Ipmip_dhcp_rtab;
|
|
/* one per interface */
|
|
typedef struct Ipmipha_iff
|
|
{
|
|
Ipmip4_if_t iff;
|
|
|
|
struct Ipmip_dhcp_rtab *dhcp_rtab;
|
|
|
|
Ip_u32 home_netmask;
|
|
Ip_u32 ha_subbrd; /* subnet broadcast = ip | ~netmask (e.g. ip/16 -> 10.1.255.255) */
|
|
Ip_u32 ha_netbrd; /* network broadcast = ip | ~IP_NETMASK(ip) (e.g. ip/16 -> 10.255.255.255) */
|
|
Ip_u16 adv_lifetime;
|
|
Ip_u16 adv_seq;
|
|
int adv_interval;
|
|
Ip_u32 adv_address; /* constant 255.255.255.255 or 224.0.0.X (from config) */
|
|
Ip_bool fa_auth;
|
|
Ip_bool revocation; /* 0: Disabled; 1: Enabled */
|
|
Ip_bool reordering; /* 0: Disabled; 1: Enabled */
|
|
Ip_bool simbind_enabled;
|
|
Ip_u32 simbind_max;
|
|
Ip_u32 replay_diff;
|
|
|
|
Ip_u16 lifetime;
|
|
|
|
Ipmip4_msgext_uhdr_t *nai_ha;
|
|
Ip_bool mn_nai_require;
|
|
|
|
Ipmip_timer_t adv_timer;
|
|
Ipmip_timer_lock_t *if_lock;
|
|
|
|
/* Ipcom_tmo2 adv_timeout; */
|
|
Ip_u8 revocation_inform; /* 0: Disabled; 1: Enabled */
|
|
Ip_u8 nat_t;
|
|
Ip_u16 nat_t_keepalive;
|
|
|
|
|
|
/* */
|
|
Ipmipha_iff_tunnel_conf_t tunnel;
|
|
Ipmipha_iff_security_conf_t security;
|
|
|
|
struct Ipmipha_node_context *nodes;
|
|
|
|
Ipmipha_iff_tunnel_t *tunnels[IPMIP_TUNNELTYPE_MAX + 1];
|
|
void *extdata[IPMIPHA_FUNCTION_MAX][32];
|
|
}
|
|
Ipmipha_iff_t;
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipha_if_create - ipmipha_if_create
|
|
*
|
|
* Create an interface for a specified configuration.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA entity.
|
|
* \i proc
|
|
* Current process.
|
|
* \i conf
|
|
* The current configuration.
|
|
* \i ifname
|
|
* The name of the interface.
|
|
* \ie
|
|
*
|
|
* RETURNS: IP_TRUE if successful.
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL Ip_bool ipmipha_if_create
|
|
(
|
|
struct Ipmipha_data *data,
|
|
struct Ipmip_proc *proc,
|
|
Ipmipha_conf_t *conf,
|
|
const char *ifname
|
|
);
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipha_if_start - ipmipha_if_start
|
|
*
|
|
* Start interfaces for a specified configuration.
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA entity.
|
|
* \i proc
|
|
* Current process.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipha_if_start
|
|
(
|
|
struct Ipmipha_data *data,
|
|
struct Ipmip_proc *proc
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
*
|
|
* ipmipha_if_stop - ipmipha_if_stop
|
|
*
|
|
* Stop the interfaces belonging to a particular configuration
|
|
*
|
|
* Parameters:
|
|
* \is
|
|
* \i data
|
|
* The FA entity.
|
|
* \i proc
|
|
* Current process
|
|
* \i conf
|
|
* The current configuration.
|
|
* \ie
|
|
*
|
|
* RETURNS: No return value
|
|
*
|
|
* ERRNO:
|
|
*
|
|
* \NOMANUAL
|
|
*/
|
|
IP_GLOBAL void ipmipha_if_stop
|
|
(
|
|
struct Ipmipha_data *data,
|
|
struct Ipmip_proc *proc,
|
|
struct Ipmipha_conf *conf
|
|
);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|