Files
m241Neelima/components/ip_net2-6.9/ipmip6ha/src/ipmip6ha_h.h
T
2026-07-30 11:19:44 +05:30

252 lines
8.0 KiB
C

/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmip6ha_h.h,v $ $Revision: 1.15 $
* $Source: /home/interpeak/CVSRoot/ipmip6ha/src/ipmip6ha_h.h,v $
* $Author: jhorteli $ $Date: 2009-03-31 15:00:32 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
******************************************************************************
*/
#ifndef IPMIP6HA_H_H
#define IPMIP6HA_H_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_route.h>
#include <ipcom_hash.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
struct Ipmip6ha_nemo_pool;
struct Ipmip6ha_context;
struct Ipmip6ha_pktbuf;
struct Ipmip_proc;
struct Ipmip6ha_if;
struct Ipmip_cli_message;
struct Ipmip6ha_node;
struct Ipmip_timer;
struct Ipmip6ha_nemo_context;
struct Ipmip_buffer;
struct Ipmip_context_id;
typedef void (*Ipmip6ha_extension_config_global_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
int action,
void *global_config,
struct Ipmip_cli_message *request
);
typedef void (*Ipmip6ha_extension_config_ifp_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
int action,
struct Ipmip6ha_if *ifp,
void *global_config,
void *ifp_config,
struct Ipmip_cli_message *request
);
typedef int (*Ipmip6ha_extension_provide_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
int action,
void *global_config,
void *ifp_config,
void *node_config,
struct Ipmip6ha_node *node,
struct Ipmip_timer *service
);
typedef Ip_bool (*Ipmip6ha_extension_setup_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
int action,
void *global_config,
void *ifp_config,
void *node_config,
struct Ipmip6ha_node *node,
struct Ipmip_cli_message *request
);
typedef Ip_bool (*Ipmip6ha_extension_pkt_req_validate_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
void *global_config,
void *ifp_config,
void *node_config,
struct Ipmip6ha_node *node,
struct Ipmip6ha_pktbuf *pbuf,
struct Ipmip_timer *service
);
typedef Ip_bool (*Ipmip6ha_extension_pkt_req_accept_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
void *global_config,
void *ifp_config,
void *node_config,
struct Ipmip6ha_node *node,
struct Ipmip6ha_pktbuf *pbuf,
struct Ipmip_timer *service
);
typedef void (*Ipmip6ha_extension_pkt_rep_apply_t)
(
struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
void *global_config,
void *ifp_config,
void *node_config,
struct Ipmip6ha_node *node,
struct Ipmip6ha_pktbuf *pbuf_reply,
struct Ipmip6ha_pktbuf *pbuf_request
);
typedef struct Ipmip6ha_extension
{
const char *name;
Ip_u32 node_data_size;
Ip_u32 ifp_data_size;
Ip_u32 global_data_size;
/* Callbacks */
Ipmip6ha_extension_config_ifp_t config_ifp;
Ipmip6ha_extension_config_global_t config_global;
Ipmip6ha_extension_provide_t provide;
Ipmip6ha_extension_setup_t setup;
Ipmip6ha_extension_pkt_req_validate_t pkt_req_validate;
Ipmip6ha_extension_pkt_req_accept_t pkt_req_accept;
Ipmip6ha_extension_pkt_rep_apply_t pkt_rep_apply;
/* Set by PMIP */
Ip_u32 type;
} Ipmip6ha_extension_t;
typedef struct Ipmip6ha_context
{
Ipmip6_context_t ipmip6; /* Global context */
Ip_fd fd_ipd; /* ipd */
struct Ip_in6_addr link_local_prefix;
/* Mobile node specific information */
/* Current prefix lists */
Ipcom_mutex prefixes_lock;
Ipcom_route *prefixes;
Ipcom_hash *relay_map;
struct Ipmip_context_id *idents;
struct Ipmip_context_id *bri;
struct
{
Ip_u32 forward;
Ip_u32 tunnel;
} iftables;
/**/
Ipcom_list ifs;
Ipmip_timer_lock_t *ifs_lock;
/* NEMO */
Ipcom_mutex nemo_lock;
Ipcom_route *nemo_rtab;
struct Ipmip6ha_nemo_context *nemo;
Ipmip6ha_extension_t *extensions[32];
Ip_u32 extensions_num;
Ip_u32 extensions_P_mask;
Ip_u32 extensions_H_mask;
Ip_u32 extensions_node_P_data;
Ip_u32 extensions_node_H_data;
void *extdata[32];
}
Ipmip6ha_context_t;
typedef struct Ipmip6ha_relay_key
{
char *nai;
Ip_size_t nai_len;
struct Ipmip6ha_if *ifp;
} Ipmip6ha_relay_key_t;
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
IP_GLOBAL Ip_u32 ipmip6ha_context_register_extension(Ipmip6ha_context_t *ctx,
Ipmip6ha_extension_t *srv,
Ip_bool reg_H,
Ip_bool reg_P);
IP_GLOBAL void ipmip6ha_dump_relay_map(struct Ipmip6ha_context *ctx,
struct Ipmip_proc *proc,
struct Ipmip_buffer *buffer);
IP_GLOBAL void ipmip6ha_main(void);
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/