Files
m241Neelima/components/ip_net2-6.9/ipmpls/include/ipmpls_ipstack.h
T
2026-07-30 11:19:44 +05:30

193 lines
7.0 KiB
C

/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipmpls_ipstack.h,v $ $Revision: 1.15 $
* $Source: /home/interpeak/CVSRoot/ipmpls/include/ipmpls_ipstack.h,v $
* $Author: jonas $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Dusan Stevanovic <dule@interpeak.se>
******************************************************************************
*/
#ifndef IPMPLS_IPSTACK_H
#define IPMPLS_IPSTACK_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include "ipmpls_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_sock.h>
#include <ipcom_sock2.h>
#include <ipcom_sock6.h>
#include <ipcom_netif.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
*===========================================================================
* PPP I/O events
*===========================================================================
* IO events are passed from MPLS to -> TCP/IP stack.
*/
#define IPMPLS_EIOXBLOCKOK 0x4001 /* IP_NULL; Ok to block? */
#define IPMPLS_EIOXDRVIOCTL 0x4002 /* Ipmpls_eio_ioctl; Driver ioctl */
#define IPMPLS_EIOXOUTPUT_IF 0x4003 /* Ipcom_pkt; Output packet to if. */
#define IPMPLS_EIOXINDEXTONETIF 0x4004 /* int; Get Ipcom_netif pointer from index. */
#define IPMPLS_EIOXCODE_LOCK 0x4005 /* -; Lock IPNET/IPLITE code. */
#define IPMPLS_EIOXCODE_UNLOCK 0x4006 /* -; Unlock IPNET/IPLITE code. */
#define IPMPLS_EIOXIF_LOCK 0x4007 /* -; Lock interface. */
#define IPMPLS_EIOXIF_UNLOCK 0x4008 /* -; Unlock interface. */
#define IPMPLS_EIOXPUBINDEXTONETIF 0x4009 /* int; Get Ipcom_netif pointer from public index. */
#define IPMPLS_EIOXNAMETONETIF 0x400A /* char*; Get Ipcom_netif pointer from name */
#define IPMPLS_EIOXIF_OPEN 0x400B /* -; Open interface */
#define IPMPLS_EIOXIF_RUNNING 0x4070 /* -; Running interface */
#define IPMPLS_EIOXIF_CLOSE 0x400C /* -; Close interface */
#define IPMPLS_EIOXIF_STOP 0x4071 /* -; Stop interface */
#define IPMPLS_EIOXFOREACHNETIF 0x400D /* Perform callback on each interface */
#define IPMPLS_EIOXRTABTONETIF 0x400E /* int; Fetch the MPLS FIB interface that
corresponds to a certain route table */
#define IPMPLS_EIOXGET_TTL 0x400F /* Extract ttl/hlim from IP header */
#define IPMPLS_EIOXUP_IN 0x4011 /* Ipmpls_eio_in; IPv4 UP */
#define IPMPLS_EIOXDOWN_IN 0x4012 /* Ipmpls_eio_in; IPv4 DOWN */
#define IPMPLS_EIOXINPUT_IN 0x4013 /* Ipcom_pkt; IPv4 input packet */
#define IPMPLS_EIOXDSTADDR_IN 0x4014 /* struct Ip_in_addr *; Check for IPv4 dstaddr (host endian) */
#define IPMPLS_EIOXUP_IN6 0x4021 /* Ipmpls_eio_in6; IPv6 UP */
#define IPMPLS_EIOXDOWN_IN6 0x4022 /* Ipmpls_eio_in6; IPv6 DOWN */
#define IPMPLS_EIOXINPUT_IN6 0x4023 /* Ipcom_pkt; IPv6 input packet */
#define IPMPLS_EIOXADDETHHDR 0x4030 /* struct Ip_sockaddr_ll * */
#define IPMPLS_EIOXGATEWAYREQ 0x4031 /* struct Ip_sockaddr_ll * */
#define IPMPLS_EIOXFLUSHSHORTCUTROUTES 0x4040 /* Ip_u32, Flush all pseudo routes referencing
a certain NHLFE */
#ifdef IPCOM_USE_INET
#define IPMPLS_EIOXARPPROBE 0x4050 /* Probe for an ARP entry */
#endif
#ifdef IPCOM_USE_INET6
#define IPMPLS_EIOXNDPROBE 0x4051 /* Probe for an ND entry */
#endif
#define IPMPLS_EIOXGET_USER_VR 0x4060
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
struct Ipmpls_link_struct; /* dummy */
/*
*===========================================================================
* Ipmpls_eio_ioctl
*===========================================================================
*/
typedef struct Ipmpls_eio_ioctl_struct
{
int command;
void *data;
}
Ipmpls_eio_ioctl;
/*
*===========================================================================
* Ipmpls_eio_in
*===========================================================================
* IO event type used with IPMPLS_EIOXUP_IN and IPMPLS_EIOXDOWN_IN.
*/
#ifdef IPCOM_USE_INET
typedef struct Ipmpls_eio_in_struct
{
Ip_u32 local_addr_n;
Ip_u32 peer_addr_n;
}
Ipmpls_eio_in;
#endif /* IPCOM_USE_INET */
/*
*===========================================================================
* Ipmpls_eio_in6
*===========================================================================
* IO event type used with IPMPLS_EIOXUP_IN6 and IPMPLS_EIOXDOWN_IN6.
*/
#ifdef IPCOM_USE_INET6
typedef struct Ipmpls_eio_in6_struct
{
struct Ip_in6_addr local_addr;
struct Ip_in6_addr peer_addr;
}
Ipmpls_eio_in6;
#endif /* IPCOM_USE_INET6 */
typedef void (*Ipmpls_netif_foreach_cb)(Ipcom_netif *netif, Ip_u16 vr, void *data);
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
IP_PUBLIC void ipmpls_tick(Ipcom_netif *netif);
IP_PUBLIC int ipmpls_ioevent(Ipcom_netif *netif, int command, void *data);
IP_PUBLIC int ipmpls_input(Ipcom_netif *netif, Ipcom_pkt *pkt, Ip_bool peeked);
IP_PUBLIC int ipmpls_tunnel_ioctl(Ipcom_netif *netif, Ip_u32 cmd, void *data);
IP_PUBLIC Ip_bool
ipmpls_sysvar_get_conf_string(Ipcom_netif *netif, struct Ipmpls_link_struct *link, const char *name, const char *string);
IP_PUBLIC int ipmpls_if_init(Ipcom_netif *netif);
IP_PUBLIC int ipmpls_tunnel_output(Ipcom_netif *netif, Ipcom_pkt *pkt);
IP_PUBLIC int ipmpls_shortcut_route_output(Ip_u32 key, Ipcom_pkt *pkt);
IP_PUBLIC int ipmpls_shortcut_route_nhlfe_lookup(struct Ip_sockaddr_mpls *sa_mpls);
IP_PUBLIC int ipcom_mpls_ioevent(Ipcom_netif *netif, int command,
void *data, void *more, void* cookie);
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/