/* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipppp_ipstack.h,v $ $Revision: 1.9 $ * $Source: /home/interpeak/CVSRoot/ipppp/include/ipppp_ipstack.h,v $ * $Author: tneale $ $Date: 2010-04-27 19:24:50 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Lennart Bang ****************************************************************************** */ #ifndef IPPPP_IPSTACK_H #define IPPPP_IPSTACK_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ #include "ipppp_config.h" /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include #include #include #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ /* *=========================================================================== * PPP I/O events *=========================================================================== * IO events are passed from PPP to -> TCP/IP stack. */ #define IPPPP_EIOXBLOCKOK 0x2001 /* IP_NULL; Ok to block? */ #define IPPPP_EIOXDRVIOCTL 0x2002 /* Ipppp_eio_ioctl; Driver ioctl */ #define IPPPP_EIOXOUTPUT_IF 0x2003 /* Ipcom_pkt; Output packet to if. */ #define IPPPP_EIOXINDEXTONETIF 0x2004 /* int; Get Ipcom_netif pointer from index. */ #define IPPPP_EIOXCODE_LOCK 0x2005 /* -; Lock IPNET/IPLITE code. */ #define IPPPP_EIOXCODE_UNLOCK 0x2006 /* -; Unlock IPNET/IPLITE code. */ #define IPPPP_EIOXIF_LOCK 0x2007 /* -; Lock interface. */ #define IPPPP_EIOXIF_UNLOCK 0x2008 /* -; Unlock interface. */ #define IPPPP_EIOXUP_IN 0x2011 /* Ipppp_eio_in; IPv4 UP */ #define IPPPP_EIOXDOWN_IN 0x2012 /* Ipppp_eio_in; IPv4 DOWN */ #define IPPPP_EIOXINPUT_IN 0x2013 /* Ipcom_pkt; IPv4 input packet */ #define IPPPP_EIOXDSTADDR_IN 0x2014 /* struct Ip_in_addr *; Check for IPv4 dstaddr (host endian) */ #define IPPPP_EIOXUP_IN6 0x2021 /* Ipppp_eio_in6; IPv6 UP */ #define IPPPP_EIOXDOWN_IN6 0x2022 /* Ipppp_eio_in6; IPv6 DOWN */ #define IPPPP_EIOXINPUT_IN6 0x2023 /* Ipcom_pkt; IPv6 input packet */ /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct Ipppp_link_struct; /* dummy */ /* *=========================================================================== * Ipppp_eio_ioctl *=========================================================================== */ typedef struct Ipppp_eio_ioctl_struct { int command; void *data; } Ipppp_eio_ioctl; /* *=========================================================================== * Ipppp_eio_in *=========================================================================== * IO event type used with IPPPP_EIOXUP_IN and IPPPP_EIOXDOWN_IN. */ #ifdef IPCOM_USE_INET typedef struct Ipppp_eio_in_struct { Ip_u32 local_addr_n; Ip_u32 peer_addr_n; } Ipppp_eio_in; #endif /* IPCOM_USE_INET */ /* *=========================================================================== * Ipppp_eio_in6 *=========================================================================== * IO event type used with IPPPP_EIOXUP_IN6 and IPPPP_EIOXDOWN_IN6. */ #ifdef IPCOM_USE_INET6 typedef struct Ipppp_eio_in6_struct { struct Ip_in6_addr local_addr; struct Ip_in6_addr peer_addr; } Ipppp_eio_in6; #endif /* IPCOM_USE_INET6 */ /* *=========================================================================== * Ipppp_ipstack_data *=========================================================================== */ typedef int (*Ipppp_if_init)(void *netif); typedef int (*Ipppp_if_attach)(Ipcom_netif *netif); typedef int (*Ipppp_if_create)(struct Ip_ifreq *ifreq); typedef int (*Ipppp_pppoe_create)(struct Ip_ifreq *ifreq); typedef int (*Ipppp_pppoe_input)(Ipcom_netif *ethif, Ipcom_pkt *pkt); #ifdef IPPPP_USE_PPPL2TP typedef int (*Ipppp_pppl2tp_create)(struct Ip_ifreq *ifreq); typedef int (*Ipppp_pppl2tp_input)(Ip_u32 ifindex, void *payload, Ip_u16 length); #endif typedef struct Ipppp_ipstack_data_struct { Ipppp_if_init if_init; Ipppp_if_attach if_attach; Ipppp_if_create if_create; #ifdef IPPPP_USE_PPPOE Ipppp_pppoe_create pppoe_create; Ipppp_pppoe_input pppoe_input; #endif #ifdef IPPPP_USE_PPPL2TP Ipppp_pppl2tp_create pppl2tp_create; Ipppp_pppl2tp_input pppl2tp_input; #endif } Ipppp_ipstack_data; /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ IP_PUBLIC int ipppp_if_init(Ipcom_netif *netif); IP_PUBLIC int ipppp_if_attach(Ipcom_netif *netif); IP_PUBLIC int ipppp_if_create(struct Ip_ifreq *ifreq); IP_PUBLIC void ipppp_tick(Ipcom_netif *netif); IP_PUBLIC int ipppp_ioevent(Ipcom_netif *netif, int command, void *data); IP_PUBLIC int ipppp_input(Ipcom_netif *netif, Ipcom_pkt *pkt); IP_PUBLIC int ipppp_ioctl(Ipcom_netif *netif, Ip_u32 command, void *data); IP_PUBLIC long ipcom_ppp_ioevent(Ipcom_netif *netif, int command, void *data); IP_PUBLIC Ip_bool ipppp_sysvar_get_conf_string(Ipcom_netif *netif, struct Ipppp_link_struct *link, const char *name, const char *string); #ifdef IPCOM_USE_INET IP_PUBLIC int ipppp_ip4_output(Ipcom_netif *netif, Ipcom_pkt *pkt); #endif #ifdef IPCOM_USE_INET6 IP_PUBLIC int ipppp_ip6_output(Ipcom_netif *netif, Ipcom_pkt *pkt); #endif #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */