original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
+103
View File
@@ -0,0 +1,103 @@
/* bridge.h - simple learning bridge declarations */
/* Copyright 2000-2005 Wind River Systems, Inc. */
/*
modification history
--------------------
01h,21nov07,tlu Move BRIDGE_PORT_INFO structure here
01g,07sep06,tlu Increment version number
01f,21jul05,svk Increment version number for Service Pack 1
01e,07feb05,svk Increment version number
01d,19jul04,svk Increment version number
01c,07may03,svk Add support for static mac addresses in bridge station cache
01b,17apr03,svk Implement version number, update copyright
01a,27sep00,jhl created
*/
#ifndef __INCbridgeh
#define __INCbridgeh
#ifdef INCLUDE_IPFIREWALL_SUPPORT
#include <ipnet_netif.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define BRIDGE_VERSION "1.3.3"
#define BRIDGE_STATIC_FLAG 0x00000001 /* Station cache entry is static */
#ifdef _WRS_CONFIG_BRIDGE_DEBUG
#ifndef BRIDGE_DEBUG
#define BRIDGE_DEBUG
#endif
#endif
#ifdef INCLUDE_DHCP_RELAY_AGENT
typedef struct
{
NODE node; /* for list */
char *circuitID; /* circuit identifier */
char *remoteID; /* remote identifier */
/* statistics */
int giaddrZeroWithOption82;
/* list for relay identifier */
char *shareKey; /* share key for AUTH */
int relayID; /* relay identifier */
/* current send Replay Detection count value */
UINT curSendRDCount;
/* current received Replay Detection count value */
UINT lastRecvRDCount;
BOOL notFirstPacket;
} BRIDGE_DHCPR_INFO;
#endif
/* bridge port information */
typedef struct
{
NODE node; /* must be first member in the structure */
char name[END_NAME_MAX];
int unitNum;
#ifdef INCLUDE_IPFIREWALL_SUPPORT
Ipnet_netif *netif;
#endif
void* pMuxBindCookie;
char portType;
#ifdef INCLUDE_DHCP_RELAY_AGENT
BOOL trustFlag;
BRIDGE_DHCPR_INFO DhcpR;
#endif
struct ifqueue errSndq;
#ifdef INCLUDE_IPFIREWALL_SUPPORT
Ipcom_pkt *firewallPkt;
#endif
} BRIDGE_PORT_INFO;
IMPORT const char * bridgeVersion;
IMPORT STATUS bridgeInit(void);
IMPORT STATUS bridgePortAdd(char* pDevName, int unitNum);
IMPORT STATUS bridgePortRemove(char* pDevName, int unitNum);
IMPORT STATUS bridgeMacAdd(char* pDevName, int unitNum, char* pMacAddr,
UINT32 flags);
IMPORT STATUS bridgeMacRemove(char* pMacAddr);
#ifdef __cplusplus
}
#endif
#endif /* __INCbridgeh */
/***************************************************************************
* END OF FILE
***************************************************************************/
@@ -0,0 +1,58 @@
/* mirrorEnd.h - Mirroring END device driver declarations */
/* Copyright 2000-2003 Wind River Systems, Inc. */
/*
modification history
--------------------
01c,21nov07,tlu Add function proto to set interface RUNNING state
01b,17apr03,svk Update copyright
01a,10oct00,jhl created
*/
#ifndef __INCmirrorEndh
#define __INCmirrorEndh
#ifdef __cplusplus
extern "C" {
#endif
IMPORT void mirrorEnetAddrGet (char *);
IMPORT STATUS mirrorEndRunningState(void);
/* defines */
#define MIRROR_END_OBJ_STRING "Mirroring Enhanced Network Driver"
#define MIRROR_DEV_NAME "mirror"
#define MIRROR_DEV_NAME_LEN 7
#define MIRROR_STACK_UNIT_NUM 0
#define MIRROR_BRIDGE_UNIT_NUM 1
#define ENDERRBLOCK 2000 /* for END_ERR_BLOCK */
#define MIRROR_END_ERR_UNBLOCK 0x666
#define MIRROR_END_ERR_BLOCK 0x888
#define MIRROR_END_ERR_BLOCK_CHECK 0x999
#define MIRROR_END_ERR_BLOCK_TRUE 100
#define MIRROR_END_ERR_BLOCK_FALSE 200
#define SYS_ENET_ADDR_GET(address) mirrorEnetAddrGet (address);
#ifdef __cplusplus
}
#endif
#endif /* __INCmirrorEndh */
/***************************************************************************
* END OF FILE
***************************************************************************/
@@ -0,0 +1,640 @@
/* applUtilLib.h - Application utility library */
/* Copyright 2001 - 2004 Wind River Systems, Inc. */
/*
modification history
--------------------
01n,07aug04,dlk Substantial changes for scalability and consistency with
syslog API.
01m,20aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01l,03aug04,nee Removing distinction between LOG_* as functions or macros
depending on whether its GNU or diab
01k,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01j,03feb04,zhr Added telnet client to logging categories
01j,27jan04,asr Added rlogin & remLib to logging categories
01i,06dec03,niq Fix compile error with GNU
01h,24nov03,asr added an include for semLib.h
moved diab version of LOG_XXXX to applUtilLib.c to get rid of warnings
01g,20nov03,niq osdep.h cleanup
01f,01nov03,asr Changes to port application logger to RTP
01e,22aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01d,15jul02,rvr defined inline functions for LOG_INFO,LOG_ERROR,LOG_WARNING
and LOG_DEBUG for diab compiler
01c,21may02,ppp adding taskLib.h for T2 build
01b,21Jan02,ism change logging macros to remove need for array
01a,18Sep01,ism written
*/
#ifndef __INCapplUtilLibh
#define __INCapplUtilLibh
/* includes */
#include <stdio.h> /* for FILE */
#include <limits.h> /* for INT_MAX */
#include <stdarg.h>
#include <semLib.h>
#include <cfgDefs.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* defines */
#ifdef _WRS_KERNEL
/* nbioLogLib is not presently supported in RTPs.
* It may or may not be desired in the kernel.
#define SUPPORT_NBIO_LOG
*/
#endif
#ifdef SUPPORT_NBIO_LOG
#define KERN_LOG_FD LOG_FD_NBIO
#else
#define KERN_LOG_FD STD_ERR
#endif
#define CAT_SHIFT 8
#define CAT_MASK ((UINT)(-(1 << CAT_SHIFT)))
/* Logging categories */
typedef enum _LOG_CAT_NUM
{
#undef LOG_DB
#undef LOG_DB_LAST
#define LOG_DB(x, y, z) x##_LOG_NUM,
#define LOG_DB_LAST(x, y, z) x##_LOG_NUM,
#include <logCategories.h>
LOG_NUMCATS
} LOG_CAT_NUM;
typedef enum _LOG_CAT
{
#undef LOG_DB
#undef LOG_DB_LAST
#define LOG_DB(x, y, z) x##_LOG = (x##_LOG_NUM << CAT_SHIFT),
#define LOG_DB_LAST(x, y, z) x##_LOG = (x##_LOG_NUM << CAT_SHIFT)
#include <logCategories.h>
} LOG_CAT;
typedef struct categoryInfo
{
int fd;
UINT level;
} CATEGORY_INFO;
typedef struct _APPL_UTIL_CFG
{
CFG_DATA_HDR cfgh; /* header */
int fd; /* default logging file descriptor, all facilities
except KERN_LOG */
UINT level; /* default logging decoration and level, non-KERN */
int fdKern; /* default logging file descriptor for KERN_LOG */
UINT levelKern; /* default logging decoration and level, KERN_LOG */
} APPL_UTIL_CFG;
#ifndef _LOG_DEC_DFLT
#define _LOG_DEC_DFLT ((LOG_DECOR|LOG_LOC) << 8)
#endif
#ifndef _LOG_LVL_DFLT
#define _LOG_LVL_DFLT WARNING_LEVEL
#endif
/* Priority levels */
#define LOG_DEBUG 7 /* Messages containing information normally of use */
/* only when debugging */
#define LOG_INFO 6 /* Informational messages */
#define LOG_NOTICE 5 /* Non-error conditions, which may require special */
/* handling */
#define LOG_WARNING 4 /* Warning messages */
#define LOG_ERR 3 /* Errors */
#define LOG_CRIT 2 /* Critical conditions, such as hard device errors */
#define LOG_ALERT 1 /* A condition which requires immediate corrective */
/* action */
#define LOG_EMERG 0 /* Panic condition. The system is unstable. */
#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
/* Logging levels - convenience values for logging all levels
* up to a specified level.
*/
#define DEBUG_LEVEL LOG_UPTO (LOG_DEBUG)
#define INFO_LEVEL LOG_UPTO (LOG_INFO)
#define NOTICE_LEVEL LOG_UPTO (LOG_NOTICE)
#define WARNING_LEVEL LOG_UPTO (LOG_WARNING)
#define ERR_LEVEL LOG_UPTO (LOG_ERR)
#define ERROR_LEVEL ERR_LEVEL /* deprecated */
#define CRIT_LEVEL LOG_UPTO (LOG_CRIT)
#define ALERT_LEVEL LOG_UPTO (LOG_ALERT)
#define EMERG_LEVEL LOG_UPTO (LOG_EMERG)
#define DO_NOT_LOG 0x00
/* We share priority levels (although not level names) with syslog() */
#define LOG_DEBUG_BIT (1 << LOG_DEBUG)
#define LOG_INFO_BIT (1 << LOG_INFO)
#define LOG_NOTICE_BIT (1 << LOG_NOTICE)
#define LOG_WARNING_BIT (1 << LOG_WARNING)
#define LOG_ERR_BIT (1 << LOG_ERR)
#define LOG_CRIT_BIT (1 << LOG_CRIT)
#define LOG_ALERT_BIT (1 << LOG_ALERT)
#define LOG_EMERG_BIT (1 << LOG_EMERG)
/*
* Special bit for compile-time enabling of kernel logging (log(), LOG()).
* Not really a priority bit.
*/
#define LOG_KERNEL_BIT 0x100
/*
* These bits may be passed to the logging macros as part of the
* "category" argument to enable or disable various "decorations"
* on the log output.
*
* These bits are exlusive-or'ed with the corresponding bits set on
* a per-facility basis using logDecorationSet().
*/
#define LOG_DECOR 0x80 /* log priority level and facility */
#define LOG_LOC 0x40 /* log file name or function and line number */
#ifdef ENABLE_LOG_TIME
#define LOG_TIME 0x20 /* log a timestamp */
#endif
#define LOG_ERRNO 0x10 /* log errno */
/* Fake file descriptor value for non-blocking I/O */
#define LOG_FD_NBIO INT_MAX
/*
* In the priority/category argument to _applLog(),
*
* Bits 0 - 2 are the priority
* Bits 3 - 7 are decoration bits.
* Bits 8 - 31 identify the category (Facility)
*
* Bit 0 is the least significant bit here.
*/
#define PRI_CAT(pri, cat) ((cat) | (pri))
#define LOG_CAT(x) ((UINT32)(x) >> CAT_SHIFT)
/* Constants controlling compile-time enabling of logging levels */
/* Define LOG_ENABLE_MASK as 0 to disable at compile time
* all application logging. This might be done if a target platform
* has no available console or other file to which it can log.
* Define LOG_ENABLE_MASK as a collection of the LOG_*_BIT values above
* to enable particular logging levels.
*/
#if !defined (LOG_ENABLE_MASK)
#if FALSE /* change to TRUE if a logging destination is not available */
#define LOG_ENABLE_MASK (0)
#elif FALSE /* change to TRUE to do full logging */
#define LOG_ENABLE_MASK (DEBUG_LEVEL | LOG_KERNEL_BIT)
#else
/*
* The _FREE_VERSION macro indicates a well-tested production
* system. We assume DEBUG and INFO levels are not of interest
* here (and should be removed to save space).
*
* For size reduction, remove these levels in the default (checked)
* build as well.
*/
#define LOG_ENABLE_MASK (LOG_NOTICE_BIT | \
LOG_WARNING_BIT | \
LOG_ERR_BIT | \
LOG_CRIT_BIT | \
LOG_ALERT_BIT | \
LOG_EMERG_BIT | \
LOG_KERNEL_BIT)
#endif
#endif /* !defined (LOG_ENABLE_MASK) */
#if __DCC__ || (__GNUCC__ >= 3)
#define C99_VARIADIC_MACROS
#endif
#if (LOG_ENABLE_MASK != 0)
#define APPL_LOGGER_INIT(cat, fd) applLoggerInit ((cat), (fd))
#define APPL_LOGGER_STOP(cat) applLoggerStop ((cat))
#define LOG_LEVEL_CHANGE(cat, mask) logLevelChange ((cat), (mask))
#define LOG_DECORATION_CHANGE(cat, disable, enable) \
logDecorationChange ((cat), (disable), (enable))
#define LOGGER_INFO_SHOW() loggerInfoShow ()
#ifdef C99_VARIADIC_MACROS
#define _APPL_LOG(cat, file, line, ...) \
_applLog ((cat), (file), (line), __VA_ARGS__);
#else
#define _APPL_LOG(cat, file, line, fmt...) \
_applLog ((cat), (file), (line), fmt);
#endif /* C99_VARIADIC_MACROS */
#else /* (LOG_ENABLE_MASK == 0) */
#define APPL_LOGGER_INIT(cat, fd) (OK)
#define APPL_LOGGER_STOP(cat) (OK)
#define LOG_LEVEL_CHANGE(cat, mask) (OK)
#define LOG_DECORATION_CHANGE(cat, disable, enable) (OK)
#define LOGGER_INFO_SHOW() do {} while (FALSE)
#ifdef C99_VARIADIC_MACROS
#define _APPL_LOG(cat, file, line, ...) do {} while (FALSE)
#else
#define _APPL_LOG(cat, file, line, fmt...) do {} while (FALSE)
#endif /* C99_VARIADIC_MACROS */
#endif /* (LOG_ENABLE_MASK == 0) */
/*
* A modicum of backwards compatibility:
*/
#define USE_PRINTF STD_OUT
/* typedefs */
/* variables */
/* function declarations */
STATUS applLoggerInit (int category, int fd);
STATUS applLoggerStop (int category);
STATUS logLevelChange (int category, UINT mask);
UINT logDecorationChange (int category, UINT disableMask, UINT enableMask);
void loggerInfoShow ();
void _applLog (int priCat, const char * file, int line, const char * fmt, ...);
/* These functions are deprecated and should not be used */
#define APPL_LOGGER_DEPRECATED_ROUTINES
#ifdef APPL_LOGGER_DEPRECATED_ROUTINES
int initApplLogger (int category, int fd);
int stopApplLogger (int category);
int changeLogLevel (int category, char level);
void showLoggerInfo ();
#endif /* APPL_LOGGER_DEPRECATED_ROUTINES */
#define GCC_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
/* XXX verify exact version numbers for _HAVE__FUNCTION__ and _HAVE__func__ */
#if defined (__GNUC__) || (defined (__DCC__) && __VERSION_NUMBER__ >= 5200)
#define _HAVE__FUNCTION__
#endif
#if (GCC_VERSION >= 30200)
#define _HAVE__func__
#endif
#define LOG_LOC_FILE 0 /* The default */
#define LOG_LOC_FUNC 1
#define LOG_LOC_NONE 2
#if LOG_LOCATION == LOG_LOC_NONE
#define _LOG_LOCATION NULL, 0
#define _LOC_UNIT NULL
#elif (LOG_LOCATION == LOG_LOC_FUNC) && defined (_HAVE__func__)
#define _LOG_LOCATION __func__, __LINE__
#define _LOC_UNIT __func__
#elif (LOG_LOCATION == LOG_LOC_FUNC) && defined (_HAVE__FUNCTION__)
#define _LOG_LOCATION __FUNCTION__, __LINE__
#define _LOC_UNIT __FUNCTION__
#else
#define _LOG_LOCATION __FILE__, __LINE__
#define _LOC_UNIT __FILE__
#endif
/*
* If logging is enabled, but LOG_ARGS is not defined, then
* logging decoration will be shown, but the specified log string
* and its variable arguments will not.
* This decreases space requirements while still providing
* logging information sufficient to locate code logging errors.
*/
#ifndef LOG_ARGS
#define LOG_ARGS 1
#endif
/*
* These macros provide the logging interface used by the VxWorks
* applications. Each macro takes a category, which identifies which
* application has made the call, and also a control string and multiple
* arguments, which are in exactly the same format as printf().
*
* For each macro the current logging level of the specified category is
* compared to the level that the macro name implies. If the current logging
* level for the application is greater than or equal to the macro level
* then the message will be logged, if it is not then the message will
* be discarded. For example, if the current logging level of an application
* is INFO_LEVEL then all the logging calls in that application will
* succeed except the logging calls made using LOG_DEBUG.
*
*/
#ifdef C99_VARIADIC_MACROS
#if (LOG_ENABLE_MASK & LOG_DEBUG_BIT)
#if LOG_ARGS
#define log_debug(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_DEBUG, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_debug(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_DEBUG, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_debug(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_INFO_BIT)
#if LOG_ARGS
#define log_info(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_INFO, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_info(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_INFO, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_info(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_NOTICE_BIT)
#if LOG_ARGS
#define log_notice(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_NOTICE, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_notice(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_NOTICE, cat), _LOG_LOCATION, "");\
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_notice(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_WARNING_BIT)
#if LOG_ARGS
#define log_warning(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_WARNING, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_warning(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_WARNING, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_warning(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_ERR_BIT)
#if LOG_ARGS
#define log_err(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_ERR, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_err(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_ERR, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_err(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_CRIT_BIT)
#if LOG_ARGS
#define log_crit(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_CRIT, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_crit(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_CRIT, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_crit(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_ALERT_BIT)
#if LOG_ARGS
#define log_alert(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_ALERT, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_alert(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_ALERT, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_alert(cat, ...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_EMERG_BIT)
#if LOG_ARGS
#define log_emerg(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_EMERG, cat), _LOG_LOCATION, \
__VA_ARGS__); \
} while (FALSE)
#else
#define log_emerg(cat, ...) \
do { \
_applLog (PRI_CAT (LOG_EMERG, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_emerg(cat, ...) do {} while (FALSE)
#endif
#else /* !defined (C99_VARIADIC_MACROS) -> assume old GNU variadic syntax */
#if (LOG_ENABLE_MASK & LOG_DEBUG_BIT)
#if LOG_ARGS
#define log_debug(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_DEBUG, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_debug(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_DEBUG, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_debug(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_INFO_BIT)
#if LOG_ARGS
#define log_info(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_INFO, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_info(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_INFO, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_info(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_NOTICE_BIT)
#if LOG_ARGS
#define log_notice(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_NOTICE, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_notice(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_NOTICE, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_notice(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_WARNING_BIT)
#if LOG_ARGS
#define log_warning(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_WARNING, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_warning(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_WARNING, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_warning(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_ERR_BIT)
#if LOG_ARGS
#define log_err(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_ERR, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_err(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_ERR, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_err(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_CRIT_BIT)
#if LOG_ARGS
#define log_crit(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_CRIT, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_crit(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_CRIT, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_crit(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_ALERT_BIT)
#if LOG_ARGS
#define log_alert(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_ALERT, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_alert(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_ALERT, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_alert(cat, fmt...) do {} while (FALSE)
#endif
#if (LOG_ENABLE_MASK & LOG_EMERG_BIT)
#if LOG_ARGS
#define log_emerg(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_EMERG, cat), _LOG_LOCATION, fmt); \
} while (FALSE)
#else
#define log_emerg(cat, fmt...) \
do { \
_applLog (PRI_CAT (LOG_EMERG, cat), _LOG_LOCATION, ""); \
} while (FALSE)
#endif /* LOG_ARGS */
#else
#define log_emerg(cat, fmt...) do {} while (FALSE)
#endif
#endif /* !defined (C99_VARIADIC_MACROS) */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __INCapplUtilLibh */
+65
View File
@@ -0,0 +1,65 @@
/* arpLib.h - VxWorks ARP table manipulation header file */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01n,09jan12,h_x Move extern "C" after last header file include.
01m,30aug05,tkf Cleanup for integration with IPNET.
01l,09feb05,sar Move gtf include files per GTF code inspection of 10/26/2004
01k,07feb05,vvv _KERNEL cleanup
01j,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01i,20nov03,niq Remove copyright_wrs.h file inclusion
01h,05nov03,cdw Removal of unnecessary _KERNEL guards.
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,23oct03,rlm updated #includes for header re-org
01d,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01c,09may03,vvv included vwModNum.h and in.h
01b,07feb02,ppp re-enabling arpLibInit
01a,14dec01,ppp ported from A.E. 1.1
*/
#ifndef __INCarpLibh
#define __INCarpLibh
#include <vwModNum.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS arpAdd (char *host, char *eaddr, int flags);
extern STATUS arpDelete (char *host);
extern STATUS arpResolve(char *targetAddr, char *pHwAddr, int numTries,int numTicks);
extern void arpFlush (void);
#else /* __STDC__ */
extern STATUS arpAdd ();
extern STATUS arpDelete ();
extern STATUS arpResolve();
extern void arpFlush();
#endif /* __STDC__ */
/* error values */
#define S_arpLib_INVALID_ARGUMENT (M_arpLib | 1)
#define S_arpLib_INVALID_HOST (M_arpLib | 2)
#define S_arpLib_INVALID_ENET_ADDRESS (M_arpLib | 3)
#define S_arpLib_INVALID_FLAG (M_arpLib | 4)
#ifdef __cplusplus
}
#endif
#endif /* __INCarpLibh */
@@ -0,0 +1,86 @@
/* inet.h - Internet header */
/* Copyright 1986 - 2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1983 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)inet.h 5.2 (Berkeley) 6/27/88
*/
/*
modification history
--------------------
01r,09jan12,h_x Move extern "C" after last header file include.
01q,22jun10,h_x Fix WIND00219346
01p,27mar08,nlu WIND00108893
01o,08nov06,kch Removed prototypes not specified in Posix specification.
01n,29jun05,vvv added inet_ntop() and inet_pton() for RFC3542
01m,04mar04,ann Removed #ifndef _KERNEL protection for including in.h
as this file is required for defining struct in_addr.
01l,20nov03,niq Remove copyright_wrs.h file inclusion
01k,04nov03,rlm Ran batch header path update for header re-org.
01j,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01i,13jun03,syy Added prototype for inet_ntoa_b() (SPR#88384)
01h,09may03,vvv included in.h
01g,26jul99,spm added ansi/c++ prototypes for routines (SPR #5307)
01f,22sep92,rrr added support for c++
01e,26may92,rrr the tree shuffle
01d,04oct91,rrr passed through the ansification filter
-changed copyright notice
01c,05oct90,shl added copyright notice.
added title.
01b,16apr89,gae updated to new 4.3BSD.
01a,22dec86,rdc created.
*/
#ifndef __INCineth
#define __INCineth
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* External definitions for
* functions in inet(3N)
*/
#if defined(__STDC__) || defined(__cplusplus)
extern uint32_t inet_addr (const char *);
extern char * inet_ntoa (struct in_addr);
extern const char * inet_ntop (int af, const void *src, char *dst,
size_t size);
extern int inet_pton (int af, const char *src, void *dst);
#else
uint32_t inet_addr();
char *inet_ntoa();
const char * inet_ntop ();
int inet_pton ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCafh */
+30
View File
@@ -0,0 +1,30 @@
/* cfgDefs.h - default configuration data set up support */
/* Copyright 2002 Wind River Systems, Inc. */
/*
modification history
--------------------
01c,05nov03,cdw Removal of unnecessary _KERNEL guards.
01b,04nov03,rlm Ran batch header path update for header re-org.
01a,11jul02,spm automatic merge from version 1 of Accordion Munich branch:
(01a,05jul02,wie written)
*/
#ifndef __INCcfgDefsh
#define __INCcfgDefsh
/* defines */
/* all default configuration data structures must have this structure at
the beginning */
typedef struct cfg_data_hdr{
int len;
} CFG_DATA_HDR;
/* macros */
#endif /* __INCcfgDefsh */
@@ -0,0 +1,60 @@
/* qosIngressLib.h - definitions for qos support on ingress */
/*
* Copyright (c) 2005 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01b,22sep09 zhr Fixed WIND00180271
01a,09aug05 niq created.
*/
#ifndef __INCqosIngressLibh
#define __INCqosIngressLibh
#ifdef __cplusplus
extern "C" {
#endif
/* defines for the return value of the packet classification hook */
typedef enum
{
QOS_HOOK_FAIL = -1,
QOS_DELIVER_PKT,
QOS_DEFER_PKT,
QOS_IGNORE_PKT
} QOS_HOOK_RETVAL;
/* definition for the packet classification hook */
typedef QOS_HOOK_RETVAL (*QOS_ING_HOOK) (END_OBJ *, M_BLK_ID *, int *);
/* Configuration structure */
typedef struct _qosConfig
{
JOB_QUEUE_ID cfg_pJobQueue; /* Job queue to use */
int cfg_jobQPri; /* Priority for the process job */
int cfg_qosDefaultPri; /* Default pri for queuing packets */
} QOS_CONFIG_PARAMS;
/* External APIs */
IMPORT STATUS qosIngressLibInit (void * cfgParams);
IMPORT STATUS qosIngressHookSet (int unit, char * ifname, QOS_ING_HOOK hookRtn);
#ifdef __cplusplus
}
#endif
#endif /* __INCqosIngressLibh */
@@ -0,0 +1,47 @@
/* etherLib.h - ethernet hook routines header */
/*
* Copyright 1984-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01g,09jan12,h_x Move extern "C" after last header file include.
01f,19jun06,jpb Removed I960 check.
01e,05nov03,cdw Removal of unnecessary _KERNEL guards.
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01b,10jun03,vvv include netVersion.h
01a,28sep02,ann provided only for backward compatibility
*/
#ifndef __INCetherLibh
#define __INCetherLibh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defints */
typedef struct enet_hdr
{
char dst [6];
char src [6];
USHORT type;
} ENET_HDR;
#define ENET_HDR_SIZ sizeof(ENET_HDR)
#define ENET_HDR_REAL_SIZ 14
#ifdef __cplusplus
}
#endif
#endif /* __INCetherLibh */
@@ -0,0 +1,80 @@
/* etherMultiLib.h - definitions for the Ethernet multicast library */
/*
* Copyright (c) 1996-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
02j,09jan12,h_x Move extern "C" after last header file include.
02i,21aug06,kch cleaned up header files.
02h,20nov03,niq Remove copyright_wrs.h file inclusion
02g,04nov03,rlm Ran batch header path update for header re-org.
02f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
02e,23oct03,rlm updated #includes for header re-org
02d,28mar02,ppp Making changes to be compatible with AE 1.1
02c,03mar02,ham renamed dummyend.h to end.h
02b,18sep01,ann correcting the inclusion of if_ether.h
02a,18sep01,ann ported to clarinet from 01d AE1.1
01d,12aug97,gnn cleaned up dependencies for multicast handling.
01c,23oct96,gnn name changes to follow coding standards.
01b,07may96,gnn added routines to handle non-IP based multicast
addresses.
Added list handling library.
01a,15apr96,gnn written.
*/
/*
DESCRIPTION
This header file describes data structures and function prototypes for
the ethernet multicast library.
INCLUDE FILES:
*/
#ifndef __INCetherMultiLibh
#define __INCetherMultiLibh
/* includes */
#include <end.h>
#include <netinet/if_ether.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defints */
/* typedefs */
/* globals */
/* locals */
/* forward declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern int etherMultiAdd(LIST *pList, char* pAddress );
extern int etherMultiDel(LIST* pList, char* pAddress);
extern int etherMultiGet(LIST *pList, MULTI_TABLE* pTable);
#else /* __STDC__ */
extern int etherMultiAdd();
extern int etherMultiDel();
extern int etherMultiGet();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCetherMultiLibh */
+70
View File
@@ -0,0 +1,70 @@
/* filio.h - file-related ioctl definitions */
/* Copyright 2001-2003 Wind River Systems, Inc. */
/*-
* Copyright (c) 1982, 1986, 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)filio.h 8.1 (Berkeley) 3/28/94
* $FreeBSD: src/sys/sys/filio.h,v 1.7 1999/12/07 22:25:28 sos Exp $
*/
/*
modification history
--------------------
01f,05sep06,kch Cleanup for IPNet integration.
01e,20nov03,niq Remove copyright_wrs.h file inclusion
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,29apr03,syy Added #ifdef for __cplusplus
01b,17sep01,ann uncommenting the inclusion of ioccom.h
01a,15aug01,ann ported to clarinet from freeBSD 4.3 ver 1.7
*/
#ifndef _SYS_FILIO_H_
#define _SYS_FILIO_H_
#ifdef __cplusplus
extern "C" {
#endif
#define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_FILIO_H_ */
+183
View File
@@ -0,0 +1,183 @@
/* ftp6Lib.h -File Transfer Protocol Client library header */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01n,09jan12,h_x Move extern "C" after last header file include.
01m,29sep10,h_x Add extern FUNCPTR _func_ftpLs.
01l,12jul06,rpb defined FTP6_FORBID_LOCAL_OVERWRITE: Fix for SPR#117576 and
Updated copyright.
01k,20jun05,vvv added hostLib.h (SPR #110024)
01j,31jul04,kc Modified FTP6_CLIENT_DATA structure to use char array for
hostname.
01i,20nov03,niq Remove copyright_wrs.h file inclusion
01h,05nov03,cdw Removal of unnecessary _KERNEL guards.
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,06jun02,ant added ftp6LibInit ()
01d,14feb02,ant added routines ftp6UserPassSet, ftp6UserPassPrint
01c,01feb02,ant FTP6_PASSIVEMODE changed to FTP6_PASSIVEOFF. Passive
mode is default.
01b,15jan02,ant sockunion moved to apps/common/sockunion.h
01a,14sep01,ant written
*/
#ifndef __INCftp6Libh
#define __INCftp6Libh
/* includes */
#include <stdio.h>
#include <hostLib.h>
#include <netinet/sockunion.h>
#ifdef _WRS_KERNEL
#include <sys/times.h>
#else
#include <time.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define FTP6_AFAMILY4 0x1
#define FTP6_AFAMILY6 0x2
#define FTP6_PASSIVEOFF 0x4
#define FTP6_RESTRICTEDDATAP 0x8
#define FTP6_TRYEPSV 0x10
#define FTP6_FORBID_LOCAL_OVERWRITE 0x80
#ifndef __INCftpLibh
/* For FTP specification see RFC-765 */
/* Reply codes. */
#define FTP_PRELIM 1 /* positive preliminary */
#define FTP_COMPLETE 2 /* positive completion */
#define FTP_CONTINUE 3 /* positive intermediate */
#define FTP_TRANSIENT 4 /* transient negative completion */
#define FTP_ERROR 5 /* permanent negative completion */
#define FTP_NOACTION 550 /* requested action not taken */
/* Type codes */
#define TYPE_A 1 /* ASCII */
#define TYPE_E 2 /* EBCDIC */
#define TYPE_I 3 /* image */
#define TYPE_L 4 /* local byte size */
/* Form codes */
#define FORM_N 1 /* non-print */
#define FORM_T 2 /* telnet format effectors */
#define FORM_C 3 /* carriage control (ASA) */
/* Structure codes */
#define STRU_F 1 /* file (no record structure) */
#define STRU_R 2 /* record structure */
#define STRU_P 3 /* page structure */
/* Mode types */
#define MODE_S 1 /* stream */
#define MODE_B 2 /* block */
#define MODE_C 3 /* compressed */
/* Record Tokens */
#define REC_ESC '\377' /* Record-mode Escape */
#define REC_EOR '\001' /* Record-mode End-of-Record */
#define REC_EOF '\002' /* Record-mode End-of-File */
/* Block Header */
#define BLK_EOR 0x80 /* Block is End-of-Record */
#define BLK_EOF 0x40 /* Block is End-of-File */
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
#define BLK_RESTART 0x10 /* Block is Restart Marker */
#define BLK_BYTECOUNT 2 /* Bytes in this block */
#endif /* __INCftpLibh */
/*typedef struct sockaddr_in SOCKADDR_IN;*/
/* typedefs */
typedef struct
{
union sockunion myctladdr; /* Client address */
union sockunion hisctladdr; /* peer address */
union sockunion data_addr; /* data connection address*/
ulong_t options;
char hostname[MAXHOSTNAMELEN]; /* remote host name */
int code; /* code of reply */
char pasv[BUFSIZ]; /* reply string of PASV command*/
char reply_string[BUFSIZ]; /* first line of previous reply */
} FTP6_CLIENT_DATA;
/* externals */
extern BOOL ftpErrorSupress; /* TRUE = don't print error messages */
extern FUNCPTR _func_ftpLs;
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS ftp6Login (int ctrlSock, FTP6_CLIENT_DATA *pData, char *user, char *passwd,
char *account);
extern STATUS ftp6Xfer (char *host, char *user, char *passwd, char *acct,
char *cmd, char *dirname, char *filename,
int *pCtrlSock, int *pDataSock, FTP6_CLIENT_DATA **pData, ulong_t options);
extern int ftp6Command (int ctrlSock, FTP6_CLIENT_DATA *pData, const char *fmt, ...);
extern int ftp6DataConnGet (int dataSock, FTP6_CLIENT_DATA *pData);
extern int ftp6DataConnInit (int, FTP6_CLIENT_DATA *pData);
extern int ftp6Hookup (char *host, FTP6_CLIENT_DATA *pData);
extern int ftp6ReplyGet (int ctrlSock, FTP6_CLIENT_DATA *pData, BOOL expecteof);
extern STATUS ftp6Ls (char *dirName, ulong_t options);
extern STATUS ftp6FileGet (char *remDirName, char *locDirName, ulong_t options);
extern time_t ftp6RemoteModTime (int ctrlSock, FTP6_CLIENT_DATA *pData, const char *file);
extern STATUS ftp6FileSend (char *locDirName, char *remDirName, ulong_t options);
extern STATUS ftp6LibInit (long timeout);
#else /* __STDC__ */
extern STATUS ftp6Login ();
extern STATUS ftp6Xfer ();
extern int ftp6Command ();
extern int ftp6DataConnGet ();
extern int ftp6DataConnInit ();
extern int ftp6Hookup ();
extern int ftp6ReplyGet ();
extern STATUS ftp6Ls ();
extern STATUS ftp6FileGet ();
extern time_t ftp6RemoteModTime ();
extern STATUS ftp6FileSend ();
extern STATUS ftp6LibInit ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCftp6Libh */
+219
View File
@@ -0,0 +1,219 @@
/* ftpLib.h - arpa File Transfer Protocol library header */
/*
* Copyright (c) 1986-1987, 1990-1992, 2002-2003,
* 2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01y,09jan12,h_x Move extern "C" after last header file include.
01x,29sep10,h_x Add extern FUNCPTR _func_ftpLs
01w,27jul09,zhr 64bits adatation
01v,22oct08,spw Fix for WIND00135072
01u,16feb06,mwv Add ftpLibInit, and ftpLs (SPR 117425)
01t,20nov03,niq Remove copyright_wrs.h file inclusion
01s,05nov03,cdw Removal of unnecessary _KERNEL guards.
01r,04nov03,rlm Ran batch header path update for header re-org.
01q,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01p,10jun03,vvv include netVersion.h
01o,09may03,vvv included vxWorks.h and vwModNum.h
01n,06jun02,elr Change return for ftpTransientFatalInstall()
01m,23may02,elr added temporary global flag to bypass PASSIVE mode
01l,22may02,elr Changed API of ftpCommandEnhanced() and ftpReplyGetEnhanced()
for PASSIVE mode support
Added function ftpDataConnInitPassiveMode ()
Added ftpLibDebugOptionsSet()
01k,12mar02,elr Added error return codes
Replaced ftpErrorSuppress with ftplDebug (SPR 71496)
01j,22sep92,rrr added support for c++
01i,11sep92,jmm added external definition for ftpErrorSupress (for spr #1257)
01h,04jul92,jcf cleaned up.
01g,26may92,rrr the tree shuffle
01f,04oct91,rrr passed through the ansification filter
-fixed #else and #endif
-changed copyright notice
01e,19oct90,shl changed ftpCommand() to use variable length argument list.
01d,05oct90,shl added ANSI function prototypes.
made #endif ANSI style.
added copyright notice.
01c,07aug90,shl added INCftpLibh to #endif.
01b,20mar87,dnw prepended FTP_ to reply codes.
01a,07nov86,dnw written
*/
#ifndef __INCftpLibh
#define __INCftpLibh
#include <vxWorks.h>
#include <vwModNum.h>
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/* For debugging options */
#define FTPL_DEBUG_OFF 0 /* No debugging messages */
#define FTPL_DEBUG_INCOMING 1 /* Show all incoming responses */
#define FTPL_DEBUG_OUTGOING 2 /* Show all outgoing commands */
#define FTPL_DEBUG_ERRORS 4 /* Display all errors and warnings that occur */
/* For FTP specification see RFC-765 */
/* Reply codes for ftpReplyGet(). (Major numbers 1xx-5xx) */
#define FTP_PRELIM 1 /* positive preliminary */
#define FTP_COMPLETE 2 /* positive completion */
#define FTP_CONTINUE 3 /* positive intermediate */
#define FTP_TRANSIENT 4 /* transient negative completion */
#define FTP_ERROR 5 /* permanent negative completion */
/* Detailed reply codes for ftpReplyGetEnhanced() */
#define FTP_SERVICE_CLOSING 221
#define FTP_PASSIVE_REPLY 227 /* Command not supported */
#define FTP_COMMAND_NOT_SUPPORTED 502 /* Command not supported */
#define FTP_NOACTION 550 /* requested action not taken */
/* Type codes */
#define TYPE_A 1 /* ASCII */
#define TYPE_E 2 /* EBCDIC */
#define TYPE_I 3 /* image */
#define TYPE_L 4 /* local byte size */
/* Form codes */
#define FORM_N 1 /* non-print */
#define FORM_T 2 /* telnet format effectors */
#define FORM_C 3 /* carriage control (ASA) */
/* Structure codes */
#define STRU_F 1 /* file (no record structure) */
#define STRU_R 2 /* record structure */
#define STRU_P 3 /* page structure */
/* Mode types */
#define MODE_S 1 /* stream */
#define MODE_B 2 /* block */
#define MODE_C 3 /* compressed */
/* Record Tokens */
#define REC_ESC '\377' /* Record-mode Escape */
#define REC_EOR '\001' /* Record-mode End-of-Record */
#define REC_EOF '\002' /* Record-mode End-of-File */
/* Block Header */
#define BLK_EOR 0x80 /* Block is End-of-Record */
#define BLK_EOF 0x40 /* Block is End-of-File */
#define BLK_ERRORS 0x20 /* Block is suspected of containing errors */
#define BLK_RESTART 0x10 /* Block is Restart Marker */
#define BLK_BYTECOUNT 2 /* Bytes in this block */
/* error values */
/*
* Note that for unexpected responses, the low-order byte of the eror code
* contains the reponse code.
*/
#define S_ftpLib_ILLEGAL_VALUE (M_ftpLib | 1)
#define S_ftpLib_TRANSIENT_RETRY_LIMIT_EXCEEDED (M_ftpLib | 2)
#define S_ftpLib_FATAL_TRANSIENT_RESPONSE (M_ftpLib | 3)
#define S_ftpLib_REMOTE_SERVER_STATUS_221 (M_ftpLib | 221)
#define S_ftpLib_REMOTE_SERVER_STATUS_226 (M_ftpLib | 226)
#define S_ftpLib_REMOTE_SERVER_STATUS_257 (M_ftpLib | 257)
#define S_ftpLib_REMOTE_SERVER_ERROR_422 (M_ftpLib | 422)
#define S_ftpLib_REMOTE_SERVER_ERROR_425 (M_ftpLib | 425)
#define S_ftpLib_REMOTE_SERVER_ERROR_450 (M_ftpLib | 450)
#define S_ftpLib_REMOTE_SERVER_ERROR_451 (M_ftpLib | 451)
#define S_ftpLib_REMOTE_SERVER_ERROR_452 (M_ftpLib | 452)
#define S_ftpLib_REMOTE_SERVER_ERROR_500 (M_ftpLib | 500)
#define S_ftpLib_REMOTE_SERVER_ERROR_501 (M_ftpLib | 501)
#define S_ftpLib_REMOTE_SERVER_ERROR_502 (M_ftpLib | 502)
#define S_ftpLib_REMOTE_SERVER_ERROR_503 (M_ftpLib | 503)
#define S_ftpLib_REMOTE_SERVER_ERROR_504 (M_ftpLib | 504)
#define S_ftpLib_REMOTE_SERVER_ERROR_520 (M_ftpLib | 520)
#define S_ftpLib_REMOTE_SERVER_ERROR_521 (M_ftpLib | 521)
#define S_ftpLib_REMOTE_SERVER_ERROR_530 (M_ftpLib | 530)
#define S_ftpLib_REMOTE_SERVER_ERROR_550 (M_ftpLib | 550)
#define S_ftpLib_REMOTE_SERVER_ERROR_551 (M_ftpLib | 551)
#define S_ftpLib_REMOTE_SERVER_ERROR_552 (M_ftpLib | 552)
#define S_ftpLib_REMOTE_SERVER_ERROR_553 (M_ftpLib | 553)
#define S_ftpLib_REMOTE_SERVER_ERROR_554 (M_ftpLib | 554)
/* externals */
extern BOOL ftplDebug; /* print error message, defined in funcBind.c */
extern FUNCPTR _func_ftpLs;
/* disable passive mode - XXX this will be removed in the next release XXX */
extern BOOL ftplPasvModeDisable;
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS ftpLibInit (long timeout);
extern STATUS ftpLogin (int ctrlSock, char *user, char *passwd, char *account);
extern STATUS ftpLs (char *dirName);
extern STATUS ftpXfer (char *host, char *user, char *passwd, char *acct,
char *cmd, char *dirname, char *filename,
int *pCtrlSock, int *pDataSock);
extern int ftpCommand (int ctrlSock, char *fmt, _Vx_usr_arg_t arg1, _Vx_usr_arg_t arg2, _Vx_usr_arg_t arg3, _Vx_usr_arg_t arg4, _Vx_usr_arg_t arg5, _Vx_usr_arg_t arg6);
extern int ftpCommandEnhanced (int ctrlSock, char *fmt, _Vx_usr_arg_t arg1, _Vx_usr_arg_t arg2, _Vx_usr_arg_t arg3, _Vx_usr_arg_t arg4, _Vx_usr_arg_t arg5, _Vx_usr_arg_t arg6, char *replyString, int replyStringLength);
extern int ftpDataConnGet (int dataSock);
extern int ftpDataConnInit (int ctrlSock);
extern int ftpDataConnInitPassiveMode (int ctrlSock);
extern int ftpHookup (char *host);
extern void ftpLibDebugOptionsSet (UINT32 options);
extern int ftpReplyGet (int ctrlSock, BOOL expecteof);
extern int ftpReplyGetEnhanced (int ctrlSock, BOOL expecteof, char *replyString,
int replyStringLength);
extern STATUS ftpTransientConfigSet (UINT32 maxRetryCount, UINT32 retryInterval);
extern STATUS ftpTransientConfigGet (UINT32 *maxRetryCount, UINT32 *retryInterval);
extern STATUS ftpTransientFatalInstall (FUNCPTR configlette);
#else /* __STDC__ */
extern STATUS ftpLibInit ();
extern STATUS ftpLogin ();
extern STATUS ftpLs ();
extern STATUS ftpXfer ();
extern int ftpCommand ();
extern int ftpCommandEnhanced ();
extern int ftpDataConnGet ();
extern int ftpDataConnInit ();
extern int ftpDataConnInitPassiveMode ();
extern int ftpHookup ();
extern void ftpLibDebugOptionsSet ();
extern int ftpReplyGet ();
extern int ftpReplyGetEnhanced ();
extern STATUS ftpPrelimConfigSet ();
extern STATUS ftpTransientConfigSet ();
extern STATUS ftpLogin ();
extern STATUS ftpXfer ();
extern STATUS ftpTransientFatalInstall ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCftpLibh */
@@ -0,0 +1,61 @@
/* ftpd6Lib.h - header file for ftpd6Lib.c */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01l,09jan12,h_x Move extern "C" after last header file include.
01k,27dec06,kch Removed references to the obsolete coreip virtual stack.
01j,15dec04,syy Fixed SPR#104035: add support for guest login
01i,20aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01h,12apr04,spm removed virtual stack #include (already in source code)
01g,15mar04,rp merged from orion
01f,20nov03,niq Remove copyright_wrs.h file inclusion
01e,05nov03,cdw Removal of unnecessary _KERNEL guards.
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01b,10jun03,vvv include netVersion.h
01a,14sep01,ant written
*/
#ifndef __INCftpd6Libh
#define __INCftpd6Libh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS ftpd6Init (char *, FUNCPTR, int stackSize);
extern STATUS ftpd6Delete (void);
extern void ftpd6EnableSecurity(void);
extern void ftpd6DisableSecurity(void);
extern STATUS ftpd6GuestIdSet (const char *, u_int);
extern STATUS ftpd6GuestAllow (const char *, const char *, BOOL);
#else /* __STDC__ */
extern STATUS ftpd6Init ();
extern void ftpd6Delete ();
extern void ftpd6EnableSecurity();
extern void ftpd6DisableSecurity();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCftpd6Libh */
+263
View File
@@ -0,0 +1,263 @@
/* hostLib.h - public header for hostLib files */
/*
* Copyright (c) 1984-2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
02n,09jan12,h_x Move extern "C" after last header file include.
02m,23aug07,tkf Add scopeStr field to ADDR6 as part of the fix for
CQ:WIND00102553
02l,07jun07,tkf Remove #ifdef INET from around ADDR4 (WIND00095796)
02k,24apr07,tkf Add IPv6-Only build support.
02j,27feb07,dlk Remove freehostent() prototype. Add HOSTENT_ALLOC_* defines.
02i,12feb07,dlk Add rtpHostLibInit() prototype.
02h,21nov06,tlu Remove errCode from structure addrinfoArgs
02g,08nov06,tkf Corrected misplacement of freehostent declaration. Also added
wrapperHostLib.h for backwards compatibility.
02f,16oct06,kch Added addrinfoArgs definition for passing arguments to sysctl.
02e,28sep06,kch Restore freehostent() prototype.
02d,16sep06,tlu Remove getservbyport(), getservbyname(), getnameinfo(),
getaddrinfo(), gethostbyaddr(), gethostbyname(),
freeaddrinfo(), freehostent(), gethostname(), sethostname(),
gai_strerror(), those function prototyping were moved to
wrapper/wrapperHostLib.h
02c,24aug06,tkf Remove gethostbynameInit() and gethostbyaddrInit()
prototypes.
02b,19jun06,jpb Removed I960 check.
02a,28jun05,vvv updated gethostbynameInit() prototype
01z,07feb05,vvv _KERNEL cleanup
01y,14jan05,vvv osdep.h cleanup
01x,22sep04,dlk Added declaration for hostTblSetup().
01w,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01v,07dec03,vvv moved definition of struct hostArgs from hostLib.c; moved
definition of getnameinfoArgs from getnameinfo.c
01u,24nov03,vvv updated for RTP support
01t,20nov03,niq Remove copyright_wrs.h file inclusion
01s,05nov03,cdw Removal of unnecessary _KERNEL guards.
01r,04nov03,rlm Ran batch header path update for header re-org.
01q,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01p,23oct03,rlm updated #includes for header re-org
01o,06aug03,nee Accordion Base6 merge from ACCORDION_BASE6_MERGE_BASELINE
label
01n,09may03,vvv included vwModNum.h and in6.h
01m,20feb03,ann added prototypes for gethostbyaddrInit and gethostbynameInit
01l,06sep01,hgo modifications and extensions for IPv6
01k,20aug97,jag added function declations for hostTblSearchByAddr(),
hostTblSearchByName() (SPR #9175)
01j,19may97,spm added S_hostLib_INVALID_PARAMETER error value
01i,22sep92,rrr added support for c++
01h,27jul92,elh Moved hostShow to netShow.
01g,04jul92,jcf cleaned up.
01f,26may92,rrr the tree shuffle
01e,04oct91,rrr passed through the ansification filter
-fixed #else and #endif
-changed VOID to void
-changed copyright notice
01d,05oct90,shl added ANSI function prototypes.
made #endif ANSI style.
added copyright notice.
01c,13apr89,shl added MAXHOSTNAMELEN.
01b,04jun88,gae changed S_remLib_* to S_hostLib_*.
01a,28may88,dnw extracted from remLib.h
*/
#ifndef __INChostLibh
#define __INChostLibh
#include <wrapper/wrapperHostLib.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <netdb.h>
#include <lstLib.h>
#include <vwModNum.h>
#include <net/if.h>
#ifdef INET6
#include <netinet6/in6.h>
#endif /* INET6 */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64 /* XXX already defined in param.h */
#endif
#define HOST_INET6_ADDR_LEN (USR_NET_IP6ADDR_LEN + IFNAMESIZ)
/* status messages */
#define S_hostLib_UNKNOWN_HOST (M_hostLib | 1)
#define S_hostLib_HOST_ALREADY_ENTERED (M_hostLib | 2)
#define S_hostLib_INVALID_PARAMETER (M_hostLib | 3)
/* former h_errno values */
#define S_hostLib_NETDB_INTERNAL (M_hostLib | 4) /* see errno */
/* Authoritative Answer Host not found */
#define S_hostLib_HOST_NOT_FOUND (M_hostLib | 5)
/* Non-Authoritative Host not found, or SERVERFAIL */
#define S_hostLib_TRY_AGAIN (M_hostLib | 6)
/* Valid name, no data record of requested type */
#define S_hostLib_NO_RECOVERY (M_hostLib | 7)
/* Definitions for sysctl nodes under CTL_NET */
#define HOSTLIB 3
#define NAMEINFO 4
#define ADDRINFO 5
/* Options for the host library sysctl handler */
#define HOSTADD 1
#define HOSTDELETE 2
#define HOSTADDRSEARCH 3
#define HOSTNAMESEARCH 4
#define HOSTNAMESEARCH2 5
/* Current hostentAlloc() limits: */
/* space allocated for address in hostent::h_addr_list[0] */
#define HOSTENT_ALLOC_MAXADDRS 24
/* space allocated for name in hostent::h_name */
#define HOSTENT_ALLOC_MAXNAME (NI_MAXHOST + 1)
/* Reentrant implementation, requiring hostentFree() of result? */
#define GETHOSTBYNAME_REENTRANT
#define GETHOSTBYADDR_REENTRANT
/*
* Structure shared by hostAdd, hostDelete and hostTblSearchByName2
* for passing arguments to sysctl.
*/
struct hostArgs
{
char * hostName;
int hostNameLen;
char * hostAddr;
int hostAddrLen;
const struct addrinfo * pHints;
};
/*
* This structure is used to pass the getnameinfo arguments from user-space
* to the kernel using sysctl.
*/
struct nameinfoArgs
{
const struct sockaddr * sa;
socklen_t salen;
char * host;
size_t hostlen;
char * serv;
size_t servlen;
int flags;
};
/*
* This structure is used to pass the getaddrinfo arguments from user-space
* to the kernel using sysctl.
*/
struct addrinfoArgs
{
const char * hostname;
int hostnamelen;
const char * servname;
int servnamelen;
const struct addrinfo * hints;
};
#ifdef _WRS_KERNEL
/* typdef's for hosttable access */
typedef struct hostname_struct
{
struct hostname_struct *link;
char *name;
} HOSTNAME;
typedef struct addr4_struct
{
struct in_addr addr;
} ADDR4;
#ifdef INET6
typedef struct addr6_struct
{
struct in6_addr addr;
uint32_t scopeId;
char scopeStr [IFNAMSIZ];
} ADDR6;
#endif
typedef union addr_union
{
ADDR4 addr4;
#ifdef INET6
ADDR6 addr6;
#endif
} ADDRU;
typedef struct
{
NODE node;
HOSTNAME hostName;
int family; /* AF_INET or AF_INET6 */
ADDRU netAddr; /* ADDR4 or ADDR6 */
} HOSTENTRY;
#endif /* _WRS_KERNEL */
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS hostAdd (char *hostName, char *hostAddr);
extern STATUS hostDelete (char *name, char *addr);
extern STATUS hostGetByAddr (int addr, char *name);
extern int hostGetByName (char *name);
extern struct hostent * hostentAlloc (void);
extern void hostentFree (struct hostent *);
#ifdef _WRS_KERNEL
extern STATUS hostTblInit (void);
extern STATUS hostTblSetup (char * pRemoteName, char * pRemoteAddr,
char * pLocalName, char * pLocalAddr);
extern int hostTblSearchByName (char *name);
extern STATUS hostTblSearchByAddr (int addr, char *name);
extern STATUS rtpHostLibInit (void);
#endif /* _WRS_KERNEL */
#else /* __STDC__ */
extern STATUS hostAdd ();
extern STATUS hostDelete ();
extern STATUS hostGetByAddr ();
extern int hostGetByName ();
extern struct hostent * hostentAlloc ();
extern void hostentFree ();
#ifdef _WRS_KERNEL
extern STATUS hostTblInit ();
extern STATUS hostTblSetup ();
extern int hostTblSearchByName ();
extern STATUS hostTblSearchByAddr ();
extern STATUS rtpHostLibInit ();
#endif /* _WRS_KERNEL */
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INChostLibh */
@@ -0,0 +1,64 @@
/*
* Copyright 1984-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01f,19jun06,jpb Updated for POSIX namespace conformance.
Changed C preprocessor macro CPU_FAMILY to _VX_CPU_FAMILY.
01e,14jan05,vvv osdep.h cleanup
01d,23sep04,kc Added coldfire arch support.
01c,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5-int/2)
01b,08dec03,dat fix CPU_FAMILY names
01a,04dec03,xli creation
*/
/*
DESCRIPTION
This file is a wrapper of in_cksum.h which include specific in_cksum.h
depend on the CPU_FAMILY
*/
#ifndef _IN_CKSUM_H_
#define _IN_CKSUM_H_
#include <vxWorks.h>
/* The following includes are from target/h/arch */
#if(_VX_CPU_FAMILY==_VX_ARM)
#include <arch/arm/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_MIPS)
#include <arch/mips/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_I80X86)
#include <arch/i86/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_PPC)
#include <arch/ppc/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_SH)
#include <arch/sh/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_COLDFIRE)
#include <arch/coldfire/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_SIMNT)
#include <arch/simnt/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_SIMLINUX)
#include <arch/simlinux/in_cksum.h>
#elif (_VX_CPU_FAMILY==_VX_SIMSPARCSOLARIS)
#include <arch/simsolaris/in_cksum.h>
#endif
#endif
+108
View File
@@ -0,0 +1,108 @@
/* inetLib.h - header for Internet address manipulation routines */
/*
* Copyright (c) 1987-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
02a,17aug12,h_x Fix WIND00370053
01z,09jan12,h_x Move extern "C" after last header file include.
01y,08nov06,kch Removed prototypes already declared in arpa/inet.h.
01x,07feb05,vvv _KERNEL cleanup
01w,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01v,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01u,25nov03,ppp added a comment based on code review
01t,21nov03,ppp rtp work
01s,20nov03,niq Remove copyright_wrs.h file inclusion
01r,05nov03,cdw Removal of unnecessary _KERNEL guards.
01q,04nov03,rlm Ran batch header path update for header re-org.
01p,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01o,23oct03,rlm updated #includes for header re-org
01n,21apr03,ppp vwModNum.h should be picked up from target/h
01m,14sep01,hgo Added definition for inet_ntop and inet_pton
IPv6 support
01l,16dec93,jag Added definition for inet_aton.
01k,09aug93,elh removed definitions of inet_addr, inet_ntoa,
inet_makeaddr, and inet_network (SPR 2268).
01j,22sep92,rrr added support for c++
01i,04jul92,jcf cleaned up.
01h,26may92,rrr the tree shuffle
-changed includes to have absolute path from h/
01g,04oct91,rrr passed through the ansification filter
-changed includes to have absolute path from h/
-changed VOID to void
-changed copyright notice
01f,19oct90,shl added #include <netinet/in.h>.
01e,05oct90,shl added ANSI function prototypes.
made #endif ANSI style.
added copyright notice.
01d,10aug90,dnw added declaration of inet_ntoa_b().
01c,24mar88,ecs added include of types.h.
01b,15dec87,gae added INET_ADDR_LEN; used IMPORTs on function decl's.
01a,01nov87,llk written
*/
#ifndef __INCinetLibh
#define __INCinetLibh
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <vwModNum.h>
#ifdef __cplusplus
extern "C" {
#endif
/* status codes */
#define S_inetLib_ILLEGAL_INTERNET_ADDRESS (M_inetLib | 1)
#define S_inetLib_ILLEGAL_NETWORK_NUMBER (M_inetLib | 2)
/* length of ASCII represention of inet addresses, eg. "90.0.0.0" */
#define INET_ADDR_LEN 18
#define INET6_ADDR_LEN 46
#define INETLIB 5 /* first available node */
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern int inet_lnaof (int inetAddress);
extern int inet_netof (struct in_addr inetAddress);
extern unsigned long inet_network (char *);
extern struct in_addr inet_makeaddr (int, int);
extern void inet_makeaddr_b (int netAddr, int hostAddr,
struct in_addr *pInetAddr);
extern void inet_ntoa_b (struct in_addr inetAddress, char *pString);
extern int inet_aton (const char * pString, struct in_addr * inetAddress);
extern void inet_netof_string(char *inetString, char *netString);
#else /* __STDC__ */
extern int inet_lnaof ();
extern int inet_netof ();
extern unsigned long inet_network ();
struct in_addr inet_makeaddr();
extern void inet_makeaddr_b ();
extern void inet_ntoa_b ();
extern int inet_aton ();
extern void inet_netof_string();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCinetLibh */
+99
View File
@@ -0,0 +1,99 @@
/* ipProto.h - defines for the bsd protocol pseudo-device driver */
/* Copyright 1996 - 2006 Wind River Systems, Inc. */
/*
modification history
--------------------
02f,09jan12,h_x Move extern "C" after last header file include.
02e,05sep06,kch Cleanup for IPNet integration.
02d,07sep05,dlk Add ipBcastAddrGet() prototype.
02c,24jun05,wap Add ifmedia support
02b,07feb05,vvv _KERNEL cleanup
02a,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01z,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01y,24nov03,wap Merge changes from Snowflake
01x,20nov03,niq Remove copyright_wrs.h file inclusion
01w,04nov03,rlm Ran batch header path update for header re-org.
01v,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01u,27oct03,cdw update include statements post header re-org.
01t,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01s,09may03,vvv added prototypes for ipDetach() and ip6Detach()
01r,29apr03,syy Added #ifdef for __cplusplus
01q,11jul02,ann added a new structure to hold the interface identifier info
01p,13jun02,ann making some changes for IPv4/IPv6 attach issue
01o,03feb02,ham changes for tornado build.
01n,25feb01,rae merged 01o tor2_0.barney (base 01m):
moved nptFlag from END_OBJ for T2 END compatibility
01m,19apr00,spm Merging NPT changes.
01l,05apr00,spm cleanup: removing unused fields from control structure
01k,02mar99,pul protoType for ipAttach(), SPR# 24253
01j,08aug98,ann Included if_ether.h to reference idr
01i,08dec97,gnn END code review fixes.
01h,25sep97,gnn SENS beta feedback fixes
01g,19aug97,gnn changes due to new buffering scheme.
01f,12aug97,gnn changes necessitated by MUX/END update.
01e,02jun97,gnn Added added memWidth to structure.
01d,21mar97,map Added pRefCntHead, removed nLoan from BSD_DRV_CTRL.
01c,22jan97,gnn Added new private flags that is seperate from if flags.
01b,21jan97,gnn Removed buffer loaning stuff.
Added reference count information.
Added minFirstBuf for scatter/gather.
01a,17dec96,gnn written.
*/
#ifndef __INCipProtoh
#define __INCipProtoh
/* includes */
#include <net/if_arp.h>
#include <netinet/if_ether.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
/* Define the length for EUI 64 id storage */
#define EUI_64_LEN 8
/*
* Structure to hold the interface identifier information. This is used in
* the alloction of global and link/site local addresses.
*/
typedef struct if_id_s
{
unsigned char interfaceId[EUI_64_LEN]; /* EUI 64 based id */
unsigned long interfaceIdLen; /* Length of id */
/* The following field could change later */
unsigned long expireTimer; /* Reserved for future use */
} IF_ID_T;
/* forward declarations */
/* globals */
IMPORT int ipAttach (int unit, char * pDevice);
IMPORT int ipDetach (int unit, char * pDevice);
IMPORT int ip6Attach (int unit, char * pDevice);
IMPORT int ip6Detach (int unit, char * pDevice);
/* locals */
/* forward declarations */
#ifdef __cplusplus
}
#endif
#endif /* __INCipProtoh */
@@ -0,0 +1,343 @@
/* IPNET socket ioctl header file */
/*
* Copyright (c) 2006-2008, 2015 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
11nov15,dlk Added SIOCSNDASYNC.
14may08,brg SIFBRDADDR ioctl added for ipvxcompat
17sep07,rme Added SIOCBEATTY to support socket as TTY
20aug07,kch Added SIOCGIFCAP support (WIND00102912).
12jul07,kch Added SIOCSETVLANPRI ioctl mapping.
12dec06,kch Added SIOCXPROMISC and corrected some inline comments.
30nov06,kch Created.
*/
#ifndef __INCipioctlh
#define __INCipioctlh
#ifdef __cplusplus
extern "C" {
#endif
/* IOCTL types: */
#define VX_IOC_VOID 0x20000000
#define VX_IOC_OUT 0x40000000
#define VX_IOC_IN 0x80000000
#define VX_IOC_INOUT (VX_IOC_IN | VX_IOC_OUT)
#define VX_IOC_READ(a) (((0x40 << 24) & (a)) == VX_IOC_OUT)
#define VX_IOC_WRITE(a) (((0x80 << 24) & (a)) == VX_IOC_IN)
#define VX_IOC_RW(a) (((0xc0 << 24) & (a)) == VX_IOC_INOUT)
/* IOCTL size: */
#define VX_IOCPARM_MASK 0x1fff /* Parameter length 13 bits */
#define VX_IOCPARM_LEN(r) (VX_IOCPARM_MASK & ((r) >> 16))
/* IOCTL flags. */
#define VX_IOCF_R 0x00000000 /* read. */
#define VX_IOCF_W 0x00001000 /* write bit. */
/* IOCTL groups: */
#define VX_IOC_GROUP(c) (((c) & 0x00000f00) >> 8)
#define VX_IOCG_BASE 1
#define VX_IOCG_SOCK 2
#define VX_IOCG_NETIF 3
#define VX_IOCG_ARP 4
#define VX_IOCG_INET 5
#define VX_IOCG_INET6 6
#define VX_IOCG_ETH 7
#define VX_IOCG_PPP 8
#define VX_IOCG_WLAN 9
#define VX_IOCG_MCAST 10
#define VX_IOCG_MCAST_IN6 11
#define VX_IOCG_MPLS 12
#define VX_IOCG_RTAB 13
#define VX_IOCG_DS 14
#define VX_IOCG_POLICY_RT 15
#define VX_IOX(g,i,f,t) (((sizeof(t) & VX_IOCPARM_MASK) << 16) | (VX_IOCF_ ## f) | ((VX_IOCG_ ## g) << 8) | (i & 0xff))
#define VX_IO(g,i,f,t) (VX_IOC_VOID | /* no parameter */ \
(((sizeof(t) & VX_IOCPARM_MASK) << 16) | (VX_IOCF_ ## f) | ((VX_IOCG_ ## g) << 8) | (i & 0xff)))
#define VX_IOR(g,i,f,t) (VX_IOC_OUT | /* out-parameter */ \
(((sizeof(t) & VX_IOCPARM_MASK) << 16) | (VX_IOCF_ ## f) | ((VX_IOCG_ ## g) << 8) | (i & 0xff)))
#define VX_IOW(g,i,f,t) (VX_IOC_IN | /* in-parameter */ \
(((sizeof(t) & VX_IOCPARM_MASK) << 16) | (VX_IOCF_ ## f) | ((VX_IOCG_ ## g) << 8) | (i & 0xff)))
#define VX_IOWR(g,i,f,t) (VX_IOC_INOUT | /* in- and out-parameter */ \
(((sizeof(t) & VX_IOCPARM_MASK) << 16) | (VX_IOCF_ ## f) | ((VX_IOCG_ ## g) << 8) | (i & 0xff)))
/* SOCK ioctls (others elsewhere, e.g. sys/ioctl.h): */
#define SIOCSNDASYNC VX_IOW(SOCK, 15, W, int)
/* AF_INET ioctls: */
/* Get interface primary address. */
#define SIOCGIFADDR VX_IOWR(INET, 1, R, struct ifreq)
/* Set interface primary address. */
#define SIOCSIFADDR VX_IOWR(INET, 2, W, struct ifreq)
/* Get broadcast address. */
#define SIOCGIFBRDADDR VX_IOWR(INET, 3, R, struct ifreq)
/* Set broadcast address. */
#define SIOCSIFBRDADDR VX_IOWR(INET, 4, W, struct ifreq)
/* Get (sub)net address mask. */
#define SIOCGIFNETMASK VX_IOWR(INET, 5, R, struct ifreq)
/* Set (sub)net address mask. */
#define SIOCSIFNETMASK VX_IOWR(INET, 6, W, struct ifreq)
/* Get point-to-point IPv4 address. */
#define SIOCGIFDSTADDR VX_IOWR(INET, 7, R, struct ifreq)
/* Set point-to-point IPv4 address. */
#define SIOCSIFDSTADDR VX_IOWR(INET, 8, W, struct ifreq)
/* Add interface alias/address. */
#define SIOCAIFADDR VX_IOWR(INET, 9, W, struct in_aliasreq)
/* Delete interface address. */
#define SIOCDIFADDR VX_IOWR(INET, 10, W, struct ifreq)
/* Deprecated (BSD 4.3 compat): add route. */
#define SIOCADDRT VX_IOWR(INET, 11, W, struct ortentry)
/* Deprecated (BSD 4.3 compat): remove route. */
#define SIOCDELRT VX_IOWR(INET, 12, W, struct ortentry)
/* Proprietary (BSD 4.3 compat): get route. */
#define SIOCXGETRT VX_IOWR(INET, 13, R, struct ortentry)
/* Proprietary AF_INET MIP ioctls */
/* Add a home address */
#define SIOCAHOMEADDR VX_IOWR(INET, 14, W, struct in_aliasreq)
/* AF_INET6 ioctls: */
#ifdef INET6
/* Add interface IPv6 address */
#define SIOCAIFADDR_IN6 VX_IOWR(INET6, 1, W, struct in6_aliasreq)
/* Delete interface IPv6 address. */
#define SIOCDIFADDR_IN6 VX_IOWR(INET6, 2, W, struct in6_ifreq)
/* Get destination IPv6 address. */
#define SIOCGIFDSTADDR_IN6 VX_IOWR(INET6, 3, R, struct in6_ifreq)
/* proprietary AF_INET6 MIP6 ioctl */
#define SIOCMIP6 VX_IOWR(INET6, 4, W, struct mip6) /* MIP6 */
/* Get interface IPv6 address prefix */
#define SIOCGIFPREFIX_IN6 VX_IOWR(INET6, 5, R, struct in6_ifreq)
/* Get interface IPv6 address */
#define SIOCXGIFADDR_IN6 VX_IOWR(INET6, 6, W, struct in6_aliasreq)
/* Get inerface IPv6 address prefix */
#define SIOCGIFPREFIX_IN6 VX_IOWR(INET6, 5, R, struct in6_ifreq)
#endif /* INET6 */
/* ARP ioctls: */
/* Create/modify ARP entry. */
#define SIOCSARP VX_IOWR(ARP, 1, W, struct arpreq)
/* Get ARP entry. */
#define SIOCGARP VX_IOWR(ARP, 2, R, struct arpreq)
/* Delete ARP entry */
#define SIOCDARP VX_IOWR(ARP, 3, W, struct arpreq)
/* interface ioctls: */
/* Get interface flags. */
#define SIOCGIFFLAGS VX_IOWR(NETIF, 1, R, struct ifreq)
/* Set interface flags. */
#define SIOCSIFFLAGS VX_IOWR(NETIF, 2, W, struct ifreq)
/* Get interface MTU. */
#define SIOCGIFMTU VX_IOWR(NETIF, 3, R, struct ifreq)
/* Set interface MTU. */
#define SIOCSIFMTU VX_IOWR(NETIF, 4, W, struct ifreq)
/* Get link level address. */
#define SIOCGIFLLADDR VX_IOWR(NETIF, 13, R, struct ifreq)
/* Set link level address. */
#define SIOCSIFLLADDR VX_IOWR(NETIF, 14, W, struct ifreq)
/* Get interface list. */
#define SIOCGIFCONF VX_IOWR(NETIF, 21, R, struct ifconf)
/* Get interface index */
#define SIOCGIFINDEX VX_IOWR(NETIF, 22, R, struct ifreq)
/* Get interface capabilities */
#define SIOCGIFCAP VX_IOWR(NETIF, 23, R, struct ifreq)
/* Get interface name */
#define SIOCGIFNAME VX_IOWR(NETIF, 24, R, struct ifreq)
/* Get TX queue length */
#define SIOCGIFTXQLEN VX_IOWR(NETIF, 25, R, struct ifreq)
/* Set TX queue length */
#define SIOCSIFTXQLEN VX_IOWR(NETIF, 26, R, struct ifreq)
/* Set interface name */
#define SIOCSIFNAME VX_IOWR(NETIF, 27, R, struct ifreq)
/* Set HW broadcast */
#define SIOCSIFHWBROADCAST VX_IOWR(NETIF, 28, R, struct ifreq)
/* Add multicast address */
#define SIOCADDMULTI VX_IOWR(NETIF, 29, W, struct sockaddr)
/* Delete multicast address */
#define SIOCDELMULTI VX_IOWR(NETIF, 30, W, struct sockaddr)
/* Set interface hardware address */
#define SIOCGIFHWADDR VX_IOWR(NETIF, 31, R, struct ifreq)
/* proprietary ioctls: */
/* Detach interface. */
#define SIOCXDETACH VX_IOWR(NETIF, 50, W, struct ifreq)
/* Attach interface. */
#define SIOCXATTACH VX_IOWR(NETIF, 51, W, struct ifreq)
/* Get DHCP status. */
#define SIOCXGDHCPRUNNING VX_IOWR(NETIF, 52, R, struct ifreq)
/* Enable(1)/Disable(0) DHCP. */
#define SIOCXSDHCPRUNNING VX_IOWR(NETIF, 53, W, struct ifreq)
/* Get private interface data */
#define SIOCGIFPRIVATE VX_IOWR(NETIF, 54, R, struct ifreq)
/* Set private interface data */
#define SIOCSIFPRIVATE VX_IOWR(NETIF, 55, W, struct ifreq)
/* Set interface callback. */
#define SIOCXSIFFEVENTCB VX_IOW(BASE, 74, W, if_eventcb)
/* Delete interface callback. */
#define SIOCXDIFFEVENTCB VX_IOW(BASE, 75, W, if_eventcb)
/* Pretend to be a TTY. */
#define SIOCBEATTY VX_IOW(BASE, 76, W, int)
#ifdef INET6
/* Proprietary : get IPv6 gateway. */
#define SIOCXGETGW_IN6 VX_IOWR(BASE, 53, R, struct sockaddr_in6)
/* Proprietaty : set IPv6 gateway. */
#define SIOCXSETGW_IN6 VX_IOWR(BASE, 54, W, struct sockaddr_in6)
#endif /* INET6 */
/* IPSEC ioctls */
#define SIOCXIPSEC_CTL VX_IOWR(BASE, 55, W, void *)
#define SIOCXIPSEC_SA_CTL VX_IOWR(BASE, 56, W, void *[2])
#define SIOCXIPSEC_CONF_CTL VX_IOWR(BASE, 57, W, void *)
/* Multicast ioctls: */
/* get VIF statistics */
#define SIOCGETVIFCNT VX_IOWR(MCAST, 0, R, struct sioc_vif_req)
/* get mcast route statistics */
#define SIOCGETSGCNT VX_IOWR(MCAST, 1, R, struct sioc_sg_req)
#ifdef INET6
/* AF_INET6 multicast ioctls: */
/* get MIF statistics */
#define SIOCGETMIFCNT_IN6 VX_IOWR(MCAST_IN6, 0, R, struct sioc_mif_req6)
/* get mcast6 route statistics */
#define SIOCGETSGCNT_IN6 VX_IOWR(MCAST_IN6, 1, R, struct sioc_sg_req6)
#endif /* INET6 */
/* route table ioctls */
/* Add a new virtual router and creates a route table with table ID == 0 */
#define SIOCADDVR VX_IOWR(RTAB, 0, W, u_int16_t)
/* Delete a virtual router and all tables owned by it */
#define SIOCDELVR VX_IOWR(RTAB, 1, W, u_int16_t)
/* Add a route table to a (virtual) router */
#define SIOCADDROUTETAB VX_IOWR(RTAB, 2, W, struct sioc_route_table)
/* Delete a route table to a (virtual) router */
#define SIOCDELROUTETAB VX_IOWR(RTAB, 3, W, struct sioc_route_table)
/* Get/create a route table by name */
#define SIOCGETROUTETAB VX_IOWR(RTAB, 4, W, struct sioc_route_table)
/* Set a name for a route table. */
#define SIOCSROUTETABNAME VX_IOWR(RTAB, 5, W, struct sioc_route_table)
/* Map a route table name to VR and table ID */
#define SIOCGROUTETABNAME VX_IOWR(RTAB, 6, R, struct sioc_route_table)
/* interface ioctls: */
/* Get interface metric. */
#define SIOCGIFMETRIC VX_IOWR(NETIF, 5, R, struct ifreq)
/* Set interface metric. */
#define SIOCSIFMETRIC VX_IOWR(NETIF, 6, W, struct ifreq)
/* Get the route table index for an interface. */
#define SIOCGIFVR VX_IOWR(NETIF, 7, R, struct ifreq)
/* Set an interface to a specific route table. */
#define SIOCSIFVR VX_IOWR(NETIF, 8, W, struct ifreq)
/* Get tunnel parameter. */
#define SIOCGETTUNNEL VX_IOWR(NETIF, 10, R, struct ip_tunnel_param)
/* Change tunnel parameters. */
#define SIOCCHGTUNNEL VX_IOWR(NETIF, 12, W, struct ip_tunnel_param)
/* Get information about a virtual LAN interface,
* 'ifru_data' must point to a struct vlanreq
*/
#define SIOCGETVLAN VX_IOWR(NETIF, 15, R, struct ifreq)
/* Set information about a virtual LAN interface,
* 'ifru_data' must point to a struct vlanreq
*/
#define SIOCSETVLAN VX_IOWR(NETIF, 16, W, struct ifreq)
/* Create a pseudo interface (like vlan) */
#define SIOCIFCREATE VX_IOWR(NETIF, 17, W, struct ifreq)
/* Destroy a pseudo interface (like vlan) */
#define SIOCIFDESTROY VX_IOWR(NETIF, 18, W, struct ifreq)
/* Set vlan priority for a virtual LAN interface */
#define SIOCSETVLANPRI VX_IOWR(NETIF, 19, W, struct ifreq)
/* bool: Activate/deactivate promiscuous mode. 'bool'is stored in int. */
#define SIOCXPROMISC VX_IOW(NETIF, 102, W, int)
/* proprietary ioctls: */
/* Reset interface statistics counter */
#define SIOCXRESETSTAT VX_IOWR(NETIF, 60, W, struct ifreq)
#ifdef __cplusplus
}
#endif
#endif /* __INCipioctlh */
@@ -0,0 +1,122 @@
/* ipioctl_var.h - IP ioctl variable header file */
/*
* Copyright (c) 2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01c,12jul07,kch Moved sioc_vif_req and sioc_sg_req struct to ip_mroute.h.
Also moved sioc_sg_req6 and sioc_mif_req6 struct to
ip6_mroute.h (WIND00102340).
01b,24apr07,tkf Add IPv6-Only build support.
01a,30nov06,kch Created.
*/
#ifndef __INCipioctl_varh
#define __INCipioctl_varh
/* includes */
#include <net/if.h>
#ifdef INET
#include <netinet/in.h>
#endif
#ifdef INET6
#include <netinet6/in6.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*if_eventcb)(char *ifname, u_int32_t ifindex, u_int32_t ifflags,
int event, void *data);
/* The maximum length of route table name */
#define RTNAMSIZ 16
/* This VR ID tells the stack to choose an unused ID and also choose the
default route table ID */
#define VR_ANY 0xffff
/* This table ID tells the stack to choose an unused ID on the specified VR */
#define ROUTE_TABLE_ANY 0xffffffff
/*
* Structure used by SIOCADDROUTETAB, SIOCDELROUTETAB, SIOCGETROUTETAB,
* SIOCSROUTETABNAME and SIOCGROUTETABNAME for manipulating route tables
* for an existing (virtual) router.
*/
struct sioc_route_table {
/* (Virtual) router index, 0 == default, VR_ANY can be used to let the
* stack choose a virtual router ID
*/
u_int16_t vr;
/* The ID of this table. Table 0 is always present and cannot be deleted.
* Setting table to ROUTE_TABLE_ANY in an add operation will result in
* the stack choosing a free ID
*/
u_int32_t table;
char name[RTNAMSIZ]; /* The (optional) name of the route table */
};
union sockaddr_union
{
struct sockaddr sa;
#ifdef INET
struct sockaddr_in sin;
#endif /* INET */
#ifdef INET6
struct sockaddr_in6 sin6;
#endif /* INET6 */
};
/*
* Tunnel parameter struct used with SIOCGETTUNNEL and SIOCCHGTUNNEL ioctls.
*/
struct ip_tunnel_param
{
char ifr_name[IFNAMSIZ]; /* if name, e.g. "gif1", "gre1" */
/* The address to use as source address for outgoing packets, must
* be the address of a local interface
*/
union sockaddr_union local_addr;
/* The address to use as destination address for outgoing packets */
union sockaddr_union remote_addr;
u_int8_t ttl; /* Value to put in time to live field */
/* These fields are read only (returned by IP_SIOCGETTUNNEL) */
/* Tunnel protocol: IP_IPPROTO_IPIP or IP_IPPROTO_GRE. */
u_int8_t protocol;
u_int16_t o_flags; /* Output flags (tunnel protocol specific). */
u_int16_t i_flags; /* Input flags (tunnel protocol specific). */
};
#ifdef INET6
/*
* used when communicating with the MIP6 subsystem
*/
struct mip6
{
u_int32_t pad[40]; /* Large enough to deal with the MIP stuff */
};
#endif /* INET6 */
#ifdef __cplusplus
}
#endif
#endif /* __INCipioctl_varh */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,386 @@
/* pfkeyv2.h - Extended PF_KEY version 2 header file */
/*
* This file defines structures and symbols for the PF_KEY Version 2
* key management interface. It was written at the U.S. Naval Research
* Laboratory. This file is in the public domain. The authors ask that
* you leave this credit intact on any copies of this file.
*/
/* Copyright 2006 Wind River Systems, Inc. */
/*
modification history
--------------------
*/
#ifndef __PFKEY_V2_H
#define __PFKEY_V2_H 1
/* includes */
#include "sys/types.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* version
*/
#define PF_KEY_V2 2
#define PFKEYV2_REVISION 199806L
/*
* SA types
*/
#define SADB_SATYPE_UNSPEC 0
#define SADB_SATYPE_AH 2
#define SADB_SATYPE_ESP 3
#define SADB_SATYPE_RSVP 5
#define SADB_SATYPE_OSPFV2 6
#define SADB_SATYPE_RIPV2 7
#define SADB_SATYPE_MIP 8
#define SADB_X_SATYPE_IPIP 9
#define SADB_X_SATYPE_TCPSIGNATURE 10
#define SADB_X_SATYPE_BYPASS 11
#define SADB_SATYPE_MAX 11
/*
* SA extensions - SADB_EXT_
*/
#define SADB_EXT_RESERVED 0 /* _Extension_data_type_ */
#define SADB_EXT_SA 1 /* struct sadb_sa */
#define SADB_EXT_LIFETIME_CURRENT 2 /* struct sadb_lifetime */
#define SADB_EXT_LIFETIME_HARD 3 /* struct sadb_lifetime */
#define SADB_EXT_LIFETIME_SOFT 4 /* struct sadb_lifetime */
#define SADB_EXT_ADDRESS_SRC 5 /* struct sadb_address */
#define SADB_EXT_ADDRESS_DST 6 /* struct sadb_address */
#define SADB_EXT_ADDRESS_PROXY 7 /* struct sadb_address */
#define SADB_EXT_KEY_AUTH 8 /* struct sadb_key */
#define SADB_EXT_KEY_ENCRYPT 9 /* struct sadb_key */
#define SADB_EXT_IDENTITY_SRC 10 /* struct sadb_ident */
#define SADB_EXT_IDENTITY_DST 11 /* struct sadb_ident */
#define SADB_EXT_SENSITIVITY 12 /* struct sadb_sens */
#define SADB_EXT_PROPOSAL 13 /* struct sadb_prop */
#define SADB_EXT_SUPPORTED 14 /* struct sadb_supported */
#define SADB_EXT_SPIRANGE 15 /* struct sadb_spirange */
#define SADB_X_EXT_SRC_MASK 16 /* struct sadb_address */
#define SADB_X_EXT_DST_MASK 17 /* struct sadb_address */
#define SADB_X_EXT_PROTOCOL 18 /* struct sadb_protocol */
#define SADB_X_EXT_SA2 19 /* struct sadb_sa */
#define SADB_X_EXT_SRC_FLOW 20 /* struct sadb_address */
#define SADB_X_EXT_DST_FLOW 21 /* struct sadb_address */
#define SADB_X_EXT_DST2 22 /* struct sadb_address */
#define SADB_X_EXT_FLOW_TYPE 23 /* struct sadb_protocol */
#define SADB_X_EXT_UDPENCAP 24 /* struct sadb_x_udpencap */
#define SADB_EXT_MAX 24
/* sadb_sa_flags */
#define SADB_SAFLAGS_PFS 0x001L /* perfect forward secrecy */
#define SADB_X_SAFLAGS_HALFIV 0x002L /* Used for ESP-old */
#define SADB_X_SAFLAGS_TUNNEL 0x004L /* Force tunneling */
#define SADB_X_SAFLAGS_CHAINDEL 0x008L /* Delete whole SA chain */
#define SADB_X_SAFLAGS_REPLACEFLOW 0x020L /* Replace existing flow */
#define SADB_X_SAFLAGS_INGRESS_FLOW 0x040L /* Ingress ACL entry */
#define SADB_X_SAFLAGS_RANDOMPADDING 0x080L /* Random ESP padding */
#define SADB_X_SAFLAGS_NOREPLAY 0x100L /* No replay counter */
#define SADB_X_SAFLAGS_UDPENCAP 0x200L /* ESP in UDP */
/* new sadb_sa_flags by Interpeak: */
#define SADB_X_SAFLAGS_INGRESS_SA 0x040L /* Ingress SA entry (same val as INGRESS_FLOW) */
#define SADB_X_SAFLAGS_EGRESS_SA 0x400L /* Egress (output) SA entry */
/*
* sadb_msg
*/
struct sadb_msg
{
uint8_t sadb_msg_version;
uint8_t sadb_msg_type;
uint8_t sadb_msg_errno;
uint8_t sadb_msg_satype;
uint16_t sadb_msg_len;
uint16_t sadb_msg_reserved;
uint32_t sadb_msg_seq;
uint32_t sadb_msg_pid;
};
/* sadb_msg_type */
#define SADB_RESERVED 0
#define SADB_GETSPI 1
#define SADB_UPDATE 2
#define SADB_ADD 3
#define SADB_DELETE 4
#define SADB_GET 5
#define SADB_ACQUIRE 6
#define SADB_REGISTER 7
#define SADB_EXPIRE 8
#define SADB_FLUSH 9
#define SADB_DUMP 10
#define SADB_X_PROMISC 11
#define SADB_X_ADDFLOW 12
#define SADB_X_DELFLOW 13
#define SADB_X_GRPSPIS 14
#define SADB_X_BINDSA 15
#define SADB_MAX 15
/*
* sadb_ext
*/
struct sadb_ext
{
uint16_t sadb_ext_len;
uint16_t sadb_ext_type;
};
/*
* sadb_sa
*/
struct sadb_sa
{
uint16_t sadb_sa_len;
uint16_t sadb_sa_exttype;
uint32_t sadb_sa_spi;
uint8_t sadb_sa_replay;
uint8_t sadb_sa_state;
uint8_t sadb_sa_auth;
uint8_t sadb_sa_encrypt;
uint32_t sadb_sa_flags;
};
/* sadb_sa_state */
#define SADB_SASTATE_LARVAL 0
#define SADB_SASTATE_MATURE 1
#define SADB_SASTATE_DYING 2
#define SADB_SASTATE_DEAD 3
#define SADB_SASTATE_MAX 3
#define SADB_KEY_FLAGS_MAX 0
/* sadb_sa_auth */
#define SADB_AALG_NONE 0
#define SADB_AALG_MD5HMAC 1
#define SADB_AALG_SHA1HMAC 2
#define SADB_AALG_MD5HMAC96 3
#define SADB_AALG_SHA1HMAC96 4
#define SADB_X_AALG_RIPEMD160HMAC96 5
#define SADB_X_AALG_MD5 6
#define SADB_X_AALG_SHA1 7
#define SADB_X_AALG_AESXCBCMAC96 8
#define SADB_AALG_MAX 8
/* sadb_sa_encrypt */
#define SADB_EALG_NONE 0
#define SADB_EALG_DESCBC 1
#define SADB_EALG_3DESCBC 2
#define SADB_X_EALG_BLF 3
#define SADB_X_EALG_CAST 4
#define SADB_X_EALG_SKIPJACK 5 /* not supported */
#define SADB_X_EALG_AES 6
#define SADB_EALG_MAX 6
/*
* sadb_lifetime
*/
struct sadb_lifetime
{
uint16_t sadb_lifetime_len;
uint16_t sadb_lifetime_exttype;
uint32_t sadb_lifetime_allocations;
uint64_t sadb_lifetime_bytes;
uint64_t sadb_lifetime_addtime;
uint64_t sadb_lifetime_usetime;
};
/*
* sadb_address
*/
struct sadb_address
{
uint16_t sadb_address_len;
uint16_t sadb_address_exttype;
uint8_t sadb_address_proto;
uint8_t sadb_address_prefixlen;
uint16_t sadb_address_reserved;
};
/*
* sadb_key
*/
struct sadb_key
{
uint16_t sadb_key_len;
uint16_t sadb_key_exttype;
uint16_t sadb_key_bits;
uint16_t sadb_key_reserved;
};
/*
* sadb_ident
*/
struct sadb_ident
{
uint16_t sadb_ident_len;
uint16_t sadb_ident_exttype;
uint16_t sadb_ident_type;
uint16_t sadb_ident_reserved;
uint64_t sadb_ident_id;
};
/* sadb_ident_type */
#define SADB_IDENTTYPE_RESERVED 0
#define SADB_IDENTTYPE_PREFIX 1
#define SADB_IDENTTYPE_FQDN 2
#define SADB_IDENTTYPE_USERFQDN 3
#define SADB_IDENTTYPE_MAX 3
/*
* sadb_sens
*/
struct sadb_sens
{
uint16_t sadb_sens_len;
uint16_t sadb_sens_exttype;
uint32_t sadb_sens_dpd;
uint8_t sadb_sens_sens_level;
uint8_t sadb_sens_sens_len;
uint8_t sadb_sens_integ_level;
uint8_t sadb_sens_integ_len;
uint32_t sadb_sens_reserved;
};
/*
* sadb_prop
*/
struct sadb_prop
{
uint16_t sadb_prop_len;
uint16_t sadb_prop_exttype;
uint8_t sadb_prop_replay;
uint8_t sadb_prop_reserved[3];
};
/*
* sadb_comb
*/
struct sadb_comb
{
uint8_t sadb_comb_auth;
uint8_t sadb_comb_encrypt;
uint16_t sadb_comb_flags;
uint16_t sadb_comb_auth_minbits;
uint16_t sadb_comb_auth_maxbits;
uint16_t sadb_comb_encrypt_minbits;
uint16_t sadb_comb_encrypt_maxbits;
uint32_t sadb_comb_reserved;
uint32_t sadb_comb_soft_allocations;
uint32_t sadb_comb_hard_allocations;
uint64_t sadb_comb_soft_bytes;
uint64_t sadb_comb_hard_bytes;
uint64_t sadb_comb_soft_addtime;
uint64_t sadb_comb_hard_addtime;
uint64_t sadb_comb_soft_usetime;
uint64_t sadb_comb_hard_usetime;
};
/*
* sadb_suppported
* original sadb_supported struct:
* struct sadb_supported
* {
* uint16_t sadb_supported_len;
* uint16_t sadb_supported_exttype;
* uint32_t sadb_supported_reserved;
* };
*/
struct sadb_supported
{
uint16_t sadb_supported_len;
uint16_t sadb_supported_exttype;
uint8_t sadb_supported_nauth;
uint8_t sadb_supported_nencrypt;
uint16_t sadb_supported_reserved;
};
/*
* sadb_alg
*/
struct sadb_alg
{
uint8_t sadb_alg_id;
uint8_t sadb_alg_ivlen;
uint16_t sadb_alg_minbits;
uint16_t sadb_alg_maxbits;
uint16_t sadb_alg_reserved;
};
/*
* sadb_spirange
*/
struct sadb_spirange
{
uint16_t sadb_spirange_len;
uint16_t sadb_spirange_exttype;
uint32_t sadb_spirange_min;
uint32_t sadb_spirange_max;
uint32_t sadb_spirange_reserved;
};
/*
* sadb_protocol
*/
struct sadb_protocol
{
uint16_t sadb_protocol_len;
uint16_t sadb_protocol_exttype;
uint8_t sadb_protocol_proto;
uint8_t sadb_protocol_reserved1;
uint16_t sadb_protocol_reserved2;
};
/* SADB_X_EXT_FLOW_TYPE sadb_protocol_proto */
#define SADB_X_FLOW_TYPE_USE 1 /* Apply security (standard flow) */
#define SADB_X_FLOW_TYPE_ACQUIRE 2 /* Generate acquire message, send packet in cleartext */
#define SADB_X_FLOW_TYPE_REQUIRE 3 /* Generate acquire message, discard packet */
#define SADB_X_FLOW_TYPE_BYPASS 4 /* Send without applying security, i.e. cleartext */
#define SADB_X_FLOW_TYPE_DENY 5 /* Silent discard */
/*#define SADB_X_FLOW_TYPE_DONTACQ 6*/
/*
* sadb_x_udpencap
*/
struct sadb_x_udpencap
{
uint16_t sadb_x_udpencap_len;
uint16_t sadb_x_udpencap_exttype;
uint16_t sadb_x_udpencap_port;
uint16_t sadb_x_udpencap_reserved;
};
#ifdef __cplusplus
}
#endif
#endif /* !__PFKEY_V2_H */
@@ -0,0 +1,117 @@
/* policy_routing.h - policy routing header file */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,30nov06,kch Guarded inet6 definitions with INET6. Also replaced IP_IOWR
with VX_IOWR and added ipnet/ipioctl.h include.
*/
#ifndef __INCpolicy_routingh
#define __INCpolicy_routingh
/* includes */
#include <ipnet/ipioctl.h>
#include "netinet/in.h"
#ifdef INET6
#include "netinet6/in6.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Policy routing i/o controls
*/
#define PR_BASE 20
#define SIOCGPRRULE VX_IOWR(POLICY_RT, 0, R, struct policy_routing_rule)
#define SIOCSPRRULE VX_IOWR(POLICY_RT, 1, W, struct policy_routing_rule)
#define SIOCDPRRULE VX_IOWR(POLICY_RT, 2, W, struct policy_routing_rule)
#define SIOCEPRRULE VX_IOWR(POLICY_RT, 3, R, struct policy_routing_rule)
/*
* Rules are processed by descending priority, rules with same priority
* are processed in the order they where added (added first is processed first)
*/
#define PR_PRIO_MIN (-32768)
#define PR_PRIO_MAX (32767)
#define PR_ID_NONE 0
/*
* in_addr_union
*/
#ifndef IN_ADDR_UNION_TYPE
#define IN_ADDR_UNION_TYPE
union in_addr_union
{
struct in_addr in;
#ifdef INET6
struct in6_addr in6;
#endif /* INET6 */
};
#endif /* !IN_ADDR_UNION_TYPE */
/*
* policy_routing_rule
*/
struct policy_routing_rule
{
u_long table; /* The table ID of the routing table to use if this rule matches */
BOOL last; /* Set to TRUE if no other rules should consider if the
routing table with policy ID 'policy' does not give a match */
u_long id; /* Unique identifier of this rule (SIOCSPRRULE set this) */
short prio; /* The index of this rule or one of the PR_IDX_xxx macros */
u_short mask; /* Set PR_RULE_xxx bit for each field that must match */
u_char af; /* Address family for this rule */
u_char ds; /* Traffic class (IPv6) or TOS (IPv4) (== DS field for DiffServ) */
u_char proto; /* Protocol in the IP header */
u_char saddr_prefixlen; /* Source prefixlen, set to 0 for exact match of 'saddr' */
u_char daddr_prefixlen; /* Destination prefixlen, set to 0 for exact match of 'daddr' */
union in_addr_union saddr; /* Source address or source network */
union in_addr_union daddr; /* Destination address or destination network */
u_long flow; /* IPv6 flow ID in host byte order */
u_long ifindex; /* Interface index in host byte order (bound if for sending, incoming if for forwarding) */
u_long scope; /* The scope of the destination */
u_long pkt_mask; /* The mask to apply to the packet */
u_long pkt_result; /* The result when masking the flags */
};
/*
* PR_xx
*/
#define PR_RULE_DS (1 << 0)
#define PR_RULE_PROTO (1 << 1)
#define PR_RULE_SADDR (1 << 2)
#define PR_RULE_FLOW (1 << 3)
#define PR_RULE_IFINDEX (1 << 4)
#define PR_RULE_SCOPE (1 << 5)
#define PR_RULE_DADDR (1 << 7)
#define PR_RULE_PKTFLAGS (1 << 8)
/* Do the route lookup based on the source (not destination)
* address in the matching route table
*/
#define PR_RULE_RTKEYSADDR (1 << 15)
#ifdef __cplusplus
}
#endif
#endif /* !__INCpolicy_routingh */
@@ -0,0 +1,266 @@
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,30nov06,kch Created.
*/
#ifndef __INCppp_varh
#define __INCppp_varh
/* includes */
#include "net/if.h"
#include "ipnet/ipioctl.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The following must not be changed unless equivalent changes are made to
* IPCOM_AUTH_USERNAME_MAX and IPCOM_AUTH_PASSWORD_MAX as well.
*/
#define PPP_AUTH_USERNAME_MAX 32 /* Max user name length. */
#define PPP_AUTH_PASSWORD_MAX 32 /* Max user password length. */
/*
* IO control commands specific to the PPP protocol.
*/
/* Driver PPP ioctls: */
/* ppp_drvconf; Get PPP driver config (default). */
#define SIOCXPPPGDRVCONF VX_IOWR(PPP, 1, R, struct pppreq)
/* ppp_drvconf; Get PPP driver info (current). */
#define SIOCXPPPGDRVINFO VX_IOWR(PPP, 2, R, struct pppreq)
/* u_int32_t; Set PPP driver baudrate. */
#define SIOCXPPPSDRVBAUDRATE VX_IOWR(PPP, 3, W, struct pppreq)
/* -; Make driver signal up (test ioctl) */
#define SIOCXPPPSDRVUP VX_IOWR(PPP, 4, R, struct pppreq)
/* -; Make driver signal down (test ioctl) */
#define SIOCXPPPSDRVDOWN VX_IOWR(PPP, 5, R, struct pppreq)
/* int; Enable wincompat mode */
#define SIOCXPPPSDRVWINCOMPAT VX_IOWR(PPP, 6, R, struct pppreq)
/* Link layer PPP ioctls: */
/* u_int32_t; Get PPP main flags (see PPP_FLAG_xxx) */
#define SIOCXPPPGFLAGS VX_IOWR(PPP, 10, R, struct pppreq)
/* u_int32_t; Set PPP main flags (in ipcom_netif.h) */
#define SIOCXPPPSFLAGS VX_IOWR(PPP, 11, W, struct pppreq)
/* ppp_conf; Get PPP main config. */
#define SIOCXPPPGCONF VX_IOWR(PPP, 12, R, struct pppreq)
/* ppp_conf; Set PPP main config. */
#define SIOCXPPPSCONF VX_IOWR(PPP, 13, W, struct pppreq)
/* char [AUTH_USERNAME_MAX]; Get local user. */
#define SIOCXPPPGUSER VX_IOWR(PPP, 14, R, struct pppreq)
/* char [AUTH_USERNAME_MAX]; Set local user. */
#define SIOCXPPPSUSER VX_IOWR(PPP, 15, W, struct pppreq)
/* char [PPP_AUTH_PASSWORD_MAX]; Get local password. */
#define SIOCXPPPGPASSWD VX_IOWR(PPP, 16, R, struct pppreq)
/* char [PPP_AUTH_PASSWORD_MAX]; Set local password. */
#define SIOCXPPPSPASSWD VX_IOWR(PPP, 17, W, struct pppreq)
/* char [PPP_AUTH_USERNAME_MAX]; Get peer user. */
#define SIOCXPPPGPEERUSER VX_IOWR(PPP, 18, R, struct pppreq)
/* if_name[IFNAMSIZ]; Set pppoe Ethernet interface */
#define SIOCXPPPSETIF VX_IOWR(PPP, 20, W, struct pppreq)
/* ppp_debuginfo; Get PPP debug info. */
#define SIOCXPPPGDINFO VX_IOWR(PPP, 22, R, struct pppreq)
/*
* PPP flags used with SIOCXPPP[G|S]FLAGS ioctl().
*/
/* Disable Address/Control compression in both directions (snd/rcv). */
#define PPP_FLAG_NOACCOMP 0x00000001
/* Do not send or ack ACCM confreq. */
#define PPP_FLAG_NOACCM 0x00000002
/* Require the peer to authenticate itself before allowing snd/rcv NCP. */
#define PPP_FLAG_AUTH 0x00000004
/* Do not require the peer to authenticate itself, i.e. do not ask for
* authentication.
*/
#define PPP_FLAG_NOAUTH 0x00000008
/* Do not agree to authenticate using PAP. */
#define PPP_FLAG_REFUSE_PAP 0x00000010
/* Do not agree to authenticate using MD5 CHAP. */
#define PPP_FLAG_REFUSE_CHAP 0x00000020
/* Initialization action is called directly after the PPP/PPPoE interface has
* been attached, i.e. directly after ipcom_if_attach() has been called.
* The init action is a good place to configure the interface with static
* interface configuration like LCP, AUTH, IPCP and/or IPV6CP etc.
* Note: The init action has replaced the example action callback function
* in previous releases.
*/
#define PPP_ACTION_INIT 1
/* Called when LCP is starting. Configure LCP here.
*/
#define PPP_ACTION_LCP_STARTING 2
/* Called when IPCP is starting.
* Use this callback to set desired local IPv4 address.
* The default local IP address is 0, which means we want the peer to suggest
* an IP address for us.
*/
#define PPP_ACTION_IPCP_STARTING 3
/* Called when IPV6CP is starting.
* Use this callback to set desired peer IPv6 address.
* The default peer IP address is 0, which means we will refuse to suggest
* an IP address for the peer.
*/
#define PPP_ACTION_IPV6CP_STARTING 4
/* IPv4 / IPv6 up/down actions:
* Enter code which must be run when PPP comes up/down here.
*/
#define PPP_ACTION_IP_UP 5
#define PPP_ACTION_IP_DOWN 6
#define PPP_ACTION_IPV6_UP 7
#define PPP_ACTION_IPV6_DOWN 8
/*
* Called when peer sends IPv6 Identifier Configure-Request.
* See RFC274:p6-8 for details.
* Return -1 if refuse to suggest peer IP identifier, else 0.
* 'data' = pointer to 128-bit IPv6 identifier.
*/
#define PPP_ACTION_PEER_IDENTIFIER 9
/*
* Called when we need to authenticate ourselves (i.e. login) to the peer.
* User code must call ipppp_login() with the same 'data',
* user name and password when ready to login.
*/
#define PPP_ACTION_LOGIN 10
/*
* ioctl structure for SIOCXPPP[G|S]CONF options.
*/
typedef struct ppp_conf_struct
{
u_int16_t restart; /* Retransmission timeout in seconds. Default 3 */
/* Max # ConfNak returned before sending ConfRej. Default 10 */
u_int8_t max_failure;
u_int8_t max_configure; /* Max # ConfReq retransmissions. Default 10 */
u_int8_t max_terminate; /* Max # TermReq retransmissions. Default 2 */
/* Max # auth retransmissions before link terminate. Default 3 */
u_int8_t max_authreq;
u_int8_t pad[2];
} ppp_conf;
/*
* ioctl structure for SIOCXPPPGDRVCONF option.
*/
typedef struct ppp_drvconf_struct
{
u_int32_t drv_flags; /* PPP driver flags. */
u_int32_t baudrate; /* Baudrate. */
u_int32_t rcv_accm; /* Recv asyncmap. Default 0xffffffff */
u_int32_t snd_accm; /* Send asyncmap. Default 0xffffffff */
u_int16_t mru; /* Maximum Receive Unit. Default 1500. */
u_int16_t mtu; /* Maximum Transmit Unit. Default 1500. */
} ppp_drvconf;
/*
* PPP driver flags (drv_flags):
*/
/* No initial/trailing PPP flag (0x7e). */
#define DRVPPP_FLAG_NOFLAG 0x00000001
/* Do not byte-escape output/input packets. */
#define DRVPPP_FLAG_NOESCAPE 0x00000002
/* Do not input-check or add output FCS. */
#define DRVPPP_FLAG_NOFCS 0x00000004
/* Do not snd/rcv addr(0xff) ctrl(0x03). */
#define DRVPPP_FLAG_NOACFC 0x00000008
/*
* ioctl structure for SIOCXPPPGDEBUGINFO option.
*/
typedef struct ppp_debuginfo_struct
{
u_int32_t link_flags; /* See ipnet_netif.h */
u_int32_t pppoe_eth_ifindex;
u_int8_t link_state;
u_int8_t lcp_state;
u_int8_t ipcp_state;
u_int8_t ipv6cp_state;
} ppp_debuginfo;
/*
* Interface request structure used for PPP ioctl's. All interface
* ioctl's must have parameter definitions which begin with ifr_name and
* link_index. The remainder may be option specific.
*/
struct pppreq
{
char pppr_name[IFNAMSIZ]; /* if name, e.g. "ppp0" */
int link_index; /* link_index, currently unused (for MPPP) */
union
{
u_int32_t ppp_flags; /* Get/Set PPP flags. */
ppp_conf pppconf; /* Get/Set PPP protocol configuration. */
char username[PPP_AUTH_USERNAME_MAX];
char password[PPP_AUTH_PASSWORD_MAX];
char if_name[IFNAMSIZ];
ppp_drvconf drvconf; /* Get PPP driver configuration. */
u_int32_t drv_baudrate; /* Set PPP driver baudrate. */
int drv_wincompat; /* Windows compat mode */
ppp_debuginfo debuginfo; /* Get PPP debug info. */
} pppru;
};
#ifdef __cplusplus
}
#endif
#endif /* __INCppp_varh */
+362
View File
@@ -0,0 +1,362 @@
/* qos.h - quality of service header file */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,30nov06,kch Guarded inet6 definitions with INET6. Also replaced IP_IOWR
with VX_IOWR and added ipnet/ipioctl.h include.
*/
#ifndef __INCqosh
#define __INCqosh
/* includes */
#include <ipnet/ipioctl.h>
#include "net/if.h"
#include "netinet/in.h"
#ifdef INET6
#include "netinet6/in6.h"
#endif /* INET6 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Quality of service i/o controls
*/
#define IFQ_BASE 192
/* Add a filter for differentiated services meter/marker */
#define SIOCXADSFILTER VX_IOWR(DS, 0, W, struct ds_filter)
/* Delete a filter for differentiated services meter/marker */
#define SIOCXDDSFILTER VX_IOWR(DS, 1, W, struct ds_filter)
/* Create a new differentiated services meter/marker entity */
#define SIOCXDSCREATE VX_IOWR(DS, 2, W, struct ds)
/* Destroys a differentiated services meter/marker entity */
#define SIOCXDSDESTROY VX_IOWR(DS, 3, W, struct ds)
/* Add a filter for differentiated services meter/marker */
#define SIOCXADSMAP VX_IOWR(DS, 4, W, struct ds_map)
/* Delete a filter for differentiated services meter/marker */
#define SIOCXDDSMAP VX_IOWR(DS, 5, W, struct ds_map)
/* Get the queue type for an interface */
#define SIOCGIFQUEUE VX_IOWR(NETIF, (IFQ_BASE + 0), R, struct ifqueue_qos)
/* Set the queue type for an interface */
#define SIOCSIFQUEUE VX_IOWR(NETIF, (IFQ_BASE + 1), W, struct ifqueue_qos)
/* Add a filter to an interface queue */
#define SIOCXAIFQFILTER VX_IOWR(NETIF, (IFQ_BASE + 2), W, struct ifqueue_filter)
/* Delete a filter from an interface queue */
#define SIOCXDIFQFILTER VX_IOWR(NETIF, (IFQ_BASE + 3), W, struct ifqueue_filter)
/*
* in_addr_union
*/
#ifndef IN_ADDR_UNION_TYPE
#define IN_ADDR_UNION_TYPE
union in_addr_union
{
struct in_addr in;
#ifdef INET6
struct in6_addr in6;
#endif /* INET6 */
};
#endif /* !IN_ADDR_UNION_TYPE */
/*
* CLASSIFIER DEFINES
*/
/*
* classifier_rule
*/
struct classifier_rule
{
u_short mask; /* Set CLS_RULE_xxx bit for each field that must match */
u_char ds; /* Traffic class (IPv6) or TOS (IPv4) (== DS field for DiffServ) */
u_char proto; /* Protocol in the IP header */
u_short sport_low; /* Source port for UDP and TCP protocols [low..high] */
u_short sport_high; /* Source port for UDP and TCP protocols */
u_short dport_low; /* Destination port for UDP and TCP protocols [low..high] */
u_short dport_high; /* Destination port for UDP and TCP protocols */
u_char af; /* Address family of the addresses (AF_INET or AF_INET6) */
u_char saddr_prefixlen; /* Source prefixlen, set to 0 for exact match of 'saddr' */
u_char daddr_prefixlen; /* Destination prefixlen, set to 0 for exact match of 'daddr' */
union in_addr_union saddr; /* Source address or source network */
union in_addr_union daddr; /* Destination address or destination network */
};
#define CLS_RULE_DS (1 << 0)
#define CLS_RULE_PROTO (1 << 1)
#define CLS_RULE_SADDR (1 << 2)
#define CLS_RULE_DADDR (1 << 3)
#define CLS_RULE_SPORT (1 << 4)
#define CLS_RULE_DPORT (1 << 5)
/*
* DIFFERENTIATE SERVICES
*/
/*
* Connects a DS rule with a DS meter/marker.
* Each meter/marker can be pointed to by more than one rule
*/
struct ds_map
{
int filter_id; /* The filter ID when running in DiffServ Multi-Field mode.
The value of the DS (i.e. TOS or TCLASS) field when running in
Behavior Aggregate mode */
int ds_id; /* The ID of the Differentiated Services handler to apply for
traffic matching the filter */
};
/*
* Rule to match traffic
*/
struct ds_filter
{
int id; /* Id for this filter. Read only for add operation */
struct classifier_rule rule; /* The rule for this filter */
};
/*
* name="SimpleMarker" - Structure for the simple marker
* Matching traffic will be assigned the specified DS field
* and the specified drop_precedence
*/
struct ds_sm
{
u_char mask; /* DS_SM_xxx bits that determines if what should be done
with matching packets */
u_char ds_value; /* Differentiated Services Field to set (if DS_SM_DS_VAL is set) */
u_char drop_precedence; /* The drop precedence, which has to be one of the
IPCOM_PKT_DROP_PRECEDENCE_xxx constants (if DS_SM_DROP_P is set) */
};
#define DS_SM_DS_VAL ((u_char)(1 << 0))
#define DS_SM_DROP_P ((u_char)(1 << 1))
/*
* name="srTCM" - Structure for the single rate Three Color Marker
*/
struct ds_srtcm
{
u_char mode; /* Mode this meter is operating in, one of the
DS_SRTCM_MODE_xxx constants */
u_long CIR; /* Committed Information Rate (bytes/second) */
u_long CBS; /* Committed Burst Size (bytes) */
u_long EBS; /* Excess Burst Size (bytes) */
u_char ds_green; /* Differentiated Services Field to set for green packets */
u_char ds_yellow; /* Differentiated Services Field to set for yellow packets */
u_char ds_red; /* Differentiated Services Field to set for red packets */
};
/* The mode that the srTCM can operate in */
#define DS_SRTCM_MODE_COLOR_BLIND 1
#define DS_SRTCM_MODE_COLOR_AWARE 2
/*
* Differentiated Services ID structure
*/
#define DS_NAME_SIZE 16
struct ds
{
int id; /* ID of the diffserv handler. Read only for create operation */
char name[DS_NAME_SIZE]; /* The name of the diffserv handler */
union ds_data
{
struct ds_sm sm;
struct ds_srtcm srtcm;
} d;
};
/*
* LEAF NETWORK INTERFACE QUEUES
*/
/*
* ifqueue_fifo
* Parameter struct used for "fifo" type queue.
*/
struct ifqueue_fifo
{
u_long fifo_limit; /* Max number of packets that can be queued */
};
/*
* ifqueue_dpaf
* Parameter struct used for the Drop Precedence Aware FIFO queue type.
* This queue type uses more memory and is a little slower compared to the
* FIFO queue.
*/
struct ifqueue_dpaf
{
u_long dpaf_limit; /* Max number of packets (regardless of drop
precedence) that can be queued */
};
/*
* ifqueue_netemu
* Parameter struct used for "netemu" type queue.
*/
struct ifqueue_netemu
{
u_long netemu_limit; /* Max number of packets that can be queued */
u_long netemu_min_latency; /* Minimum latency added to packets in milliseconds */
u_long netemu_max_latency; /* Maximum latency added to packets in milliseconds */
BOOL netemu_random_drop; /* FALSE -> drop every drop_probability packet
TRUE -> there is 1/every drop_probability
chance that at packet is dropped */
u_long netemu_drop_probability; /* 1 means every packet dropped, 10 means that
every 10 packet is dropped */
u_long netemu_drop_pattern; /* Bit patter where set bit means drop packet
ex: Bit 0 and bit 2 set, all other cleared */
u_char netemu_drop_pattern_len; /* Number of valid bits in "netemu_drop_pattern",
setting the length to zero will have the same effect
as setting bit 0 in the pattern and the length to 1 */
BOOL netemu_random_corrupt; /* FALSE -> corrupt every corrupt_probability packet
TRUE -> there is 1/every corrupt_probability
chance that a packet is corrupted */
u_long netemu_corrupt_probability; /* 1 means every packet corrupted, 10 means tha
every 10 packet is corrupted */
};
/*
* CONTAINER NETWORK INTERFACE QUEUES
*/
/*
* ifqueue_filter
* Determines which interface queue a packet will be queued at in the
* container queue identified by the filter ID.
* Diffserv traffic should only use the 'ds' field in the rule, but it is
* possible to use all supported fields.
*/
struct ifqueue_filter
{
char filter_ifname[IFNAMSIZ]; /* Interface name, e.g. "gif1", "gre1" */
int filter_id; /* Will be set to the ID of the filter for add
and is used to identify the filter on delete */
int filter_queue_id; /* The ID of the queue this filter should
be attached to */
/* Following fields are only needed for filter add operations */
int filter_child_queue_id; /* The ID of the child that packet matching
this rule should be queued at */
struct classifier_rule filter_rule;
};
/*
* ifqueue_container
* Read only structure that will be filled in by SIOCGIFQUEUE operation.
*/
#define IFQ_CONTAINER_MAX_COUNT 64
struct ifqueue_container
{
int child_count; /* Number of valid entries in the 'child_ids' array */
int child_ids[IFQ_CONTAINER_MAX_COUNT]; /* ID of the childs */
};
/*
* ifqueue_mbc
* Parameter struct used for "mbc" type queues.
* This container queue type has 2 or more "bands", filter rules determines
* which band is used when enqueueing. The rule for dequeueing works like
* this; packet will be dequeued from band 0 until empty,
* packets will then be dequeued from band 1 until empty, etc.
*/
struct ifqueue_mbc
{
struct ifqueue_container mbc_container; /* Read only */
u_long mbc_bands; /* Number of bands, must be 2 or more */
u_long mbc_default_band; /* Index of the band to use for packets that
do not match any rule [0..prio_bands) */
};
/*
* ifqueue_htbc
* Parameter struct used for "htbc" type queues.
* The default queue will get all traffic that does not match some other
* classify rule.
* Dequeueing is done in by Round-Robin through all childs.
*/
struct ifqueue_htbc
{
struct ifqueue_container htbc_container; /* Read only */
u_long htbc_byterate; /* Maximum bitrate for this queue */
u_long htbc_token_limit; /* Maximum number of tokens this queue
can have, MUST be >MTU of the interface */
int htbc_default_id; /* The ID of the default queue (read-only) */
};
/*
* ifqueue_qos - ioctl
* struct used with SIOCxIFQUEUE ioctls.
*/
struct ifqueue_qos
{
char ifq_name[IFNAMSIZ]; /* if name, e.g. "gif1", "gre1" */
char ifq_type[IFNAMSIZ]; /* queue type e.g. "fifo", "red" */
int ifq_id; /* Must be an ID that unique on the specified interface or
IFQ_ID_NONE for get operation when the root queue should be returned */
int ifq_parent_id; /* ID of the parent queue or IFQ_ID_NONE
if this is directly attached to the interface */
int ifq_count; /* Will contain the current number of queued packets
after a SIOCGIFQUEUE call */
union ifqueue_data
{
struct ifqueue_fifo fifo;
struct ifqueue_dpaf dpaf;
struct ifqueue_netemu netemu;
struct ifqueue_htbc htbc;
struct ifqueue_mbc mbc;
} ifq_data;
};
#define IFQ_ID_NONE 0 /* Must be used as parent ID if the queue is a root queue */
#define IFQ_ID_DEFAULT 1 /* Default ID, should be used on root queues where no specific ID is required */
#ifdef __cplusplus
}
#endif
#endif /* !__INCqosh */
@@ -0,0 +1,166 @@
/* jobQueueLib.h - header file for the prioritized job queueing library */
/*
* Copyright (c) 2005-2007, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01f,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
01e,11oct07,dlk Added _func_netDaemonIxToQId and _func_netDaemonQIdToIx
declarations.
01d,22jun06,dlk Add jobQueueUtilInit() prototype.
01c,25aug05,dlk Add section tags.
01b,13jul05,dlk Added member_to_object() and QJOB_IS_BUSY() definitions.
Added 'extern' on prototypes, and jobQueueTask() prototype.
01a,14may05,dlk Written.
*/
#ifndef __INCjobQueueLibh
#define __INCjobQueueLibh
#include <taskLib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* macros */
#define member_to_object(pMember, type, memberName) \
((type *)((char *)(pMember) - offsetof (type, memberName)))
#define JOBQ_PRI_MASKABLE /* enable priority masking */
/*
* The QJOB_BUSY bit in the priInfo member of a pre-allocated QJOB may be
* used for any purpose by the jobLib client. jobLib does not modify this
* bit, and is not affected by it.
*/
#define QJOB_BUSY 0x20 /* managed by client */
#define QJOB_IS_BUSY(pJob) ((pJob)->priInfo & QJOB_BUSY)
#define QJOB_SET_BUSY(pJob) ((pJob)->priInfo |= QJOB_BUSY)
#define QJOB_CLEAR_BUSY(pJob) ((pJob)->priInfo &= ~QJOB_BUSY)
#define QJOB_PRI_LOWEST 0 /* minimum, least urgent priority */
#define QJOB_PRI_HIGHEST 31 /* maximum, most urgent priority */
#define QJOB_NUM_PRI 32 /* Number of prioritiies */
#define QJOB_PRI_MASK 0x1f /* Mask for priority bits */
#define QJOB_SET_PRI(pJob, pri) \
((pJob)->priInfo = ((pJob)->priInfo & ~QJOB_PRI_MASK) | \
((pri) & QJOB_PRI_MASK))
#define QJOB_GET_PRI(pJob) ((pJob)->priInfo & QJOB_PRI_MASK)
/* types */
typedef void (* QJOB_FUNC) (void *);
/*
* A QJOB is typically a member of a larger structure with information
* used by the handler function 'func'. func() is passed a pointer to
* the QJOB as its only argument.
*/
typedef struct _QJOB
{
struct _QJOB * pNext;
UINT32 priInfo; /* modify with QJOB_SET_PRI () */
QJOB_FUNC func; /* function to execute */
} QJOB;
typedef struct _QJOB_STANDARD
{
QJOB job;
void * arg1;
void * arg2;
void * arg3;
void * arg4;
void * arg5;
} QJOB_STANDARD;
struct _JOB_QUEUE;
typedef struct _JOB_QUEUE * JOB_QUEUE_ID;
struct _QJOB_STD_POOL;
typedef struct _QJOB_STD_POOL * QJOB_STD_POOL_ID;
/*
* Functions to convert network daemon index to a job queue ID,
* and vice-versa.
* Set by daemon.c or possibly other facility.
*/
extern JOB_QUEUE_ID (*_func_netDaemonIxToQId) (int index);
/* This one returns -1 for failure: */
extern int (*_func_netDaemonQIdToIx) (JOB_QUEUE_ID qId);
/*
* Variant of jobQueueProcess() to use. By default this
* function pointer points at jobQueueProcess(), but if
* jobQueueAdvLib() is included, it may be
* point at jobQueueProcessWrapper().
*/
extern int (* jobQueueProcessFunc) (JOB_QUEUE_ID pJobQ);
/* function declarations */
_WRS_INITTEXT
extern void jobQueueLibInit (void);
_WRS_FASTTEXT
extern STATUS jobQueuePost (JOB_QUEUE_ID jobQueueId, QJOB * pJob);
_WRS_FASTTEXT
extern STATUS jobQueueStdPost (JOB_QUEUE_ID jobQueueId, int pri,
VOIDFUNCPTR pFunc, void * arg1, void * arg2,
void * arg3, void * arg4, void * arg5);
extern JOB_QUEUE_ID jobQueueCreate (QJOB_STD_POOL_ID stdPoolId);
extern STATUS jobQueueInit (JOB_QUEUE_ID jobQueueId,
QJOB_STD_POOL_ID stdPoolId);
_WRS_FASTTEXT
extern int jobQueueProcess (JOB_QUEUE_ID jobQId);
extern TASK_ID jobQueueTask (JOB_QUEUE_ID jobQueueId);
#ifdef JOBQ_PRI_MASKABLE
extern UINT32 jobQueuePriorityMask (JOB_QUEUE_ID jobQId, UINT32 disablePri,
UINT32 enablePri);
#endif /* JOBQ_PRI_MASKABLE */
/* standard pools */
extern STATUS jobQueueStdPoolInit (QJOB_STD_POOL_ID stdPoolId);
extern STATUS jobQueueStdJobsAlloc (QJOB_STD_POOL_ID stdPoolId,
int nStdJobs);
/* in jobQueueUtilLib */
extern void jobQueueUtilInit (void);
extern STATUS jobQueueQuit (JOB_QUEUE_ID jobQId, int pri, int quitValue,
VOIDFUNCPTR pFunc, void * arg1, void * arg2);
extern int jobQueueProcessWrapper (JOB_QUEUE_ID jobQId);
extern STATUS jobQueueDelete (JOB_QUEUE_ID jobQId);
extern STATUS jobQueueTerminate (JOB_QUEUE_ID jobQId);
extern STATUS jobQueueStdPoolJobsFree (QJOB_STD_POOL_ID pStdPool);
#ifdef __cplusplus
}
#endif
#endif /* __INCjobQueueLibh */
@@ -0,0 +1,52 @@
/* logCategories.h */
/*
* Copyright (c) 2004-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01g,20sep10,h_x Add a new marco (QOS) for log.
01f,06sep06,kch Cleanup for IPNet integration.
01e,08feb06,kch Added ALTQ log entry.
01d,15jun05,tlu Add an entry for MIP6
01c,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01b,28oct04,ann changed default log level for FTP client to 0 (SPR# 103249)
01a,07sep04,dlk written
*/
/*
* This header file forms the database of logging facilities used
* by applLogLib and syslog.h. It is meant to be included multiple
* times, with varying definitions of the LOG_DB() and LOG_DB_LAST()
* macros, so it is not protected against multiple inclusion.
*
* Default Default
* Facility Dest. FD Logging Decoration and Level
* -------- -------- ------------------------------
*/
LOG_DB (PING_V6, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (TELNET, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (TELNETD, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (TFTPD, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (TFTP, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (FTP, STD_OUT, (_LOG_DEC_DFLT | 0 ))
LOG_DB (FTPD, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (SYSCTL, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (RLOGIN, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (REMLIB, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (KERN, KERN_LOG_FD, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (NETDRV, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
LOG_DB (QOS, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
/* must be last */
LOG_DB_LAST (GENERAL, STD_OUT, (_LOG_DEC_DFLT | _LOG_LVL_DFLT))
+44
View File
@@ -0,0 +1,44 @@
/* m2IfLib.h - VxWorks MIB-II interface to SNMP Agent */
/* Copyright 1984 - 2005, 2010 Wind River Systems, Inc. */
/*
modification history
--------------------
02m,29apr10,pad Moved extern C statement after include statements.
02l,07feb05,vvv _KERNEL cleanup
02k,20nov03,niq Remove copyright_wrs.h file inclusion
02j,04nov03,rlm Ran batch header path update for header re-org.
02i,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
02h,24oct03,cdw update include statements post header re-org.
02g,30jul03,vvv backed out previous change
02f,24jul03,vvv modified include for endLib.h
02e,01may03,spm Tornado 2.2 CP1 merge (from ver 01h,27jan03,vvv:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
02d,21may02,ann changed the include of end.h to endLib.h
02c,28mar02,ppp modifying it as part of the cleanup for installation script
02b,03feb02,ham renamed dummyend.h to end.h
02a,12sep01,ann ported to clarinet
01a,29mar01,spm file creation: copied from version 01b of tor2_0.open_stack
branch (wpwr VOB) for unified code base
*/
#ifndef __INCm2IfLibh
#define __INCm2IfLibh
#include <m2Lib.h>
#include <endLib.h>
#ifdef __cplusplus
extern "C" {
#endif
extern STATUS m2PollStatsIfPoll (END_IFDRVCONF *);
extern STATUS m2IfUsrCountersInstall (M2_ID *, void *);
extern STATUS m2IfUsrCountersRemove (M2_ID *);
#ifdef __cplusplus
}
#endif
#endif /* __INCm2Libh */
+454
View File
@@ -0,0 +1,454 @@
/* m2Ipv6Lib.h - VxWorks IPv6 MIB-II interface to SNMP Agent */
/*
* Copyright 2002-2006, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01q,21jun10,h_x Fix WIND00217113
01p,29apr10,pad Moved extern C statement after include statements.
01o,05feb10,h_x Support 64bit
01n,27dec06,kch Removed references to the obsolete coreip virtual stack
headers.
01m,19jun06,jpb Removed I960 check.
01l,07feb05,vvv _KERNEL cleanup
01k,19sep04,spm updated virtual stack startup: restored use of published
init routine and removed packing/unpacking parameters
01j,02feb04,pas finished Zoltan's changes for new avlLib API
01i,20nov03,niq Remove copyright_wrs.h file inclusion
01h,05nov03,cdw Removal of unnecessary _KERNEL guards.
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,22oct03,zl updated for new avlLib API
01d,15sep03,vvv updated path for new headers
01c,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01b,14may03,vvv included m2Lib.h
01a,16apr02,ant written
*/
#ifndef __INCm2Ipv6Libh
#define __INCm2Ipv6Libh
#include <cfgDefs.h>
#include <sys/socket.h> /* needed by sockaddr usage in if.h */
#include <net/if.h>
#include <avlLib.h>
#include <m2Lib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IPV6ADDRESSLEN 16
/* Convert IPv6 address from network format to host format (or vice versa).
* All parameters in m2Ipv6xxx functions that are of Ipv6 address type
* are expected in host format.
*/
#define NTOHL_IPV6ADDR(in6Addr) \
{ \
uint32_t * p32; \
\
p32 = (uint32_t *)in6Addr; \
p32[0] = ntohl(p32[0]); \
p32[1] = ntohl(p32[1]); \
p32[2] = ntohl(p32[2]); \
p32[3] = ntohl(p32[3]); \
}
#define HTONL_IPV6ADDR(in6Addr) \
{ \
uint32_t * p32; \
\
p32 = (uint32_t *)in6Addr; \
p32[0] = htonl(p32[0]); \
p32[1] = htonl(p32[1]); \
p32[2] = htonl(p32[2]); \
p32[3] = htonl(p32[3]); \
}
/* possible values for ipv6Forwarding */
#define M2_ipv6Forwarding_forwarding 1
#define M2_ipv6Forwarding_notForwarding 2
/* possible values for ipv6IfAdminStatus */
#define M2_ipv6IfAdminStatus_up 1
#define M2_ipv6IfAdminStatus_down 2
/* possible values for ipv6IfOperStatus */
#define M2_ipv6IfOperStatus_up 1
#define M2_ipv6IfOperStatus_down 2
#define M2_ipv6IfOperStatus_noIfIdentifier 3
#define M2_ipv6IfOperStatus_unknown 4
#define M2_ipv6IfOperStatus_notPresent 5
/* possible values for ipv6TcpConnState */
#define M2_ipv6TcpConnState_closed 1
#define M2_ipv6TcpConnState_listen 2
#define M2_ipv6TcpConnState_synSent 3
#define M2_ipv6TcpConnStatee_synReceived 4
#define M2_ipv6TcpConnState_established 5
#define M2_ipv6TcpConnState_finWait1 6
#define M2_ipv6TcpConnState_finWait2 7
#define M2_ipv6TcpConnState_closeWait 8
#define M2_ipv6TcpConnState_lastAck 9
#define M2_ipv6TcpConnState_closing 10
#define M2_ipv6TcpConnState_timeWait 11
#define M2_ipv6TcpConnState_deleteTCB 12
/* possible values for ipv6AddrType */
#define M2_ipv6AddrType_stateless 1
#define M2_ipv6AddrType_stateful 2
#define M2_ipv6AddrType_unknown 3
/* possible values for ipv6AddrStatus */
#define M2_ipv6AddrStatus_preferred 1
#define M2_ipv6AddrStatus_deprecated 2
#define M2_ipv6AddrStatus_invalid 3
#define M2_ipv6AddrStatus_inaccessible 4
#define M2_ipv6AddrStatus_unknown 5
/* possible values for ipv6RouteType */
#define M2_ipv6RouteType_other 1
#define M2_ipv6RouteType_discard 2
#define M2_ipv6RouteType_local 3
#define M2_ipv6RouteType_remote 4
/* possible values for ipv6RouteProtocol */
#define M2_ipv6RouteProtocol_other 1
#define M2_ipv6RouteProtocol_local 2
#define M2_ipv6RouteProtocol_netmgmt 3
#define M2_ipv6RouteProtocol_ndisc 4
#define M2_ipv6RouteProtocol_rip 5
#define M2_ipv6RouteProtocol_ospf 6
#define M2_ipv6RouteProtocol_bgp 7
#define M2_ipv6RouteProtocol_idrp 8
#define M2_ipv6RouteProtocol_igrp 9
/* possible values for ipv6NetToMediaType */
#define M2_ipv6NetToMediaType_other 1
#define M2_ipv6NetToMediaType_dynamic 2
#define M2_ipv6NetToMediaType_static 3
#define M2_ipv6NetToMediaType_local 4
/* possible values for ipv6NetToMediaState */
#define M2_ipv6NetToMediaState_reachable 1
#define M2_ipv6NetToMediaState_stale 2
#define M2_ipv6NetToMediaState_delay 3
#define M2_ipv6NetToMediaState_probe 4
#define M2_ipv6NetToMediaState_invalid 5
#define M2_ipv6NetToMediaState_unknown 6
/* IPv6 General Group objects */
typedef struct m2Ipv6General
{
Mib2_Integer ipv6Forwarding;
Mib2_Integer ipv6DefaultHopLimit;
Mib2_Unsigned32 ipv6Interfaces;
Mib2_TimeStamp ipv6IfTableLastChange;
} M2_IPV6_GENERAL;
/* values for ipv6GeneralSetEntry varToSet */
#define M2_varId_ipv6Forwarding 1
#define M2_varId_ipv6DefaultHopLimit 2
/* IPv6 General Group set operation structure */
typedef struct ipv6GeneralSetEntry
{
Mib2_Unsigned varToSet;
Mib2_Integer ipv6Forwarding;
Mib2_Integer ipv6DefaultHopLimit;
} IPV6_GENERAL_SETENTRY;
/* values for ipv6IfSetEntry varToSet */
#define M2_varId_ipv6IfDescr 1
#define M2_varId_ipv6IfIdentifier 2
#define M2_varId_ipv6IfIdentifierLength 4
#define M2_varId_ipv6IfAdminStatus 8
/* IPv6 if table set operation structure */
typedef struct ipv6IfSetEntry
{
Mib2_Unsigned varToSet;
Mib2_IfIndexOrZero ipv6IfIndex;
Mib2_OctetString ipv6IfDescr[M2DISPLAYSTRSIZE];
/* XXX Do we really want to be able to set the if identifier?? ism */
Mib2_OctetString ipv6IfIdentifier[8];
Mib2_Integer ipv6IfIdentifierLength;
Mib2_Integer ipv6IfAdminStatus;
} IPV6_IF_SETENTRY;
/* IPv6 TCP Connection Table Entry, RFC 2452 */
typedef struct
{
Mib2_OctetString ipv6TcpConnLocalAddress [IPV6ADDRESSLEN];
Mib2_Integer ipv6TcpConnLocalPort;
Mib2_OctetString ipv6TcpConnRemAddress [IPV6ADDRESSLEN];
Mib2_Integer ipv6TcpConnRemPort;
Mib2_IfIndexOrZero ipv6TcpConnIfIndex;
Mib2_Integer ipv6TcpConnState;
} M2_IPV6TCPCONNTBL;
/* IPv6 UDP Table Entry, RFC 2454 */
typedef struct
{
Mib2_OctetString ipv6UdpLocalAddress [IPV6ADDRESSLEN];
Mib2_Integer ipv6UdpLocalPort;
Mib2_IfIndexOrZero ipv6UdpIfIndex;
} M2_IPV6UDPTBL;
/* IPV6 Address Prefix Table Entry, RFC 2465 */
typedef struct
{
Mib2_OctetString ipv6AddrPrefixAddress [IPV6ADDRESSLEN];
Mib2_Integer ipv6AddrPrefixLength;
Mib2_TruthValue ipv6AddrPrefixOnLinkFlag;
Mib2_TruthValue ipv6AddrPrefixAutonomousFlag;
Mib2_Unsigned32 ipv6AddrPrefixAdvPreferredLifetime;
Mib2_Unsigned32 ipv6AddrPrefixAdvValidLifetime;
} M2_IPV6ADDRPFXTBL;
/* IPV6 Address Table Entry, RFC 2465 */
typedef struct
{
Mib2_OctetString ipv6AddrAddress [IPV6ADDRESSLEN];
Mib2_Integer ipv6AddrPfxLength;
Mib2_Integer ipv6AddrType;
Mib2_TruthValue ipv6AddrAnycastFlag;
Mib2_Integer ipv6AddrStatus;
} M2_IPV6ADDRTBL;
/* IPV6 Routing objects */
typedef struct
{
Mib2_Gauge32 ipv6RouteNumber;
Mib2_Counter32 ipv6DiscardedRoutes;
} M2_IPV6ROUTE;
/* IPV6 Routing Table Entry, RFC 2465 */
typedef struct
{
Mib2_OctetString ipv6RouteDest [IPV6ADDRESSLEN];
Mib2_Integer ipv6RoutePfxLength;
Mib2_Unsigned32 ipv6RouteIndex;
Mib2_IfIndexOrZero ipv6RouteIfIndex;
Mib2_OctetString ipv6RouteNextHop [IPV6ADDRESSLEN];
Mib2_Integer ipv6RouteType;
Mib2_Integer ipv6RouteProtocol;
Mib2_Integer32 ipv6RoutePolicy;
Mib2_Unsigned32 ipv6RouteAge;
Mib2_Unsigned32 ipv6RouteNextHopRDI;
Mib2_Unsigned32 ipv6RouteMetric;
Mib2_Unsigned32 ipv6RouteWeight;
M2_OBJECTID ipv6RouteInfo;
Mib2_TruthValue ipv6RouteValid;
} M2_IPV6ROUTETBL;
/* IPV6 Addres Translation Table Entry, RFC 2465 */
typedef struct
{
Mib2_OctetString ipv6NetToMediaNetAddress [IPV6ADDRESSLEN];
M2_PHYADDR ipv6NetToMediaPhysAddress;
Mib2_Integer ipv6NetToMediaType;
Mib2_Integer ipv6NetToMediaState;
Mib2_TimeStamp ipv6NetToMediaLastUpdated;
Mib2_TruthValue ipv6NetToMediaValid;
} M2_IPV6ATRANSTBL;
/* IPV6 ICMPv6 statistics table, RFC 2466 */
typedef struct
{
Mib2_Counter32 ipv6IfIcmpInMsgs;
Mib2_Counter32 ipv6IfIcmpInErrors;
Mib2_Counter32 ipv6IfIcmpInDestUnreachs;
Mib2_Counter32 ipv6IfIcmpInAdminProhibs;
Mib2_Counter32 ipv6IfIcmpInTimeExcds;
Mib2_Counter32 ipv6IfIcmpInParmProblems;
Mib2_Counter32 ipv6IfIcmpInPktTooBigs;
Mib2_Counter32 ipv6IfIcmpInEchos;
Mib2_Counter32 ipv6IfIcmpInEchoReplies;
Mib2_Counter32 ipv6IfIcmpInRouterSolicits;
Mib2_Counter32 ipv6IfIcmpInRouterAdvertisements;
Mib2_Counter32 ipv6IfIcmpInNeighborSolicits;
Mib2_Counter32 ipv6IfIcmpInNeighborAdvertisements;
Mib2_Counter32 ipv6IfIcmpInRedirects;
Mib2_Counter32 ipv6IfIcmpInGroupMembQueries;
Mib2_Counter32 ipv6IfIcmpInGroupMembResponses;
Mib2_Counter32 ipv6IfIcmpInGroupMembReductions;
Mib2_Counter32 ipv6IfIcmpOutMsgs;
Mib2_Counter32 ipv6IfIcmpOutErrors;
Mib2_Counter32 ipv6IfIcmpOutDestUnreachs;
Mib2_Counter32 ipv6IfIcmpOutAdminProhibs;
Mib2_Counter32 ipv6IfIcmpOutTimeExcds;
Mib2_Counter32 ipv6IfIcmpOutParmProblems;
Mib2_Counter32 ipv6IfIcmpOutPktTooBigs;
Mib2_Counter32 ipv6IfIcmpOutEchos;
Mib2_Counter32 ipv6IfIcmpOutEchoReplies;
Mib2_Counter32 ipv6IfIcmpOutRouterSolicits;
Mib2_Counter32 ipv6IfIcmpOutRouterAdvertisements;
Mib2_Counter32 ipv6IfIcmpOutNeighborSolicits;
Mib2_Counter32 ipv6IfIcmpOutNeighborAdvertisements;
Mib2_Counter32 ipv6IfIcmpOutRedirects;
Mib2_Counter32 ipv6IfIcmpOutGroupMembQueries;
Mib2_Counter32 ipv6IfIcmpOutGroupMembResponses;
Mib2_Counter32 ipv6IfIcmpOutGroupMembReductions;
} M2_IPV6IFICMPTBL;
/* IPV6 MLD Interface Table Entry, RFC 3019 */
typedef struct
{
Mib2_InterfaceIndex mldInterfaceIfIndex; /* Host compliance */
Mib2_Unsigned32 mldInterfaceQueryInterval;
Mib2_RowStatus mldInterfaceStatus; /* Host compliance */
Mib2_Unsigned32 mldInterfaceVersion;
Mib2_OctetString mldInterfaceQuerier [IPV6ADDRESSLEN]; /* Host compliance */
Mib2_Unsigned32 mldInterfaceQueryMaxResponseDelay;
Mib2_Counter32 mldInterfaceJoins;
Mib2_Gauge32 mldInterfaceGroups;
Mib2_Unsigned32 mldInterfaceRobustness;
Mib2_Unsigned32 mldInterfaceLastListenQueryIntvl;
Mib2_IfIndexOrZero mldInterfaceProxyIfIndex;
Mib2_TimeTicks mldInterfaceQuerierUpTime;
Mib2_TimeTicks mldInterfaceQuerierExpiryTime;
} M2_MLDINTERFACETBL;
/* IPV6 MLD Cache Table Entry, RFC 3019 */
typedef struct
{
Mib2_OctetString mldCacheAddress [IPV6ADDRESSLEN]; /* Host compliance */
Mib2_InterfaceIndex mldCacheIfIndex; /* Host compliance */
Mib2_TruthValue mldCacheSelf; /* Host compliance */
Mib2_OctetString mldCacheLastReporter [IPV6ADDRESSLEN];
Mib2_TimeTicks mldCacheUpTime;
Mib2_TimeTicks mldCacheExpiryTime;
Mib2_RowStatus mldCacheStatus; /* Host compliance */
} M2_MLDCACHETBL;
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS m2Ipv6Init(unsigned long maxRouteTableSize);
extern STATUS m2Ipv6Delete (void);
extern STATUS m2Ipv6TcpInit (void);
extern STATUS m2Ipv6TcpConnEntryGet (int search, M2_IPV6TCPCONNTBL * pTcpConnEntry);
extern STATUS m2Ipv6TcpConnEntrySet (M2_IPV6TCPCONNTBL * pTcpConnEntry);
extern STATUS m2Ipv6TcpDelete (void);
extern STATUS m2Ipv6UdpInit (void);
extern STATUS m2Ipv6UdpTblEntryGet (int search, M2_IPV6UDPTBL * pUdpEntry);
extern STATUS m2Ipv6UdpDelete (void);
extern STATUS m2Ipv6IfInit (unsigned long maxRouteTableSize);
extern STATUS m2Ipv6IfGeneralGet(M2_IPV6_GENERAL * pIpv6Gen);
extern STATUS m2Ipv6IfGeneralSet(void * pIpv6IfReqEntry);
extern STATUS m2Ipv6IfTblEntryGet(int search,void * pIpv6IfReqEntry);
extern STATUS m2Ipv6IfTblEntrySet(void * pIpv6IfReqEntry);
extern STATUS m2Ipv6AddrTblEntryGet (int search, int * index,
M2_IPV6ADDRTBL * pIpAddrTblEntry);
extern STATUS m2Ipv6AddrPfxTblEntryGet (int search, int * index,
M2_IPV6ADDRPFXTBL * pIpAddrPfxTblEntry);
extern STATUS m2Ipv6RouteInfoGet (M2_IPV6ROUTE * pIpv6RouteInfo);
extern STATUS m2Ipv6RouteTblEntryGet (int search, M2_IPV6ROUTETBL * pIpRouteTblEntry);
extern STATUS m2Ipv6RouteTblEntrySet (M2_IPV6ROUTETBL * pIpRouteTblEntry);
extern STATUS m2Ipv6AtransTblEntryGet (int search, int * index,
M2_IPV6ATRANSTBL * pReqIpAtEntry);
extern STATUS m2Ipv6AtransTblEntrySet (int index, M2_IPV6ATRANSTBL * pReqIpAtEntry);
extern STATUS m2Ipv6IfDelete (void);
extern STATUS m2Ipv6IfIcmpInit (void);
extern STATUS m2Ipv6IfIcmpTblGet (int search, int * index, M2_IPV6IFICMPTBL * pIcmpInfo);
extern STATUS m2Ipv6IfIcmpDelete (void);
extern STATUS m2Ipv6MldInit (void);
extern STATUS m2Ipv6MldIfTblEntryGet (int search, M2_MLDINTERFACETBL * pMldIfEntry);
extern STATUS m2Ipv6MldCacheTblEntryGet (int search, M2_MLDCACHETBL * pMldCacheEntry);
extern STATUS m2Ipv6MldCacheTblEntrySet (M2_MLDCACHETBL * pMldCacheEntry);
extern STATUS m2Ipv6MldDelete (void);
extern M2_IFINDEX * m2Ipv6AvlSearch (AVLU_TREE root, UINT key);
extern M2_IFINDEX * m2Ipv6AvlSuccessorGet (AVLU_TREE root, UINT key);
#else /* __STDC__ */
extern STATUS m2Ipv6Init();
extern STATUS m2Ipv6Delete ();
extern STATUS m2Ipv6TcpInit (void);
extern STATUS m2Ipv6TcpConnEntryGet ();
extern STATUS m2Ipv6TcpConnEntrySet ();
extern STATUS m2Ipv6TcpDelete ();
extern STATUS m2Ipv6UdpInit ();
extern STATUS m2Ipv6UdpTblEntryGet ();
extern STATUS m2Ipv6UdpDelete ();
extern STATUS m2Ipv6IfInit ();
extern STATUS m2Ipv6IfGeneralGet();
extern STATUS m2Ipv6IfGeneralSet();
extern STATUS m2Ipv6IfTblEntryGet();
extern STATUS m2Ipv6IfTblEntrySet();
extern STATUS m2Ipv6AddrTblEntryGet ();
extern STATUS m2Ipv6AddrPfxTblEntryGet ();
extern STATUS m2Ipv6RouteInfoGet ();
extern STATUS m2Ipv6RouteTblEntryGet ();
extern STATUS m2Ipv6RouteTblEntrySet ();
extern STATUS m2Ipv6AtransTblEntryGet ();
extern STATUS m2Ipv6AtransTblEntrySet ();
extern STATUS m2Ipv6IfDelete ();
extern STATUS m2Ipv6IfIcmpInit ();
extern STATUS m2Ipv6IfIcmpTblGet ();
extern STATUS m2Ipv6IfIcmpDelete ();
extern STATUS m2Ipv6MldInit ();
extern STATUS m2Ipv6MldIfTblEntryGet ();
extern STATUS m2Ipv6MldCacheTblEntryGet ();
extern STATUS m2Ipv6MldCacheTblEntrySet ();
extern STATUS m2Ipv6MldDelete ();
extern void * m2Ipv6AvlSearch ();
extern void * m2Ipv6AvlSuccessorGet ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCm2Ipv6Libh */
File diff suppressed because it is too large Load Diff
+288
View File
@@ -0,0 +1,288 @@
/* muxL2Lib.h - definitions for the L2 MUX library */
/*
* Copyright (c) 1996-2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01l,30sep05,kch Added cfi to MUX_L2_PORT_VLAN.
01k,27sep05,kch Fixed documentation. Also removed the unsupported (unused)
MUXL2IOCSFLAGS and MUXL2IOCGFLAGS defines (SPR #112935).
01j,15sep05,kch Added MAX_VID, MIN_VID, MAX_VID, MIN_USER_PRIORITY,
MAX_USER_PRIORITY, IS_VALID_VID and IS_VALID_PRORITY macros
(SPR #112513).
01i,31aug05,kch Removed the non-standard global vlan id ioctl commands. Added
MUXL2IOCGPORTINFO ioctl command and MUX_L2_PORT_PARAMS
structure definition (SPR #112068).
01h,26aug05,kch Added EGRESS_FRAME_TYPE enum. Renamed MUX_L2_VLAN structure
to MUX_L2_PORT_VLAN. Replaced isEgressUntagged boolean with
etype EGRESS_FRAME_TYPE enumeration to handle the default
egress tagging state for pvid and other vids correctly.
01g,25aug05,kch Added prototypes muxL2PortAltAttach() and
muxL2PortTos2UpriorityRegister() for backward compatibility.
01f,24aug05,kch Added muxL2StatShow() and muxL2VlanStatShow() prototypes.
01e,23aug05,kch Added vlan tag related macros.
01d,18aug05,kch Added MUXL2IOCSGLOBALVIDJOIN and MUXL2IOCSGLOBALVIDLEAVE
commands.
01c,17aug05,kch Added muxL2VlanShow() prototype. Removed argument
'verbose' from muxL2Show() prototype.
01b,17aug05,kch Added argument 'verbose' to muxL2Show() prototype.
01a,28jul05,kch written.
*/
/*
DESCRIPTION
This file includes function prototypes for the Layer 2 MUX.
INCLUDE FILES:
*/
#ifndef __INCmuxL2Libh
#define __INCmuxL2Libh
#include <cfgDefs.h>
#include <muxLib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct mux_l2_config_params {
CFG_DATA_HDR cfgh;
/* the number of ports that the device has */
int cfg_priv_muxL2NumPorts;
/* maximum number of 802.1Q VLANs that the device supports */
int cfg_priv_muxL2MaxVlanSupport;
} MUX_L2_CONFIG_PARAMS;
/*
* The length of 802.1Q VAN encapsulation
*/
#define ETHER_VLAN_ENCAP_LEN 4
#define VLAN_ID_MASK 0x0fff /* 12 bits vlan id */
#define PRIORITY_BITS 0xe000 /* bits 15..13 in the tag */
#define PRIORITY_MASK 0x0007 /* 3 bit priority field */
#define GET_VLAN_ID(qTag) ((qTag) & VLAN_ID_MASK)
#define GET_VLAN_USER_PRIORITY(qTag) (((qTag) >> 13) & PRIORITY_MASK)
/*
* 802.1Q VLAN definitions
*/
#define NULL_VID 0 /* for priority-tagged frame */
/*#define MIN_VID 1*/
#define MIN_VID 0
#define MAX_VID 4094
/*
* The following defines defines the acceptable priority-level for 802.1Q
* priority-tagged frame
*/
#define MIN_USER_PRIORITY 0
#define MAX_USER_PRIORITY 7
/*
* Macros for 802.1Q vlan-tag boundary checking
*/
#define IS_VALID_VID(pvid) ((pvid) <= MAX_VID)
#define IS_VALID_PRORITY(up) ((up) <= MAX_USER_PRIORITY)
/*
* Ingress Acceptable Frame Type
*/
typedef enum {
ADMIT_ALL_FRAMES = 1, /* default */
ADMIT_TAGGED_ONLY_FRAMES
} ACCEPT_FRAME_TYPE;
/*
* Per 802.1Q 8.11.9 (note 2), the default tagging state for the pvid
* is untagged, and for all other vids are tagged, unless otherwise
* configured.
*/
typedef enum {
EGRESS_NOT_SPECIFIED = 0, /* not specified */
EGRESS_TAGGED_FRAMES, /* send vlan-tagged frame for the given vlan */
EGRESS_UNTAGGED_FRAMES /* send untagged frame for the given vlan */
} EGRESS_FRAME_TYPE;
/*
* <l2Attached> sets to true if a port is attached to the layer 2, false
* if the port is detached from layer 2. If <l2Attached> is true for END
* device, the interface's if_output routine is expected to use the
* pEnd->pFuncTable->formAddress to construct its ethernet header. For
* NPT-style device, the <l2Attached> should be ignore for now (actual
* bahavior is currently not defined).
*
* <newMtu> indicates the mtu size upper layer protocols (e.g. IP) should
* apply to the interface. The value of the <newMtu>will be set to the
* existing hardware mtu size if one of the following applies:
* 1) hardware indicates it supports hardware VLAN tagging (e.g. the
* IFCAP_VLAN_HWTAGGING in if_capabilities is set), or
* 2) hardware doesn't support hardware VLAN tagging but capable of handling
* larger mtu that may include a software-appended VLAN header (e.g. the
* IFCAP_VLAN_MTU flag is set in if_capabilities)
* If none of the above is true, the existing hardware mtu size will be
* reduced by 4 bytes and reflects in <newMtu>.
*/
typedef struct mux_l2_port_params {
BOOL l2Attached; /* true if port is attached to layer 2, false if detach */
unsigned long newMtu;
} MUX_L2_PORT_PARAMS;
typedef struct mux_l2_port_vlan {
unsigned short vid; /* Valid Vid: 1..4094 */
unsigned short upriority; /* User Priority, Valid Priority: 0..7 */
unsigned short cfi; /* canonical format indicator, 0 or 1 */
EGRESS_FRAME_TYPE etype; /* default to untagged if not specified */
} MUX_L2_PORT_VLAN;
typedef struct mux_l2_port_vlan_membership {
unsigned short vid; /* VLAN to join/leave/modify */
EGRESS_FRAME_TYPE etype; /* default to vlan-tagged if not specified */
} MUX_L2_PORT_VLAN_MEMBERSHIP;
typedef struct mux_l2_port_vlan_member_info {
unsigned short vid;
BOOL isMember; /* TRUE if port is a member of the vlan */
EGRESS_FRAME_TYPE etype; /* egress frame type, tagged or untagged */
} MUX_L2_PORT_VLAN_MEMBER_INFO;
/*
* structure passed for SIOCMUXL2PASSTRHU ioctl.
*
* Required data field for MUX L2 SET ioctl commands:
*
* MUXL2IOCSPORTATTACH - none
* MUXL2IOCSPORTDETACH - none
* MUXL2IOCSPORTVLAN - portDefaultVlan.vid, portDefaultVlan.upriority,
* portDefaultVlan.etype (optional)
* MUXL2IOCSINGRESSFRAMETYPE - portIngressAcceptFrameType
* MUXL2IOCSINGRESSFILTER - portIngressFilter
* MUXL2IOCSEGRESSFRAMETYPE - portVlanMember.vid, portVlanMember.etype
* MUXL2IOCSVLANJOIN - portVlanMember.vid, portVlanMember.etype
* MUXL2IOCSVLANLEAVE - portVlanMember.vid, portVlanMember.etype not used
*
* The following data field(s) are required and will be filled in by the
* MUX L2 GET ioctl commands:
*
* MUXL2IOCGPORTINFO - portInfo.l2Attached portInfo.newMtu
* MUXL2IOCGPORTVLAN - portDefaultVlan.vid, portDefaultVlan.upriority,
* portDefaultVlan.etype
* MUXL2IOCGINGRESSFRAMETYPE - portIngressAcceptFrameType
* MUXL2IOCGINGRESSFILTER - portIngressFilter
* MUXL2IOCGVLANINFO - portVlanInfo.isMember, portVlanInfo.etype if port is
* a member of the specified vid (portVlanInfo.vid
* must be provided)
*/
typedef struct mux_l2_ioctl_req {
union {
/* layer 2 port parameters */
MUX_L2_PORT_PARAMS portInfo;
/* port-based vlan configuration */
MUX_L2_PORT_VLAN portDefaultVlan;
/* per-port Ingress Acceptable Frame Type */
ACCEPT_FRAME_TYPE portIngressAcceptFrameType;
/* per-port Ingress Rules */
BOOL portIngressFilter;
/* per-port per-VLAN membership configuration */
MUX_L2_PORT_VLAN_MEMBERSHIP portVlanMember;
/* per-port per-VLAN membership information */
MUX_L2_PORT_VLAN_MEMBER_INFO portVlanInfo;
} data;
} MUX_L2_IOCTL_REQ;
/*
* Supported MUX ioctl command for L2 on a per-port basis
*
* MUXL2IOCSPORTATTACH - create a binding between an END device and L2 MUX
* MUXL2IOCSPORTDETACH - detach the specified END device from L2 MUX
* MUXL2IOCGPORTINFO - get the device layer 2 port information
* MUXL2IOCSPORTVLAN - set the per-port default vid and user priority
* MUXL2IOCGPORTVID - get the per-port default vid and user priority
* MUXL2IOCSINGRESSFRAMETYPE - set the port Ingress Acceptable Frame Type
* MUXL2IOCGINGRESSFRAMETYPE - get the port Ingress Acceptable Frame Type
* MUXL2IOCSINGRESSFILTER - set the port Ingress Frame Filtering state
* MUXL2IOCGINGRESSFILTER - get the port Ingress Frame Filtering state
* MUXL2IOCSEGRESSFRAMETYPE - set Egress Acceptable Frame Type
* MUXL2IOCSVLANJOIN - join VLAN membership on a port
* MUXL2IOCSVLANLEAVE - leave VLAN membership on a port
* MUXL2IOCGVLANINFO - get VLAN membership for a port
*/
#define MUXL2IOCSPORTATTACH _IOW('m', 1, MUX_L2_IOCTL_REQ)
#define MUXL2IOCSPORTDETACH _IOW('m', 2, MUX_L2_IOCTL_REQ)
#define MUXL2IOCGPORTINFO _IOR('m', 3, MUX_L2_IOCTL_REQ)
/* port-based vlan get and set commands */
#define MUXL2IOCSPORTVLAN _IOW('m', 4, MUX_L2_IOCTL_REQ)
#define MUXL2IOCGPORTVLAN _IOR('m', 5, MUX_L2_IOCTL_REQ)
/* per-port ingress acceptable frame type get and set commands */
#define MUXL2IOCSINGRESSFRAMETYPE _IOW('m', 6, MUX_L2_IOCTL_REQ)
#define MUXL2IOCGINGRESSFRAMETYPE _IOR('m', 7, MUX_L2_IOCTL_REQ)
/* per-port ingress filter get and set commands */
#define MUXL2IOCSINGRESSFILTER _IOW('m', 8, MUX_L2_IOCTL_REQ)
#define MUXL2IOCGINGRESSFILTER _IOR('m', 9, MUX_L2_IOCTL_REQ)
#define MUXL2IOCSEGRESSFRAMETYPE _IOW('m', 10, MUX_L2_IOCTL_REQ)
/* per-port vlan membership join/leave get and set commands */
#define MUXL2IOCSVLANJOIN _IOW('m', 11, MUX_L2_IOCTL_REQ)
#define MUXL2IOCSVLANLEAVE _IOW('m', 12, MUX_L2_IOCTL_REQ)
#define MUXL2IOCGVLANINFO _IOR('m', 13, MUX_L2_IOCTL_REQ)
#ifdef _WRS_KERNEL
/* globals */
IMPORT MUX_FUNCS _func_mux_l2;
IMPORT MUX_L2_CONFIG_PARAMS muxL2DefaultConfigParams;
/* prototypes */
IMPORT STATUS muxL2LibInit (void *muxL2InitValues);
IMPORT STATUS muxL2Ioctl (void* pCookie, int cmd, caddr_t data);
IMPORT void * muxL2EndTake (const char * pDevName, int unit);
IMPORT void muxL2EndGive (void * pCookie);
IMPORT STATUS muxL2PortAttach (char * pDevName, int unit);
IMPORT STATUS muxL2PortDetach (char * pDevName, int unit);
IMPORT void muxL2Show (char *pDevName, int unit);
IMPORT void muxL2VlanShow (unsigned short vid);
IMPORT void muxL2StatShow (char *pDevName, int unit);
IMPORT void muxL2VlanStatShow (unsigned short vid);
/* the following prototypes are provided for backward compatibility */
IMPORT STATUS muxL2PortAltAttach (char * pDevName, int unit,
BOOL updateNetFuncs,
M_BLK_ID (*formAddress)(),
STATUS (*packetDataGet)(),
STATUS (*ingressVlanTagCheck)());
#ifdef VLAN_TAG
IMPORT STATUS muxL2PortTos2UpriorityRegister (char * pDevName, int unit,
unsigned char (*tos2UpriorityConvRtn) (unsigned char));
#endif /* VLAN_TAG */
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* __INCmuxL2Libh */
+348
View File
@@ -0,0 +1,348 @@
/* muxLib.h - definitions for the MUX library */
/*
* Copyright (c) 2001-2008, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
03w,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
03v,28mar08,dlk Added muxProtoInfoGet()/muxProtoListGet().
Pass the PROTO_COOKIE also to mux2Bind() protocol shutdown
routines.
03u,26feb08,dlk MUX2 redesign.
03t,12oct07,dlk Made muxEndRxJobQueue() public. Added muxEndQnumGet().
Added muxErrorPost(). muxIfFuncBase scalability.
03s,20sep07,dlk Added muxLinkUpNotify() and muxLinkDownNotify().
03r,02jan07,kch Added muxIterate() prototype.
03q,05aug06,kch Cleanup.
03p,25aug05,dlk Add section tags.
03o,28jul05,dlk Added muxErrorSkip() declaration.
03n,20feb05,dlk Added MUX_FUNCS, muxEndTake(), muxEndGive(), MUX_PASSTHRU.
03m,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
03l,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
03k,24nov03,wap Merge in changes from Snowflake
03j,20nov03,niq Remove copyright_wrs.h file inclusion
03i,04nov03,rlm Ran batch header path update for header re-org.
03h,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
03g,27oct03,cdw update include statements post header re-org.
03f,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
03e,06feb03,vvv merged from tor2_2-patch.alameda, ver02c (SPR #83258)
03d,03feb02,ham renamed dummyend.h to end.h.
03c,20feb02,ham changed for tornado build.
03b,09jan02,ann adding the field for the output function in MUX_ADDR_REC
03a,15may01,ann major changes as per MUX design doc for clarinet.
added some prototypes. code inherited from AE ver 02c.
*/
/*
DESCRIPTION
This file includes function prototypes for the MUX.
INCLUDE FILES:
*/
#ifndef __INCmuxLibh
#define __INCmuxLibh
/* includes */
#include <vsbConfig.h>
#ifdef _WRS_KERNEL
#include <end.h>
#else
#include <endCommon.h>
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
extern "C" {
#endif
/* defints */
/* MUX_MAX_IFTYPE associates with IFT_MAX_TYPE as default. If the user wants
* to add a resource function, verify it's smaller than MUX_MAX_IFTYPE.
*/
#define MUX_MAX_IFTYPE M2_ifType_pmp
/* Error defines. */
#define S_muxLib_LOAD_FAILED (M_muxLib | 1)
#define S_muxLib_NO_DEVICE (M_muxLib | 2)
#define S_muxLib_INVALID_ARGS (M_muxLib | 3)
#define S_muxLib_ALLOC_FAILED (M_muxLib | 4)
#define S_muxLib_ALREADY_BOUND (M_muxLib | 5)
#define S_muxLib_UNLOAD_FAILED (M_muxLib | 6)
#define S_muxLib_NOT_A_TK_DEVICE (M_muxLib | 7)
#define S_muxLib_NO_TK_DEVICE (M_muxLib | 8)
#define S_muxLib_END_BIND_FAILED (M_muxLib | 9)
#define S_muxLib_MISSING_WRAPPERS (M_muxLib | 10)
/* These are above all SAPs but still in the ethernet size range */
/* so won't interfere with RFC 1700 */
#define MUX_PROTO_PROMISC 0x100
#define MUX_PROTO_SNARF 0x101
#define MUX_PROTO_OUTPUT 0x102
/*
* Note that these bind styles are correlated in number
* and order with the END styles in endCommon.h
*/
#define BIND_STYLE_MUX2BIND 0
#define BIND_STYLE_MUXBIND 1
#define BIND_STYLE_MUXTKBIND 2
/* NUM_BIND_STYLES is defined as 3 in end.h */
/*
* The following defines are used for the various if-protocol functions
* that are maintained by the MUX function table.
*/
#define ADDR_RES_FUNC 1
#define IF_OUTPUT_FUNC 2
#define MULTI_ADDR_RES_FUNC 4
/* typedefs */
/* structure passed for SIOCMUXPASSTRHU ioctl */
typedef struct _MUX_PASSTHRU
{
char name[END_NAME_MAX]; /* device name, without unit number */
int unit; /* unit number. */
u_int cmd; /* Tunnelled ioctl command. Must properly
encode size and IOC_IN/IOC_OUT/IOC_VOID,
and IOC_USER must be set if RTP access is
allowed. */
void * pData; /* Tunnelled ioctl data argument */
} MUX_PASSTHRU;
#ifdef _WRS_KERNEL
/*
* These data structures define the 2D list of address resolution
* functions. This list is ordered by ifType and the protocol.
*/
typedef struct mux_addr_rec
{
NODE node;
long protocol;
int setFuncs;
FUNCPTR addrResFunc;
FUNCPTR ifOutputFunc;
FUNCPTR multiAddrResFunc;
} MUX_ADDR_REC;
/* function pointers for scalability */
typedef struct _MUX_FUNCS
{
void * (*endTake) (const char * pName, int unit);
void (*endGive) (void * pCookie);
int (*ioctl) (void* pCookie, int cmd, caddr_t data);
/* ADD MORE HERE AS NEEDED */
} MUX_FUNCS;
/*
* PROTO_COOKIE is the opaque pointer type returned by mux2Bind(),
* muxBind(), and muxTkBind(). It represents the binding of a protocol
* to a network device. It is used in calls to muxIoctl(), muxUnbind(),
* muxSend(), muxPollSend(), muxPollReceive(), muxTkSend(), muxTkPollSend(),
* muxTkPollReceive(), muxMCastAddrAdd(), muxMCastAddrDel(),
* muxMCastAddrGet(), muxLinkHeaderCreate(), muxAddressForm(),
* muxPacketDataGet(), and muxPacketAddrGet().
*
* Note that mux2Send(), mux2PollSend(), and mux2PollReceive() require
* a DEV_COOKIE, not a PROTO_COOKIE.
*/
typedef void * PROTO_COOKIE;
/*
* DEV_COOKIE is the opaque pointer type returned by muxDevLoad() and
* muxDevAcquire(), and passed to muxDevRelease(), muxDevStart(), and
* muxDevStop(), muxError(), mux2Send(), mux2PollSend(), and mux2PollReceive().
* It represents the network device. (Pssst: it's an END_OBJ *)
*
* For VxWorks 6.7 and later: a DEV_COOKIE may be used a fake
* PROTO_COOKIE, for the purposes of calling muxSend(), muxIoctl(),
* muxPollSend(), muxPollReceive(), muxTkSend(), muxTkPollSend(),
* muxMCastAddrAdd(), muxMCastAddrDel(), muxMCastAddrGet(),
* muxLinkHeaderCreate(), muxAddressForm(), muxPacketDataGet(), and
* muxPacketAddrGet().
*
* Don't use a DEV_COOKIE for a call to muxUnbind() or muxTkPollReceive();
* they work only with a real PROTO_COOKIE.
*/
typedef void * DEV_COOKIE;
/*
* Protocol information. Returned by muxProtoInfoGet(). Note that
* the actual signatures of the callback functions depends upon the
* binding style.
*/
typedef struct _MUX_PROTO_INFO
{
char name[END_PROTO_NAME_MAX]; /* String name for this protocol */
int netSvcType; /* Network service type */
int bindStyle; /* MUX bind style (BIND_STYLE_* above) */
BOOL (*stackRcvRtn) (); /* Protocol's receive routine */
STATUS (*stackTxRestartRtn) (); /* Callback for restarting blocked tx. */
STATUS (*stackShutdownRtn) (); /* The routine to call to shut down */
void (*stackErrorRtn) (); /* Callback for device errors/events */
DEV_COOKIE pEnd;
void * callbackArg;
} MUX_PROTO_INFO;
typedef struct _MUX_PROTOS_INFO
{
int nprotos; /* Number of PROTO_INFOs in plist */
MUX_PROTO_INFO * plist; /* Array of PROTO_INFO structures */
} MUX_PROTOS_INFO;
struct Ipcom_pkt_struct; /* declaration in ipcom_pkt.h */
/* globals */
IMPORT MUX_FUNCS _func_mux;
/* locals */
/* function declarations */
/* common routines shared by all device styles and protocol binding styles */
IMPORT STATUS muxCommonInit (void);
IMPORT DEV_COOKIE muxDevAcquire (const char * name, int unit);
IMPORT void muxDevRelease (DEV_COOKIE pEnd);
IMPORT END_OBJ * endFindByName (char* pName, int unit);
IMPORT DEV_COOKIE muxDevLoad (int unit, END_OBJ* (*endLoad) (char *, void*),
char *initString, BOOL loaning, void*pBSP);
IMPORT STATUS muxDevUnload (char* pName, int unit);
IMPORT STATUS muxDevStart (DEV_COOKIE pEnd);
IMPORT STATUS muxDevStop (DEV_COOKIE pEnd);
IMPORT STATUS muxDevStopAll (int timeout);
IMPORT int muxEndListGet (END_OBJ ** pEnds, int nSlots);
IMPORT void muxShow (char* pDevName, int unit);
IMPORT STATUS muxUnbind(PROTO_COOKIE cookie, long type,
FUNCPTR stackShutdownRtn);
IMPORT STATUS muxIoctl (PROTO_COOKIE cookie, int cmd, caddr_t data);
IMPORT STATUS muxMCastAddrAdd (PROTO_COOKIE cookie, char* pAddress);
IMPORT STATUS muxMCastAddrDel (PROTO_COOKIE cookie, char* pAddress);
IMPORT STATUS muxMCastAddrGet (PROTO_COOKIE cookie, MULTI_TABLE* pTable);
IMPORT void muxTxRestart(void * pEnd);
IMPORT void muxErrorSkip (DEV_COOKIE pEnd, END_ERR * pError,
PROTO_COOKIE skipProtoCookie);
IMPORT void muxErrorPost(END_OBJ * pEnd, INT32 errCode,
char * pMesg, void * pSpare);
IMPORT JOB_QUEUE_ID muxEndRxJobQueue (END_OBJ * pEnd);
IMPORT int muxEndQnumGet (char * instName, int unit);
IMPORT int muxProtoListGet (END_OBJ * pEnd, MUX_PROTOS_INFO * pInfo);
IMPORT STATUS muxProtoInfoGet (PROTO_COOKIE cookie, MUX_PROTO_INFO * pInfo);
/* routines for END-style devices and muxBind() protocols */
IMPORT STATUS muxLibInit (void);
IMPORT PROTO_COOKIE muxBind (char * pName, int unit,
BOOL (*stackRcvRtn) (void*, long,M_BLK_ID, LL_HDR_INFO *,
void*),
STATUS (*stackShutdownRtn) (void*, void*),
STATUS (*stackTxRestartRtn) (void*, void*),
void (*stackErrorRtn) (END_OBJ*, END_ERR*, void*),
long type, char* pProtoName, void* pSpare);
IMPORT STATUS muxSend (PROTO_COOKIE cookie, M_BLK_ID pMblk);
IMPORT STATUS muxPollSend (PROTO_COOKIE cookie, M_BLK_ID pMblk);
IMPORT STATUS muxPollReceive (PROTO_COOKIE cookie, M_BLK_ID pMblk);
IMPORT M_BLK_ID muxLinkHeaderCreate(PROTO_COOKIE cookie, M_BLK_ID pPacket,
M_BLK_ID pSrcAddr, M_BLK_ID pDstAddr,
BOOL bcastFlag);
IMPORT M_BLK_ID muxAddressForm (PROTO_COOKIE cookie, M_BLK_ID pMblk,
M_BLK_ID pSrcAddr, M_BLK_ID pDstAddr);
IMPORT STATUS muxPacketDataGet(PROTO_COOKIE cookie, M_BLK_ID pMblk,
LL_HDR_INFO *);
IMPORT STATUS muxPacketAddrGet (PROTO_COOKIE cookie, M_BLK_ID pMblk,
M_BLK_ID pSrc,
M_BLK_ID pDst,
M_BLK_ID pESrc,
M_BLK_ID pEDst);
IMPORT BOOL muxDevExists (char* pName, int unit);
/* These functions are deprecated */
IMPORT STATUS muxAddrResFuncDel (long ifType, long protocol);
IMPORT FUNCPTR muxAddrResFuncGet (long ifType, long protocol);
IMPORT STATUS muxAddrResFuncAdd (long ifType, long protocol,
FUNCPTR addrResFunc);
IMPORT STATUS muxIfFuncBaseInit (void);
IMPORT STATUS muxIfFuncDel (long ifType, long protocol, int funcType);
IMPORT FUNCPTR muxIfFuncGet (long ifType, long protocol, int funcType);
IMPORT STATUS muxIfFuncAdd (long ifType, long protocol, int funcType,
FUNCPTR ifFunc);
IMPORT END_OBJ* endFirstUnitFind (char* pDevName);
/* Routines for mux2Bind() protocols and END2-style devices */
void mux2LibInit (void);
void * mux2Bind (char * name, int unit,
BOOL (*stackRcvRtn) (void * callbackArg,
struct Ipcom_pkt_struct * pkt),
STATUS (*stackShutdownRtn) (PROTO_COOKIE cookie, void * callbackArg),
STATUS (*stackTxRestartRtn) (void * callbackArg),
void (*stackErrorRtn) (void * callbackArg, END_ERR * err),
unsigned short type, char * pProtoName, void * callbackArg);
IMPORT int mux2Send (END_OBJ * pEnd, struct Ipcom_pkt_struct * pkt);
IMPORT int mux2PollSend (END_OBJ * pEnd, struct Ipcom_pkt_struct * pkt);
IMPORT int mux2PollReceive (END_OBJ * pEnd, struct Ipcom_pkt_struct * pkt);
/* Routines called (mostly) by network device drivers */
IMPORT void mux2Receive (END_OBJ * pEnd, struct Ipcom_pkt_struct * pkt);
IMPORT STATUS muxReceive (void * pEnd, M_BLK_ID pMblk);
IMPORT void muxError (DEV_COOKIE pEnd, END_ERR * pError);
IMPORT void muxLinkUpNotify (END_OBJ * pEnd);
IMPORT void muxLinkDownNotify (END_OBJ * pEnd);
/* utility routines (deprecate these?) */
IMPORT STATUS muxIterate (FUNCPTR pCallbackRtn, void * pCallbackArg);
IMPORT STATUS muxIterateByName (char * pName, FUNCPTR pCallbackRtn,
void * pCallbackArg);
/* cross protocol / device */
IMPORT void muxOverEnd2Init (void);
IMPORT void mux2OverEndInit (void);
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* __INCmuxLibh */
+106
View File
@@ -0,0 +1,106 @@
/* muxTkLib.h - definitions for muxTkLib.c */
/*
* Copyright 1998-2003, 2005, 2008, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
02l,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
02k,03mar08,dlk Update for MUX2.
02j,25aug05,dlk Add section tags.
02i,16may05,dlk Remove unsupported routine muxTkPktsReceive() unless
END_STYLE_MULTI_SUPPORT is defined.
02h,24nov03,wap Merge in changes from Snowflake
02g,20nov03,niq Remove copyright_wrs.h file inclusion
02f,04nov03,rlm Ran batch header path update for header re-org.
02e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
02d,22jul03,ann changed 6th argument of muxTkBind to VOIDFUNCPTR.
02c,01may03,spm Tornado 2.2 CP1 merge (from version 01k,14nov02,wap:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
02b,06feb03,vvv merged from tor2_2-patch.alameda, ver01k (SPR #83032)
02a,02may01,ann made major changes for Clarinet based on MUX design doc
01i,19apr00,ham merged TOR2_0-NPT-FCS(01h,29apr99,pul).
01h,29apr99,pul Upgraded NPT phase3 code to tor2.0.0
01g,30mar99,pul removed all muxMCastMap and muxSvcFunc function declarations
01f,24feb99,sj added muxTkPollReceive
01e,23feb99,sj added spare data last argument for muxTkSend and muxTkPollSend
01d,06nov98,sj removed prototypes for muxTkReceive and nptHookRtn
01c,27oct98,pul changed nptHookRtn declaration to return STATUS.
01b,09oct98,sj fixed bad prototype for muxMCastMapFuncGet
01a,07oct98,pul written.
*/
/*
DESCRIPTION
This file includes function prototypes for the MUX.
INCLUDE FILES: muxLib.h
*/
#ifndef __INCmuxTkLibh
#define __INCmuxTkLibh
/* includes */
#include <muxLib.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
/* typedefs */
/* locals */
/* globals */
IMPORT int muxMaxBinds;
/* forward declarations */
/* Toolkit functions */
IMPORT STATUS muxTkLibInit (void);
IMPORT int muxTkDrvCheck (char * pDevName);
IMPORT PROTO_COOKIE muxTkBind (char * pName, int unit,
FUNCPTR stackRcvRtn,
FUNCPTR stackShutdownRtn,
FUNCPTR stackTxRestartRtn,
VOIDFUNCPTR stackErrorRtn,
long type, char * pProtoName,
void * pNetCallbackId,
void * pNetSvcInfo, void * pNetDrvInfo);
IMPORT STATUS muxTkSend (PROTO_COOKIE cookie, M_BLK_ID pNBuff, char *,
USHORT, void *);
IMPORT STATUS muxTkPollSend (PROTO_COOKIE cookie, M_BLK_ID pNBuff, char *,
USHORT, void *);
IMPORT STATUS muxTkPollReceive (PROTO_COOKIE cookie, M_BLK_ID pNBuff,
void *pSpare);
STATUS muxTkReceive (void * pEndCookie, M_BLK_ID pMblk, long netSvcOffset,
long netSvcType, BOOL uniPromiscuous, void * pSpareData);
IMPORT STATUS muxTkPollReceive2 (void *, M_BLK_ID pNBuff);
IMPORT void * muxTkCookieGet (char *, int);
#ifdef END_STYLE_MULTI_SUPPORT
STATUS muxTkPktsReceive (void* pEndCookie, M_BLK_ID pMblk);
#endif
IMPORT void muxTkOverEndInit (void);
IMPORT void muxTkOverEnd2Init (void);
#ifdef __cplusplus
}
#endif
#endif /* __INCmuxTkLibh */
@@ -0,0 +1,98 @@
/* domain.h - communication domain structure and prototypes */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)domain.h 8.1 (Berkeley) 6/2/93
* $FreeBSD: src/sys/sys/domain.h,v 1.14 1999/12/29 04:24:40 peter Exp $
*/
/*
modification history
--------------------
01j,09sep06,kch Cleanup for IPNet integration.
01i,07feb05,vvv _KERNEL cleanup
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,06aug03,nee Accordion Base6 merge from ACCORDION_BASE6_MERGE_BASELINE
label
01d,03jan03,ann added the prototype for addDomain
01d,02dec02,spm merged from WINDNET_IPV6-1_0-FCS label (ver 01c,06sep02,hsh)
01c,26aug02,kal virtualised and moved to addDomain()
01b,03feb02,ham included cdefs.h for tornado build.
01a,15aug01,ann ported to clarinet from freeBSD 4.3 ver 1.14
*/
#ifndef _SYS_DOMAIN_H_
#define _SYS_DOMAIN_H_
#ifdef _WRS_KERNEL
#include <sys/cdefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structure per communications domain.
*/
/*
* Forward structure declarations for function prototypes [sic].
*/
struct mbuf;
struct domain {
int dom_family; /* AF_xxx */
char *dom_name;
void (*dom_init) /* initialize domain data structures */
__P((void));
int (*dom_externalize) /* externalize access rights */
__P((struct mbuf *));
void (*dom_dispose) /* dispose of internalized rights */
__P((struct mbuf *));
struct protosw *dom_protosw, *dom_protoswNPROTOSW;
struct domain *dom_next;
int (*dom_rtattach) /* initialize routing table */
__P((void **, int));
int dom_rtoffset; /* an arg to rtattach, in bits */
int dom_maxrtkey; /* for routing layer */
};
#ifdef __cplusplus
}
#endif
#endif /* _WRS_KERNEL */
#endif /* _SYS_DOMAIN_H_ */
@@ -0,0 +1,129 @@
/* ethernet.h - ethernet header file */
/* Copyright 2001-2005, 2017 Wind River Systems, Inc. */
/*
* Fundamental constants relating to ethernet.
*
* $FreeBSD: src/sys/net/ethernet.h,v 1.12.2.5 2000/07/19 21:43:52 archie Exp $
*
*/
/*
modification history
--------------------
01n,02feb16,h_l Add PTP ethertype definition
01m,09jan12,h_x Move extern "C" after last header file include.
01l,12sep06,kch Removed reference to struct ifnet.
01k,09sep06,kch Cleanup for IPNet integration.
01j,07feb05,vvv _KERNEL cleanup
01i,20nov03,niq Remove copyright_wrs.h file inclusion
01h,05nov03,cdw Removal of unnecessary _KERNEL guards.
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,20aug03,niq Include cdefs.h for __BEGIN_DECLS definition (to correct
compilation issues
01d,10jun03,vvv include netVersion.h
01c,09sep02,hsh add c++ protection
01b,12sep01,ann adding a definition for ETHERSMALL
01a,07aug01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NET_ETHERNET_H_
#define _NET_ETHERNET_H_
#ifdef _WRS_KERNEL
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* The number of bytes in an ethernet (MAC) address.
*/
#define ETHER_ADDR_LEN 6
/*
* The number of bytes in the type field.
*/
#define ETHER_TYPE_LEN 2
/*
* The number of bytes in the trailing CRC field.
*/
#define ETHER_CRC_LEN 4
/*
* The length of the combined header.
*/
#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
/*
* The minimum packet length.
*/
#define ETHER_MIN_LEN 64
/*
* The maximum packet length.
*/
#define ETHER_MAX_LEN 1518
/*
* A macro to validate a length with
*/
#define ETHER_IS_VALID_LEN(foo) \
((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
/*
* Structure of a 10Mb/s Ethernet header.
*/
struct ether_header {
u_char ether_dhost[ETHER_ADDR_LEN];
u_char ether_shost[ETHER_ADDR_LEN];
u_short ether_type;
};
/*
* Structure of a 48-bit Ethernet address.
*/
struct ether_addr {
u_char octet[ETHER_ADDR_LEN];
};
#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
#define ETHERTYPE_IP 0x0800 /* IP protocol */
#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */
#define ETHERTYPE_IPV6 0x86dd /* IPv6 */
#define ETHERTYPE_PTP 0x88f7 /* PTP */
#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */
/* XXX - add more useful types here */
/*
* The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
* (type-ETHERTYPE_TRAIL)*512 bytes of data followed
* by an ETHER type (as given above) and then the (variable-length) header.
*/
#define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */
#define ETHERTYPE_NTRAILER 16
#define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
#define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN)
/* Clarinet */
#define ETHERSMALL 60
/*
* For device drivers to specify whether they support BPF or not
*/
#define ETHER_BPF_UNSUPPORTED 0
#define ETHER_BPF_SUPPORTED 1
#ifdef __cplusplus
}
#endif
#endif /* _WRS_KERNEL */
#endif /* !_NET_ETHERNET_H_ */
+346
View File
@@ -0,0 +1,346 @@
/* if.h - network interface header file */
/* Copyright 2001 - 2007 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/net/if.h,v 1.58.2.9 2002/08/30 14:23:38 sobomax Exp $
*/
/*
modification history
--------------------
02q,12jan12,h_x Move extern "C" after last header file include.
02p,20dec07,dlk Add IFF_END_MODIFIABLE mask.
02o,04dec06,kch Changed ifru_flags in ifreq to u_short.
02n,25oct06,kch Comment out ifi_hwassist in if_data structure for now.
02m,03oct06,kch Removed unsupported IFF flags for IPNet integration. Also
changed the type for index associated with an ifp from
u_short to u_long.
02l,26sep06,kch Added ifru_ifindex, ifru_vr and ifru_opt members to ifreq
structure. Changed ifru_flags from long to u_short.
02k,12sep06,kch Restore if_nameindex structure definition and prototypes
for if_nametoindex(), if_indextoname(), if_nameindex()
and if_freenameindex().
02j,09sep06,kch Cleanup for IPNet integration.
02i,30aug05,kch Added ifdeladdrreq structure (moved from if.c) (SPR #112068).
02h,17aug05,mcm Including sys/time.h for struct timeval
02g,26jul05,kch Move if_clone structure definition to if_clone.h.
02f,30jun05,wap Move ifi_link_state for binary compatibility
02e,24jun05,wap Add link state support
02d,18feb05,wap Allow sysctl init routines to be scaled out
02c,07feb05,vvv _KERNEL cleanup
02b,14jan05,vvv osdep.h cleanup
02a,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01z,19jul04,niq Move sysctl initialization from configelette to the component
init routine
01y,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01x,09feb04,niq Include if_var.h only in kernel context
01w,14dec03,ijm added IFF_PROXY_ALL for spr#85896,for interface based proxy
01v,20nov03,niq osdep.h cleanup
01u,04nov03,rlm Ran batch header path update for header re-org.
01t,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01s,24oct03,rlm updated #includes for header re-org
01r,15sep03,vvv updated path for new headers
01q,18aug03,nee Merging from ACCORDION_BASE6_MERGE_BASELINE
01p,15may03,spm Tornado 2.2 FCS merge (SPR #69683; ver 01m,10oct01,rae:
TOR2_2-FCS-COPY label, tor2 branch, /wind/river VOB)
01o,09may03,vvv included socket.h
01n,08may03,vvv fixed value for IFF_PPROMISC (SPR #88237)
01m,01may03,spm Tornado 2.2 CP1 merge (from ver 01n,17jan03,vvv:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
01l,01feb03,pas merge from FreeBSD 4.7 - clone, announce interfaces
01k,17sep02,nee added admin control macros
01j,09sep02,hsh add c++ protection
01i,24aug02,nee extended ifnet for admin control;defined admin states for
boot/up/down
01h,12jul02,hsh fix head file for ppc
01g,03feb02,ham modified for tornado build.
01f,16dec01,ann temporarily moving the if_name* declerations out the _KERNEL
condition
01e,24sep01,ppp adding the prototype for if_name and the macro for IFAREF
01d,12sep01,ann adding some IFF flags
01c,11sep01,ann uncomment ifi_lastchange
01b,09sep01,ham changed header file's path, made ifi_lastchange obsolete.
01a,16jul01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef __INCifh
#define __INCifh
#ifdef _WRS_KERNEL
#include <sys/queue.h>
#include <sys/times.h>
#else
#include <sys/time.h>
#endif
#include <sys/socket.h>
#include <cfgDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Length of interface external name, including terminating '\0'.
* Note: this is the same size as a generic device's external name.
*/
#define IFNAMSIZ 16
#define IF_NAMESIZE IFNAMSIZ
/*
* Structure describing information about an interface
* which may be of interest to management entities.
*/
struct if_data {
/* generic interface information */
u_char ifi_type; /* ethernet, tokenring, etc */
u_char ifi_addrlen; /* media address length */
u_char ifi_hdrlen; /* media header length */
u_char ifi_link_state; /* current link state */
u_long ifi_mtu; /* maximum transmission unit */
u_long ifi_metric; /* routing metric (external only) */
u_long ifi_baudrate; /* linespeed */
/* volatile statistics */
u_long ifi_ipackets; /* packets received on interface */
u_long ifi_ierrors; /* input errors on interface */
u_long ifi_opackets; /* packets sent on interface */
u_long ifi_oerrors; /* output errors on interface */
u_long ifi_collisions; /* collisions on csma interfaces */
u_long ifi_ibytes; /* total number of octets received */
u_long ifi_obytes; /* total number of octets sent */
u_long ifi_imcasts; /* packets received via multicast */
u_long ifi_omcasts; /* packets sent via multicast */
u_long ifi_iqdrops; /* dropped on input, this interface */
u_long ifi_noproto; /* destined for unsupported protocol */
#if 0
u_long ifi_hwassist; /* HW offload capabilities */
#endif
struct timeval ifi_lastchange; /* time of last administrative change */
};
#define IFF_UP 0x1 /* interface link is up */
#define IFF_BROADCAST 0x2 /* broadcast address valid */
#define IFF_DEBUG 0x4 /* turn on debugging */
#define IFF_LOOPBACK 0x8 /* is a loopback net */
#define IFF_POINTOPOINT 0x10 /* interface is point-to-point link */
#define IFF_RUNNING 0x40 /* resources allocated */
#define IFF_NOARP 0x80 /* no address resolution protocol */
#define IFF_PROMISC 0x100 /* receive all packets */
#define IFF_ALLMULTI 0x200 /* receive all multicast packets */
#define IFF_OACTIVE 0x400 /* transmission in progress */
#define IFF_SIMPLEX 0x800 /* can't hear own transmissions */
#define IFF_LINK0 0x1000 /* forwarding disabled */
#define IFF_LINK1 0x2000 /* per link layer defined bit */
#define IFF_LINK2 0x4000 /* per link layer defined bit */
#define IFF_ALTPHYS IFF_LINK2 /* use alternate physical connection */
#define IFF_MULTICAST 0x8000 /* supports multicast */
#define IFF_NOTRAILERS 0x20000 /* avoid use of trailers */
/*
* These bits are modifiable for END devices via EIOCSFLAGS.
* For now, we allow modifying some unallocated bits and the IFF_LINK* bits.
* IFF_UP is explicitly NOT modifiable; to start or stop an interface
* at the END level, one must use muxDevStart()/muxDevStop(). The END driver
* controls its own IFF_UP flag in pEnd->flags.
*/
#define IFF_END_MODIFIABLE \
(IFF_DEBUG | IFF_PROMISC | IFF_ALLMULTI | \
IFF_LINK0 | IFF_LINK1 | IFF_LINK2 | \
0xfffd0000)
/*
* Values for if_link_state.
*/
#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */
#define LINK_STATE_DOWN 1 /* link is down */
#define LINK_STATE_UP 2 /* link is up */
/* Capabilities that interfaces can advertise. */
#define IFCAP_RXCSUM 0x0001 /* can offload checksum on RX */
#define IFCAP_TXCSUM 0x0002 /* can offload checksum on TX */
#define IFCAP_NETCONS 0x0004 /* can be a network console */
#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
/*
* Message format for use in obtaining information about interfaces
* from getkerninfo and the routing socket
*/
struct if_msghdr {
u_short ifm_msglen; /* to skip over non-understood messages */
u_char ifm_version; /* future binary compatability */
u_char ifm_type; /* message type */
int ifm_addrs; /* like rtm_addrs */
int ifm_flags; /* value of if_flags */
u_long ifm_index; /* index for associated ifp */
struct if_data ifm_data;/* statistics and other data about if */
};
/*
* Message format for use in obtaining information about interface addresses
* from getkerninfo and the routing socket
*/
struct ifa_msghdr {
u_short ifam_msglen; /* to skip over non-understood messages */
u_char ifam_version; /* future binary compatability */
u_char ifam_type; /* message type */
int ifam_addrs; /* like rtm_addrs */
int ifam_flags; /* value of ifa_flags */
u_long ifam_index; /* index for associated ifp */
int ifam_metric; /* value of ifa_metric */
};
/*
* Message format announcing the arrival or departure of a network interface.
*/
struct if_announcemsghdr {
u_short ifan_msglen; /* to skip over non-understood messages */
u_char ifan_version; /* future binary compatibility */
u_char ifan_type; /* message type */
u_long ifan_index; /* index for associated ifp */
char ifan_name[IFNAMSIZ]; /* if name, e.g. "en0" */
u_short ifan_what; /* what type of announcement */
};
#define IFAN_ARRIVAL 0 /* interface arrival */
#define IFAN_DEPARTURE 1 /* interface departure */
/*
* Interface request structure used for socket
* ioctl's. All interface ioctl's must have parameter
* definitions which begin with ifr_name. The
* remainder may be interface specific.
*/
struct sockaddr;
struct ifreq {
char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
u_short ifru_flags;
int ifru_metric;
int ifru_mtu;
int ifru_ivalue;
int ifru_ifindex;
int ifru_phys;
int ifru_media;
void * ifru_data; /* interface dependent data */
u_short ifru_vr; /* virtual router */
int ifru_opt; /* option: enable=1, disable=0 */
int ifru_cap[2];
char ifru_newname[IFNAMSIZ]; /* if name, e.g. "eth0" */
char ifru_slave[IFNAMSIZ]; /* if name, e.g. "eth0" */
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#define ifr_flags ifr_ifru.ifru_flags /* flags */
#define ifr_metric ifr_ifru.ifru_metric /* metric */
#define ifr_ifindex ifr_ifru.ifru_ifindex /* Interface index */
#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
#define ifr_phys ifr_ifru.ifru_phys /* physical wire */
#define ifr_media ifr_ifru.ifru_media /* physical media */
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
#define ifr_vr ifr_ifru.ifru_vr /* Interpeak virtual router extension*/
#define ifr_opt fr_ifru.ifru_opt /* Interpeak option extension */
#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested capabilities */
#define ifr_curcap ifr_ifru.ifru_cap[1] /* current capabilities */
};
#define _SIZEOF_ADDR_IFREQ(ifr) \
((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
(sizeof(struct ifreq) - sizeof(struct sockaddr) + \
(ifr).ifr_addr.sa_len) : sizeof(struct ifreq))
struct ifaliasreq {
char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
struct sockaddr ifra_addr;
struct sockaddr ifra_broadaddr;
struct sockaddr ifra_mask;
};
struct ifmediareq {
char ifm_name[IFNAMSIZ]; /* if name, e.g. "en0" */
int ifm_current; /* current media options */
int ifm_mask; /* don't care mask */
int ifm_status; /* media status */
int ifm_active; /* active options */
int ifm_count; /* # entries in ifm_ulist array */
int *ifm_ulist; /* media words */
};
/*
* Structure used in SIOCGIFCONF request.
* Used to retrieve interface configuration
* for machine (useful for programs which
* must know all networks accessible).
*/
struct ifconf {
int ifc_len; /* size of associated buffer */
union {
caddr_t ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
};
struct if_nameindex {
u_int if_index; /* 1, 2, ... */
char *if_name; /* null terminated name: "le0", ... */
};
u_int if_nametoindex __P((const char *));
char *if_indextoname __P((u_int, char *));
struct if_nameindex *if_nameindex __P((void));
void if_freenameindex __P((struct if_nameindex *));
#ifdef __cplusplus
}
#endif
#ifdef _WRS_KERNEL
#include <net/if_var.h>
#endif /* _WRS_KERNEL */
#endif /* !__INCifh */
@@ -0,0 +1,164 @@
/* if_arp.h - network interface address resolution protocol header file */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_arp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/net/if_arp.h,v 1.14.2.3 2002/02/20 23:34:09 fjoe Exp $
*/
/*
modification history
--------------------
01r,20nov06,kch Removed unused arcbroadcastaddr extern declaration.
01q,24oct06.kch Changed arp_ha in arpreq strcture from sockaddr to
sockaddr_dl. Removed unsupported ATF flags and added
ATF_GRAT and ATF_BLACKHOLE.
01p,09sep06,kch Cleanup for IPNet integration.
01o,07feb05,vvv _KERNEL cleanup
01n,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01m,20nov03,niq Remove copyright_wrs.h file inclusion
01l,05nov03,cdw Removal of unnecessary _KERNEL guards.
01k,04nov03,rlm Ran batch header path update for header re-org.
01j,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01i,27oct03,rlm update include statements post header re-org.
01h,06aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01g,09may03,vvv included socket.h and if.h
01h,07mar03,spm merged from CLARINET-1_1-KAME-UPDATE (ver 01f,01feb03,pas)
01g,02dec02,spm merged from WINDNET_IPV6-1_0-FCS label (ver 01e,09sep02,hsh)
01f,27aug02,kal inclusion of in.h for struct in_addr (in arpcom)
01e,23aug02,vlk added ac_ipaddr item into "arpcom" struct
and ATF_INCOMPLETE definition
01d,03feb02,ham changes for tornado build.
01c,09dec01,ppp adding ATF_PROXY flag
01b,20aug01,qli moving the element to protos/arp
01a,12aug01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NET_IF_ARP_H_
#define _NET_IF_ARP_H_
/* includes */
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if_dl.h>
#include <net/if.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Address Resolution Protocol.
*
* See RFC 826 for protocol description. ARP packets are variable
* in size; the arphdr structure defines the fixed-length portion.
* Protocol type values are the same as those for 10 Mb/s Ethernet.
* It is followed by the variable-sized fields ar_sha, arp_spa,
* arp_tha and arp_tpa in that order, according to the lengths
* specified. Field names used correspond to RFC 826.
*/
struct arphdr {
u_short ar_hrd; /* format of hardware address */
#define ARPHRD_ETHER 1 /* ethernet hardware format */
#define ARPHRD_EETHER 2 /* experimental ethernet format */
#define ARPHRD_AX25 3 /* AX.25 Level 2 */
#define ARPHRD_PRONET 4 /* PROnet token ring */
#define ARPHRD_CHAOS 5 /* Chaosnet */
#define ARPHRD_IEEE802 6 /* token-ring hardware format */
#define ARPHRD_ARCNET 7 /* arcnet hardware format */
#define ARPHRD_HYPERCH 8 /* Hyper channel */
#define ARPHRD_LANSTAR 9 /* LanStar */
#define ARPHRD_ULTRALINK 13 /* UltraLink */
#define ARPHRD_FRELAY 15 /* frame relay hardware format */
#define ARPHRD_DLCI ARPHRD_FRELAY
#define ARPHRD_ATM 19 /* ATM */
#define ARPHRD_METRICOM 23 /* Metricom STRIP (new IANA id) */
#define ARPHRD_IEEE1394 24 /* IEEE 1394 IPv4 - RFC 2734 */
#define ARPHRD_EUI64 27 /* EUI-64 */
u_short ar_pro; /* format of protocol address */
u_char ar_hln; /* length of hardware address */
u_char ar_pln; /* length of protocol address */
u_short ar_op; /* one of: */
#define ARPOP_REQUEST 1 /* request to resolve address */
#define ARPOP_REPLY 2 /* response to previous request */
#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
#define ARPOP_REVREPLY 4 /* response giving protocol address */
#define ARPOP_INVREQUEST 8 /* request to identify peer */
#define ARPOP_INVREPLY 9 /* response identifying peer */
/*
* The remaining fields are variable in size,
* according to the sizes above.
*/
#ifdef COMMENT_ONLY
u_char ar_sha[]; /* sender hardware address */
u_char ar_spa[]; /* sender protocol address */
u_char ar_tha[]; /* target hardware address */
u_char ar_tpa[]; /* target protocol address */
#endif
};
#define ar_sha(ap) (((caddr_t)((ap)+1)) + 0)
#define ar_spa(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln)
#define ar_tha(ap) (((caddr_t)((ap)+1)) + (ap)->ar_hln + (ap)->ar_pln)
#define ar_tpa(ap) (((caddr_t)((ap)+1)) + 2*(ap)->ar_hln + (ap)->ar_pln)
#define arphdr_len2(ar_hln, ar_pln) \
(sizeof(struct arphdr) + 2*(ar_hln) + 2*(ar_pln))
#define arphdr_len(ap) (arphdr_len2((ap)->ar_hln, (ap)->ar_pln))
/*
* ARP ioctl request
*/
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr_dl arp_ha; /* hardware address */
int arp_flags; /* flags */
};
/* arp_flags and at_flags field values */
#define ATF_COM 0x02 /* completed entry (enaddr valid) */
#define ATF_PERM 0x04 /* permanent entry */
#define ATF_PUBL 0x08 /* publish entry (respond for other host) */
#define ATF_GRAT 0x100 /* send gratuitous ARP request */
#define ATF_BLACKHOLE 0x200 /* set blackhole flag on entry */
extern u_char etherbroadcastaddr[6];
#ifdef __cplusplus
}
#endif
#endif /* !_NET_IF_ARP_H_ */
+106
View File
@@ -0,0 +1,106 @@
/* if_dl.h - data link level structure header file */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_dl.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/net/if_dl.h,v 1.10 2000/03/01 02:46:25 archie Exp $
*/
/*
modification history
--------------------
01k,09jan12,h_x Move extern "C" after last header file include.
01j,02oct06,kch Removed the unsupported source routing members from the
sockaddr_dl structure.
01i,28sep06,kch Removed unsupported prototypes.
01h,07feb05,vvv _KERNEL cleanup
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,09sep02,hsh add c++ protection
01a,12jul01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NET_IF_DL_H_
#define _NET_IF_DL_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* A Link-Level Sockaddr may specify the interface in one of two
* ways: either by means of a system-provided index number (computed
* anew and possibly differently on every reboot), or by a human-readable
* string such as "il0" (for managerial convenience).
*
* Census taking actions, such as something akin to SIOCGCONF would return
* both the index and the human name.
*
* High volume transactions (such as giving a link-level ``from'' address
* in a recvfrom or recvmsg call) may be likely only to provide the indexed
* form, (which requires fewer copy operations and less space).
*
* The form and interpretation of the link-level address is purely a matter
* of convention between the device driver and its consumers; however, it is
* expected that all drivers for an interface of a given if_type will agree.
*/
/*
* Structure of a Link-Level sockaddr:
*/
struct sockaddr_dl {
u_char sdl_len; /* Total length of sockaddr */
u_char sdl_family; /* AF_LINK */
u_short sdl_index; /* if != 0, system given index for interface */
u_char sdl_type; /* interface type */
u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
u_char sdl_alen; /* link level address length */
u_char sdl_slen; /* link layer selector length */
char sdl_data[12]; /* minimum work area, can be larger;
contains both if name and ll address */
};
#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
#ifdef __cplusplus
}
#endif
#endif
+124
View File
@@ -0,0 +1,124 @@
/* if_ll.h - layer 2 link level structure header file */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,30nov06,kch Created.
*/
#ifndef _NET_IF_LL_H_
#define _NET_IF_LL_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Frame Values
* Used for 3rd argument to when creating packet sockets.
*/
#define NET_ETH_P_ALL 0
#define NET_ETH_P_IP 0x0800
#define NET_ETH_P_ARP 0x0806
#define NET_ETH_P_RARP 0x8035
#define NET_ETH_P_IPV6 0x86DD
#define NET_ETH_P_PPPOE_DIS 0x8863
#define NET_ETH_P_PPPOE_SES 0x8864
#define NET_ETH_P_8021Q_VLAN 0x8100
#define NET_ETH_P_MPLS_UNICAST 0x8847
#define NET_ETH_P_MPLS_MULTICAST 0x8848
/* Packet types 'sll_pkttype'. Packet is addressed to: */
#define PACKET_HOST 1 /* this host */
#define PACKET_BROADCAST 2 /* all hosts on this link */
#define PACKET_MULTICAST 3 /* a multicast group this host is a member of */
#define PACKET_OTHERHOST 4 /* someone else */
#define PACKET_OUTGOING 5 /* Packet was sent and read back */
/*
* The link level sockaddr is a device independent physical layer address.
* It is used for packet socket to receive or send raw packets at the
* Layer 2.
*
* When using the packet socket, the socket type is either SOCK_RAW for
* raw packets including the link level header or SOCK_DGRAM for cooked
* packets with the link level header removed. The link level header
* information is available in a common format in an sockaddr_ll. Allowed
* values for Ethernet are any of the NET_ETH_P_xxx constants in network
*
* When protocol is set to htons(NET_ETH_P_ALL), then all protocols are
* received. All incoming packets of that protocol type will be passed to
* the packet socket before they are passed to the protocols implemented in
* SOCK_RAW packets are passed to and from the device driver without any
* changes in the packet data. When receiving a packet, the address is still
* parsed and passed in a standard sockaddr_ll address structure. When
* transmitting a packet, the user-supplied buffer must contain the physical
* layer header. That packet is then queued, unmodified, to the network
* driver of the interface defined by the destination address.
*
* SOCK_DGRAM operates on a slightly higher level. The physical header is
* removed before the packet is passed to the user. Packets sent through a
* SOCK_DGRAM packet socket get a suitable physical layer header based on
* the information in the sockaddr_ll destination address before they are
* queued.
*
* When sending packets using a packet socket, it is enough to specify
* sll_family, sll_addr, sll_halen and sll_ifindex. All other fields
* should be set to 0. The sll_hatype and sll_pkttype are set on
* received packets.
*
* The connect() operation is not supported on packet sockets.
*/
struct sockaddr_ll
{
u_int8_t sll_len; /* Length of this structure */
u_int8_t sll_family; /* Always AF_PACKET */
/*
* Link layer protocol (frame type) in network order, not used when
* sending frames on an SOCK_RAW type socket
*/
u_int16_t sll_protocol;
u_int32_t sll_ifindex; /* Interface index, must not be zero */
/* Link layer type (IFT_xxx), only used for received frames */
u_int16_t sll_hatype;
/*
* Packet type (PACKET_xxx), only used for received frames. Valid
* types are:
* PACKET_HOST - for packets addressed to the local host
* PACKET_BROADCAST - for physical layer broadcast packets to all
* hosts on this link
* PACKET_MULTICAST - for packets sent to a physical layer multicast
* address
* PACKET_OTHERHOST - for packets send to some other host that has
* been caught by a device driver in promiscuous
* mode
* PACKET_OUTGOING - for packets originated from local host that
* is looped back to a packet socket.
*/
u_int8_t sll_pkttype;
u_int8_t sll_halen; /* Length of link layer address */
u_int8_t sll_addr[8]; /* Link layer address */
};
#ifdef __cplusplus
}
#endif
#endif /* _NET_IF_LL_H_ */
@@ -0,0 +1,173 @@
/* if.h - network interface header file */
/* Copyright 2001-2004 Wind River Systems, Inc. */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_llc.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/net/if_llc.h,v 1.7 1999/08/28 00:48:18 peter Exp $
*/
/*
modification history
--------------------
01i,09jan12,h_x Move extern "C" after last header file include.
01h,10nov04,syy Fix SPR#103861
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,09sep02,hsh add c++ protection
01a,10aug01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NET_IF_LLC_H_
#define _NET_IF_LLC_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* IEEE 802.2 Link Level Control headers, for use in conjunction with
* 802.{3,4,5} media access control methods.
*
* Headers here do not use bit fields due to shortcomings in many
* compilers.
*/
struct llc {
u_char llc_dsap;
u_char llc_ssap;
union {
struct {
u_char control;
u_char format_id;
u_char llc_class;
u_char window_x2;
} type_u;
struct {
u_char num_snd_x2;
u_char num_rcv_x2;
} type_i;
struct {
u_char control;
u_char num_rcv_x2;
} type_s;
struct {
u_char control;
struct frmrinfo {
u_char rej_pdu_0;
u_char rej_pdu_1;
u_char frmr_control;
u_char frmr_control_ext;
u_char frmr_cause;
} frmrinfo;
} type_frmr;
struct {
u_char control;
u_char org_code[3];
u_short ether_type;
} type_snap;
struct {
u_char control;
u_char control_ext;
} type_raw;
} llc_un;
};
#define llc_control llc_un.type_u.control
#define llc_control_ext llc_un.type_raw.control_ext
#define llc_fid llc_un.type_u.format_id
#define llc_class llc_un.type_u.llc_class
#define llc_window llc_un.type_u.window_x2
#define llc_frmrinfo llc_un.type_frmr.frmrinfo
#define llc_frmr_pdu0 llc_un.type_frmr.frmrinfo.rej_pdu0
#define llc_frmr_pdu1 llc_un.type_frmr.frmrinfo.rej_pdu1
#define llc_frmr_control llc_un.type_frmr.frmrinfo.frmr_control
#define llc_frmr_control_ext llc_un.type_frmr.frmrinfo.frmr_control_ext
#define llc_frmr_cause llc_un.type_frmr.frmrinfo.frmr_control_ext
/*
* Don't use sizeof(struct llc_un) for LLC header sizes
*/
#define LLC_ISFRAMELEN 4
#define LLC_UFRAMELEN 3
#define LLC_FRMRLEN 7
/*
* Unnumbered LLC format commands
*/
#define LLC_UI 0x3
#define LLC_UI_P 0x13
#define LLC_DISC 0x43
#define LLC_DISC_P 0x53
#define LLC_UA 0x63
#define LLC_UA_P 0x73
#define LLC_TEST 0xe3
#define LLC_TEST_P 0xf3
#define LLC_FRMR 0x87
#define LLC_FRMR_P 0x97
#define LLC_DM 0x0f
#define LLC_DM_P 0x1f
#define LLC_XID 0xaf
#define LLC_XID_P 0xbf
#define LLC_SABME 0x6f
#define LLC_SABME_P 0x7f
/*
* Supervisory LLC commands
*/
#define LLC_RR 0x01
#define LLC_RNR 0x05
#define LLC_REJ 0x09
/*
* Info format - dummy only
*/
#define LLC_INFO 0x00
/*
* ISO PDTR 10178 contains among others
*/
#define LLC_X25_LSAP 0x7e
#define LLC_SNAP_LSAP 0xaa
#define LLC_ISO_LSAP 0xfe
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,99 @@
/* if_types.h - interface types header file */
/* Copyright 2001 - 2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1989, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_types.h 8.3 (Berkeley) 4/28/95
* $FreeBSD: src/sys/net/if_types.h,v 1.8.2.4 2002/12/23 23:02:21 kbyanc Exp $
* $FreeBSD: src/sys/net/if_types.h,v 1.8.2.3 2001/07/03 11:01:41 ume Exp $
*/
/*
modification history
--------------------
01o,09jan12,h_x Move extern "C" after last header file include.
01n,20nov06,kch Updated interface types.
01m,25oct06,kch Removed unsupported interface types. Also corrected macro
mismatched for certain interface types.
01l,24may05,kch Comment out IFT_IST define for now.
01k,13may05,kch Merged from FreeBSD v 1.8.2.4.
01j,20nov03,niq Remove copyright_wrs.h file inclusion
01i,05nov03,cdw Removal of unnecessary _KERNEL guards.
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,08aug03,nee Merging from label ACCORDION_BASE6_MERGE_BASELINE in
accordion codeline to Base6
01e,10jun03,vvv include netVersion.h
01d,15may03,spm Tornado 2.2 FCS merge (SPR #76443; ver 01d,16may02,vvv:
TOR2_2-FCS-COPY label, tor2 branch, /wind/river VOB)
01c,09may03,spm T2.2 FCS merge.
01b,09sep02,hsh add c++ protection
01a,16jul01,ham created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NET_IF_TYPES_H_
#define _NET_IF_TYPES_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interface types for benefit of parsing media address headers.
* This list is derived from the SNMP list of ifTypes, originally
* documented in RFC1573, now maintained as:
*
* ftp.isi.edu/in-notes/iana/assignments/smi-numbers
*/
#define IFT_OTHER 0x1 /* none of the following */
#define IFT_ETHER 0x6 /* Ethernet CSMA/CD */
#define IFT_PPP 0x17 /* RFC 1331 */
#define IFT_LOOP 0x18 /* loopback */
#define IFT_IEEE80211 0x47 /* Radio spread spectrum */
#define IFT_MPLS_TUNNEL 0x83 /* MPLS tunnel interface */
#define IFT_L2VLAN 0x87 /* Layer 2 Virtual LAN using 802.1Q */
#define IFT_PPPOE 0xf0 /* PPPoE */
#define IFT_TUNNEL 0xf1 /* IP over IP tunnel */
#define IFT_SOCKDEV 0xf2 /* Device that has a 1-to-1 mapping to a
socket in the IP_AF_SOCKDEV domain */
#ifdef __cplusplus
}
#endif
#endif /* __INCif_typesh */
@@ -0,0 +1,194 @@
/* if_var.h - network interface variable header file */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* From: @(#)if.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/net/if_var.h,v 1.98.2.5 2005/10/07 14:00:05 glebius Exp $
* $FreeBSD: src/sys/net/if_var.h,v 1.62 2003/11/12 03:14:29 rwatson Exp $
* $FreeBSD: src/sys/net/if_var.h,v 1.18.2.15 2002/06/28 12:36:54 luigi Exp $
*/
/*
modification history
--------------------
02p,09jan12,h_x Move extern "C" after last header file include.
02o,25oct06,kch Removed unused forward declarations.
02n,28sep06,kch Removed struct ifnet since it is not supported by IPNet.
02m,10sep06,kch Temporarily restore the ifnet structure.
02l,10sep06,kch Restore all IF_XXX queue related macros.
02k,09sep06,kch Cleanup for IPNet integration.
02j,08feb06,kch Added IFQ_LOCK_ASSERT() macro and define it as noop.
02i,06jan06,kch Integrated FreeBSD 6.0 ALTQ implementation.
02h,21sep05,kch Added if_xname[] to ifnet structure, introduced if_name()
macro to replace if_name() routine for backward compatibility.
Also added if_initname() prototype (merged from FreeBSD 5.x
if_var.h,v 1.84.2.6) (SPR #112724).
02g,29aug05,kch Added if_nvlans counter to ifnet structure (SPR #112068).
02f,26aug05,dlk Add section tags.
02e,26aug05,kch Removed pTagData pointer from ifnet structure.
02d,12aug05,kch Moved ifclone prototypes to if_clone.h.
02c,04aug05,vvv clarified comments for if_index and ifIndex (SPR #106657)
02b,16jul05,dlk Added intrqFlush() declaration for VIRTUAL_STACK case.
02a,25jun05,dlk Added INTRQ_QJOB definition.
01z,24jun05,wap Add link state support
01y,09may05,vvv added include for if.h
01x,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01w,07feb05,vvv _KERNEL cleanup
01v,10sep04,kc Added VLAN_TAG define to protect pTagData in ifnet structure.
01u,12jul04,vvv fixed compiler warning
01t,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01s,14may04,kc Added pTagData to struct ifnet for L2 VLAN Tagging support.
01r,25feb04,nee Adding if6_resolve to ifnet
01q,24feb04,dlk Add closing brace if __cplusplus is defined.
01p,03feb04,wap Add extra structure fields for checksum offload support
01o,02feb04,dlk Restore interface output queues (repair IF_ENQUEUE()).
01n,20nov03,niq osdep.h cleanup
01m,04nov03,rlm Ran batch header path update for header re-org.
01l,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01k,23oct03,rlm updated #includes for header re-org
01j,24sep03,kkz Rebasing with BASE6_ITER2_FRZ7 - added IF_DEQUEUEIF macro
01i,08aug03,nee Merging from label ACCORDION_BASE6_MERGE_BASELINE in
accordion codeline to Base6
01h,01feb03,pas merge from FreeBSD 4.7 - added clone support, polling;
changed if_queue_drop() to if_handoff()
01g,18sep02,nee removed ifr_type from ifreq structure
01f,09sep02,hsh add c++ protection
01e,24aug02,nee extended ifnet for admin control;defined admin states for
boot/up/down
01d,13feb02,ham changed for tornado build.
01c,06oct01,ann removing the prototypes for ether_output and
ether_output_frame
01b,11sep01,ann adding the if_resolve func pointer that is missing
01a,16jul01,ham created from FreeBSD4.3.
*/
#ifndef _NET_IF_VAR_H_
#define _NET_IF_VAR_H_
#include <sys/queue.h> /* get TAILQ macros */
#include <net/mbuf.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structure defining a queue for a network interface.
*/
struct ifqueue {
struct mbuf *ifq_head;
struct mbuf *ifq_tail;
int ifq_len;
int ifq_maxlen;
int ifq_drops;
};
/*
* Output queues (ifp->if_snd) and slow device input queues (*ifp->if_slowq)
* are queues of messages stored on ifqueue structures
* (defined above). Entries are added to and deleted from these structures
* by these macros, which should be called with ipl raised to splimp().
*/
#define IF_QFULL(ifq) ((ifq)->ifq_len >= (ifq)->ifq_maxlen)
#define IF_DROP(ifq) ((ifq)->ifq_drops++)
#define IF_ENQUEUE(ifq, m) \
do { \
(m)->m_nextpkt = 0; \
if ((ifq)->ifq_tail == 0) \
(ifq)->ifq_head = m; \
else \
(ifq)->ifq_tail->m_nextpkt = m; \
(ifq)->ifq_tail = m; \
(ifq)->ifq_len++; \
} while (0)
#define IF_PREPEND(ifq, m) { \
(m)->m_nextpkt = (ifq)->ifq_head; \
if ((ifq)->ifq_tail == 0) \
(ifq)->ifq_tail = (m); \
(ifq)->ifq_head = (m); \
(ifq)->ifq_len++; \
}
#define IF_DEQUEUE(ifq, m) { \
(m) = (ifq)->ifq_head; \
if (m) { \
if (((ifq)->ifq_head = (m)->m_nextpkt) == 0) \
(ifq)->ifq_tail = 0; \
(m)->m_nextpkt = 0; \
(ifq)->ifq_len--; \
} \
}
#ifdef _WRS_KERNEL
/*
* #define _IF_QFULL for compatibility with -current
*/
#define _IF_QFULL(ifq) IF_QFULL(ifq)
/*
* The following macros are defined to eliminate direct references to the
* interface output queue
*/
#define IFQ_IS_EMPTY(ifq) ((ifq)->ifq_len == 0)
#define IFQ_INC_LEN(ifq) ((ifq)->ifq_len++)
#define IFQ_DEC_LEN(ifq) (--(ifq)->ifq_len)
#define IFQ_INC_DROPS(ifq) IF_DROP(ifq)
#define IFQ_SET_MAXLEN(ifq, len) ((ifq)->ifq_maxlen = (len))
/*
* 72 was chosen below because it is the size of a TCP/IP
* header (40) + the minimum mss (32).
*/
#define IF_MINMTU 72
#define IF_MAXMTU 65535
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* !_NET_IF_VAR_H_ */
@@ -0,0 +1,64 @@
/* Copyright 2005-2007 Wind River Systems, Inc. */
/*
* Copyright 1998 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
* granted, provided that both the above copyright notice and this
* permission notice appear in all copies, that both the above
* copyright notice and this permission notice appear in all
* supporting documentation, and that the name of M.I.T. not be used
* in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. M.I.T. makes
* no representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
* SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/net/if_vlan_var.h,v 1.5.2.4 2004/09/09 16:57:33 yar Exp $
*/
/*
modification history
--------------------
01e,11jul07,kch Restore vlan priority support to vlanreq structure.
01d,12dec06,kch Cleanup for IPNet integration.
01c,27aug05,kch Added vlr_upriority and vlr_flags to vlanreq structure.
01b,19aug05,kch Removed vlan tag macros.
01a,28jul05,kch Ported from FreeBSD.
*/
#ifndef _NET_IF_VLAN_VAR_H_
#define _NET_IF_VLAN_VAR_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Configuration structure for SIOCSETVLAN and SIOCGETVLAN ioctls.
*/
struct vlanreq {
char vlr_parent[IFNAMSIZ];
u_short vlr_tag; /* 12-bit vlan id, 1..4094, 0 for priority-tagged */
u_short vlr_pri; /* 3-bit vlan priority, 0..7 */
};
#ifdef __cplusplus
}
#endif
#endif /* _NET_IF_VLAN_VAR_H_ */
@@ -0,0 +1,87 @@
/* ifaddrs.h - structure and routines for interface addresses */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/* $KAME: ifaddrs.h,v 1.3 2001/01/26 08:14:55 itojun Exp $ */
/*
* Copyright (c) 1995, 1999
* Berkeley Software Design, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
*/
/*
modification history
--------------------
01f,20nov06,kch Added ifu_dstaddr to ifaddrs struct for compatibility with
IPNET. Also restored getifaddrs and freeifaddrs prototypes.
01e,28sep06,kch Removed unsupported prototypes for IPNet integration.
01d,24may05,vvv updated for user-side builds
01c,20nov03,niq Remove copyright_wrs.h file inclusion
01b,06nov03,rlm Ran batch header update for header re-org.
01a,29apr03,syy Added #ifdef for __cplusplus
*/
#ifndef __INCifaddrsh
#define __INCifaddrsh
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
struct ifaddrs {
struct ifaddrs *ifa_next;
char *ifa_name;
u_int ifa_flags;
struct sockaddr *ifa_addr;
struct sockaddr *ifa_netmask;
union {
struct sockaddr *ifu_broadaddr;
struct sockaddr *ifu_dstaddr;
} ifa_ifu;
#ifndef ifa_broadaddr
#define ifa_broadaddr ifa_ifu.ifu_broadaddr
#endif
#ifndef ifa_dstaddr
#define ifa_dstaddr ifa_ifu.ifu_dstaddr
#endif
void *ifa_data;
};
/*
* This may have been defined in <net/if.h>. Note that if <net/if.h> is
* to be included it must be included before this header file.
*/
#ifndef ifa_broadaddr
#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */
#endif
extern int getifaddrs __P((struct ifaddrs **));
extern void freeifaddrs __P((struct ifaddrs *));
#ifdef __cplusplus
}
#endif
#endif /* ! __INCifaddrsh */
+566
View File
@@ -0,0 +1,566 @@
/* mbuf.h - mbuf header file */
/* Copyright 2001-2006, 2008 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
* $FreeBSD: src/sys/sys/mbuf.h,v 1.44.2.26 2004/06/17 00:08:21 fjoe Exp $
*/
/*
modification history
--------------------
02p,22may12,dhe M_COPY_PKTHDR() now copies also offset2 field.
02o,09jan12,h_x Move extern "C" after last header file include.
02n,18mar08,dlk Added CSUM_IPHDR_OFFSET(). Modified CSUM_IPHDR_LEN() to
use mBlkHdr.offset2 instead of mBlkHdr.offset1.
02m,27dec06,kch Removed references to the obsolete coreip virtual stack.
02l,12sep06,kch Replaced (struct ifnet *) with (void *) for m_devget()
prototype.
02k,15sep05,kch Added CSUM_PTAGGED for 802.1P priority-tagged frame support
(SPR #112513).
02j,07sep05,kch Removed CSUM_NOVLAN (SPR #112068).
02i,01sep05,sar Add M_WRITEABLE check to M_LEADINGSPACE and
M_TRAILINGSPACE to ensure we don't overwrite
part of a buffer that we shouldn't.
02h,28jul05,dlk Added CSUM_VLAN and CSUM_NOVLAN.
02g,12jul05,vvv merged M_NOTIFICATION from kame-20050404-freebsd411
02f,17jun05,dlk Make m_copym(), m_copypacket(), and m_copydata() macros also.
02e,16may05,dlk Make m_freem() and m_free() macros for better performance.
02d,22apr05,kch Fixed diab compilation error for MCLGET1() macro.
02c,07feb05,vvv _KERNEL cleanup
02b,24jan05,vvv osdep.h cleanup
02a,20jan05,sar Removal of unused m_dup routine.
01z,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01y,01jul04,vvv fixed warnings
01x,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01w,05feb04,wap Make M_COPY_PKTHDR() preserve extra fields in mBlkHdr
01v,06jan04,vvv removed dtom, modified allocation macros to not store mbuf
back-pointer (SPR #88742)
01u,20nov03,niq Remove copyright_wrs.h file inclusion
01t,04nov03,rlm Ran batch header path update for header re-org.
01s,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01r,27oct03,cdw update include statements post header re-org.
01q,18aug03,nee Merging from ACCORDION_BASE6_MERGE_BASELINE. Only
virtualixation related changes are being merged in.
01p,09jul03,syy Back out the previous fix to SPR#88742
01o,06jun03,pas fix M_LEADINGSPACE to account for hidden back-ptr (SPR#88742)
01n,14may03,vvv make routines available when _KERNEL is not defined
01m,01may03,spm Tornado 2.2 CP1 merge (from ver 01n,21mar02,vvv:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
01l,15apr03,syy Fixed Diab compiler warnings
01k,01feb03,pas merge from FreeBSD 4.7 - added packet tags
01j,30sep02,sar Add M_SECURE_PKT to the list of mflags
01i,23aug02,ann extended MGETHDR1 and MGET1 to recognize bestfit and closefit
01h,20jun02,ann redefined MGET1/MGETHDR1/MCLGET1
01g,07jun02,pas new version of MGET/MGETHDR/MCLGET takes size argument
01f,29apr02,deg back to old netBufLib
01e,22mar02,deg MFREE auxiliary chain freeing removed (moved to _mBlkFree())
01d,06feb02,ham changed for tornado build.
01c,05feb02,deg bugfix in MCLGET()
01b,11dec01,ppp correcting m_pktdat
01a,08sep01,qli fixed mtod
01a,09aug01,deg written.
*/
#ifndef __INCNewMbufh
#define __INCNewMbufh
#ifdef _WRS_KERNEL
#include <netBufLib.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Note that any file which uses _pNetDpool or _pNetSysPool, either directly
* or via the macros (MGET1 etc) MUST include vsNetCore.h for Virtual Stack.
*/
extern NET_POOL_ID _pNetDpool; /* network data pool */
extern NET_POOL_ID _pNetSysPool; /* network system pool */
extern M_CL_CONFIG pktMblkClBlkDesc; /* mBlk, clBlk configuration */
extern CL_DESC pktClDescTbl []; /* cluster configuration */
extern UINT pktClDescTblNumEnt; /* no. elements in the table */
extern M_CL_CONFIG sysMblkClBlkDesc; /* mBlk, clBlk configuration */
extern CL_DESC sysClDescTbl []; /* cluster configuration */
extern UINT sysClDescTblNumEnt; /* no. elements in the table */
/*
* Mbufs are of a single size, MSIZE (machine/param.h), which
* includes overhead. An mbuf may add a single "mbuf cluster" of size
* MCLBYTES (also in machine/param.h), which has no additional overhead
* and is used instead of the internal data area; this is done when
* at least MINCLSIZE of data must be stored.
*/
#define SIMCLSIZE 128 /* cluster size to simulate mbuf data space */
#define MCLBYTES 2048 /* mbuf cluster size */
#define MLEN SIMCLSIZE
#define MHLEN MLEN
#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */
/*
* Macro for type conversion
* mtod(m, t) - convert mbuf pointer to data pointer of correct type
*/
#define mtod(m, t) ((t)((m)->m_data))
/* Clarinet defs */
#define mbuf mBlk
#define m_next mBlkHdr.mNext
#define m_len mBlkHdr.mLen
#define m_data mBlkHdr.mData
#define m_type mBlkHdr.mType
#define m_flags mBlkHdr.mFlags
#define m_nextpkt mBlkHdr.mNextPkt
#define m_act m_nextpkt
#define m_pkthdr mBlkPktHdr
#define m_ext pClBlk
#define m_hdr mHdr
#define mh_next mNext
#define mh_nextpkt mNextPkt
#define mh_data mData
#define mh_len mLen
#define mh_type mType
#define mh_flags mFlags
#define m_extBuf m_ext->clNode.pClBuf
#define m_extSize m_ext->clSize
#define m_extRefCnt m_ext->clRefCnt
#define m_extFreeRtn m_ext->pClFreeRtn
#define m_extArg1 m_ext->clFreeArg1
#define m_extArg2 m_ext->clFreeArg2
#define m_extArg3 m_ext->clFreeArg3
/*
* It is not possible to port m_ext.ext_buf and m_ext.ext_free
* Change your code :
* m_ext.ext_buf to m_extBuf
* m_ext.ext_free to m_extFreeRtn
*/
#define m_pktdat m_ext->clNode.pClBuf
#define m_dat m_ext->clNode.pClBuf
#define M_PROTO1 0x0008 /* protocol-specific */
#define M_PROTO2 0x0010 /* protocol-specific */
#define M_PROTO3 0x0020 /* protocol-specific */
#define M_PROTO4 0x0040 /* protocol-specific */
/* The M_PROTO5 flag has been removed to allow the bit to be
* used as the SECURE_PKT bit. The define has been left in
* as part of the history of the file and should be removed
* in the future.
* sar
*/
#if 0
#define M_PROTO5 0x0080 /* protocol-specific */
#endif
#define M_SECURE_PKT 0x0080 /* For use by Wind River IPSec product */
#define M_FRAG 0x0400 /* packet is a fragment of a larger packet */
#define M_FIRSTFRAG 0x0800 /* packet is first fragment */
#define M_LASTFRAG 0x1000 /* packet is last fragment */
#define M_NOTIFICATION 0x8000 /* notification event */
/* flags copied when copying m_pkthdr */
#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_PROTO1|M_PROTO2|M_PROTO3 | \
M_PROTO4|M_SECURE_PKT|M_BCAST|M_MCAST|M_FRAG)
/* flags indicating hw checksum support and sw checksum requirements */
#define CSUM_IP 0x0001 /* will csum IP */
#define CSUM_TCP 0x0002 /* will csum TCP */
#define CSUM_UDP 0x0004 /* will csum UDP */
#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */
#define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */
#define CSUM_TCP_SEG 0x0020 /* will segment TCP/IPv4 */
#define CSUM_TCPv6 0x0040 /* will csum TCP/IPv6 */
#define CSUM_UDPv6 0x0080 /* will csum UDP/IPv6 */
#define CSUM_TCPv6_SEG 0x0100 /* will csum TCP/IPv6 */
#define CSUM_VLAN 0x0200 /* insert or extracted VLAN */
#define CSUM_PTAGGED 0x0400 /* send priority-tagged frame */
#define CSUM_IP_CHECKED 0x1000 /* did csum IP */
#define CSUM_IP_VALID 0x2000 /* ... the csum is valid */
#define CSUM_DATA_VALID 0x4000 /* csum_data field is valid */
#define CSUM_PSEUDO_HDR 0x8000 /* csum_data has pseudo hdr */
#define CSUM_DELAY_DATA (CSUM_TCP | CSUM_UDP)
#define CSUM_DELAY_IP (CSUM_IP) /* XXX add ipv6 here too? */
#define CSUM_DELAY_DATA6 (CSUM_TCPv6 | CSUM_UDPv6)
#define CSUM_RESULTS (CSUM_IP_CHECKED | CSUM_IP_VALID | \
CSUM_DATA_VALID | CSUM_PSEUDO_HDR)
/*
* CSUM_IPHDR_OFFSET() is the network service offset, i.e. the
* offset from the start of the link header to the start of the
* network layer (IP) header. It includes LLC/SNAP if present.
*/
#define CSUM_IPHDR_OFFSET(pMblk) ((pMblk)->mBlkHdr.offset1)
#define CSUM_IP_HDRLEN(pMblk) ((pMblk)->mBlkHdr.offset2)
#define CSUM_XPORT_HDRLEN(pMblk) \
(((pMblk)->mBlkPktHdr.csum_data & 0xff00) >> 8)
#define CSUM_XPORT_CSUM_OFF(pMblk) ((pMblk)->mBlkPktHdr.csum_data & 0xff)
/* malloc flags (sys/malloc.h) */
#define M_NOWAIT M_DONTWAIT
#define M_WAITOK M_WAIT
#define M_CLOSEFIT 0x02
/*
* mbuf allocation/deallocation macros:
*
* MGET(struct mbuf *m, int how, int type)
* allocates an mbuf and initializes it to contain internal data.
*
* MGETHDR(struct mbuf *m, int how, int type)
* allocates an mbuf and initializes it to contain a packet header
* and internal data.
*/
/* Clarinet: This one gets an mbuf with attached cluster, to replace
* the MGET()/MCLGET() paired calls. This should save some time by
* avoiding allocating a 128-byte cluster, freeing it, allocating a
* larger cluster, and joining it to the clBlk.
*/
#define MGET1(m, size, how, type) \
{ \
(m) = netTupleGet (_pNetDpool, size < SIMCLSIZE ? SIMCLSIZE : size, \
(how & M_NOWAIT), (type), \
((how & M_CLOSEFIT) ? \
FALSE : TRUE)); \
}
/* Following change is to eliminate Diab compiler warning 1606 */
#define MGET(m, how, type) \
{ \
(m) = netTupleGet (_pNetDpool, SIMCLSIZE, \
(how & M_NOWAIT), (type), \
((how & M_CLOSEFIT) ? \
FALSE : TRUE)); \
}
#define MGETHDR1(m, size, how, type) \
{ \
int i = size; \
\
(m) = netTupleGet(_pNetDpool, i < SIMCLSIZE ? SIMCLSIZE : i, \
(how & M_NOWAIT), (type), \
((how & M_CLOSEFIT) ? FALSE : TRUE)); \
if ((m) != NULL) \
(m)->m_flags |= M_PKTHDR; \
}
/* Following change is to eliminate Diab compiler warning 1606 */
#define MGETHDR(m, how, type) \
{ \
(m) = netTupleGet (_pNetDpool, SIMCLSIZE, \
(how & M_NOWAIT), (type), \
((how & M_CLOSEFIT) ? FALSE : TRUE)); \
if ((m) != NULL) \
(m)->m_flags |= M_PKTHDR; \
}
#define MCLGET1(m, size, how) \
{ \
char * pClBuf; \
CL_POOL_ID pClPool; \
\
if ((m)->m_flags & M_EXT) \
{ \
netClFree((m)->pClBlk->pNetPool, \
(UCHAR *)(m)->pClBlk->clNode.pClBuf); \
(m)->m_flags &= ~M_EXT; \
} \
\
if ((pClPool = netClPoolIdGet(_pNetDpool, \
(size), \
TRUE)) != NULL) \
{ \
if ((pClBuf = netClusterGet(_pNetDpool, \
pClPool)) != NULL) \
{ \
netClBlkJoin((m)->m_ext, \
pClBuf, \
(size), \
0,0,0,0); \
netMblkClJoin((m), (m)->m_ext); \
} \
} \
}
#define MCLGET(m, how) MCLGET1(m, MCLBYTES, how)
/*
* MFREE(struct mbuf *m, struct mbuf *n)
* Free a single mbuf and associated external storage.
* Place the successor, if any, in n.
*
* we do need to check non-first mbuf for m_aux, since some of existing
* code does not call M_PREPEND properly.
* (example: call to bpf_mtap from drivers)
*/
#define MFREE(m, n) (n) = netMblkClFree((m))
/*
* Copy mbuf pkthdr from "from" to "to".
* from must have M_PKTHDR set, and to must be empty.
* aux pointer will be moved to `to'.
*/
#define M_COPY_PKTHDR(to, from) \
{ \
struct mbuf *_mfrom = (from); \
struct mbuf *_mto = (to); \
_mto->mBlkHdr.reserved = _mfrom->mBlkHdr.reserved;\
_mto->mBlkHdr.offset1 = _mfrom->mBlkHdr.offset1; \
_mto->mBlkHdr.offset2 = _mfrom->mBlkHdr.offset2; \
_mto->m_flags = _mfrom->m_flags; \
_mto->m_pkthdr = _mfrom->m_pkthdr; \
_mfrom->m_pkthdr.aux = (struct mbuf *)NULL; \
}
/*
* Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
* an object of the specified size at the end of the mbuf, longword aligned.
*/
#define M_ALIGN(m, len) ((m)->m_data += \
((m)->m_extSize - (len)) &~ (sizeof(long) - 1))
/*
* As above, for mbufs allocated with m_gethdr/MGETHDR
* or initialized by M_COPY_PKTHDR.
*/
#define MH_ALIGN(m, len) (M_ALIGN((m),(len)))
/*
* Check if we can write to an mbuf.
*/
#define M_WRITABLE(m) ((m)->m_extRefCnt == 1)
/* For M_LEADINGSPACE and M_TRAILINGSPACE the
* M_WRITABLE() is a conservative safety measure. */
/*
* Compute the amount of space available
* before the current start of data in an mbuf.
*/
#define M_LEADINGSPACE(m) \
(M_WRITABLE(m) ? ((m)->m_data - (m)->m_extBuf) : 0)
/*
* Compute the amount of space available
* after the end of data in an mbuf.
*/
#define M_TRAILINGSPACE(m) \
(M_WRITABLE(m) ? ((m)->m_extBuf + (m)->m_extSize - \
(m)->m_data - (m)->m_len) \
: 0)
/*
* Arrange to prepend space of size plen to mbuf m.
* If a new mbuf must be allocated, how specifies whether to wait.
* If how is M_DONTWAIT and allocation fails, the original mbuf chain
* is freed and m is set to NULL.
*/
#ifndef STANDALONE_AGENT
#define M_PREPEND(m, plen, how) \
{ \
if (M_LEADINGSPACE(m) >= (plen)) \
{ \
(m)->m_data -= (plen); \
(m)->m_len += (plen); \
} \
else \
(m) = m_prepend((m), (plen), (how)); \
if ((m) && (m)->m_flags & M_PKTHDR) \
(m)->m_pkthdr.len += (plen); \
}
#else /* STANDALONE_AGENT */
/*
* for standalone agent, the M_PREPEND routine does no try to allocate
* a new buffer (there is no available). Anyway, this is not needed since
* all the WDB packets can be stored in one buffer.
*/
#define M_PREPEND(m, plen, how) \
{ \
if (M_LEADINGSPACE(m) >= (plen)) { \
(m)->m_data -= (plen); \
(m)->m_len += (plen); \
} else \
(m) = NULL; \
if ((m) && (m)->m_flags & M_PKTHDR) \
(m)->m_pkthdr.len += (plen); \
}
#endif /* STANDALONE_AGENT */
/* change mbuf to new type */
#define MCHTYPE(m, t) (_pNetDpool->mBlkStat.types[(m)->m_type]--; \
_pNetDpool->mBlkStat.types[(t)]++; \
(m)->m_type = (t))
/* compatibility with 4.3 */
/*
* pkthdr.aux type tags.
*/
struct mauxtag {
int af;
int type;
void* p;
};
/*
* Some packet tags to identify different mbuf annotations.
*
* Eventually, these annotations will end up in an appropriate chain
* (struct m_tag or similar, e.g. as in NetBSD) properly managed by
* the mbuf handling routines.
*
* As a temporary and low impact solution to replace the even uglier
* approach used so far in some parts of the network stack (which relies
* on global variables), these annotations are stored in MT_TAG
* mbufs (or lookalikes) prepended to the actual mbuf chain.
*
* m_type = MT_TAG
* m_flags = m_tag_id
* m_next = next buffer in chain.
*
* BE VERY CAREFUL not to pass these blocks to the mbuf handling routines.
*
*/
#define m_tag_id m_flags
/* Packet tag types -- first ones are from NetBSD */
#define PACKET_TAG_NONE 0 /* Nadda */
#define PACKET_TAG_IPSEC_IN_DONE 1 /* IPsec applied, in */
#define PACKET_TAG_IPSEC_OUT_DONE 2 /* IPsec applied, out */
#define PACKET_TAG_IPSEC_IN_CRYPTO_DONE 3 /* NIC IPsec crypto done */
#define PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED 4 /* NIC IPsec crypto req'ed */
#define PACKET_TAG_IPSEC_IN_COULD_DO_CRYPTO 5 /* NIC notifies IPsec */
#define PACKET_TAG_IPSEC_PENDING_TDB 6 /* Reminder to do IPsec */
#define PACKET_TAG_BRIDGE 7 /* Bridge processing done */
#define PACKET_TAG_GIF 8 /* GIF processing done */
#define PACKET_TAG_GRE 9 /* GRE processing done */
#define PACKET_TAG_IN_PACKET_CHECKSUM 10 /* NIC checksumming done */
#define PACKET_TAG_ENCAP 11 /* Encap. processing */
#define PACKET_TAG_IPSEC_SOCKET 12 /* IPSEC socket ref */
#define PACKET_TAG_IPSEC_HISTORY 13 /* IPSEC history */
#define PACKET_TAG_IPV6_INPUT 14 /* IPV6 input processing */
/* Packet tags used in the FreeBSD network stack
* We don't support dummynet or divert, they are included for consistency */
#define PACKET_TAG_DUMMYNET 15 /* dummynet info */
#define PACKET_TAG_IPFW 16 /* ipfw classification */
#define PACKET_TAG_DIVERT 17 /* divert info */
#define PACKET_TAG_IPFORWARD 18 /* ipforward info */
#define PACKET_TAG_MAX 19
extern int max_linkhdr; /* largest link-level header */
extern int max_protohdr; /* largest protocol header */
extern int max_hdr; /* largest link+protocol header */
void m_adj (struct mbuf *, int);
void m_cat (struct mbuf *,struct mbuf *);
void m_copyback (struct mbuf *, int, int, caddr_t);
void m_copydata (struct mbuf *,int,int,caddr_t);
struct mbuf *m_copypacket (struct mbuf *, int);
struct mbuf *m_devget (char *, int, int, void *,
void (*copy)(char *, caddr_t, u_int));
/* Removed m_dup as it wasn't being used */
struct mbuf *m_free (struct mbuf *);
void m_freem (struct mbuf *);
struct mbuf *m_get (int, int);
struct mbuf *m_getclr (int, int);
struct mbuf *m_gethdr (int, int);
struct mbuf *m_getm (struct mbuf *, int, int, int);
struct mbuf *m_prepend (struct mbuf *,int,int);
struct mbuf *m_pulldown (struct mbuf *, int, int, int *);
struct mbuf *m_pullup (struct mbuf *, int);
struct mbuf *m_split (struct mbuf *,int,int);
struct mbuf *m_aux_add2 (struct mbuf *, int, int, void *);
struct mbuf *m_aux_find2 (struct mbuf *, int, int, void *);
struct mbuf *m_aux_add (struct mbuf *, int, int);
struct mbuf *m_aux_find (struct mbuf *, int, int);
void m_aux_delete (struct mbuf *, struct mbuf *);
struct mbuf *m_copym (struct mbuf *, int, int, int);
/* Make m_freem() and m_free() macros for better performance */
#define m_freem(m) (netMblkClChainFree (m))
#define m_free(m) (netMblkClFree (m))
/* Make m_copydata(), m_copypacket(), and m_copym() macros also */
#define m_copydata(m, off, len, cp) \
((void)(netMblkOffsetToBufCopy((m), (off), (cp), (len), 0)))
#define m_copym(m, off0, len, wait) \
(netMblkChainDup(_pNetDpool, (m), (off0), (len), (wait)))
#define m_copypacket(m, how) \
(netMblkChainDup(_pNetDpool, (m), 0, M_COPYALL, (how)))
#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
#ifdef __cplusplus
}
#endif
#endif /* _WRS_KERNEL */
#endif /* __INCNewMbufh */
@@ -0,0 +1,344 @@
/* protosw.h - protocol switch table header file */
/* Copyright 2001 - 2005 Wind River Systems, Inc. */
/*-
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)protosw.h 8.1 (Berkeley) 6/2/93
* $FreeBSD: src/sys/sys/protosw.h,v 1.28.2.2 2001/07/03 11:02:01 ume Exp $
*/
/*
modification history
--------------------
01n,12sep06,kch Removed reference to struct ifnet. Also removed obsolete
prototypes.
01m,12jul05,vvv merged from kame-20050404-freebsd411
01l,07feb05,vvv _KERNEL cleanup
01k,24jan05,vvv osdep.h cleanup
01j,19jan04,bwa added PRUS_EXP definition for COMP protocol
01i,20nov03,niq Remove copyright_wrs.h file inclusion
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,07aug03,nee Merging to Base6 from ACCORDION_BASE6_MERGE_BASELINE label on
Accordion codeline
01e,15may03,spm Tornado 2.2 FCS merge (SPR #72213; from tcp_var.h
ver 01g,05jun02,vvv: TOR2_2-FCS-COPY label, tor2 branch,
/wind/river VOB)
01d,09sep02,hsh add c++ protection
01c,12jul02,hsh fix head file for ppc
01b,21sep01,hsh uncomment pru_sense_null function point
01a,18sep01,ham made pf* routines extern. diabled pru_sense_null.
*/
#ifndef _SYS_PROTOSW_H_
#define _SYS_PROTOSW_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declare these structures referenced from prototypes below. */
struct mbuf;
struct proc;
struct sockaddr;
struct socket;
struct sockopt;
#ifdef _WRS_KERNEL
/*
* Protocol switch table.
*
* Each protocol has a handle initializing one of these structures,
* which is used for protocol-protocol and system-protocol communication.
*
* A protocol is called through the pr_init entry before any other.
* Thereafter it is called every 200ms through the pr_fasttimo entry and
* every 500ms through the pr_slowtimo for timer based actions.
* The system will call the pr_drain entry if it is low on space and
* this should throw away any non-critical data.
*
* Protocols pass data between themselves as chains of mbufs using
* the pr_input and pr_output hooks. Pr_input passes data up (towards
* the users) and pr_output passes it down (towards the interfaces); control
* information passes up and down on pr_ctlinput and pr_ctloutput.
* The protocol is responsible for the space occupied by any the
* arguments to these entries and must dispose it.
*
* In retrospect, it would be a lot nicer to use an interface
* similar to the vnode VOP interface.
*/
struct protosw {
short pr_type; /* socket type used for */
struct domain *pr_domain; /* domain protocol a member of */
short pr_protocol; /* protocol number */
short pr_flags; /* see below */
/* protocol-protocol hooks */
void (*pr_input) __P((struct mbuf *, int len));
/* input to protocol (from below) */
int (*pr_output) __P((struct mbuf *m, struct socket *so));
/* output to protocol (from above) */
void (*pr_ctlinput)__P((int, struct sockaddr *, void *));
/* control input (from below) */
int (*pr_ctloutput)__P((struct socket *, struct sockopt *));
/* control output (from above) */
/* user-protocol hook */
void *pr_ousrreq;
/* utility hooks */
void (*pr_init) __P((void)); /* initialization hook */
void (*pr_fasttimo) __P((void));
/* fast timeout (200ms) */
void (*pr_slowtimo) __P((void));
/* slow timeout (500ms) */
void (*pr_drain) __P((void));
/* flush any excess space possible */
struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */
};
#endif /* _WRS_KERNEL */
#define PR_SLOWHZ 2 /* 2 slow timeouts per second */
#define PR_FASTHZ 5 /* 5 fast timeouts per second */
/*
* Values for pr_flags.
* PR_ADDR requires PR_ATOMIC;
* PR_ADDR and PR_CONNREQUIRED are mutually exclusive.
* PR_IMPLOPCL means that the protocol allows sendto without prior connect,
* and the protocol understands the MSG_EOF flag. The first property is
* is only relevant if PR_CONNREQUIRED is set (otherwise sendto is allowed
* anyhow).
* PR_ADDR_OPT requires PR_ATOMIC (like PR_ADDR)
*/
#define PR_ATOMIC 0x01 /* exchange atomic messages only */
#define PR_ADDR 0x02 /* addresses given with messages */
#define PR_CONNREQUIRED 0x04 /* connection required by protocol */
#define PR_WANTRCVD 0x08 /* want PRU_RCVD calls */
#define PR_RIGHTS 0x10 /* passes capabilities */
#define PR_IMPLOPCL 0x20 /* implied open/close */
#define PR_LASTHDR 0x40 /* enforce ipsec policy; last header */
#define PR_ADDR_OPT 0x80 /* allow addresses during delivery */
/*
* The arguments to usrreq are:
* (*protosw[].pr_usrreq)(up, req, m, nam, opt);
* where up is a (struct socket *), req is one of these requests,
* m is a optional mbuf chain containing a message,
* nam is an optional mbuf chain containing an address,
* and opt is a pointer to a socketopt structure or nil.
* The protocol is responsible for disposal of the mbuf chain m,
* the caller is responsible for any space held by nam and opt.
* A non-zero return from usrreq gives an
* UNIX error number which should be passed to higher level software.
*/
#define PRU_ATTACH 0 /* attach protocol to up */
#define PRU_DETACH 1 /* detach protocol from up */
#define PRU_BIND 2 /* bind socket to address */
#define PRU_LISTEN 3 /* listen for connection */
#define PRU_CONNECT 4 /* establish connection to peer */
#define PRU_ACCEPT 5 /* accept connection from peer */
#define PRU_DISCONNECT 6 /* disconnect from peer */
#define PRU_SHUTDOWN 7 /* won't send any more data */
#define PRU_RCVD 8 /* have taken data; more room now */
#define PRU_SEND 9 /* send this data */
#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */
#define PRU_CONTROL 11 /* control operations on protocol */
#define PRU_SENSE 12 /* return status into m */
#define PRU_RCVOOB 13 /* retrieve out of band data */
#define PRU_SENDOOB 14 /* send out of band data */
#define PRU_SOCKADDR 15 /* fetch socket's address */
#define PRU_PEERADDR 16 /* fetch peer's address */
#define PRU_CONNECT2 17 /* connect two sockets */
/* begin for protocols internal use */
#define PRU_FASTTIMO 18 /* 200ms timeout */
#define PRU_SLOWTIMO 19 /* 500ms timeout */
#define PRU_PROTORCV 20 /* receive from below */
#define PRU_PROTOSEND 21 /* send to below */
/* end for protocol's internal use */
#define PRU_SEND_EOF 22 /* send and close */
#define PRU_NREQ 22
#ifdef PRUREQUESTS
char *prurequests[] = {
"ATTACH", "DETACH", "BIND", "LISTEN",
"CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN",
"RCVD", "SEND", "ABORT", "CONTROL",
"SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",
"PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO",
"PROTORCV", "PROTOSEND",
"SEND_EOF",
};
#endif
#ifdef _WRS_KERNEL /* users shouldn't see this decl */
struct stat;
struct ucred;
struct uio;
/*
* If the ordering here looks odd, that's because it's alphabetical.
* Having this structure separated out from the main protoswitch is allegedly
* a big (12 cycles per call) lose on high-end CPUs. We will eventually
* migrate this stuff back into the main structure.
*/
struct pr_usrreqs {
int (*pru_abort) __P((struct socket *so));
int (*pru_accept) __P((struct socket *so, struct sockaddr **nam));
int (*pru_attach) __P((struct socket *so, int proto,
struct proc *p));
int (*pru_bind) __P((struct socket *so, struct sockaddr *nam,
struct proc *p));
int (*pru_connect) __P((struct socket *so, struct sockaddr *nam,
struct proc *p));
int (*pru_connect2) __P((struct socket *so1, struct socket *so2));
int (*pru_control) __P((struct socket *so, u_long cmd, caddr_t data,
void *ifp, struct proc *p));
int (*pru_detach) __P((struct socket *so));
int (*pru_disconnect) __P((struct socket *so));
int (*pru_listen) __P((struct socket *so, struct proc *p));
int (*pru_peeraddr) __P((struct socket *so,
struct sockaddr **nam));
int (*pru_rcvd) __P((struct socket *so, int flags));
int (*pru_rcvoob) __P((struct socket *so, struct mbuf *m,
int flags));
int (*pru_send) __P((struct socket *so, int flags, struct mbuf *m,
struct sockaddr *addr, struct mbuf *control,
struct proc *p));
#define PRUS_OOB 0x01
#define PRUS_EOF 0x02
#define PRUS_MORETOCOME 0x04
#define PRUS_EOB 0x08
#define PRUS_EXP 0x10
int (*pru_sense) __P((struct socket *so, struct stat *sb));
int (*pru_shutdown) __P((struct socket *so));
int (*pru_sockaddr) __P((struct socket *so,
struct sockaddr **nam));
/*
* These three added later, so they are out of order. They are used
* for shortcutting (fast path input/output) in some protocols.
* XXX - that's a lie, they are not implemented yet
* Rather than calling sosend() etc. directly, calls are made
* through these entry points. For protocols which still use
* the generic code, these just point to those routines.
*/
int (*pru_sosend) __P((struct socket *so, struct sockaddr *addr,
struct uio *uio, struct mbuf *top,
struct mbuf *control, int flags,
struct proc *p));
int (*pru_soreceive) __P((struct socket *so,
struct sockaddr **paddr,
struct uio *uio, struct mbuf **mp0,
struct mbuf **controlp, int *flagsp));
int (*pru_sopoll) __P((struct socket *so, int events,
struct ucred *cred, struct proc *p));
};
#endif /* _WRS_KERNEL */
/*
* The arguments to the ctlinput routine are
* (*protosw[].pr_ctlinput)(cmd, sa, arg);
* where cmd is one of the commands below, sa is a pointer to a sockaddr,
* and arg is a `void *' argument used within a protocol family.
*/
#define PRC_IFDOWN 0 /* interface transition */
#define PRC_ROUTEDEAD 1 /* select new route if possible ??? */
#define PRC_IFUP 2 /* interface has come back up */
#define PRC_QUENCH2 3 /* DEC congestion bit says slow down */
#define PRC_QUENCH 4 /* some one said to slow down */
#define PRC_MSGSIZE 5 /* message size forced drop */
#define PRC_HOSTDEAD 6 /* host appears to be down */
#define PRC_HOSTUNREACH 7 /* deprecated (use PRC_UNREACH_HOST) */
#define PRC_UNREACH_NET 8 /* no route to network */
#define PRC_UNREACH_HOST 9 /* no route to host */
#define PRC_UNREACH_PROTOCOL 10 /* dst says bad protocol */
#define PRC_UNREACH_PORT 11 /* bad port # */
/* was PRC_UNREACH_NEEDFRAG 12 (use PRC_MSGSIZE) */
#define PRC_UNREACH_SRCFAIL 13 /* source route failed */
#define PRC_REDIRECT_NET 14 /* net routing redirect */
#define PRC_REDIRECT_HOST 15 /* host routing redirect */
#define PRC_REDIRECT_TOSNET 16 /* redirect for type of service & net */
#define PRC_REDIRECT_TOSHOST 17 /* redirect for tos & host */
#define PRC_TIMXCEED_INTRANS 18 /* packet lifetime expired in transit */
#define PRC_TIMXCEED_REASS 19 /* lifetime expired on reass q */
#define PRC_PARAMPROB 20 /* header incorrect */
#define PRC_UNREACH_ADMIN_PROHIB 21 /* packet administrativly prohibited */
#define PRC_NCMDS 22
#define PRC_IS_REDIRECT(cmd) \
((cmd) >= PRC_REDIRECT_NET && (cmd) <= PRC_REDIRECT_TOSHOST)
#ifdef PRCREQUESTS
char *prcrequests[] = {
"IFDOWN", "ROUTEDEAD", "IFUP", "DEC-BIT-QUENCH2",
"QUENCH", "MSGSIZE", "HOSTDEAD", "#7",
"NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
"#12", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
"TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
"PARAMPROB", "ADMIN-UNREACH"
};
#endif
/*
* The arguments to ctloutput are:
* (*protosw[].pr_ctloutput)(req, so, level, optname, optval, p);
* req is one of the actions listed below, so is a (struct socket *),
* level is an indication of which protocol layer the option is intended.
* optname is a protocol dependent socket option request,
* optval is a pointer to a mbuf-chain pointer, for value-return results.
* The protocol is responsible for disposal of the mbuf chain *optval
* if supplied,
* the caller is responsible for any space held by *optval, when returned.
* A non-zero return from usrreq gives an
* UNIX error number which should be passed to higher level software.
*/
#define PRCO_GETOPT 0
#define PRCO_SETOPT 1
#define PRCO_NCMDS 2
#ifdef PRCOREQUESTS
char *prcorequests[] = {
"GETOPT", "SETOPT",
};
#endif
#ifdef __cplusplus
}
#endif
#endif
+237
View File
@@ -0,0 +1,237 @@
/* route.h - routing table */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1980, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)route.h 8.4 (Berkeley) 1/9/95
* $FreeBSD: src/sys/net/route.h,v 1.36.2.5 2002/02/01 11:48:01 ru Exp $
*/
/*
modification history
--------------------
02d,09jan12,h_x Move extern "C" after last header file include.
02c,25oct06,kch Removed route structure as well as unsupported members from
rt_metrics.
02b,04oct06,kch Updated rt_msghdr structure for IPNet integration.
02a,05sep06,kch Cleanup for IPNet integration.
01z,19may05,rp added RTM_ADDRINFO
01y,01mar05,niq Include in6.h
01x,24feb05,spm removed unneeded route format storage (SPR #100995)
01w,24feb05,spm performance updates and code cleanup (SPR #100995)
01v,08feb05,vvv _KERNEL cleanup
01u,17sep04,niq Scale out routing sockets
01t,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01s,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01r,06dec03,niq Add the RTF_PRIMARY flag
01q,24nov03,vvv updated for RTP support
01p,20nov03,niq Remove copyright_wrs.h file inclusion
01o,10nov03,cdw Rebase from base6 iteration 1 view
01n,04nov03,rlm Ran batch header path update for header re-org.
01m,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01l,27sep03,vvv moved RTFREE out of #ifdef _KERNEL
01k,23sep03,asr Moved the #include <route/ipRouteLib.h> outside of #ifdef _KERNEL
01j,06aug03,niq Merge from Accordion into Base6 Iteration 1 branch
01i,10jun03,vvv include netVersion.h
01h,01feb03,pas merge from FreeBSD 4.7 - added rt_getifa(),
rt_ifannouncemsg(), rtrequest1()
01g,05sep02,hsh add cplusplus protection
01f,16may02,ant field rmx_filler[4] in the struct rt_metrics expand to
rmx_filler[5]. New definitions rt_mod and RTF_MGMT
01e,11mar02,ham reverted previous checkin 01d
01d,27feb02,nee extending the rt_metrics for rip
01c,02feb02,ham changed for tornado build.
01b,19dec01,nee Adding multipath capability
01a,08sep01,qli 1st round of porting
*/
#ifndef _NET_ROUTE_H_
#define _NET_ROUTE_H_
#include <sys/socket.h>
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Kernel resident routing tables.
*
* The routing tables are initialized when interface addresses
* are set by making entries for all directly connected interfaces.
*/
/*
* We distinguish between routes to hosts and routes to networks,
* preferring the former if available. For each route we infer
* the interface to use from the gateway address supplied when
* the route was entered. Routes that forward packets through
* gateways are marked so that the output routines know to address the
* gateway rather than the ultimate destination.
*/
/*
* Following structure necessary for 4.3 compatibility;
* We should eventually move it to a compat file.
*/
struct ortentry {
struct sockaddr ort_dst; /* key */
struct sockaddr ort_gateway; /* value */
short ort_flags; /* up/down?, host/net */
};
/*
* These numbers are used by reliable protocols for determining
* retransmission behavior and are included in the routing structure.
*/
struct rt_metrics {
u_long rmx_mtu; /* MTU for this path */
u_long rmx_hopcount; /* max hops expected */
u_long rmx_expire; /* lifetime for route, e.g. redirect */
u_long rmx_rtt; /* estimated round trip time */
u_long rmx_rttvar; /* estimated rtt variance */
};
/*
* rmx_rtt and rmx_rttvar are stored as microseconds;
* RTTTOPRHZ(rtt) converts to a value suitable for use
* by a protocol slowtimo counter.
*/
#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */
#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ))
/*
* XXX kernel function pointer `rt_output' is visible to applications.
*/
/* Values for rt_flags */
#define RTF_UP 0x1 /* route usable */
#define RTF_GATEWAY 0x2 /* destination is a gateway */
#define RTF_HOST 0x4 /* host entry (net otherwise) */
#define RTF_REJECT 0x8 /* host or net unreachable */
#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */
#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect)*/
#define RTF_DONE 0x40 /* message confirmed */
#define RTF_MASK 0x80 /* Subnet mask present */
#define RTF_CLONING 0x100 /* generate new routes on use */
#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP)*/
#define RTF_STATIC 0x800 /* manually added */
#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates)*/
#define RTF_LOCAL 0x2000 /* route represents a local address */
#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
#define RTF_PREF 0x10000 /* Add route first, no ECMP */
#define RTF_SRCADDR 0x20000 /* The gateway field specifies the default source address */
#define RTF_MBINDING 0x40000 /* This route is part of multiple binding */
#define RTF_SKIP 0x80000 /* Treat this route as a routing lookup failure */
/*
* Structures for routing messages.
*/
struct rt_msghdr {
u_short rtm_msglen; /* to skip over non-understood messages */
u_char rtm_version; /* future binary compatibility */
u_char rtm_type; /* message type */
u_long rtm_index; /* index for associated ifp */
int rtm_flags; /* flags, incl. kern & message, e.g. DONE */
int rtm_addrs; /* bitmask identifying sockaddrs in msg */
pid_t rtm_pid; /* identify sender */
int rtm_seq; /* for sender to identify action */
int rtm_errno; /* why failed */
int rtm_use; /* from rtentry */
u_long rtm_inits; /* which metrics we are initializing */
u_long rtm_table; /* Route table index (IPCOM_ROUTE_TABLE_DEFAULT = default) */
struct rt_metrics rtm_rmx; /* metrics themselves */
};
/*
* Message types. The message numbers should be continous as their
* values are used as array indices
*/
#define RTM_ADD 0x1 /* Add Route */
#define RTM_DELETE 0x2 /* Delete Route */
#define RTM_CHANGE 0x3 /* Change Metrics or flags */
#define RTM_GET 0x4 /* Report Metrics */
#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */
#define RTM_REDIRECT 0x6 /* Told to use different route */
#define RTM_MISS 0x7 /* Lookup failed on this address */
#define RTM_LOCK 0x8 /* fix specified metrics */
#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */
#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */
#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */
#define RTM_NEWADDR 0xc /* address being added to iface */
#define RTM_DELADDR 0xd /* address being removed from iface */
#define RTM_IFINFO 0xe /* iface going up/down etc. */
#define RTM_IFANNOUNCE 0x10 /* iface arrival/departure */
/* IPNet extension for Virtual Router */
#define RTM_NEWVR 0xf1 /* TF1 Add a new virtual router */
#define RTM_DELVR 0xf2 /* TF1 Delete a virtual router, the default (0)
route table cannot be remmoved */
/*
* Bitmask values for rtm_addrs.
*/
#define RTA_DST 0x1 /* destination sockaddr present */
#define RTA_GATEWAY 0x2 /* gateway sockaddr present */
#define RTA_NETMASK 0x4 /* netmask sockaddr present */
#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */
#define RTA_IFP 0x10 /* interface name sockaddr present */
#define RTA_IFA 0x20 /* interface addr sockaddr present */
#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */
#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */
/*
* Index offsets for sockaddr array for alternate internal encoding.
*/
#define RTAX_DST 0 /* destination sockaddr present */
#define RTAX_GATEWAY 1 /* gateway sockaddr present */
#define RTAX_NETMASK 2 /* netmask sockaddr present */
#define RTAX_GENMASK 3 /* cloning mask sockaddr present */
#define RTAX_IFP 4 /* interface name sockaddr present */
#define RTAX_IFA 5 /* interface addr sockaddr present */
#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */
#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */
#define RTAX_MAX 8 /* size of array to allocate */
#ifdef __cplusplus
}
#endif
#endif /* _NET_ROUTE_H_ */
@@ -0,0 +1,357 @@
/* socketvar.h - internal socket structures and definitions */
/*
* Copyright (c) 2001-2007 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)socketvar.h 8.3 (Berkeley) 2/19/95
* $FreeBSD: src/sys/sys/socketvar.h,v 1.46.2.9 2002/08/14 22:23:10 dg Exp $
*/
/*
modification history
--------------------
02j,10jul07,ebh Remove socketvar refcount for SMP as it is not used
02i,27dec06,wap Add socketvar refcount for SMP
02h,20dec06,kch Added so_bkendaux member to socket structure to support
backend auxiliary data. Also removes the obsolete socket
vlan members from socket structure.
02g,28sep06,kch Cleanup unsupported prototypes for IPNet integration.
02f,09jan06,hya Added soo_stat().
02e,15sep05,kch Added so_vlan_options to socket structure. Modified
SO_VLAN_ADD() macro to use the so_vlan_options (SPR #112513).
02d,23aug05,kch Keep the vlan in m_pkthdr in host byte order.
02c,09aug05,kch Added so_vlan to socket structure.
02b,27feb05,dlk Make so_linger an unsigned short; part of linger time-out
support.
02a,09feb05,dlk Embed socket semaphores in struct socket. Remove
excess semaphores. Added unixIoctlMemValidate() routine.
01z,07feb05,vvv _KERNEL cleanup
01y,02feb05,vvv replaced _WRS_KERNEL with _KERNEL to fix build error
01x,24jan05,dlk Remove sb_sel member of struct sockbuf; use SB_SEL flag
(SPR #105576).
01x,14jan05,vvv osdep.h cleanup
01w,19sep04,ann removed usage of the SELECT_LIST macro defined in osdep.h.
01v,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01u,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01t,07jan04,ann fixed sblock definition (SPR #92509)
01s,02jan04,vvv added pSoConnTimo field in socket structure
01r,08dec03,vvv updated based on inspection comments
01q,20nov03,niq Remove copyright_wrs.h file inclusion
01p,17nov03,nee Added socket backend table pointer
01o,05nov03,cdw Removal of unnecessary _KERNEL guards.
01n,04nov03,rlm Ran batch header path update for header re-org.
01m,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01l,24oct03,cdw update include statements post header re-org.
01k,06aug03,nee Accordion Base6 merge from ACCORDION_BASE6_MERGE_BASELINE
label
01j,09may03,vvv included semLib.h and selectLib.h
01i,01feb03,pas merge from FreeBSD 4.7 - added sf_buf functions
01h,06sep02,hsh add c++ protection
01g,02feb02,ham changed for tornado build.
01f,13dec01,ann enabling the xsockets for sysctl
01e,29oct01,ann fixing bugs from the test mode
01d,12sep01,ann changing the sbfree macro based on new buffer library
01c,24aug01,ann changing the path for protosw.h
01b,10aug01,ann more porting stuff
01a,02aug01,ann performed the WRS-port from FreeBSD 4.3 v 1.46.2.5
*/
#ifndef _SYS_SOCKETVAR_H_
#define _SYS_SOCKETVAR_H_
#include <net/protosw.h>
#include <sys/queue.h>
#include <semLib.h>
#include <selectLib.h>
#include <sockFunc.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Kernel structure per socket.
* Contains send and receive buffer queues,
* handle on protocol and pointer to protocol
* private data and error information.
*/
typedef u_quad_t so_gen_t;
/*
* WRS-port
* - if 0'd so_zone, and the accept filter members
*/
#ifdef _WRS_KERNEL
struct socket {
struct sockFunc *pSockFuncTbl; /* socket backend function table */
short so_type; /* generic type, see socket.h */
short so_options; /* from socket call, see socket.h */
u_short so_linger; /* time to linger while closing */
short so_state; /* internal state flags SS_*, below */
caddr_t so_pcb; /* protocol control block */
struct protosw *so_proto; /* protocol handle */
/*
* Variables for connection queuing.
* Socket where accepts occur is so_head in all subsidiary sockets.
* If so_head is 0, socket is not related to an accept.
* For head socket so_incomp queues partially completed connections,
* while so_comp is a queue of connections ready to be accepted.
* If a connection is aborted and it has so_head set, then
* it has to be pulled out of either so_incomp or so_comp.
* We allow connections to queue up based on current queue lengths
* and limit on number of queued connections for this socket.
*/
struct socket *so_head; /* back pointer to accept socket */
TAILQ_HEAD(, socket) so_incomp; /* queue of partial unaccepted connections */
TAILQ_HEAD(, socket) so_comp; /* queue of complete unaccepted connections */
TAILQ_ENTRY(socket) so_list; /* list of unaccepted connections */
short so_qlen; /* number of unaccepted connections */
short so_incqlen; /* number of unaccepted incomplete
connections */
short so_qlimit; /* max number queued connections */
short so_timeo; /* connection timeout */
u_short so_error; /* error affecting connection */
u_long so_oobmark; /* chars to oob mark */
short so_pgrp; /* WRS extension for ASYNC oper */
int so_fd; /* WRS extension for storing FD */
SEL_WAKEUP_LIST so_selWakeupList; /* WRS extension for select */
/*
* Variables for socket buffering.
*/
struct sockbuf {
u_long sb_cc; /* actual chars in buffer */
u_long sb_hiwat; /* max actual char count */
u_long sb_mbcnt; /* chars of mbufs used */
u_long sb_mbmax; /* max chars of mbufs to use */
long sb_lowat; /* low water mark */
struct mbuf *sb_mb; /* the mbuf chain */
short sb_flags; /* flags, see below */
short sb_timeo; /* timeout for read/write */
u_long sb_selCount;
SEMAPHORE sb_Sem; /* WRS extension for sb semaphore */
} so_rcv, so_snd;
#define SB_MAX (256*1024) /* default for max chars in sockbuf */
#define SB_LOCK 0x01 /* lock on data queue */
#define SB_WANT 0x02 /* someone is waiting to lock */
#define SB_WAIT 0x04 /* someone is waiting for data/space */
#define SB_SEL 0x08 /* someone is selecting */
#define SB_ASYNC 0x10 /* ASYNC I/O, need signals */
#define SB_UPCALL 0x20 /* someone wants an upcall */
#define SB_NOINTR 0x40 /* operations not interruptible */
#define SB_AIO 0x80 /* AIO operations queued */
#define SB_KNOTE 0x100 /* kernel note attached */
void (*so_upcall) __P((struct socket *, void *, int));
void *so_upcallarg;
/* NB: generation count must not be first; easiest to make it last. */
so_gen_t _so_gencnt; /* generation count */
void *so_emuldata; /* private data for emulators */
int connTimeo; /* connection establishment timeout */
void *so_bkendaux; /* socket backend auxiliary data */
};
#endif /* _WRS_KERNEL */
/*
* Socket state bits.
*/
#define SS_NOFDREF 0x0001 /* no file table ref any more */
#define SS_ISCONNECTED 0x0002 /* socket connected to a peer */
#define SS_ISCONNECTING 0x0004 /* in process of connecting to peer */
#define SS_ISDISCONNECTING 0x0008 /* in process of disconnecting */
#define SS_CANTSENDMORE 0x0010 /* can't send more data to peer */
#define SS_CANTRCVMORE 0x0020 /* can't receive more data from peer */
#define SS_RCVATMARK 0x0040 /* at mark on input */
#define SS_PRIV 0x0080 /* privileged for broadcast, raw... */
#define SS_NBIO 0x0100 /* non-blocking ops */
#define SS_ASYNC 0x0200 /* async i/o notify */
#define SS_ISCONFIRMING 0x0400 /* deciding to accept connection req */
#define SS_INCOMP 0x0800 /* unaccepted, incomplete connection */
#define SS_COMP 0x1000 /* unaccepted, complete connection */
#define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */
/*
* Externalized form of struct socket used by the sysctl(3) interface.
*/
struct xsocket {
size_t xso_len; /* length of this structure */
struct socket *xso_so; /* makes a convenient handle sometimes */
short so_type;
short so_options;
u_short so_linger;
short so_state;
caddr_t so_pcb; /* another convenient handle */
int xso_protocol;
int xso_family;
short so_qlen;
short so_incqlen;
short so_qlimit;
short so_timeo;
u_short so_error;
u_long so_oobmark;
struct xsockbuf {
u_long sb_cc;
u_long sb_hiwat;
u_long sb_mbcnt;
u_long sb_mbmax;
long sb_lowat;
short sb_flags;
short sb_timeo;
} so_rcv, so_snd;
uid_t so_uid; /* XXX */
};
/*
* Macros for sockets and socket buffering.
*/
/*
* Do we need to notify the other side when I/O is possible?
*/
#define sb_notify(sb) (((sb)->sb_flags & (SB_WAIT | SB_SEL | SB_ASYNC | \
SB_UPCALL | SB_AIO | SB_KNOTE)) != 0)
/*
* How much space is there in a socket buffer (so->so_snd or so->so_rcv)?
* This is problematical if the fields are unsigned, as the space might
* still be negative (cc > hiwat or mbcnt > mbmax). Should detect
* overflow and return 0. Should use "lmin" but it doesn't exist now.
*/
#define sbspace(sb) \
((long) imin((int)((sb)->sb_hiwat - (sb)->sb_cc), \
(int)((sb)->sb_mbmax - (sb)->sb_mbcnt)))
/* do we have to send all at once on a socket? */
#define sosendallatonce(so) \
((so)->so_proto->pr_flags & PR_ATOMIC)
/* can we read something from so? */
#define soreadable(so) \
((so)->so_rcv.sb_cc >= (so)->so_rcv.sb_lowat || \
((so)->so_state & SS_CANTRCVMORE) || \
(so)->so_comp.tqh_first || (so)->so_error)
/* can we write something to so? */
#define sowriteable(so) \
((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \
(((so)->so_state&SS_ISCONNECTED) || \
((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \
((so)->so_state & SS_CANTSENDMORE) || \
(so)->so_error)
/* adjust counters in sb reflecting allocation of m */
#define sballoc(sb, m) { \
(sb)->sb_cc += (m)->m_len; \
(sb)->sb_mbcnt += MSIZE; \
if ((m)->m_flags & M_EXT) \
(sb)->sb_mbcnt += (m)->m_extSize; \
}
/* adjust counters in sb reflecting freeing of m */
#define sbfree(sb, m) { \
(sb)->sb_cc -= (m)->m_len; \
(sb)->sb_mbcnt -= MSIZE; \
if ((m)->m_flags & M_EXT) \
(sb)->sb_mbcnt -= (m)->m_extSize; \
}
#ifdef _WRS_KERNEL
/*
* Macro to add the socket-based VLAN to the m_pkthdr. This is in the
* _WRS_KERNEL section because it will never be used by user code.
*/
#ifdef SOCKET_VLAN
/*
* Keep the vlan in the m_pkthdr in host byte order until it needs to be
* put into the packet (by the MUX-L2 egress code).
*/
#define SO_VLAN_ADD(m, so) \
if ((so)->so_options & SO_VLAN) \
{ \
(m)->m_pkthdr.vlan = (so)->so_vlan; \
(m)->m_pkthdr.csum_flags |= (so)->so_vlan_options; \
}
#endif /* SOCKET_VLAN */
/*
* Argument structure for sosetopt et seq. This is in the _WRS_KERNEL
* section because it will never be visible to user code.
*/
enum sopt_dir { SOPT_GET, SOPT_SET };
struct sockopt {
enum sopt_dir sopt_dir; /* is this a get or a set? */
int sopt_level; /* second arg of [gs]etsockopt */
int sopt_name; /* third arg of [gs]etsockopt */
void *sopt_val; /* fourth arg of [gs]etsockopt */
size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */
struct proc *sopt_p; /* calling process or null if kernel */
};
struct sf_buf {
SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */
int refcnt; /* reference count */
};
extern STATUS unixIoctlMemValidate (unsigned int cmd, const void * pData);
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_SOCKETVAR_H_ */
+107
View File
@@ -0,0 +1,107 @@
/* systm.h */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)systm.h 8.7 (Berkeley) 3/29/95
* $FreeBSD: src/sys/sys/systm.h,v 1.111.2.5 2001/01/16 12:26:21 phk Exp $
*/
/*
modification history
--------------------
01u,09jan12,h_x Move extern "C" after last header file include.
01t,11apr05,sar Use gtfTimeout and gtfUntimeout directly instead of via
macros and replace global tm with gtfTimerMangaerCB
Removed timeout and untimeout.
01s,06apr05,vvv restored copyin/copyout to macros to fix warnings
(SPR #106982)
01r,09feb05,sar Move gtf include files per GTF code inspection of 10/26/2004
01q,07feb05,vvv _KERNEL cleanup
01p,17mar04,rp updated to build for 5.5
01o,20nov03,niq Remove copyright_wrs.h file inclusion
01n,05nov03,cdw Removal of unnecessary _KERNEL guards.
01m,04nov03,rlm Ran batch header path update for header re-org.
01l,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01k,27oct03,cdw update include statements post header re-org.
01j,02jul03,vvv added _KERNEL protection for copyin and copyout
01i,14may03,vvv included taskLib.h
01h,09may03,vvv included string.h
01g,24apr03,syy Make copyin() and copyout() static to avoid duplicated
symbols
01f,18apr03,syy Fixed compiler warnings
01e,10sep02,hsh add c++ protection
01d,28mar02,ppp changing it for tornado build environment
01c,17sep01,ppp adding the macro for lmin
01b,13sep01,ann un commenting certain defines that will be needed
01a,06jun01,deg ported.
*/
#ifndef _SYS_SYSTM_H_
#define _SYS_SYSTM_H_
#include <string.h>
#include <private/gtf_wrapper.h>
#include "taskLib.h"
#include "semLib.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WRS_KERNEL
extern GTF_TIMER_MANAGER * gtfTimerManagerCB;
#define ovbcopy bcopy /* overlapped buffer copy */
#define copyout(from, to, len) (bcopy (from, to, len), OK)
#define copyin(from, to, len) (bcopy (from, to, len), OK)
#define imin(a,b) (((a) < (b)) ? (a) : (b)) /* interger min */
#define lmin(a,b) ((a) < (b) ? (a) : (b)) /* long min */
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_SYSTM_H_ */
+128
View File
@@ -0,0 +1,128 @@
/* uio.h - i/o vectors for reading and writing */
/* Copyright 2001-2006, 2009 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)uio.h 8.5 (Berkeley) 2/22/94
* $FreeBSD: src/sys/sys/uio.h,v 1.11.2.1 2001/09/28 16:58:35 dillon Exp $
*/
/*
modification history
--------------------
01n,09jan12,h_x Move extern "C" after last header file include.
01m,03jul09,zly LP64-bit support
01l,06apr06,jlk SPR 119965. Changed uio->uio_offset to an off_t64.
01k,15feb05,vvv include cdefs.h only in kernel
01j,24jan05,vvv osdep.h cleanup
01i,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,27oct03,cdw update include statements post header re-org.
01d,01feb03,pas merge from FreeBSD 4.7 - added uio_yield()
01c,06sep02,hsh add c++ protection
01b,02feb02,ham changed for tornado build.
01a,15aug01,ann ported to clarinet from FreeBSD 4.3 ver 1.11
*/
#ifndef _SYS_UIO_H_
#define _SYS_UIO_H_
#include <vxWorks.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* XXX
* iov_base should be a void *.
*/
struct iovec {
char *iov_base; /* Base address. */
size_t iov_len; /* Length. */
};
/*
* Limits. Note, the maximum size of cluster in the network stack system
* buffer pool may impose a more stringent limit than UIO_MAXIOV.
*/
#define UIO_MAXIOV 1024 /* max 1K of iov's */
#define UIO_SMALLIOV 8 /* 8 on stack, else malloc */
#ifdef _WRS_KERNEL
#include <sys/cdefs.h>
enum uio_rw { UIO_READ, UIO_WRITE };
/* Segment flag values. */
enum uio_seg {
UIO_USERSPACE, /* from user data space */
UIO_SYSSPACE, /* from system space */
UIO_USERISPACE, /* from user I space */
UIO_NOCOPY /* don't copy, already in object */
};
struct uio {
struct iovec *uio_iov;
int uio_iovcnt;
off_t64 uio_offset;
size_t uio_resid;
enum uio_seg uio_segflg;
enum uio_rw uio_rw;
struct proc *uio_procp;
};
struct vm_object;
void uio_yield __P((void));
#if defined(RUNTIME_64BIT_NAME) /* FIXME */ || \
(_WRS_VXWORKS_MAJOR >= 6 && _WRS_VXWORKS_MINOR >= 9)
int uiomove __P((caddr_t, size_t, struct uio *));
#else
int uiomove __P((caddr_t, int, struct uio *));
#endif
int uiomoveco __P((caddr_t, int, struct uio *, struct vm_object *));
int uioread __P((int, struct uio *, struct vm_object *, int *));
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_UIO_H_ */
@@ -0,0 +1,97 @@
/* unixLib.h - UNIX kernel compatability library header file */
/*
* Copyright (c) 1984-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01v,09jan12,h_x Move extern "C" after last header file include.
01u,06sep06,kch Removed unsupported prototypes for IPNet integration.
01t,19jun06,jpb Removed I960 check
01s,26aug05,dlk Add section tags.
01r,12jul05,kch Removed _netMalloc() and _netFree() prototypes.
01q,07jul05,dlk Balance parenthesis in wakeup_one().
01p,18may05,rp moved ppsratecheck from icmp6.c to unixLib
01o,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01n,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01m,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01l,03dec03,asr Fix compile errors after dinkum libc check-in
01k,20nov03,niq Remove copyright_wrs.h file inclusion
01j,05nov03,cdw Removal of unnecessary _KERNEL guards.
01i,04nov03,rlm Ran batch header path update for header re-org.
01h,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01g,10jun03,vvv include netVersion.h
01f,09may03,vvv included semLib.h and times.h
01e,09oct01,hsh add phashinit routine
01d,26sep01,qli chaning the prototype for "panic"
01c,18sep01,ann adding the prototype of tvToTicks
01b,05sep01,ham corrected microtime's prototype.
01a,01sep01,ann ported to clarinet from AE1.1 version 01f,
added the prototypes for microtime()
*/
#ifndef __INCunixLibh
#define __INCunixLibh
#include <netVersion.h>
#ifdef _WRS_KERNEL
#include <sys/times.h>
#else
#include <sys/time.h> /* For RTP, it is sys/time.h */
#endif
#include <semLib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MALLOC(space, cast, size, type, flags) { \
(space) = (cast) netClusterGet (_pNetSysPool, \
netClPoolIdGet (_pNetSysPool, \
size, TRUE)); \
}
#define FREE(addr, type) { \
netClFree (_pNetSysPool, (unsigned char *) addr); \
}
#define DATA_TO_MBLK(pBuf) \
(*((struct mbuf **)((char *)(pBuf) - sizeof(struct mbuf **))))
/* Function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern void panic(const char *, ...);
#else /* __STDC__ */
extern void panic ();
#endif /* __STDC__ */
/*
* BSD defines wakeup() to wake up all tasks sleeping on
* the specified channel. wakeup_one() wakes up a single process
* (more or less). VxWorks' tsleep() and ksleep() have been modified to
* give up splSemId and take the awaited semaphore atomically, which is
* necessary whether semFlush() or semGive() is used.
* Note, VxWorks has in the past incorrectly made wakeup() equivalent
* to semGive() rather than semFlush().
*/
#define wakeup(semId) ((void)semFlush((semId)))
#define wakeup_one(semId) ((void)semGive((semId)))
#ifdef __cplusplus
}
#endif
#endif /* __INCunixLibh */
@@ -0,0 +1,76 @@
/* ifconfig.h - interface configuation */
/* Copyright 2002 - 2006 Wind River Systems, Inc. */
/*
* Copyright (c) 1997 Peter Wemm.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed for the FreeBSD Project
* by Peter Wemm.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* so there!
*
* $FreeBSD: src/sbin/ifconfig/ifconfig.h,v 1.5.2.2 2001/07/04 20:49:20 brooks Exp $
*/
/*
modification history
--------------------
01n,09jan12,h_x Move extern "C" after last header file include.
01m,04oct06,kch Removed unsupported prefix prototype.
01l,07sep05,kch Removed prototypes for vlan pseudo interface.
01k,27aug05,kch Added setvlanpriority() prototype.
01j,23aug05,dlk Fix compiler warning.
01i,04aug05,kch Added ifconfig_vlan.c prototypes.
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,05nov03,cdw Removal of unnecessary _KERNEL guards.
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,10jun03,vvv include netVersion.h
01c,14may03,vvv added ifconfig()
01b,29apr03,syy Added #ifdef's for inclusion and __cplusplus
01a,23jan02,deg ported from FreeBSD
*/
#ifndef __INCifconfigh
#define __INCifconfigh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int ifconfig (char *);
#ifdef __cplusplus
}
#endif
#endif /* ! __INCifconfigh */
@@ -0,0 +1,32 @@
/* l2config.h - header file for l2config utility */
/*
* Copyright (c) 2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01b,26aug05,kch Added l2configInit() prototype.
01a,12aug05,kch written.
*/
#ifndef __INCl2configh
#define __INCl2configh
#ifdef __cplusplus
extern "C" {
#endif
IMPORT STATUS l2configInit (void);
IMPORT int l2config (char *);
#ifdef __cplusplus
}
#endif
#endif /* ! __INCl2configh */
@@ -0,0 +1,85 @@
/* netstat.h - network information display header file */
/*
* Copyright (c) 1984-2005 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01o,05sep06,kch Cleanup for IPNet integration.
01n,29jun05,kch Added sctp_protopr() and sctp_stats() prototypes.
01m,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01l,25feb05,niq merge mroute changes from comp_wn_ipv6_multicast_interim-dev
branch (ver 1)
01k,07feb05,vvv _KERNEL cleanup
01j,20nov03,niq Remove copyright_wrs.h file inclusion
01i,05nov03,cdw Removal of unnecessary _KERNEL guards.
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,10jun03,vvv include netVersion.h
01e,11apr03,ijm fixed diab compiler warnings
01d,03apr03,vvv modified for componentization (SPR #87352)
01c,26sep02,ppp changing the return type for routepr from void to int
01b,09apr02,ppp changing/ enabling a few prototypes; adding the prototype for
netstat
01a,02feb02,ppp ported from kame
*/
/*
* Copyright (c) 1992, 1993
* Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)netstat.h 8.2 (Berkeley) 1/4/94
* $FreeBSD: src/usr.bin/netstat/netstat.h,v 1.16.2.4 2001/08/10 09:07:09 ru Exp $
*/
#ifndef __INCnetstath
#define __INCnetstath
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WRS_KERNEL
extern int netstat (char * options);
#endif /* _WRS_KERNEL*/
#ifdef __cplusplus
}
#endif
#endif /* __INCnetstath */
@@ -0,0 +1,39 @@
/* rtadvLib.h - Router Advertisement for IPv6 */
/* Copyright 1992-2003 Wind River Systems, Inc. */
/*
modification history
--------------------
01f,09jan12,h_x Move extern "C" after last header file include.
01e,05nov03,cdw Removal of unnecessary _KERNEL guards.
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01b,10jun03,vvv include netVersion.h
01a,09Apr02,nee written.
*/
#ifndef __INCrouteCmdh
#define __INCrouteCmdh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__STDC__) || defined(__cplusplus)
extern int routec (char *options);
#else /* __STDC__ */
extern int routec ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCrouteCmdh */
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,48 @@
/* netFuncBindP.h - prototypes of network common global functions */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01e,03dec10,h_x Add IMPORT FUNCPTR _func_remCurIdGet and
IMPORT FUNCPTR _func_remCurIdSet.
01d,10oct07,tkf Add _ipdhcpc_callback_hook (as part of a fix to
WIND00102686).
01c,28feb07,dlk Replace _gethostbyname, _gethostbyaddr function pointers
with reentrant versions _ipcom_gethostbyname_r,
_ipcom_gethostbyaddr_r.
01b,24oct06,kch Removed unsupported fastudp prototypes.
01a,28aug06,tkf Adopted the obsoleted netFuncBindP.h.
*/
/*
DESCRIPTION
This header file declares prototypes of network common global functions.
*/
#ifndef __INCnetFuncBindPh
#define __INCnetFuncBindPh
/* Global function pointer variables */
/* Function pointers provided by hostLib */
IMPORT FUNCPTR _ipcom_gethostbyname_r; /* Use IPDNSC for the name query */
IMPORT FUNCPTR _ipcom_gethostbyaddr_r; /* Use IPDNSC for the pointer query */
IMPORT FUNCPTR _ipdhcpc_callback_hook; /* Use IPDNSC for the pointer query */
IMPORT FUNCPTR _func_remCurIdGet;
IMPORT FUNCPTR _func_remCurIdSet;
/* protoypes */
#endif /* __INCnetFUNCBindPh */
+94
View File
@@ -0,0 +1,94 @@
/* netLib.h - header file for the tNetTask */
/*
* Copyright 2001-2003, 2005-2007, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01u,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
01t,12oct07,dlk Changed netDaemonQ() to take an signed int argument;
add the inverse function netDaemonQnum().
01s,09jun07,dlk Make netDaemonQ() public. Add netDaemonsCount().
netLibInitialize() takes additional netTaskFunc() argument.
01r,06mar07,dlk Remove references to netJobInfo.
01q,09sep06,kch Added string.h include.
01p,20jun06,jpb Removed I960 check.
01o,25aug05,dlk Added section tags.
01n,08jul05,dlk Implement netJobAdd() using jobQueueLib.
01m,25nov03,wap Merge in changes for Snowflake
01l,20nov03,niq Remove copyright_wrs.h file inclusion
01k,05nov03,cdw Removal of unnecessary _KERNEL guards.
01j,04nov03,rlm Ran batch header path update for header re-org.
01i,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01h,15aug03,nee Merging from ACCORDION_BASE6_MERGE_BASELINE
01g,10jun03,vvv include netVersion.h
01f,13may03,vvv deleted TCP_MSL_CFG to avoid duplicate definitions
01e,01may03,spm Tornado 2.2 CP1 merge (from ver 01p,22jan03,wap:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
01d,30dec02,ann changing the value of IP_PROTO_NUM_MAX to 16
01c,26feb02,ham renamed to netLib.h
01b,23aug01,ann correcting the references to netlibh after the rename
01a,15aug01,ann ported to clarinet from AE1.1 version 01o.
*/
#ifndef __INCnetLibh
#define __INCnetLibh
#include <netVersion.h>
#include <string.h>
#include <jobQueueLib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define NET_TASK_QJOB_PRI 16
/* For convenience only. Using &netJobInfo avoids a dereference. */
extern JOB_QUEUE_ID netJobQueueId;
extern void * netGtfTickInformation; /* read only */
/* function declarations */
extern STATUS netJobAdd (FUNCPTR routine,
_Vx_usr_arg_t param1,
_Vx_usr_arg_t param2,
_Vx_usr_arg_t param3,
_Vx_usr_arg_t param4,
_Vx_usr_arg_t param5);
extern STATUS netLibInitialize (unsigned int numDaemons, BOOL affinityLock,
int (*netTaskFunc) (JOB_QUEUE_ID qId, int qIndex));
extern unsigned int netDaemonsCount (void);
extern JOB_QUEUE_ID netDaemonQ (int i);
extern int netDaemonQnum (JOB_QUEUE_ID qId);
extern void netErrnoSet (int status);
extern void mbinit (void * pNetPoolCfg);
extern STATUS netJobAlloc (u_int numJobs);
_WRS_FASTTEXT
extern void netGtfTickFunc (void * pTm, void * arg);
/* backwards compatibility */
#define netJobAdd(f, a1, a2, a3, a4, a5) \
(jobQueueStdPost (netJobQueueId, NET_TASK_QJOB_PRI, \
(VOIDFUNCPTR)(f), (void *)(a1), (void *)(a2), \
(void *)(a3), (void *)(a4), (void *)(a5)))
#ifdef __cplusplus
}
#endif
#endif /* __INCnetLibh */
+53
View File
@@ -0,0 +1,53 @@
/* netShow.h - header file for netShow.c */
/* Copyright 1984-2004 Wind River Systems, Inc. */
/*
modification history
--------------------
01p,09jan12,h_x Move extern "C" after last header file include.
01o,08dec08,ggz Added ifShow() wrapper
01n,08sep06,kch Cleanup for IPNet integration
01m,20sep04,spm changed init routine prototypes to prevent build warnings;
removed obsolete __STDC__ support for old compilers
01l,19sep04,spm updated virtual stack startup and shutdown for TCP and UDP
show routines: restored use of published initialization
routines and removed unused destructors
01k,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01j,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01i,05nov03,cdw Removal of unnecessary _KERNEL guards.
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01e,10jun03,vvv include netVersion.h
01d,08apr03,ann moved netBufShow prototypes to netBufLib.h and
moved some definitions from netShow.c to here. SPR# 86899
01c,18jan02,ppp adding INET6 protection to a routine
01b,09jan02,ppp adding support for ipv6
01a,08dec01,ppp porting from A.E. 1.1
*/
#ifndef __INCnetShowh
#define __INCnetShowh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/* externs */
/* function declarations */
extern void arpShow (void);
extern void hostShow (void);
extern void hostShowInit (void);
extern void ifShow (char *ifName);
#ifdef __cplusplus
}
#endif
#endif /* __INCnetShowh */
@@ -0,0 +1,42 @@
/* netVersion.h - Network stack version information */
/* Copyright 2003 - 2006 Wind River Systems, Inc. */
/*
modification history
--------------------
01h,15aug06,spw updated to version 3.1.2
01g,28mar06,dlk updated to version 3.1
01f,13jul05,vvv updated version to 3.0
01e,24jun05,vvv updated version to 2.2
01d,07apr05,vvv updated version
01c,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01b,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/IPV6_alameda/base6_itn5_networking-int/1)
01a,11jun03,vvv written
*/
#ifndef __INCnetVersionh
#define __INCnetVersionh
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define STACK_NAME_V4 1 /* Classic IPv4 only stack */
#define STACK_NAME_V4_V6 2 /* Dual IPv4, IPv6 stack */
#define STACK_NAME STACK_NAME_V4_V6
#define STACK_VERSION_MAJOR 3
#define STACK_VERSION_MINOR 1
#define STACK_VERSION_PATCH 2
#define STACK_VERSION_PATCH_MINOR 0
#ifdef __cplusplus
}
#endif
#endif /* __INCnetVersionh */
+244
View File
@@ -0,0 +1,244 @@
/* netdb.h - server entries and the like for routed/rip */
/* Copyright 1996-2007 Wind River Systems, Inc. */
/*-
* Copyright (c) 1980, 1983, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)netdb.h 8.1 (Berkeley) 6/2/93
* From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
* $FreeBSD: src/include/netdb.h,v 1.14.2.5 2001/08/29 08:46:51 alfred Exp $
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
* -
* --Copyright--
*/
/*
modification history
--------------------
01s,09jan12,h_x Move extern "C" after last header file include.
01r,12feb07,dlk Added prototypes for rtpGetaddrinfoInit() and
rtpGetnameinfoInit().
01q,05oct06,kch Removed h_ttl member from struct hostent for IPNet
compatibility.
01p,06jul05,vvv fixed build errors
01o,29jun05,vvv added getaddrinfo(), getnameinfo(), freeaddrinfo() and
gai_strerror() for RFC3493
01n,28jun05,vvv restored v4mapped
01m,13may05,vvv merged from kame-20050404-freebsd411
01l,20nov03,niq Remove copyright_wrs.h file inclusion
01k,05nov03,cdw Removal of unnecessary _KERNEL guards.
01j,04nov03,rlm Ran batch header path update for header re-org.
01i,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01h,06aug03,nee Accordion Base6 merge from ACCORDION_BASE6_MERGE_BASELINE
label
01g,10jun03,vvv include netVersion.h
01f,12dec01,hgo add support of flag AI_V4MAPPED for getaddrinfo()
01e,20sep01,hgo extensions for IPv6 support
01d,19aug97,jag Added the field h_ttl to the structure hostent.
01c,29apr97,jag fixed include define and added C++ linkage. Changed field
names of struc netnet to avoid conflict with i960 macros.
01b,24feb97,jag changed comment.
01a,26nov96,gnn created from BSD4.4 routed
*/
#ifndef __INCnetdbh
#define __INCnetdbh
#include <netVersion.h>
#include <sys/socket.h> /* for socklen_t */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structures returned by network data base library. All addresses are
* supplied in host order, and returned in network order (suitable for
* use in system calls).
*/
struct hostent {
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses from name server */
#define h_addr h_addr_list[0] /* address, for backward compatiblity */
};
/*
* Assumption here is that a network number
* fits in an unsigned long -- probably a poor one.
*/
struct netent {
char * nName; /* official name of net */
char ** nAliases; /* alias list */
int nAddrtype; /* net address type */
unsigned long nNet; /* network # */
};
struct servent {
char *s_name; /* official service name */
char **s_aliases; /* alias list */
int s_port; /* port # */
char *s_proto; /* protocol to use */
};
struct protoent {
char *p_name; /* official protocol name */
char **p_aliases; /* alias list */
int p_proto; /* protocol # */
};
struct addrinfo
{
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
size_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
/*
* Error return codes from getaddrinfo()
*/
/* #define EAI_ADDRFAMILY 1 (obsoleted) */
#define EAI_AGAIN 2 /* temporary failure in name resolution */
#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
#define EAI_FAMILY 5 /* ai_family not supported */
#define EAI_MEMORY 6 /* memory allocation failure */
/* #define EAI_NODATA 7 (obsoleted) */
#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
#define EAI_SYSTEM 11 /* system error returned in errno */
#define EAI_BADHINTS 12 /* Invalid value for hints */
#define EAI_PROTOCOL 13 /* Resolved protocol is unknown */
#define EAI_OVERFLOW 14 /* Argument buffer overflow */
#define EAI_MAX 15
/*
* Flag values for getaddrinfo()
*/
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
/* valid flags for getaddrinfo (not a standard def, apps should not use it) */
#define AI_MASK \
(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
AI_ADDRCONFIG | AI_ALL | AI_V4MAPPED_CFG | AI_V4MAPPED)
#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
#define AI_NUMERICSERV 0x00001000 /* prevent service resolution */
/* special recommended flags for getipnodebyname */
#define AI_DEFAULT AI_V4MAPPED_CFG | AI_ADDRCONFIG
/*
* Constants for getnameinfo()
*/
#define NI_MAXHOST 1025
#define NI_MAXSERV 32
/*
* Flag values for getnameinfo()
*/
#define NI_NOFQDN 0x00000001
#define NI_NUMERICHOST 0x00000002
#define NI_NAMEREQD 0x00000004
#define NI_NUMERICSERV 0x00000008
#define NI_DGRAM 0x00000010
#if 0 /* obsolete */
#define NI_WITHSCOPEID 0x00000020
#endif
#define NI_NUMERICSCOPE 0x00000040
/*
* Scope delimit character
*/
#define SCOPE_DELIMITER '%'
/*
* Error return codes from res_query.c
*/
#define HOST_NOT_FOUND 1 /* Authoritative Answer Host not found */
#define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */
#define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
#define NO_DATA 4 /* Valid name, no data record of requested type */
#define NO_ADDRESS NO_DATA /* no address, look for MX record */
#ifndef __INCwrapperHostLibh
extern int getnameinfo (const struct sockaddr *sa, socklen_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags);
extern int getaddrinfo (const char *hostname, const char *servname,
const struct addrinfo *hints, struct addrinfo **result);
extern void freeaddrinfo (struct addrinfo * ai);
extern char * gai_strerror (int ecode);
#endif
#ifdef _WRS_KERNEL
extern STATUS rtpGetaddrinfoInit (void);
extern STATUS rtpGetnameinfoInit (void);
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* __INCnetdbh */
+152
View File
@@ -0,0 +1,152 @@
/* netffs.h - structures for netffs.c */
/*
* Copyright (c) 2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01e,20jun06,jpb Updated for POSIX namespace conformance.
Changed C preprocessor macro CPU_FAMILY to _VX_CPU_FAMILY.
01d,02mar06,dlk Remove extra tokens "(x)" at end of "#ifndef FFS".
01c,03feb06,dlk Remove ffsMsb() declaration, but do not add include
for ffsLib.h yet.
01b,10jan06 hya removed ARM CPU variant code.
01a,09aug05 niq created.
*/
#ifndef __INCnetffsh
#define __INCnetffsh
#ifdef __cplusplus
extern "C" {
#endif
/*
* We want the fastest possible 'ffsMsb() - 1' for each architecture,
* ideally inlined assembly.
* Eventually, this stuff should be moved to architecture-specific
* headers.
*/
#if !defined (__GNUC__) && !defined (_DIAB_TOOL)
#define USE_FFSMSB_PORTABLE
#endif
#if defined (USE_FFSMSB_PORTABLE)
#define FFS(x) (ffsMsb(x) - 1)
#else /* !defined (USE_FFSMSB_PORTABLE) */
#if (_VX_CPU_FAMILY == _VX_I80X86)
#define FFS(x) _firstBit(x)
#if defined (__GNUC__)
/*
* Return the index of the most significant bit on in x.
* We don't have to handle the x=0 case, this is only called
* when x != 0. Returns a value y in the range 31 >= y >= 0.
* 31 indicates the most significant bit.
*/
static __inline__ UINT32 _firstBit
(
UINT32 x
)
{
UINT32 y;
__asm__ ("bsrl %1, %0"
: "=r" (y)
: "r" (x)
: "cc");
return y;
}
#else /* _DIAB_TOOL */
/* SPR #110427 is now fixed, restore inline assembly for I80X806/diab */
#pragma pure_function _firstBit
__asm UINT32 _firstBit
(
UINT32 x
)
{
% mem x
! "ax"
bsrl x, %eax
}
#endif /* _DIAB_TOOL */
#elif (_VX_CPU_FAMILY == _VX_PPC)
#define FFS(x) (31 - _countLeadingZeroes(x))
#if defined (__GNUC__)
/*
* Return the number of zero bits in bit positions more significant
* than the first set bit.
* We don't have to handle the x=0 case, this is only called
* when x != 0. Returns a value y in the range 31 >= y >= 0.
* 0 indicates the most significant bit.
*/
static __inline__ UINT32 _countLeadingZeroes
(
UINT32 x
)
{
UINT32 y;
__asm__ ("cntlzw %0, %1"
: "=r" (y)
: "r" (x)
);
return y;
}
#else /* _DIAB_TOOL */
#pragma pure_function _countLeadingZeroes
__asm UINT32 _countLeadingZeroes
(
UINT32 x
)
{
% reg x
! "r3"
cntlzw r3, x
}
#endif /* _DIAB_TOOL */
#else /* unknown or unsupported _VX_CPU_FAMILY */
#ifndef FFS
#define FFS(x) (ffsMsb(x) - 1)
#endif
#endif /* _VX_CPU / _VX_CPU_FAMILY */
#endif /* !defined (USE_FFSMSB_PORTABLE) */
#ifdef __cplusplus
}
#endif
#endif /* __INCnetffsh */
@@ -0,0 +1,185 @@
/* if_ether.h - network interface Ethernet header file */
/* Copyright 2001 - 2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)if_ether.h 8.3 (Berkeley) 5/2/95
* $FreeBSD: src/sys/netinet/if_ether.h,v 1.24.2.1 2002/02/13 21:38:56 fjoe Exp $
*/
/*
modification history
--------------------
02a,25oct06,kch Removed unsupported sockaddr_inarp and llinfo_arp structures.
01z,09sep06,kch Cleanup for IPNet integration.
01y,23feb05,vvv restored ether_tag_header definition for
backward-compatibility (SPR #102773)
01x,18feb05,wap Allow sysctl init routines to be scaled out
01w,08feb05,vvv _KERNEL cleanup
01v,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01u,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01t,24feb04,nee Adding the prototype for ipEtherResolvRtn
01s,20nov03,niq Remove copyright_wrs.h file inclusion
01r,04nov03,rlm Ran batch header path update for header re-org.
01q,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01p,23oct03,rlm updated #includes for header re-org
01o,15sep03,vvv updated path for new headers
01n,13aug03,niq Fix definition of la_rt (Part of Accordion Base6 merge)
01m,15may03,spm Tornado 2.2 FCS merge (SPR #63006; ver 01h,24may02,vvv:
TOR2_2-FCS-COPY label, tor2 branch, /wind/river VOB)
01l,09may03,vvv changed include order to fix build
01k,01may03,spm Tornado 2.2 CP1 merge (from ver 01i,13jan03,rae:
TOR2_2-CP1-F label, tor2_2-patch branch, /wind/river VOB)
01j,01feb03,pas merge from FreeBSD 4.7 - changed arp_rtrequest(),
arp_ifinit() calls
01i,09sep02,hsh add c++ protection
01h,13feb02,ham changed for tornado build
01g,09dec01,ppp adding llinfo_arp structure
01f,03oct01,ann commenting the prototype for arpintr
01e,17sep01,ppp Commenting out the static declaration of in_arpinput
01d,10sep01,ann adding some macros that could be helpful
01c,24aug01,ann moving the forward declaration of arpintr here from
if_ether.c
01b,14aug01,ppp Commenting out two definations.
01a,01aug01,ppp Created from FreeBSD 4.3
*/
#ifndef _NETINET_IF_ETHER_H_
#define _NETINET_IF_ETHER_H_
#include <cfgDefs.h>
#include <netinet/in.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <cfgDefs.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Ether header for tagged frames */
struct ether_tag_header
{
u_char ether_dhost [6];
u_char ether_shost [6];
u_char etherTag [4];
u_short ether_type;
};
/*
* Clarinet
* The following macros are required as they are used in all the
* driver header files which include if_ether.h
*/
/*
* for compilers that have 4-bytes structure alignment rule,
* it is understood that sizeof (ether_header) is 0x10
*/
#define SIZEOF_ETHERHEADER 0xe
/* For tagged Ethernet headers */
#define SIZEOF_TAG_ETHERHEADER 0x12
/* minimal size of an ethernet frame including the headers supported
* by most ethernet chips.
*/
#define ETHERSMALL 60
/* End of Clarinet introduced macros */
/*
* Macro to map an IP multicast address to an Ethernet multicast address.
* The high-order 25 bits of the Ethernet address are statically assigned,
* and the low-order 23 bits are taken from the low end of the IP address.
*/
#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
/* struct in_addr *ipaddr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x01; \
(enaddr)[1] = 0x00; \
(enaddr)[2] = 0x5e; \
(enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
(enaddr)[4] = ((u_char *)ipaddr)[2]; \
(enaddr)[5] = ((u_char *)ipaddr)[3]; \
}
/*
* Macro to map an IP6 multicast address to an Ethernet multicast address.
* The high-order 16 bits of the Ethernet address are statically assigned,
* and the low-order 32 bits are taken from the low end of the IP6 address.
*/
#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr) \
/* struct in6_addr *ip6addr; */ \
/* u_char enaddr[ETHER_ADDR_LEN]; */ \
{ \
(enaddr)[0] = 0x33; \
(enaddr)[1] = 0x33; \
(enaddr)[2] = ((u_char *)ip6addr)[12]; \
(enaddr)[3] = ((u_char *)ip6addr)[13]; \
(enaddr)[4] = ((u_char *)ip6addr)[14]; \
(enaddr)[5] = ((u_char *)ip6addr)[15]; \
}
#define ETHER_MULTICAST(enaddr) \
((enaddr)[0] == 0x1) && ((enaddr)[1] == 0x0) && ((enaddr)[2] == 0x5e)
/*
* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted
* to resolving internet addresses. Field names used correspond to
* RFC 826.
*/
struct ether_arp {
struct arphdr ea_hdr; /* fixed-size header */
u_char arp_sha[ETHER_ADDR_LEN]; /* sender hardware address */
u_char arp_spa[4]; /* sender protocol address */
u_char arp_tha[ETHER_ADDR_LEN]; /* target hardware address */
u_char arp_tpa[4]; /* target protocol address */
};
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln
#define arp_pln ea_hdr.ar_pln
#define arp_op ea_hdr.ar_op
#ifdef __cplusplus
}
#endif
#endif /* _NETINET_IF_ETHER_H_ */
@@ -0,0 +1,201 @@
/* igmp.h - igmp header file */
/* Copyright 2001-2005, 2010 Wind River Systems, Inc. */
/*
* Copyright (c) 1988 Stephen Deering.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Stephen Deering of Stanford University.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)igmp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/igmp.h,v 1.10 1999/08/28 00:49:15 peter Exp $
*/
/*
modification history
--------------------
01i,01may10,pad Moved extern C statement after include statements.
01h,29jun05,spm updated for IGMPv3 support
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,10sep02,hsh add c++ protection
01a,27aug01,hsh Created from BSD 4.3
*/
#ifndef _NETINET_IGMP_H_
#define _NETINET_IGMP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Internet Group Management Protocol (IGMP) definitions.
*
* Written by Steve Deering, Stanford, May 1988.
*
* MULTICAST Revision: 3.5.1.2
*/
/*
* IGMPv1/v2 packet and v3 Query packet format.
*/
struct igmp {
u_char igmp_type; /* version & type of IGMP message */
u_char igmp_code; /* subtype for routing msgs */
#define IGMP_EXP(x) (((x) >> 4) & 0x07)
#define IGMP_MANT(x) ((x) & 0x0f)
u_int16_t igmp_cksum; /* IP-style checksum */
struct in_addr igmp_group; /* group address being specified */
/* (zero for general query) */
u_int8_t igmp_rtval; /* Reserved, S Flag and QRV */
#define IGMP_QRESV(x) (((x) >> 4) & 0x0f)
#define IGMP_SFLAG(x) (((x) >> 3) & 0x01)
#define IGMP_QRV(x) ((x) & 0x07) /* querier's robustness variable */
u_int8_t igmp_qqi; /* querier's query interval (QQI) */
u_int16_t igmp_numsrc; /* number of sources (zero for general*/
/* and group-specific queries) */
struct in_addr src[1]; /* source address list */
} __attribute__((__packed__));
/*
* IGMPv3 Membership Report Message header.
*/
struct igmp_report_hdr {
u_int8_t igmp_type; /* version & type of IGMP message */
u_int8_t igmp_reserved1; /* reserved (set to zero) */
u_int16_t igmp_cksum; /* IP-style checksum */
u_int16_t igmp_reserved2; /* reserved (set to zero) */
u_int16_t igmp_grpnum; /* number of group record */
} __attribute__((__packed__));
/*
* IGMPv3 Group Record header.
*/
struct igmp_group_record_hdr {
u_int8_t record_type; /* record types for membership report */
u_int8_t auxlen; /* aux data length (must be zero) */
u_int16_t numsrc; /* number of sources */
struct in_addr group; /* group address */
struct in_addr src[1]; /* source address list */
} __attribute__((__packed__));
#define IGMP_MINLEN 8
/*
* Message types, including version number.
*/
#define IGMP_MEMBERSHIP_QUERY 0x11 /* membership query */
#define IGMP_V1_MEMBERSHIP_REPORT 0x12 /* Ver. 1 membership report */
#define IGMP_V2_MEMBERSHIP_REPORT 0x16 /* Ver. 2 membership report */
#define IGMP_V2_LEAVE_GROUP 0x17 /* Leave-group message */
#define IGMP_DVMRP 0x13 /* DVMRP routing message */
#define IGMP_PIM 0x14 /* PIM routing message */
#define IGMP_MTRACE_RESP 0x1e /* traceroute resp.(to sender)*/
#define IGMP_MTRACE 0x1f /* mcast traceroute messages */
#define IGMP_MAX_HOST_REPORT_DELAY 10 /* max delay for response to */
/* query (in seconds) according */
/* to RFC1112 */
#define IGMP_TIMER_SCALE 10 /* denotes that the igmp code field */
/* specifies time in 10th of seconds*/
/*
* The following four defininitions are for backwards compatibility.
* They should be removed as soon as all applications are updated to
* use the new constant names.
*/
#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
#ifdef __cplusplus
}
#endif
#define IGMP_v3_HOST_MEMBERSHIP_REPORT 0x22 /* v3 membership report */
#define IGMP_v3_GENERAL_QUERY 1
#define IGMP_v3_GROUP_QUERY 2
#define IGMP_v3_GROUP_SOURCE_QUERY 3
#define IGMP_v3_QUERY_MINLEN 12
/*
* States for the IGMP state table.
*/
#define IGMP_DELAYING_MEMBER 1
#define IGMP_IDLE_MEMBER 2
#define IGMP_LAZY_MEMBER 3
#define IGMP_SLEEPING_MEMBER 4
#define IGMP_AWAKENING_MEMBER 5
#define IGMP_QUERY_PENDING_MEMBER 6 /* pending General Query */
#define IGMP_G_QUERY_PENDING_MEMBER 7 /* pending Grp-specific Query */
#define IGMP_SG_QUERY_PENDING_MEMBER 8 /* pending Grp-Src-specific Q.*/
/*
* Group Record Types in the IGMP Membership Report
*/
#define MODE_IS_INCLUDE 1
#define MODE_IS_EXCLUDE 2
#define CHANGE_TO_INCLUDE_MODE 3
#define CHANGE_TO_EXCLUDE_MODE 4
#define ALLOW_NEW_SOURCES 5
#define BLOCK_OLD_SOURCES 6
/*
* States for IGMP router version cache.
*/
#define IGMP_v1_ROUTER 1
#define IGMP_v2_ROUTER 2
#define IGMP_v3_ROUTER 3
/*
* IGMP Query version
*/
#define IGMP_v1_QUERY IGMP_v1_ROUTER
#define IGMP_v2_QUERY IGMP_v2_ROUTER
#define IGMP_v3_QUERY IGMP_v3_ROUTER
#endif /* _NETINET_IGMP_H_ */
@@ -0,0 +1,550 @@
/* in.h - internet header file */
/*
* Copyright (c) 1984-2007 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
* Copyright (c) 2002 INRIA. All rights reserved.
*
* Implementation of Internet Group Management Protocol, Version 3.
* Developed by Hitoshi Asaeda, INRIA, February 2002.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of INRIA nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SER Added IP_MULTICAST_IF structure definition.VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
* $FreeBSD: src/sys/netinet/in.h,v 1.48.2.12 2004/06/16 06:57:49 ru Exp $
* $FreeBSD: src/sys/netinet/in.h,v 1.48.2.11 2003/09/09 19:09:22 bms Exp $
*/
/*
modification history
--------------------
02l,09jan12,h_x Move extern "C" after last header file include.
02k,22jun10,h_x Fix WIND00219346
02j,07may09,kjn Added definition of struct in_pktinfo.
02i,12jul07,kch Restore multicast sockopts number and the required group_req
and group_source_req argument structures (WIND00102340).
02h,20nov06,kch Removed unsupported group_filter structure and related
defines. Added ip_mreqn structure definition.
02g,25oct06,kch Removed Kame specific ip_msfilter and ip_mreq_source
structures. Added new socket options for IP_RECVTTL,
IP_RECVTOS, IP_UDP_XCHKSUM, IP_NAT, IP_FW, IP_NEXTHOP,
IP_X_SENDERLINKADDR and IP_X_VRID.
02f,12sep06,kch Removed obsolete prototypes and unsupported proto defines
for IPNet integration.
02e,03feb06,spw Correct IN_ADDR_IS_LINKLOCAL macro
02d,25aug05,dlk Add section tags.
02c,18may05,kch Merged from FreeBSD v 1.48.2.12.
02b,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
02a,18apr05,vvv included in6.h for user-space
01z,03mar05,vvv removed reference to _KERNEL
01y,25feb05,niq merge from niqbal.tor3.mroute for IP router alert changes
01x,17feb05,dlk NTOHL() etc. only usable as statements, not expressions.
01w,07feb05,vvv _KERNEL cleanup
01v,24jan05,vvv osdep.h cleanup
01u,20jan05,sar Removal of divert, dummynet and fw code.
01t,14oct04,nee include osdep.h and machdep.h when _KERNEL is defined
(SPR #102593)
01s,31may04,nee Adding macro IN_ADDR_IS_LINKLOCAL
01r,25nov03,ppp added a comment before the inclusion of in6.h
01q,21nov03,ppp rtp work
01p,04nov03,rlm Ran batch header path update for header re-org.
01o,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01n,23oct03,rlm updated #includes for header re-org
01m,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01l,13jun03,syy Added declaration for inet_ntoa_b() (SPR#88384)
01k,15may03,vvv included mbuf.h
01j,09may03,vvv included vxWorks.h
01i,01feb03,pas merge from FreeBSD 4.7 - moved satosin() etc here
01h,09sep02,hsh add c++ protection
01g,15jul02,ann moved the early declaration of some structures to avoid
compilation warnings
01f,08feb02,nee making in_socktrim non static
01e,02oct01,ppp Removing the INET6 guard fot in6.h
01d,18sep01,qli fixed a header inclusion error
01c,18sep01,ppp guarding the inclusion of in6.h by INET6 for the link
temporarily
01b,23aug01,ppp Adding the WindRiver copyright
01a,08aug01,ppp Created from FreeBSD 4.3
*/
#ifndef _NETINET_IN_H_
#define _NETINET_IN_H_
#include <vxWorks.h>
#ifdef _WRS_KERNEL
#include <net/mbuf.h>
#endif
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Constants and structures defined by the internet system,
* Per RFC 790, September 1981, and numerous additions.
*/
/*
* Protocols (RFC 1700)
*/
#define IPPROTO_IP 0 /* dummy for IP */
#define IPPROTO_HOPOPTS 0 /* IP6 hop-by-hop options */
#define IPPROTO_ICMP 1 /* control message protocol */
#define IPPROTO_IGMP 2 /* group mgmt protocol */
#define IPPROTO_IPV4 4 /* IPv4 encapsulation */
#define IPPROTO_IPIP IPPROTO_IPV4 /* for compatibility */
#define IPPROTO_TCP 6 /* tcp */
#define IPPROTO_UDP 17 /* user datagram protocol */
#define IPPROTO_IPV6 41 /* IP6 header */
#define IPPROTO_RSVP 46 /* resource reservation */
#define IPPROTO_GRE 47 /* General Routing Encap. */
#define IPPROTO_ESP 50 /* IP6 Encap Sec. Payload */
#define IPPROTO_AH 51 /* IP6 Auth Header */
#define IPPROTO_MOBILE 55 /* IP Mobility */
#define IPPROTO_ICMPV6 58 /* ICMP6 */
#define IPPROTO_OSPFIGP 89 /* OSPFIGP */
#define IPPROTO_PIM 103 /* Protocol Independent Mcast */
#define IPPROTO_L2TP 115 /* L2TP */
#define IPPROTO_MH 135 /* IPv6 Mobility Header */
/* 255: Reserved */
/* BSD Private, local use, namespace incursion */
#define IPPROTO_RAW 255 /* raw IP packet */
#define IPPROTO_MAX 256
/* last return value of *_input(), meaning "all job for this pkt is done". */
#define IPPROTO_DONE 257
/*
* Local port number conventions:
*
* When a user does a bind(2) or connect(2) with a port number of zero,
* a non-conflicting local port address is chosen.
* The default range is IPPORT_RESERVED through
* IPPORT_USERRESERVED, although that is settable by sysctl.
*
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
* default assignment range.
*
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
*
* The value IP_PORTRANGE_HIGH changes the range of candidate port numbers
* into the "high" range. These are reserved for client outbound connections
* which do not want to be filtered by any firewalls.
*
* The value IP_PORTRANGE_LOW changes the range to the "low" are
* that is (by convention) restricted to privileged processes. This
* convention is based on "vouchsafe" principles only. It is only secure
* if you trust the remote host to restrict these ports.
*
* The default range of ports and the high range can be changed by
* sysctl(3). (net.inet.ip.port{hi,low}{first,last}_auto)
*
* Changing those values has bad security implications if you are
* using a a stateless firewall that is allowing packets outside of that
* range in order to allow transparent outgoing connections.
*
* Such a firewall configuration will generally depend on the use of these
* default values. If you change them, you may find your Security
* Administrator looking for you with a heavy object.
*
* For a slightly more orthodox text view on this:
*
* ftp://ftp.isi.edu/in-notes/iana/assignments/port-numbers
*
* port numbers are divided into three ranges:
*
* 0 - 1023 Well Known Ports
* 1024 - 49151 Registered Ports
* 49152 - 65535 Dynamic and/or Private Ports
*
*/
/*
* Ports < IPPORT_RESERVED are reserved for
* privileged processes (e.g. root). (IP_PORTRANGE_LOW)
* Ports > IPPORT_USERRESERVED are reserved
* for servers, not necessarily privileged. (IP_PORTRANGE_DEFAULT)
*/
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED 5000
/*
* Default local port range to use by setting IP_PORTRANGE_HIGH
*/
#define IPPORT_HIFIRSTAUTO 49152
#define IPPORT_HILASTAUTO 65535
/*
* Scanning for a free reserved port return a value below IPPORT_RESERVED,
* but higher than IPPORT_RESERVEDSTART. Traditionally the start value was
* 512, but that conflicts with some well-known-services that firewalls may
* have a fit if we use.
*/
#define IPPORT_RESERVEDSTART 600
/*
* Internet address (a structure for historical reasons)
*/
typedef u_int32_t in_addr_t;
struct in_addr {
in_addr_t s_addr;
};
/*
* Definitions of bits in internet address integers.
* On subnets, the decomposition of addresses to host and net parts
* is done according to subnet mask, not the masks here.
*/
#define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
#define IN_CLASSA_HOST 0x00ffffff
#define IN_CLASSA_MAX 128
#define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET 0xffff0000
#define IN_CLASSB_NSHIFT 16
#define IN_CLASSB_HOST 0x0000ffff
#define IN_CLASSB_MAX 65536
#define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET 0xffffff00
#define IN_CLASSC_NSHIFT 8
#define IN_CLASSC_HOST 0x000000ff
#define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
#define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */
#define IN_CLASSD_NSHIFT 28 /* net and host fields, but */
#define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */
#define IN_MULTICAST(i) IN_CLASSD(i)
#define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
#define IN_LOCAL_GROUP(i) (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
#define INADDR_ANY (u_int32_t)0x00000000
#define INADDR_LOOPBACK (u_int32_t)0x7f000001
#define INADDR_BROADCAST (u_int32_t)0xffffffff /* must be masked */
#define INADDR_NONE 0xffffffff /* -1 return */
#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */
#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */
#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */
#define INADDR_NEW_ALLRTRS_GROUP (u_int32_t)0xe0000016 /* 224.0.0.22 */
#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */
#define IN_LOOPBACKNET 127 /* official! */
#define INADDR_LINKLOCAL 0xA9FE0000 /* 169.254 */
#define IN_ADDR_IS_LINKLOCAL(i) (((u_int32_t)(i) & 0xFFFF0000) == INADDR_LINKLOCAL)
#if _BYTE_ORDER == _BIG_ENDIAN
#define ntohl(x) (x)
#define ntohs(x) (x)
#define htonl(x) (x)
#define htons(x) (x)
#define NTOHL(x) do {} while (FALSE)
#define NTOHS(x) do {} while (FALSE)
#define HTONL(x) do {} while (FALSE)
#define HTONS(x) do {} while (FALSE)
#else
#define ntohl(x) ((((x) & 0x000000ff) << 24) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0xff000000) >> 24))
#define htonl(x) ((((x) & 0x000000ff) << 24) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0xff000000) >> 24))
#define ntohs(x) ((((x) & 0x00ff) << 8) | \
(((x) & 0xff00) >> 8))
#define htons(x) ((((x) & 0x00ff) << 8) | \
(((x) & 0xff00) >> 8))
#define NTOHL(x) do {(x) = ntohl((u_int32_t)(x)); } while (FALSE)
#define NTOHS(x) do {(x) = ntohs((u_short)(x)); } while (FALSE)
#define HTONL(x) do {(x) = htonl((u_int32_t)(x)); } while (FALSE)
#define HTONS(x) do {(x) = htons((u_short)(x)); } while (FALSE)
#endif /* _BYTE_ORDER */
/*
* Socket address, internet style.
*/
struct sockaddr_in {
u_char sin_len;
u_char sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
#define INET_ADDRSTRLEN 16
/*
* Options for use with [gs]etsockopt at the IP level.
* First word of comment is data type; bool is stored in int.
*/
#define IP_OPTIONS 1 /* char[0..40]; set/get IP options */
#define IP_HDRINCL 2 /* int; header is included with data */
#define IP_TOS 3 /* int; IP type of service and preced. */
#define IP_TTL 4 /* int; IP time to live */
#define IP_RECVDSTADDR 7 /* int; receive IP dst addr w/dgram */
#define IP_PKTINFO 8 /* int; turn packet information ancillary
* data" on/off
*/
#define IP_MULTICAST_IF 9 /* struct in_addr or struct ip_mreq or
* struct ip_mreqn. Which one is used
* is determined by size of argument.
* Controls which interface multicast
* packets sent from this socket should
* use
*/
#define IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
#define IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
#define IP_ADD_MEMBERSHIP 12 /* struct ip_mreq or struct ip_mreqn.
* Which one that is used is determiend
* by size of argument. drop an IPv4
* group membership
*/
#define IP_JOIN_GROUP IP_ADD_MEMBERSHIP
#define IP_DROP_MEMBERSHIP 13 /* struct ip_mreq or struct ip_mreqn.
* Which one that is used is determiend
* by size of argument. drop an IPv4
* group membershi
*/
#define IP_LEAVE_GROUP IP_DROP_MEMBERSHIP
#define IP_RECVIF 20 /* int; receive reception if w/dgram */
#define IP_ROUTER_ALERT 21 /* u_char; accept router alert packets */
#define IP_DONTFRAG 22 /* u_char; set the DF bit on each packet
* sent from this socket
*/
#define IP_NOLOCALFRAG 23 /* int; enable/disable support for
* local fragmentation (default off,
* which means that local
* fragmentation is allowed)
*/
#define IP_RECVTTL 31 /* int; turn "get the time-to-live
* ancillary data" on/off
*/
#define IP_RECVTOS 32 /* int; turn "get the type-of-service ancillary data" on/off */
#define IP_UDP_XCHKSUM 40 /* int; Turn on/off checksum for outgoing
* UDP packages (default on)
*/
/* NOTE: 42-47 is used by MCAST_xxx macros */
#define IP_NAT 50 /* Ipnet_nat_ctrl; Network address translation control */
#define IP_FW 51 /* Ipfirewall_ctrl; Firewall control */
#define IP_NEXTHOP 52 /* struct sockaddr_in; specify the next
* hop router as ancillary data
*/
#define IP_X_SENDERLINKADDR 100 /* int; recvmsg() returns a struct
* sockaddr_dl that will contain the link
* address of the sender
*/
#define IP_X_VRID 101 /* u_char; specify the virtual router ID
* as ancillary data
*/
/* MCAST_* sockopts number should not be duplicated with IPv6-level sockopts */
/*
* Any-Source Multicast API; cannot be mixed with Source-Specific
* Multicast API
*/
#define MCAST_JOIN_GROUP 42 /* join an any-source group */
#define MCAST_BLOCK_SOURCE 43 /* block a given source */
#define MCAST_UNBLOCK_SOURCE 44 /* unblock a given source */
#define MCAST_LEAVE_GROUP 45 /* leave an any-source group */
/*
* Source-Specific Multicast API; cannot be mixed with Any-Source
* Multicast API
*/
#define MCAST_JOIN_SOURCE_GROUP 46 /* join a source-specific group */
#define MCAST_LEAVE_SOURCE_GROUP 47 /* leave a source-specific grou */
/*
* Defaults and limits for options
*/
#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */
#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
#define IP_MAX_MEMBERSHIPS 20 /* per socket */
#define IP_MAX_SOURCE_FILTER 128 /* max number of MSF per group */
#define SO_MAX_SOURCE_FILTER 64 /* max number of MSF per socket */
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP.
*/
struct ip_mreq {
struct in_addr imr_multiaddr; /* IP multicast address of group */
struct in_addr imr_interface; /* local IP address of interface */
};
#define MCAST_INCLUDE 0 /* Exclude filter mode */
#define MCAST_EXCLUDE 1 /* Include filter mode */
/*
* Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHI.
*/
struct ip_mreqn
{
struct in_addr imr_multiaddr; /* IPv4 class D multicast addr */
struct in_addr imr_interface; /* IPv4 address of local interface */
u_int32_t imr_ifindex; /* Interface index of local interface */
};
/*
* Argument structure for MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP
*/
struct group_req {
u_int32_t gr_interface; /* interface index */
struct sockaddr_storage gr_group; /* group address */
};
/*
* Argument structure for MCAST_BLOCK_SOURCE, MCAST_UNBLOCK_SOURCE,
* MCAST_JOIN_SOURCE_GROUP and MCAST_LEAVE_SOURCE_GROUP
*/
struct group_source_req {
u_int32_t gsr_interface; /* interface index */
struct sockaddr_storage gsr_group; /* group address */
struct sockaddr_storage gsr_source; /* source address */
};
/*
* Ancillary data for IP_PKTINFO. It can be use toghether with
* sendmsg() to specify egress interface and/or source address. It
* will be returned by recvmsg() if reception of packet information
* has been enabled via the IP_PKTINFO socket option.
*/
struct in_pktinfo {
u_int32_t ipi_ifindex; /* egress/ingress interface index */
struct in_addr ipi_addr; /* local address of packet */
};
/*
* Argument for IP_PORTRANGE:
* - which range to search when port is unspecified at bind() or connect()
*/
#define IP_PORTRANGE_DEFAULT 0 /* default range */
#define IP_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
#define IP_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
/* Packet reassembly stuff */
#define IPREASS_NHASH_LOG2 6
#define IPREASS_NHASH (1 << IPREASS_NHASH_LOG2)
#define IPREASS_HMASK (IPREASS_NHASH - 1)
#define IPREASS_HASH(x,y) \
(((((x) & 0xF) | ((((x) >> 8) & 0xF) << 4)) ^ (y)) & IPREASS_HMASK)
#define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */
/*
* Definitions for inet sysctl operations.
*
* Third level is protocol number.
* Fourth level is desired variable within that protocol.
*/
#define IPPROTO_MAXID (IPPROTO_AH + 1) /* don't list to IPPROTO_MAX */
/* INET6 stuff, temporary workaround */
#define __KAME_NETINET_IN_H_INCLUDED_
#include <netinet6/in6.h>
#undef __KAME_NETINET_IN_H_INCLUDED_
#ifdef _WRS_KERNEL
void inet_ntoa_b __P((struct in_addr, char *));
char *inet_ntoa __P((struct in_addr)); /* in libkern */
#if 0
#define satosin(sa) ((struct sockaddr_in *)(sa))
#define sintosa(sin) ((struct sockaddr *)(sin))
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
#endif
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,91 @@
/* in_systm.h - miscellaneous internetwork definitions for kernel */
/* Copyright 2001-2005, 2010 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in_systm.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/in_systm.h,v 1.9 1999/12/29 04:41:00 peter Exp $
*/
/*
modification history
--------------------
01i,01may10,pad Moved extern C statement after include statements.
01h,07feb05,vvv _KERNEL cleanup
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,09sep02,hsh add c++ protection
01a,23aug01,ann ported to clarinet from freeBSD 4.3 version 1.9
*/
#ifndef _NETINET_IN_SYSTM_H_
#define _NETINET_IN_SYSTM_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Miscellaneous internetwork
* definitions for kernel.
*/
/*
* Network types.
*
* Internally the system keeps counters in the headers with the bytes
* swapped so that VAX instructions will work on them. It reverses
* the bytes before transmission at each protocol level. The n_ types
* represent the types with the bytes in ``high-ender'' order.
*/
typedef u_int16_t n_short; /* short as received from the net */
typedef u_int32_t n_long; /* long as received from the net */
typedef u_int32_t n_time; /* ms since 00:00 GMT, byte rev */
#ifdef _WRS_KERNEL
n_time iptime __P((void));
#endif
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,152 @@
/* in_var.h - in_var header file */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
* Copyright (c) 1985, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in_var.h 8.2 (Berkeley) 1/9/95
* $FreeBSD: src/sys/netinet/in_var.h,v 1.33.2.3 2001/12/14 20:09:34 jlemon Exp $
*/
/*
* Copyright (c) 2002 INRIA. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by INRIA and its
* contributors.
* 4. Neither the name of INRIA nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Implementation of Internet Group Management Protocol, Version 3.
*
* Developed by Hitoshi Asaeda, INRIA, February 2002.
*/
/*
modification history
--------------------
02d,30nov06,kch Added netinet6/in6_var.h include.
02c,09sep06,kch Cleanup for IPNet integration
02b,02mar06,dlk Remove references to ipflow* functions (SPR #104107).
02a,25aug05,dlk Add section tags.
01z,13jul05,dlk Added ipintrqJob declaration.
01y,29jun05,spm updated for IGMPv3 support
01x,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01w,02mar05,niq Make router alert support scalable
01v,25feb05,niq merge from niqbal.tor3.mroute for IP router alert changes
01u,07feb05,vvv _KERNEL cleanup
01t,31jan05,niq virtual stack changes for sysctl
01s,24jan05,vvv osdep.h cleanup
01r,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01q,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01p,25nov03,ppp added a comment around the inclusion of in6_var.h
01o,21nov03,ppp rtp work
01n,20nov03,niq Remove copyright_wrs.h file inclusion
01m,04nov03,rlm Ran batch header path update for header re-org.
01l,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01k,23oct03,rlm updated #includes for header re-org
01j,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01i,23jul03,vvv added _KERNEL protection to fix warnings (SPR #89813)
01h,09may03,vvv included if.h
01g,01feb03,pas merge from FreeBSD 4.7 - added hash table for IP addresses
01f,09sep02,hsh add c++ protection
01e,28mar02,ppp modified it for backward compatibilty with A.E. 1.1
01d,03dec01,niq Sysctl changes for Clarinet
01c,02oct01,ppp removing the guaed for in6_var.h
01b,18sep01,ppp temporarily guarding in6_var.h by INET6 for the link process
01a,27aug01,hsh Created from FreeBSD 4.3
*/
#ifndef _NETINET_IN_VAR_H_
#define _NETINET_IN_VAR_H_
#include <sys/queue.h>
#ifdef _WRS_KERNEL
#include <sys/fnv_hash.h>
#endif
#include <net/if.h>
#ifdef __cplusplus
extern "C" {
#endif
struct in_aliasreq {
char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */
struct sockaddr_in ifra_addr;
struct sockaddr_in ifra_broadaddr;
#define ifra_dstaddr ifra_broadaddr
struct sockaddr_in ifra_mask;
};
#ifdef __cplusplus
}
#endif
#ifdef INET6
#include <netinet6/in6_var.h>
#endif /* INET6 */
#endif /* _NETINET_IN_VAR_H_ */
@@ -0,0 +1,244 @@
/* ip.h - ip head file */
/*
* Copyright (c) 2001-2005, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip.h 8.2 (Berkeley) 6/1/94
* $FreeBSD: src/sys/netinet/ip.h,v 1.25 2003/10/29 15:07:03 ume Exp $
* $FreeBSD: src/sys/netinet/ip.h,v 1.17 1999/12/22 19:13:20 shin Exp $
*/
/*
modification history
--------------------
01l,01may10,pad Moved extern C statement after include statements.
01k,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01j,15feb05,vvv include in_systm.h only in kernel
01i,07feb05,vvv _KERNEL cleanup
01h,14jan05,vvv osdep.h cleanup
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE
01c,09may03,vvv included in.h and in_systm.h
01b,09sep02,hsh add c++ protection
01a,23aug01,ann ported to clarinet from freeBSD 4.3 version 1.17
*/
#ifndef _NETINET_IP_H_
#define _NETINET_IP_H_
#include <netinet/in.h>
#ifdef _WRS_KERNEL
#include <netinet/in_systm.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for internet protocol version 4.
* Per RFC 791, September 1981.
*/
#define IPVERSION 4
/*
* Structure of an internet header, naked of options.
*/
struct ip {
#ifdef _IP_VHL
u_char ip_vhl; /* version << 4 | header length >> 2 */
#else
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int ip_hl:4, /* header length */
ip_v:4; /* version */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int ip_v:4, /* version */
ip_hl:4; /* header length */
#endif
#endif /* not _IP_VHL */
u_char ip_tos; /* type of service */
u_short ip_len; /* total length */
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_char ip_ttl; /* time to live */
u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
};
#ifdef _IP_VHL
#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))
#define IP_VHL_HL(vhl) ((vhl) & 0x0f)
#define IP_VHL_V(vhl) ((vhl) >> 4)
#define IP_VHL_BORING 0x45
#endif
#define IP_MAXPACKET 65535 /* maximum packet size */
/*
* Definitions for IP type of service (ip_tos)
*/
#define IPTOS_LOWDELAY 0x10
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_RELIABILITY 0x04
#define IPTOS_MINCOST 0x02
#if 1
/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */
/* ECN bits proposed by Sally Floyd */
#define IPTOS_CE 0x01 /* congestion experienced */
#define IPTOS_ECT 0x02 /* ECN-capable transport */
#endif
/*
* Definitions for IP precedence (also in ip_tos) (hopefully unused)
*/
#define IPTOS_PREC_NETCONTROL 0xe0
#define IPTOS_PREC_INTERNETCONTROL 0xc0
#define IPTOS_PREC_CRITIC_ECP 0xa0
#define IPTOS_PREC_FLASHOVERRIDE 0x80
#define IPTOS_PREC_FLASH 0x60
#define IPTOS_PREC_IMMEDIATE 0x40
#define IPTOS_PREC_PRIORITY 0x20
#define IPTOS_PREC_ROUTINE 0x00
/*
* ECN (Explicit Congestion Notification) codepoints in RFC3168
* mapped to the lower 2 bits of the TOS field.
*/
#define IPTOS_ECN_NOTECT 0x00 /* not-ECT */
#define IPTOS_ECN_ECT1 0x01 /* ECN-capable transport (1) */
#define IPTOS_ECN_ECT0 0x02 /* ECN-capable transport (0) */
#define IPTOS_ECN_CE 0x03 /* congestion experienced */
#define IPTOS_ECN_MASK 0x03 /* ECN field mask */
/*
* Definitions for options.
*/
#define IPOPT_COPIED(o) ((o)&0x80)
#define IPOPT_CLASS(o) ((o)&0x60)
#define IPOPT_NUMBER(o) ((o)&0x1f)
#define IPOPT_CONTROL 0x00
#define IPOPT_RESERVED1 0x20
#define IPOPT_DEBMEAS 0x40
#define IPOPT_RESERVED2 0x60
#define IPOPT_EOL 0 /* end of option list */
#define IPOPT_NOP 1 /* no operation */
#define IPOPT_RR 7 /* record packet route */
#define IPOPT_TS 68 /* timestamp */
#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
#define IPOPT_LSRR 131 /* loose source route */
#define IPOPT_ESO 133 /* extended security */
#define IPOPT_CIPSO 134 /* commerical security */
#define IPOPT_SATID 136 /* satnet id */
#define IPOPT_SSRR 137 /* strict source route */
#define IPOPT_RA 148 /* router alert */
/*
* Offsets to fields in options other than EOL and NOP.
*/
#define IPOPT_OPTVAL 0 /* option ID */
#define IPOPT_OLEN 1 /* option length */
#define IPOPT_OFFSET 2 /* offset within option */
#define IPOPT_MINOFF 4 /* min value of above */
/*
* Time stamp option structure.
*/
struct ip_timestamp {
u_char ipt_code; /* IPOPT_TS */
u_char ipt_len; /* size of structure (variable) */
u_char ipt_ptr; /* index of current entry */
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int ipt_flg:4, /* flags, see below */
ipt_oflw:4; /* overflow counter */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#endif
union ipt_timestamp {
u_long ipt_time[1];
struct ipt_ta {
struct in_addr ipt_addr;
u_long ipt_time;
} ipt_ta[1];
} ipt_timestamp;
};
/* flag bits for ipt_flg */
#define IPOPT_TS_TSONLY 0 /* timestamps only */
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
#define IPOPT_TS_PRESPEC 3 /* specified modules only */
/* bits for security (not byte swapped) */
#define IPOPT_SECUR_UNCLASS 0x0000
#define IPOPT_SECUR_CONFID 0xf135
#define IPOPT_SECUR_EFTO 0x789a
#define IPOPT_SECUR_MMMM 0xbc4d
#define IPOPT_SECUR_RESTR 0xaf13
#define IPOPT_SECUR_SECRET 0xd788
#define IPOPT_SECUR_TOPSECRET 0x6bc5
/*
* Internet implementation parameters.
*/
#define MAXTTL 255 /* maximum time to live (seconds) */
#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
#define IPFRAGTTL 60 /* time to live for frags, slowhz */
#define IPTTLDEC 1 /* subtracted when forwarding */
#define IP_MSS 576 /* default maximum segment size */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,28 @@
/* ip6.h - IPv6 protocol definitions */
/*
* Copyright (c) 2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01a,29jun05,vvv written
*/
#ifndef __INCip6h
#define __INCip6h
/*
* This file has been added to satisfy the requirement in RFC3542
* that ip6.h should be in the netinet directory. The copy in netinet6
* is retained for backward compatibility.
*/
#include <netinet6/ip6.h>
#endif /* not __INCip6h */
@@ -0,0 +1,235 @@
/* ip_icmp.h - interface control message protocol header file */
/* Copyright 2001-2006, 2010 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/ip_icmp.h,v 1.16 1999/12/29 04:41:01 peter Exp $
*/
/*
modification history
--------------------
01m,01may10,pad Moved extern C statement after include statements.
01l,21sep06,tlu Cleanup for IPNET integration
01k,10sep06,kch Cleanup for IPNet integration.
01j,04jul05,dlk Added result member to icmp_info structure (SPR #110450).
01i,07feb05,vvv _KERNEL cleanup
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,04nov03,rlm Ran batch header path update for header re-org.
01f,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01e,07aug03,niq Merging from Accordion label ACCORDION_BASE6_MERGE_BASELINE.
01d,09may03,vvv included in_systm.h and ip.h
01c,10sep02,hsh add c++ protection
01b,20jun02,ppp adding the structure for icmp_info
01a,22aug01,ppp Created from BSD 4.3
*/
#ifndef _NETINET_IP_ICMP_H_
#define _NETINET_IP_ICMP_H_
#include <netinet/ip.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interface Control Message Protocol Definitions.
* Per RFC 792, September 1981.
*/
/*
* Internal of an ICMP Router Advertisement
*/
struct icmp_ra_addr {
u_int32_t ira_addr;
u_int32_t ira_preference;
};
/*
* Structure of an icmp header.
*/
struct icmp {
u_char icmp_type; /* type of message, see below */
u_char icmp_code; /* type sub code */
u_short icmp_cksum; /* ones complement cksum of struct */
union {
u_char ih_pptr; /* ICMP_PARAMPROB */
struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
struct ih_idseq {
u_int16_t icd_id;
u_int16_t icd_seq;
} ih_idseq;
int ih_void;
/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
struct ih_pmtu {
u_int16_t ipm_void;
u_int16_t ipm_nextmtu;
} ih_pmtu;
struct ih_rtradv {
u_char irt_num_addrs;
u_char irt_wpa;
u_int16_t irt_lifetime;
} ih_rtradv;
} icmp_hun;
#define icmp_pptr icmp_hun.ih_pptr
#define icmp_gwaddr icmp_hun.ih_gwaddr
#define icmp_id icmp_hun.ih_idseq.icd_id
#define icmp_seq icmp_hun.ih_idseq.icd_seq
#define icmp_void icmp_hun.ih_void
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
union {
struct id_ts {
u_int32_t its_otime;
u_int32_t its_rtime;
u_int32_t its_ttime;
} id_ts;
struct id_ip {
struct ip idi_ip;
/* options and then 64 bits of data */
} id_ip;
struct icmp_ra_addr id_radv;
u_int32_t id_mask;
char id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_rtime icmp_dun.id_ts.its_rtime
#define icmp_ttime icmp_dun.id_ts.its_ttime
#define icmp_ip icmp_dun.id_ip.idi_ip
#define icmp_radv icmp_dun.id_radv
#define icmp_mask icmp_dun.id_mask
#define icmp_data icmp_dun.id_data
};
/*
* Added this structure for passing additional information to ctl functions
* that may want to use it
*/
struct icmp_info {
struct sockaddr_in sock;
u_short errorPktLen;
u_short result;
#define ICMP4_RESULT_ACCEPT 0
#define ICMP4_RESULT_REJECT 1
};
/*
* Lower bounds on packet lengths for various types.
* For the error advice packets must first insure that the
* packet is large enough to contain the returned ip header.
* Only then can we do the check to see if 64 bits of packet
* data have been returned, since we need to check the returned
* ip header length.
*/
#define ICMP_MINLEN 8 /* abs minimum */
#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
#define ICMP_MASKLEN 12 /* address mask */
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
#ifndef _IP_VHL
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
/* N.B.: must separately check that ip_hl >= 5 */
#else
#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
/* N.B.: must separately check that header length >= 5 */
#endif
/*
* Definition of type and code field values.
*/
#define ICMP_ECHOREPLY 0 /* echo reply */
#define ICMP_UNREACH 3 /* dest unreachable, codes: */
#define ICMP_UNREACH_NET 0 /* bad net */
#define ICMP_UNREACH_HOST 1 /* bad host */
#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
#define ICMP_UNREACH_PORT 3 /* bad port */
#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */
#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */
#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
#define ICMP_REDIRECT 5 /* shorter route, codes: */
#define ICMP_REDIRECT_NET 0 /* for network */
#define ICMP_REDIRECT_HOST 1 /* for host */
#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
#define ICMP_ECHO 8 /* echo service */
#define ICMP_ROUTERADVERT 9 /* router advertisement */
#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
#define ICMP_PARAMPROB 12 /* ip header bad */
#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */
#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
#define ICMP_PARAMPROB_LENGTH 2 /* bad length */
#define ICMP_TSTAMP 13 /* timestamp request */
#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
#define ICMP_IREQ 15 /* information request */
#define ICMP_IREQREPLY 16 /* information reply */
#define ICMP_MASKREQ 17 /* address mask request */
#define ICMP_MASKREPLY 18 /* address mask reply */
#define ICMP_MAXTYPE 18
#define ICMP_INFOTYPE(type) \
((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,178 @@
/* ip_mroute.h - multicast forwarding header file */
/*
* Copyright (c) 1984-2007, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
* Copyright (c) 1989 Stephen Deering.
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Stephen Deering of Stanford University.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip_mroute.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/ip_mroute.h,v 1.17 1999/12/29 04:41:01 peter Exp $
*/
/*
modification history
--------------------
01j,01may10,pad Moved extern C statement after include statements.
01i,12jul07,kch Re-integrated to support IP multicast source forwarding
for IPNET (WIND00102340).
01h,16jul05,dlk Added tbf_timeo member to struct tbf for timer cancellation
when shutting down mrouter in virtual stack destructor.
01g,25feb05,niq add support for router alert
01f,31jan05,niq merge mroute changes from comp_wn_ipv6_multicast_interim-dev
branch (ver 1)
01e,20sep04,rae fix compiler warnings
01d,24jun03,rae add #include netVersion.h
01c,10oct01,rae merge from truestack ver 01k (v2 upgrade)
01b,08apr97,vin removed declarations for ip_mforward and ip_mrouter_done.
implemented ip_mforward as a hook for scalability.
01a,03mar96,vin created from BSD4.4lite2.
*/
#ifndef _NETINET_IP_MROUTE_H_
#define _NETINET_IP_MROUTE_H_
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definitions for IP multicast forwarding.
*
* Written by David Waitzman, BBN Labs, August 1988.
* Modified by Steve Deering, Stanford, February 1989.
* Modified by Ajit Thyagarajan, PARC, August 1993.
* Modified by Ajit Thyagarajan, PARC, August 1994.
* Modified by Ahmed Helmy, SGI, June 1996.
* Modified by Pavlin Radoslavov, ICSI, October 2002.
*
* MROUTING Revision: 3.3.1.3
* and PIM-SMv2 and PIM-DM support, advanced API support,
* bandwidth metering and signaling.
*/
/***** IP_IPPROTO_IP level multicast socket options: *****/
#define MRT_BASE 0x40000000
/*
* Multicast Routing set/getsockopt commands.
*/
#define MRT_INIT (MRT_BASE + 0) /* initialize mrouted */
#define MRT_DONE (MRT_BASE + 1) /* shut down mrouted */
#define MRT_ADD_VIF (MRT_BASE + 2) /* create virtual interface */
#define MRT_DEL_VIF (MRT_BASE + 3) /* delete virtual interface */
#define MRT_ADD_MFC (MRT_BASE + 4) /* insert forwarding cache entry */
#define MRT_DEL_MFC (MRT_BASE + 5) /* delete forwarding cache entry */
#define MRT_VERSION (MRT_BASE + 6) /* get kernel version number */
#define MRT_ASSERT (MRT_BASE + 7) /* enable assert processing */
#define MRT_PIM MRT_ASSERT /* enable PIM processing */
#define MAXVIFS 32 /* Maximum number of virtual interfaces */
typedef u_short vifi_t; /* Virtual interface index type */
/*
* Structure used for IPv4 multicast routing
*/
/*
* Argument structure for MRT_ADD_VIF.
* (MRT_DEL_VIF takes a single vifi_t argument.)
*/
struct vifctl {
vifi_t vifc_vifi; /* the index of the vif to be added */
u_char vifc_flags; /* VIFF_ flags defined below */
u_char vifc_threshold; /* min ttl required to forward on vif */
u_int32_t vifc_rate_limit; /* max rate */
struct in_addr vifc_lcl_addr; /* local interface address */
struct in_addr vifc_rmt_addr; /* remote address (tunnels only) */
};
#define VIFF_TUNNEL 0x1 /* vif represents a tunnel end-point */
#define VIFF_REGISTER 0x4 /* used for PIM Register encap/decap */
/*
* Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
*/
struct mfcctl {
struct in_addr mfcc_origin; /* ip origin of mcasts */
struct in_addr mfcc_mcastgrp; /* multicast group associated*/
vifi_t mfcc_parent; /* incoming vif */
u_char mfcc_ttls[MAXVIFS]; /* forwarding ttls on vifs */
};
/* Structure used by SIOCGETSGCNT ioctl
* Holds statistsic for the route matching 'src' and 'grp'
*/
struct sioc_sg_req
{
struct in_addr src; /* The source address */
struct in_addr grp; /* The destination group address */
u_int32_t pktcnt; /* Packets sent along this route */
u_int32_t bytecnt; /* Bytes sent along this route */
u_int32_t wrong_if; /* Number of packet received on the wrong
* VIF matching this route
*/
};
/* Structure used by SIOCGETVIFCNT ioctl.
* Hold statistics for the virtual interface
*/
struct sioc_vif_req
{
vifi_t vifi; /* Virtual interface index */
u_int32_t icount; /* Number of packets received on this interface */
u_int32_t ocount; /* Number of packets sent on this interface */
u_int32_t ibytes; /* Number of bytes received on this interface */
u_int32_t obytes; /* Number of bytes sent on this interface */
};
#ifdef __cplusplus
}
#endif
#endif /* _NETINET_IP_MROUTE_H_ */
@@ -0,0 +1,35 @@
/* sctp.h - IPNET SCTP header file */
/*
* Copyright (c) 2009 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01a,18Feb09,jgy Created,base on draft-ietf-tsvwg-sctpsocket-16.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*
* This is the header file for SCTP SOCKET.
*/
#ifndef SCTP_H
#define SCTP_H
#include <sys/sctp_socket.h>
#endif
@@ -0,0 +1,50 @@
/* sockunion.h -File Transfer Protocol library header */
/*
modification history
--------------------
01h,01may10,pad Moved extern C statement after include statements.
01f,24apr07,tkf Add IPv6-Only build support.
01e,07jan05,syy Port to RTP
01d,05nov03,cdw Removal of unnecessary _KERNEL guards.
01c,04nov03,rlm Ran batch header path update for header re-org.
01b,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01a,15sep02,ant written
*/
#ifndef __INCsockunionh
#define __INCsockunionh
/* includes */
#include <netinet/in.h>
#ifdef __cplusplus
extern "C" {
#endif
/* typedefs */
union sockunion {
struct sockinet {
u_char si_len;
u_char si_family;
u_short si_port;
} su_si;
#ifdef INET
struct sockaddr_in su_sin;
#endif
#ifdef INET6
struct sockaddr_in6 su_sin6;
#endif
};
#define su_len su_si.si_len
#define su_family su_si.si_family
#define su_port su_si.si_port
#ifdef __cplusplus
}
#endif
#endif /* __INCsockunionh */
@@ -0,0 +1,171 @@
/* tcp.h - TCP protocol definitions */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/tcp.h,v 1.13.2.3 2001/03/01 22:08:42 jlemon Exp $
*/
/*
modification history
--------------------
01k,09jan12,h_x Move extern "C" after last header file include.
01j,04oct06,kch Updated TCP user-settable options.
01i,14jan05,vvv osdep.h cleanup
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,05nov03,cdw Removal of unnecessary _KERNEL guards.
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,10jun03,vvv include netVersion.h
01c,10sep02,hsh add c++ protection
01b,08feb02,pas EAR code cleanup
01a,13aug01,pas Created from FreeBSD4.3-RELEASE(July-17-01).
*/
#ifndef _NETINET_TCP_H_
#define _NETINET_TCP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef u_int32_t tcp_seq;
typedef u_int32_t tcp_cc; /* connection count per rfc1644 */
#define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */
#define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */
/*
* TCP header.
* Per RFC 793, September, 1981.
*/
struct tcphdr {
u_short th_sport; /* source port */
u_short th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
#if _BYTE_ORDER == _LITTLE_ENDIAN
u_int th_x2:4, /* (unused) */
th_off:4; /* data offset */
#endif
#if _BYTE_ORDER == _BIG_ENDIAN
u_int th_off:4, /* data offset */
th_x2:4; /* (unused) */
#endif
u_char th_flags;
#define TH_FIN 0x01
#define TH_SYN 0x02
#define TH_RST 0x04
#define TH_PUSH 0x08
#define TH_ACK 0x10
#define TH_URG 0x20
#define TH_ECE 0x40
#define TH_CWR 0x80
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG|TH_ECE|TH_CWR)
u_short th_win; /* window */
u_short th_sum; /* checksum */
u_short th_urp; /* urgent pointer */
};
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
#define TCPOLEN_MAXSEG 4
#define TCPOPT_WINDOW 3
#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4 /* Experimental */
#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5 /* Experimental */
#define TCPOPT_TIMESTAMP 8
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
#define TCPOPT_CC 11 /* CC options: RFC-1644 */
#define TCPOPT_CCNEW 12
#define TCPOPT_CCECHO 13
#define TCPOLEN_CC 6
#define TCPOLEN_CC_APPA (TCPOLEN_CC+2)
#define TCPOPT_CC_HDR(ccopt) \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|(ccopt)<<8|TCPOLEN_CC)
/*
* Default maximum segment size for TCP.
* With an IP MSS of 576, this is 536,
* but 512 is probably more convenient.
* This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
*/
#define TCP_MSS 512
/*
* Default maximum segment size for TCP6.
* With an IP6 MSS of 1280, this is 1220,
* but 1024 is probably more convenient. (xxx kazu in doubt)
* This should be defined as MIN(1024, IP6_MSS - sizeof (struct tcpip6hdr))
*/
#define TCP6_MSS 1024
#define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
#define TTCP_CLIENT_SND_WND 4096 /* dflt send window for T/TCP client */
#define TCP_MAX_WINSHIFT 14 /* maximum window shift */
#define TCP_MAXBURST 4 /* maximum segments in a burst */
#define TCP_MAXHLEN (0xf<<2) /* max length of header in bytes */
#define TCP_MAXOLEN (TCP_MAXHLEN - sizeof(struct tcphdr))
/* max space left for options */
/*
* User-settable options (used with setsockopt).
*/
#define TCP_NODELAY 1 /* don't delay send to coalesce packets */
#define TCP_MAXSEG 2 /* set maximum segment size */
#define TCP_NOPUSH 3 /* don't push last block of write */
#define TCP_KEEPIDLE 4 /* Send first keepalive probe when the connections
been isdl this time (in seconds) */
#define TCP_KEEPINTVL 5 /* Interval (in seconds) between keepalives */
#define TCP_KEEPCNT 6 /* Maximum number of keepalives before dropping
the connection */
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,79 @@
/* udp.h - udp header file */
/* Copyright 2001-2003, 2010 Wind River Systems, Inc. */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)udp.h 8.1 (Berkeley) 6/10/93
* $FreeBSD: src/sys/netinet/udp.h,v 1.7 1999/08/28 00:49:34 peter Exp $
*/
/*
modification history
--------------------
01h,01may10,pad Moved extern C statement after include statements.
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,10sep02,hsh add c++ protection
01a,24aug01,hsh Created from BSD 4.3
*/
#ifndef _NETINET_UDP_H_
#define _NETINET_UDP_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Udp protocol header.
* Per RFC 768, September, 1981.
*/
struct udphdr {
u_short uh_sport; /* source port */
u_short uh_dport; /* destination port */
u_short uh_ulen; /* udp length */
u_short uh_sum; /* udp checksum */
};
#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,527 @@
/* in6.c - in6 header file */
/*
* Copyright (c) 2001-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/* $KAME: in6.h,v 1.159 2005/03/19 07:28:59 suz Exp $ */
/* $KAME: in6.h,v 1.155 2004/06/02 05:53:14 itojun Exp $ */
/* $FreeBSD: src/sys/netinet6/in6.h,v 1.7.2.7 2002/08/01 19:38:50 ume Exp $ */
/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
*/
/*
modification history
--------------------
02d,01dec11,rjq Add IPV6_X_VRID
02c,11sep08,kjn Add IPV6_PREFER_SRC_xxx flags
02b,02jul08,kjn Add back in6addr_any and in6addr_loopback
02a,30nov06,kch Changed ipi6_ifindex in in6_pktinfo structure from unsigned
int to u_int32_t.
01z,20nov06,kch Corrected comments for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
Also updated in6_addr structure declarations and macros.
01y,27oct06,kch Restore some non-standard macros that are removed previously.
01x,25oct06,kch Removed Kame specific non-standard macros. Added new
IPV6_RECVSAINFO, IPV6_ADDR_PREFERENCES, IPV6_FW and
IPV6_RECVIF socket options.
01w,04oct06,kch Updated the values assigned to the IPV6 options. Also removed
the unsupported IPV6CTL defines.
01v,10sep06,kch Cleanup for IPNet integration
01u,06aug05,dlk Added in6_pseudo() declaration.
01t,04jun05,dlk Make inet6_opt* functions from RFCs 2292 and 3542 visible in
user space.
01s,31may05,tlu Added IN6_IS_ADDR_GLOBAL
01r,09may05,kch Merged from Kame v 1.159.
01q,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01p,23feb05,dlk Make functions from rthdr.c visible in user space.
01o,07feb05,vvv _KERNEL cleanup
01n,24jan05,vvv osdep.h cleanup
01m,20jan05,sar Removal of divert, dummynet and fw code.
01l,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01k,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01j,20nov03,niq Remove copyright_wrs.h file inclusion
01i,04nov03,rlm Ran batch header path update for header re-org.
01h,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01g,27oct03,rlm update include statements post header re-org.
01f,11aug03,nee Merging from label ACCORDION_BASE6_MERGE_BASELINE in
accordion codeline to Base6
01e,09may03,vvv fixed check for in.h
01d,30apr03,syy Added #ifdef for __cplusplus
01c,01feb03,pas merge from FreeBSD 4.7 - added faithprefix_p
01b,30sep02,sar IFDEF out the KAME IPsec mflags
01a,03feb02,ham changes for tornado.
*/
#ifndef _NETINET_IN_H_
#error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
#endif
#ifndef _NETINET6_IN6_H_
#define _NETINET6_IN6_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Identification of the network protocol stack
* for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE
* has the table of implementation/integration differences.
*/
#define __KAME__
#define __KAME_VERSION "SNAP 20050404"
/*
* Local port number conventions:
*
* Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root),
* unless a kernel is compiled with IPNOPRIVPORTS defined.
*
* When a user does a bind(2) or connect(2) with a port number of zero,
* a non-conflicting local port address is chosen.
*
* The default range is IPPORT_ANONMIN to IPPORT_ANONMAX, although
* that is settable by sysctl(3); net.inet.ip.anonportmin and
* net.inet.ip.anonportmax respectively.
*
* A user may set the IPPROTO_IP option IP_PORTRANGE to change this
* default assignment range.
*
* The value IP_PORTRANGE_DEFAULT causes the default behavior.
*
* The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
* and exists only for FreeBSD compatibility purposes.
*
* The value IP_PORTRANGE_LOW changes the range to the "low" are
* that is (by convention) restricted to privileged processes.
* This convention is based on "vouchsafe" principles only.
* It is only secure if you trust the remote host to restrict these ports.
* The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
*/
#define IPV6PORT_RESERVED 1024
#define IPV6PORT_ANONMIN 49152
#define IPV6PORT_ANONMAX 65535
#define IPV6PORT_RESERVEDMIN 600
#define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
/*
* IPv6 address
*/
struct in6_addr {
union {
u_int8_t addr8[16];
u_int16_t addr16[8];
u_int32_t addr32[4];
} in6; /* 128-bit IP6 address */
};
#ifndef s6_addr
#define s6_addr in6.addr8
#endif
#ifdef _WRS_KERNEL /* XXX nonstandard */
#ifndef s6_addr8
#define s6_addr8 in6.addr8
#endif
#ifndef s6_addr16
#define s6_addr16 in6.addr16
#endif
#ifndef s6_addr32
#define s6_addr32 in6.addr32
#endif
#endif /* _WRS_KERNEL */
#define INET6_ADDRSTRLEN 46
/*
* Socket address for IPv6
*/
#ifndef _XOPEN_SOURCE
#define SIN6_LEN
#endif
struct sockaddr_in6 {
u_int8_t sin6_len; /* length of this struct(sa_family_t)*/
u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */
u_int16_t sin6_port; /* Transport layer port # (in_port_t)*/
u_int32_t sin6_flowinfo; /* IP6 flow information */
struct in6_addr sin6_addr; /* IP6 address */
u_int32_t sin6_scope_id; /* scope zone index */
};
/*
* Local definition for masks
*/
#ifdef _WRS_KERNEL /* XXX nonstandard */
#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}}
#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }}}
/*
* Macros started with IPV6_ADDR is KAME local
*/
#if _BYTE_ORDER == _BIG_ENDIAN
#define IPV6_ADDR_INT32_ONE 1
#define IPV6_ADDR_INT32_TWO 2
#define IPV6_ADDR_INT32_MNL 0xff010000
#define IPV6_ADDR_INT32_MLL 0xff020000
#define IPV6_ADDR_INT32_SMP 0x0000ffff
#define IPV6_ADDR_INT16_ULL 0xfe80
#define IPV6_ADDR_INT16_USL 0xfec0
#define IPV6_ADDR_INT16_MLL 0xff02
#elif _BYTE_ORDER == _LITTLE_ENDIAN
#define IPV6_ADDR_INT32_ONE 0x01000000
#define IPV6_ADDR_INT32_TWO 0x02000000
#define IPV6_ADDR_INT32_MNL 0x000001ff
#define IPV6_ADDR_INT32_MLL 0x000002ff
#define IPV6_ADDR_INT32_SMP 0xffff0000
#define IPV6_ADDR_INT16_ULL 0x80fe
#define IPV6_ADDR_INT16_USL 0xc0fe
#define IPV6_ADDR_INT16_MLL 0x02ff
#endif
#endif /* _WRS_KERNEL */
/*
* Definition of some useful macros to handle IP6 addresses
*/
#define IN6ADDR_ANY_INIT \
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
#define IN6ADDR_LOOPBACK_INIT \
{{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_NODELOCAL_ALLNODES_INIT \
{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \
{{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
#define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
#ifdef MLDV2
#define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \
{{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}}
#endif
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
/* Equality */
#define IN6_ARE_ADDR_EQUAL(a, b) \
(bcmp ((char *) &(a)->s6_addr[0], (char *) &(b)->s6_addr[0], \
sizeof(struct in6_addr)) == 0)
#ifdef _WRS_KERNEL /* non standard */
#if 0
/* see if two addresses are equal in a scope-conscious manner. */
#define SA6_ARE_ADDR_EQUAL(a, b) \
(((a)->sin6_scope_id == 0 || (b)->sin6_scope_id == 0 || \
((a)->sin6_scope_id == (b)->sin6_scope_id)) && \
(bcmp ((char *) &(a)->sin6_addr, (char *) &(b)->sin6_addr, \
sizeof (struct in6_addr)) == 0))
#endif
#endif
/*
* Unspecified
*/
#define IN6_IS_ADDR_UNSPECIFIED(a) \
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
/*
* Loopback
*/
#define IN6_IS_ADDR_LOOPBACK(a) \
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
/*
* IPv4 compatible
*/
#define IN6_IS_ADDR_V4COMPAT(a) \
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
/*
* Mapped
*/
#define IN6_IS_ADDR_V4MAPPED(a) \
((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
(*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
/*
* KAME Scope Values
*/
#ifdef _WRS_KERNEL /* XXX nonstandard */
#define IPV6_ADDR_SCOPE_NODELOCAL 0x01
#define IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02
#define IPV6_ADDR_SCOPE_SITELOCAL 0x05
#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
#define IPV6_ADDR_SCOPE_GLOBAL 0x0e
#else
#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
#define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
#define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
#define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
#define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
#endif
/*
* Unicast Scope
* Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
*/
#define IN6_IS_ADDR_LINKLOCAL(a) \
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
#define IN6_IS_ADDR_SITELOCAL(a) \
(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
/*
* Multicast
*/
#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
/*
* Global Scope
*/
#define IN6_IS_ADDR_GLOBAL(adr) \
((!IN6_IS_ADDR_MULTICAST(adr)) && \
(!IN6_IS_ADDR_LINKLOCAL(adr)) && \
(!IN6_IS_ADDR_SITELOCAL(adr)))
#ifdef _WRS_KERNEL /* XXX nonstandard */
#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
#else
#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
#endif
/*
* Multicast Scope
*/
#ifdef _WRS_KERNEL /* refers nonstandard items */
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL))
#define IN6_IS_ADDR_MC_INTFACELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_INTFACELOCAL))
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_GLOBAL))
#else
#define IN6_IS_ADDR_MC_NODELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
#define IN6_IS_ADDR_MC_SITELOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && \
(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
#endif
#ifdef _WRS_KERNEL /* nonstandard */
/*
* KAME Scope
*/
#define IN6_IS_SCOPE_LINKLOCAL(a) \
((IN6_IS_ADDR_LINKLOCAL(a)) || \
(IN6_IS_ADDR_MC_LINKLOCAL(a)))
#define IFA6_IS_DEPRECATED(a) \
((a)->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME && \
(u_int32_t)((time_second - (a)->ia6_updatetime)) > \
(a)->ia6_lifetime.ia6t_pltime)
#define IFA6_IS_INVALID(a) \
((a)->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME && \
(u_int32_t)((time_second - (a)->ia6_updatetime)) > \
(a)->ia6_lifetime.ia6t_vltime)
#endif /* _WRS_KERNEL */
/* IP6 route structure
*/
#ifndef _XOPEN_SOURCE
#include <net/route.h>
#endif
/*
* Options for use with [gs]etsockopt at the IPV6 level.
* First word of comment is data type; bool is stored in int.
*/
#define IPV6_V6ONLY 1 /* bool; make AF_INET6 sockets v6 only */
#define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
#define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
#define IPV6_CHECKSUM 7 /* int; checksum offset for raw socket */
#define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */
#define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */
#define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */
#define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */
#define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */
#define IPV6_PKTINFO 20 /* in6_pktinfo; send if, src addr */
#define IPV6_TCLASS 22 /* int; send traffic class value */
#define IPV6_NEXTHOP 23 /* sockaddr; next hop addr */
#define IPV6_RTHDR 24 /* ip6_rthdr; send routing header */
#define IPV6_HOPOPTS 25 /* ip6_hbh; send hop-by-hop option */
#define IPV6_DSTOPTS 26 /* ip6_dest; send dst option befor rthdr */
/* new socket options introduced in RFC2292bis */
#define IPV6_RTHDRDSTOPTS 27 /* ip6_dest; send dst option before rthdr */
#define IPV6_RECVPKTINFO 30 /* bool; recv if, dst addr */
#define IPV6_RECVHOPLIMIT 31 /* bool; recv hop limit */
#define IPV6_RECVTCLASS 32 /* bool; recv traffic class values */
#define IPV6_RECVRTHDR 34 /* bool; recv routing header */
#define IPV6_RECVHOPOPTS 35 /* bool; recv hop-by-hop option */
#define IPV6_RECVDSTOPTS 36 /* bool; recv dst option after rthdr */
#define IPV6_RECVSAINFO 37 /* int; get the SA information */
#define IPV6_ADDR_PREFERENCES 38 /* int; set/get sticky address preference flags (IPV6_PREFER_SRC_xxx) */
#define IPV6_FW 51 /* Ipfirewall_ctrl; Firewall control */
#define IPV6_RECVIF 100 /* int; turn "get link layer address (as a struct sockaddr_dl) */
#define IPV6_X_SENDERLINKADDR 101 /* int; ipcom_recvmsg() returns a struct
sockaddr_dl that will contain the link
address of the sender */
#define IPV6_X_VRID 103 /* Ip_u8; specify the virtual router ID as ancillary data */
#define IPV6_HOPLIMIT 21 /* int; send hop limit */
/* IPPROTO_ICMPV6 level socket options. */
#define ICMP6_FILTER 1 /* icmp6_filter; icmp6 filter */
/* Flags for IPV6_ADDR_PREFERENCES option */
#define IPV6_PREFER_SRC_HOME (1u << 0) /* Prefer Home Address as source (not implemented) */
#define IPV6_PREFER_SRC_COA (1u << 1) /* Prefer Care-Of_address as source (not implemented) */
#define IPV6_PREFER_SRC_TMP (1u << 2) /* Prefer Temporary address as source */
#define IPV6_PREFER_SRC_PUBLIC (1u << 3) /* Prefer Public address as source */
#define IPV6_PREFER_SRC_CGA (1u << 4) /* Prefer CGA address as source */
#define IPV6_PREFER_SRC_NONCGA (1u << 5) /* Prefer a non-CGA address as source (not implemented) */
#define IPV6_PREFER_SRC_LARGESCOPE (1u << 6) /* Prefer larger scope source */
#define IPV6_PREFER_SRC_SMALLSCOPE (1u << 7) /* Prefer smaller scope source */
/*
* Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
*/
struct ipv6_mreq {
struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast addr */
unsigned int ipv6mr_interface; /* interface index, or 0 */
};
/*
* IPV6_PKTINFO: Packet information(RFC2292 sec 5)
*/
struct in6_pktinfo {
struct in6_addr ipi6_addr; /* src/dst IPv6 address */
u_int32_t ipi6_ifindex; /* send/recv interface index */
};
#ifdef __cplusplus
}
#endif
#endif /* !_NETINET6_IN6_H_ */
@@ -0,0 +1,168 @@
/* in6_var.h - IPv6 interface definitions */
/*
* Copyright (c) 2001-2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/* $KAME: in6_var.h,v 1.107 2005/03/14 08:53:36 suz Exp $ */
/* $KAME: in6_var.h,v 1.103 2004/08/17 10:18:58 jinmei Exp $ */
/* $FreeBSD: src/sys/netinet6/in6_var.h,v 1.3.2.3 2002/04/28 05:40:27 suz Exp $ */
/* $KAME: in6_var.h,v 1.56 2001/03/29 05:34:31 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1985, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)in_var.h 8.1 (Berkeley) 6/10/93
*/
/*
modification history
--------------------
01r,09jan12,h_x Move extern "C" after last header file include.
01q,30nov06,kch Cleanup for IPNet integration.
01p,25jun05,dlk Add ip6intrqJob declaration.
01o,20jun05,kch Do not guard IN6_IFF_HOME and IN6_IFF_DEREGISTERING defines
with MIP6 build flag.
01n,24may05,vvv updated for Kame merge
01m,13may05,nee Add a IPv6 address flag IN6_IFF_SUBNETANYCAST.
01o,10may05,kch Merged from Kame v 1.107.
01n,28apr05,kch Moved addrsel_policyent structure definition here from
in6_src.c.
01m,20apr05,kch Merged from comp_wn_ipv6_mld_interim-dev branch.
01l,16mar05,nee Add SIOCSIFINFO_IN6
01k,07feb05,vvv _KERNEL cleanup
01j,25jan05,vvv fixed bitfield definitions (SPR #92171)
01i,21nov03,vvv protected in6_prflags and in6_rrenumreq structures with INET6
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,05nov03,cdw Removal of unnecessary _KERNEL guards.
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,12aug03,nee Merging from label ACCORDION_BASE6_MERGE_BASELINE in
accordion codeline to Base6
01c,10jun03,vvv include netVersion.h
01b,30apr03,syy Added #ifdef for __cplusplus
01a,24jun02,ism created new structure to hold the IPv6 MIB information
*/
#ifndef _NETINET6_IN6_VAR_H_
#define _NETINET6_IN6_VAR_H_
#ifdef _WRS_KERNEL
#include <net/if_var.h> /* needed for struct ifaddr */
#else
#include <net/if.h> /* needed for IFNAMSIZ */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* pltime/vltime are just for future reference (required to implements 2
* hour rule for hosts). they should never be modified by nd6_timeout or
* anywhere else.
* userland -> kernel: accept pltime/vltime
* kernel -> userland: throw up everything
* in kernel: modify preferred/expire only
*/
struct in6_addrlifetime {
time_t ia6t_expire; /* valid lifetime expiration time */
time_t ia6t_preferred; /* preferred lifetime expiration time */
u_int32_t ia6t_vltime; /* valid lifetime */
u_int32_t ia6t_pltime; /* prefix lifetime */
};
struct in6_ifreq {
char ifr_name[IFNAMSIZ]; /* if name, e.g. "eth0" */
union {
struct sockaddr_in6 ifru_addr; /* address */
struct sockaddr_in6 ifru_dstaddr; /* other end of p-to-p link */
unsigned ifru_prefixlen; /* address prefix length */
} ifr_ifru;
};
struct in6_aliasreq {
char ifra_name[IFNAMSIZ];
struct sockaddr_in6 ifra_addr; /* The address to set */
struct sockaddr_in6 ifra_dstaddr; /* Peer address for PPP interfaces */
struct sockaddr_in6 ifra_prefixmask; /* Mask to get the nework ID */
int ifra_flags; /* IN6_IFF_xxx flags */
struct in6_addrlifetime ifra_lifetime;
};
#define IN6_IFF_TEMPORARY 0x01 /* temporary (anonymous) address. */
#define IN6_IFF_TENTATIVE 0x02 /* tentative address */
#define IN6_IFF_HOMEADDRESS 0x04 /* MIP6 home address */
#define IN6_IFF_DEPRECATED 0x08 /* deprecated address */
#define IN6_IFF_AUTOMATIC 0x10 /* create automatically by IPNET */
#define IN6_IFF_AUTONOMOUS 0x20 /* create based on prefix adv */
#define IN6_IFF_ANYCAST 0x40 /* anycast address */
#ifdef __cplusplus
}
#endif
#endif /* _NETINET6_IN6_VAR_H_ */
@@ -0,0 +1,339 @@
/* ip6.h - IPv6 protocol definitions */
/*
* Copyright (c) 2001-2005 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/* $FreeBSD: src/sys/netinet/ip6.h,v 1.2.2.2 2001/07/03 11:01:46 ume Exp $ */
/* $KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ip.h 8.1 (Berkeley) 6/10/93
*/
/*
modification history
--------------------
01m,09jan12,h_x Move extern "C" after last header file include.
01l,25oct06,kch Removed unused coreip specific IP6_EXTHDR macros.
01k,21jun05,dlk Improve IP6_EXTHDR_CHECK() macro.
01j,03may05,rp removed __attribute__((__packed__))
01i,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01h,07feb05,vvv _KERNEL cleanup
01g,14jan05,vvv osdep.h cleanup
01f,20nov03,niq Remove copyright_wrs.h file inclusion
01e,05nov03,cdw Removal of unnecessary _KERNEL guards.
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01b,11aug03,nee Merging from label ACCORDION_BASE6_MERGE_BASELINE in
accordion codeline to Base6
01b,17feb02,pas EAR code cleanup
01a,01sep01,qli created
*/
#ifndef _NETINET_IP6_H_
#define _NETINET_IP6_H_
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Definition for internet protocol version 6.
* RFC 2460
*/
struct ip6_hdr {
union {
struct ip6_hdrctl {
u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */
u_int16_t ip6_un1_plen; /* payload length */
u_int8_t ip6_un1_nxt; /* next header */
u_int8_t ip6_un1_hlim; /* hop limit */
} ip6_un1;
u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
} ip6_ctlun;
struct in6_addr ip6_src; /* source address */
struct in6_addr ip6_dst; /* destination address */
};
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
#define IPV6_VERSION 0x60
#define IPV6_VERSION_MASK 0xf0
#if _BYTE_ORDER == _BIG_ENDIAN
#define IPV6_FLOWINFO_MASK 0x0fffffff /* flow info (28 bits) */
#define IPV6_FLOWLABEL_MASK 0x000fffff /* flow label (20 bits) */
#else
#if _BYTE_ORDER == _LITTLE_ENDIAN
#define IPV6_FLOWINFO_MASK 0xffffff0f /* flow info (28 bits) */
#define IPV6_FLOWLABEL_MASK 0xffff0f00 /* flow label (20 bits) */
#endif /* LITTLE_ENDIAN */
#endif
#if 1
/* ECN bits proposed by Sally Floyd */
#define IP6TOS_CE 0x01 /* congestion experienced */
#define IP6TOS_ECT 0x02 /* ECN-capable transport */
#endif
#ifdef _WRS_KERNEL
/*
* for IPv6 pseudo header checksum
* XXX nonstandard
*/
struct ip6_hdr_pseudo {
struct in6_addr ip6ph_src;
struct in6_addr ip6ph_dst;
u_int32_t ip6ph_len;
u_int8_t ip6ph_zero[3];
u_int8_t ip6ph_nxt;
};
#endif
/*
* Extension Headers
*/
struct ip6_ext {
u_int8_t ip6e_nxt;
u_int8_t ip6e_len;
};
/* Hop-by-Hop options header */
/* XXX should we pad it to force alignment on an 8-byte boundary? */
struct ip6_hbh {
u_int8_t ip6h_nxt; /* next header */
u_int8_t ip6h_len; /* length in units of 8 octets */
/* followed by options */
};
/* Destination options header */
/* XXX should we pad it to force alignment on an 8-byte boundary? */
struct ip6_dest {
u_int8_t ip6d_nxt; /* next header */
u_int8_t ip6d_len; /* length in units of 8 octets */
/* followed by options */
};
/* Option types and related macros */
#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
#define IP6OPT_PADN 0x01 /* 00 0 00001 */
#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
#define IP6OPT_NSAP_ADDR 0xC3 /* 11 0 00011 */
#define IP6OPT_TUNNEL_LIMIT 0x04 /* 00 0 00100 */
#ifndef _WRS_KERNEL
#define IP6OPT_RTALERT 0x05 /* 00 0 00101 (KAME definition) */
#endif
#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 (RFC3542, recommended) */
#define IP6OPT_RTALERT_LEN 4
#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
#define IP6OPT_MINLEN 2
#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */
#define IP6OPT_EID 0x8a /* 10 0 01010 */
#define IP6OPT_TYPE(o) ((o) & 0xC0)
#define IP6OPT_TYPE_SKIP 0x00
#define IP6OPT_TYPE_DISCARD 0x40
#define IP6OPT_TYPE_FORCEICMP 0x80
#define IP6OPT_TYPE_ICMP 0xC0
#define IP6OPT_MUTABLE 0x20
/* IPv6 options: common part */
struct ip6_opt {
u_int8_t ip6o_type;
u_int8_t ip6o_len;
};
/* Jumbo Payload Option */
struct ip6_opt_jumbo {
u_int8_t ip6oj_type;
u_int8_t ip6oj_len;
u_int8_t ip6oj_jumbo_len[4];
};
#define IP6OPT_JUMBO_LEN 6
/* NSAP Address Option */
struct ip6_opt_nsap {
u_int8_t ip6on_type;
u_int8_t ip6on_len;
u_int8_t ip6on_src_nsap_len;
u_int8_t ip6on_dst_nsap_len;
/* followed by source NSAP */
/* followed by destination NSAP */
};
/* Tunnel Limit Option */
struct ip6_opt_tunnel {
u_int8_t ip6ot_type;
u_int8_t ip6ot_len;
u_int8_t ip6ot_encap_limit;
};
/* Router Alert Option */
struct ip6_opt_router {
u_int8_t ip6or_type;
u_int8_t ip6or_len;
u_int8_t ip6or_value[2];
};
/* Router alert values (in network byte order) */
#if _BYTE_ORDER == _BIG_ENDIAN
#define IP6_ALERT_MLD 0x0000
#define IP6_ALERT_RSVP 0x0001
#define IP6_ALERT_AN 0x0002
#else
#if _BYTE_ORDER == _LITTLE_ENDIAN
#define IP6_ALERT_MLD 0x0000
#define IP6_ALERT_RSVP 0x0100
#define IP6_ALERT_AN 0x0200
#endif /* LITTLE_ENDIAN */
#endif
/* Home Address Option */
struct ip6_opt_home_address {
u_int8_t ip6oh_type;
u_int8_t ip6oh_len;
u_int8_t ip6oh_addr[16];/* Home Address */
/* followed by sub-options */
};
/* Routing header */
struct ip6_rthdr {
u_int8_t ip6r_nxt; /* next header */
u_int8_t ip6r_len; /* length in units of 8 octets */
u_int8_t ip6r_type; /* routing type */
u_int8_t ip6r_segleft; /* segments left */
/* followed by routing type specific data */
};
/* Type 0 Routing header */
struct ip6_rthdr0 {
u_int8_t ip6r0_nxt; /* next header */
u_int8_t ip6r0_len; /* length in units of 8 octets */
u_int8_t ip6r0_type; /* always zero */
u_int8_t ip6r0_segleft; /* segments left */
u_int32_t ip6r0_reserved; /* reserved field */
/* followed by up to 127 struct in6_addr */
};
/* Type 2 Routing header for Mobile IPv6 */
struct ip6_rthdr2 {
u_int8_t ip6r2_nxt; /* next header */
u_int8_t ip6r2_len; /* always 2 */
u_int8_t ip6r2_type; /* always 2 */
u_int8_t ip6r2_segleft; /* 0 or 1 */
u_int32_t ip6r2_reserved; /* reserved field */
struct in6_addr ip6r2_home; /* home address */
};
/* Fragment header */
struct ip6_frag {
u_int8_t ip6f_nxt; /* next header */
u_int8_t ip6f_reserved; /* reserved field */
u_int16_t ip6f_offlg; /* offset, reserved, and flag */
u_int32_t ip6f_ident; /* identification */
};
#if _BYTE_ORDER == _BIG_ENDIAN
#define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */
#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
#else /* BYTE_ORDER == LITTLE_ENDIAN */
#define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */
#define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */
#define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
/*
* Internet implementation parameters.
*/
#define IPV6_MAXHLIM 255 /* maximum hoplimit */
#define IPV6_DEFHLIM 64 /* default hlim */
#define IPV6_FRAGTTL 120 /* ttl for fragment packets, in slowtimo tick */
#define IPV6_HLIMDEC 1 /* subtracted when forwarding */
#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */
#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/
#define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */
#ifdef __cplusplus
}
#endif
#endif /* not _NETINET_IP6_H_ */
@@ -0,0 +1,174 @@
/* ip6_mroute.h - IPv6 mroute header file */
/* $KAME: ip6_mroute.h,v 1.29 2004/05/21 08:17:58 itojun Exp $ */
/* $FreeBSD: src/sys/netinet6/ip6_mroute.h,v 1.2.2.3 2002/04/28 05:40:27 suz Exp $ */
/* $KAME: ip6_mroute.h,v 1.19 2001/06/14 06:12:55 suz Exp $ */
/*
* Copyright (c) 2001-2007 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
* Copyright (C) 1998 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* BSDI ip_mroute.h,v 2.5 1996/10/11 16:01:48 pjd Exp */
/*
* Definitions for IP multicast forwarding.
*
* Written by David Waitzman, BBN Labs, August 1988.
* Modified by Steve Deering, Stanford, February 1989.
* Modified by Ajit Thyagarajan, PARC, August 1993.
* Modified by Ajit Thyagarajan, PARC, August 1994.
* Modified by Ahmed Helmy, USC, September 1996.
*
* MROUTING Revision: 1.2
*/
/*
modification history
--------------------
01i,09jan12,h_x Move extern "C" after last header file include.
01h,12jul07,kch Re-integrated to support multicast forwarding for IPNET
(WIND00102340).
01g,20may05,kch Redefined cfg_privInitSysctl as function pointer. Moved
ip6MrouteSysctlInit() prototype to sysctlLib.h.
01f,26apr05,kch Allow ip6 mrouter to be scaled out.
01e,19apr05,rp merged from comp_wn_ipv6_mld_interim-dev
01d,28jan05,kc Redefined IF_COPY and IF_ZERO macros.
01c,28dec04,kc Added ipm6_config_params structure. Also added
ip6MrouteSysctlInit() prototype.
01b,23dec04,kc Added pim6_input() and ip6MrouterInstInit() prototypes.
01a,08dec04,kc Integrated Kame changes.
*/
#ifndef _NETINET6_IP6_MROUTE_H_
#define _NETINET6_IP6_MROUTE_H_
#include <netinet6/in6.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Multicast Routing set/getsockopt commands.
*/
#define MRT6_BASE 0x60000000
#define MRT6_INIT (MRT6_BASE + 0) /* initialize mrouted */
#define MRT6_DONE (MRT6_BASE + 1) /* shut down mrouted */
#define MRT6_ADD_MIF (MRT6_BASE + 2) /* add multicast interface */
#define MRT6_DEL_MIF (MRT6_BASE + 3) /* delete multicast interface */
#define MRT6_ADD_MFC (MRT6_BASE + 4) /* add forwarding cache entry */
#define MRT6_DEL_MFC (MRT6_BASE + 5) /* delete forwarding cache entry */
#define MRT6_PIM (MRT6_BASE + 6) /* enable pim code */
/*
* Types and macros for handling bitmaps with one bit per multicast interface.
*/
typedef u_short mifi_t; /* type of a mif index */
#define MAXMIFS 64 /* Maximum number of multicast interfaces */
#ifndef IF_SETSIZE
#define IF_SETSIZE 256
#endif
typedef u_int32_t if_mask;
#define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */
typedef struct if_set {
if_mask ifs_bits[(((IF_SETSIZE)+((NIFBITS)-1))/(NIFBITS))];
} if_set;
/* Macros to operate on the mf6cc_ifset bit array */
#define IF_SET(n, p) \
((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS)))
#define IF_CLR(n, p) \
((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS)))
#define IF_ISSET(n, p) \
((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS)))
#define IF_COPY(f, t) bcopy(f, t, sizeof(struct if_set))
#define IF_ZERO(p) bzero(p, sizeof(struct if_set))
/*
* Argument structure for MRT6_ADD_MIF and MRT6_DEL_MIF.
*/
struct mif6ctl {
mifi_t mif6c_mifi; /* the index of the mif to be added */
u_char mif6c_flags; /* MIFF_ flags defined below */
u_short mif6c_pifi; /* the index of the physical IF */
};
#define MIFF_REGISTER 0x1 /* mif represents a register end-point */
/*
* Argument structure for MRT6_ADD_MFC and MRT6_DEL_MFC
*/
struct mf6cctl {
struct sockaddr_in6 mf6cc_origin; /* IPv6 origin of mcasts */
struct sockaddr_in6 mf6cc_mcastgrp; /* multicast group associated */
mifi_t mf6cc_parent; /* incoming ifindex */
struct if_set mf6cc_ifset; /* set of forwarding ifs */
};
/*
* Argument structure for SIOCGETSGCNT_IN6
* Used by a multicast routing daemon to get src-grp packet counts
*/
struct sioc_sg_req6 {
struct sockaddr_in6 src; /* Source address */
struct sockaddr_in6 grp; /* Multicast group address */
u_int64_t pktcnt; /* No of packets routed */
u_int64_t bytecnt; /* No of bytes routed */
u_int64_t wrong_if; /* No of packets arrived on wrong interface */
};
/*
* Argument structure for SIOCGETMIFCNT_IN6
* Used by a multicast routing daemon to get multicast interface packet
* counts.
*/
struct sioc_mif_req6 {
mifi_t mifi; /* mif number */
u_int64_t icount; /* Input packet count */
u_int64_t ocount; /* Output packet count */
u_int64_t ibytes; /* Input byte count */
u_int64_t obytes; /* Output byte count */
};
#ifdef __cplusplus
}
#endif
#endif /* !_NETINET6_IP6_MROUTE_H_ */
@@ -0,0 +1,39 @@
/* pathUtilLib.h - path utility library header file */
/* Copyright 2004 Wind River Systems, Inc. */
/*
modification history
--------------------
01c,09jan12,h_x Move extern "C" after last header file include.
01b,07jan05,syy Fixed compile error for RTP
01a,14dec04,syy written.
*/
#ifndef __INCpathUtilLibh
#define __INCpathUtilLibh
/* includes */
#include <vxWorks.h>
#ifdef __cplusplus
extern "C" {
#endif
/* function declarations */
extern STATUS pathUtilBuild (const char ** nameArray, char ** nameArrayEnd,
char *destString);
extern STATUS pathUtilCat (const char *dirName, const char *fileName,
char *result);
extern void pathUtilCondense (char *pathName);
extern void pathUtilParse (const char *longName, char ** nameArray,
char *nameBuf);
extern void pathUtilArrayReduce (char **nameArray);
extern BOOL pathUtilIsSubDir (const char *s1, const char *s2);
#ifdef __cplusplus
}
#endif
#endif /* __INCpathUtilLibh */
@@ -0,0 +1,42 @@
/* ping6Lib.h - Packet InterNet Grouper (PING) library header */
/*
* Copyright (c) 2001-2003,2005-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01i,27jul06,kch Removed unsupported ping6LibInit() and ping6Parse()
prototypes.
01h,23feb05,dlk Added ping6Parse() function prototype.
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,01mar02,ant added ping6LibInit
01a,14sep01,ant written
*/
#ifndef __INCping6Libh
#define __INCping6Libh
#ifdef __cplusplus
extern "C" {
#endif
/* function declarations */
extern STATUS ping6 (char *, int);
#ifdef __cplusplus
}
#endif
#endif /* __INCping6Libh */
+118
View File
@@ -0,0 +1,118 @@
/* pingLib.h - Packet InterNet Grouper (PING) library header */
/*
* Copyright (c) 1994-2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01o,09jan12,h_x Move extern "C" after last header file include.
01n,26oct06,tkf Restore removed structures (needed by pingLib.c for user side
build).
01m,20sep06,tlu Restore some header file, constant and type definitions
01l,03aug06,kch Cleanup for IPNet stack. Changed PING_TMO from 5 to 1 sec.
01k,07feb05,vvv _KERNEL cleanup
01j,20nov03,niq Remove copyright_wrs.h file inclusion
01j,T14ov03,asr Changes for porting ping to RTP
01i,05nov03,cdw Removal of unnecessary _KERNEL guards.
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,15may03,spm Tornado 2.2 FCS merge (SPR #73570; ver 01d,12mar02,rae:
TOR2_2-FCS-COPY label, tor2 branch, /wind/river VOB)
01e,09may03,vvv included ip_icmp.h
01d,25jul02,ant definitions ICMP_PROTO and ICMP_TYPENUM removed
01c,03may02,ant u_char bufTx [PING_MAXPACKET] in the struct PING_STAT changed
to u_char *bufTx. It is allocated dynamically now. Receive
buffer u_char bufRx[PING_MAXPACKET] changed in the same way.
New member int timing defined in the struct PING_STAT.
PING_MAXPACKET increased to 65536.
01b,14jan00,ham changed PING_STAT for PD support.
01a,25oct94,dzb written.
*/
#ifndef __INCpingLibh
#define __INCpingLibh
/* includes */
#include <vxWorks.h>
#include <netinet/ip_icmp.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define PING_MAXPACKET 65536 /* max packet size */
#define PING_INTERVAL 1 /* default packet interval in seconds */
#define PING_TMO 1 /* default packet timeout in seconds */
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#ifndef INET_ADDR_LEN
#define INET_ADDR_LEN 18
#endif
/* status codes */
#define S_pingLib_NOT_INITIALIZED (M_pingLib | 1)
#define S_pingLib_TIMEOUT (M_pingLib | 2)
/* flags */
#define PING_OPT_SILENT 0x1 /* work silently */
#define PING_OPT_DONTROUTE 0x2 /* dont route option */
#define PING_OPT_DEBUG 0x4 /* print debugging messages */
#define PING_OPT_NOHOST 0x8 /* suppress host lookup [ANT] */
/* typedefs */
typedef struct pingStat /* PING_STAT */
{
struct pingStat * statNext; /* next struct in list */
int pingFd; /* socket file descriptor */
char toHostName [MAXHOSTNAMELEN + 2];/* name to ping */
char toInetName [INET_ADDR_LEN];/* IP addr to ping */
u_char *bufTx; /* transmit buffer */
u_char *bufRx; /* receive buffer */
struct icmp * pBufIcmp; /* ptr to icmp */
ulong_t * pBufTime; /* ptr to time */
int dataLen; /* size of data portion */
int numPacket; /* total # of packets to send */
int numTx; /* number of packets sent */
int numRx; /* number of packets received */
int idRx; /* id of Rx task */
int clkTick; /* sys clock ticks per second */
int tMin; /* min RT time (ms) */
int tMax; /* max RT time (ms) */
int tSum; /* sum of all times */
int flags; /* option flags */
int timing; /* flag to do timing */
} PING_STAT;
/* forward declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern STATUS ping (char *host, int numPackets, ulong_t options);
#else /* __STDC__ */
extern STATUS ping ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCpingLibh */
@@ -0,0 +1,38 @@
/* ftpLibP.h - private header for ftpLib */
/*
* Copyright (c) 1992, 2002-2003, 2006 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01h,09jan12,h_x Move extern "C" after last header file include.
01g,16feb06,mwv Remove ftpLs(), but keep this file for
backward compatibility
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,14feb02,ant added routines ftpUserPassSet, ftpUserPassPrint
01b,22sep92,rrr added support for c++
01a,20sep92,kdl written.
*/
#ifndef __INCftpLibPh
#define __INCftpLibPh
#include <ftpLib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* __INCftpLibPh */
@@ -0,0 +1,267 @@
/* gtf_core.h - general timer facility - core */
/*
* Copyright (c) 2001-2007, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01r,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
01q,16apr07,dcc added _WRS_FASTDATA to the definition of netGtfSeconds.
01p,20feb07,kch Merged from base6_iter12_smp-dev - Use spinlocks instead of
intLock.
01o,27dec06,kch Removed references to the obsolete coreip virtual stack.
01n,10jul05,dlk Optimizations. Use L_NODE lists rather than DLL_LIST lists
to avoid needing to reference the list head when removing
a timer from the expire list. Replace timerMutex with
intLock/intUnlock.
01m,31jan05,sar Fix defects found in GTF code inspection of 10/26/2004
as described in SPRs 106685 - 105688
01l,17jan05,vvv osdep.h cleanup
01k,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01j,02jul04,vvv changed vsnum from VSNUM to VSID
01i,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/2)
01h,25nov03,wap Merge changes from Snowflake
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,27oct03,rlm update include statements post header re-org.
01c,07aug03,nee Merging to Base6 from ACCORDION_BASE6_MERGE_BASELINE label on
Accordion codeline
01b,03feb02,ham changed for tornado build.
01a,06jun01,deg written.
*/
#ifndef __INCgtf_coreh
#define __INCgtf_coreh
#include <netVersion.h>
#include <wdLib.h>
#include <semLib.h>
#include <sllLib.h>
#include <dllLib.h>
#include <spinLockLib.h>
#include <private/gtf_util.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* For virtual stack, the source files that include this header must
* include vsNetCore.h to find splSemId and splTid
*/
IMPORT SEM_ID splSemId; /* spl mutex semaphore id */
IMPORT INT32 splTid; /* task which currently owns splSemId */
/* defines */
/* The LOCAL_ALLOC bit indicates if the GTF has allocated the memory for
* the timer. It is set if GTF did so.
* The ACTIVE bit indicates if the user has serviced this timer. It is cleared
* by GTF when initializing a timer structure and then set when a timer is
* activated (started or reset). It is cleared if the timer is stopped
* (cancel or delete). It is left for the user to clear when the timer
* expires.
* The PENDING bit indicates if the timer is queued in the GTF timer wheels.
* It is cleared by GTF when initializing a timer structure and then set when
* a timer is activated (started or reset). It is cleared when the timer is
* removed from the timer wheels (cancel, delete or expire).
*/
#define TIMER_LOCAL_ALLOC 0x0001 /* true if GTF allocates timer memory */
#define TIMER_ACTIVE 0x0002 /* true if timer has not been served */
#define TIMER_PENDING 0x0004 /* true if timer is waiting for timeout */
#define TICKS tickGet()
#define TICK_LT(x,y) ((long)((x) - (y)) < 0)
#define TICK_GT(x,y) ((long)((x) - (y)) > 0)
#define TICK_LEQ(x,y) ((long)((x) - (y)) <= 0)
#define TICK_GEQ(x,y) ((long)((x) - (y)) >= 0)
#define time_second netGtfSeconds
/* typedefs */
struct gtfTimerManager;
struct gtfTimer;
typedef int (*GTF_TIMER_HANDLER)(void*);
typedef void (*GTF_TICK_FUNC) (struct gtfTimerManager *, void *);
/*
* This structure is used both for the head and for nodes within
* a circular list. We want to be able to remove a node without
* referencing the list head, and to add quickly to the tail end
* of a list, and fetch the first node quickly. When used as a
* list head, pNext indicates the first entry of the list and
* pPrev indicates the last entry.
*/
typedef struct L_NODE
{
struct L_NODE * pPrev;
struct L_NODE * pNext;
} L_NODE;
#define L_EMPTY(h) ((h) == (h)->pNext)
#define L_INIT(h) \
do { \
(h)->pPrev = (h); \
(h)->pNext = (h); \
} while ((0))
/*
* Be careful. After L_REMOVE/L_GET, a node is left with dangling
* references to the list it was in.
*/
#define L_REMOVE(n) \
do { \
L_NODE * _pPrev_ = (n)->pPrev; \
L_NODE * _pNext_ = (n)->pNext; \
_pPrev_->pNext = _pNext_; \
_pNext_->pPrev = _pPrev_; \
} while ((0))
#define L_GET(h, n) \
do { \
L_NODE * _pNext_; \
(n) = (void *)((h)->pNext); \
_pNext_ = ((L_NODE *)(n))->pNext; \
(h)->pNext = _pNext_; \
_pNext_->pPrev = (h); \
} while ((0))
#define L_SPLICE(_prev, _next, n) \
do { \
(n)->pPrev = (_prev); \
(n)->pNext = (_next); \
(_prev)->pNext = (n); \
(_next)->pPrev = (n); \
} while ((0))
#define L_ADD(h, n) \
do { \
L_NODE * _pPrev_ = (h)->pPrev; \
L_SPLICE (_pPrev_, (h), (n)); \
} while ((0))
typedef struct gtfTimerUnitManager
{
L_NODE *timerWheel; /* array of timer slots */
unsigned int fuzzyMask; /* lsb bits (error range) */
unsigned int shiftBits; /* # bits of fuzzy mask */
unsigned long nbrFiredTimer; /* # fired timer */
unsigned int nbrOutstandTimer; /* # outstanding timer */
} GTF_TIMER_UNIT_MANAGER;
typedef struct gtfTimerManager
{
GTF_TIMER_UNIT_MANAGER *timerUnitManager; /* array of timer units */
unsigned int nbrTimerUnit; /* # of timer units */
unsigned int nbrTimerSlot; /* # of timer slots */
unsigned int timerUnitMask; /* mask to realize wrap-around array */
unsigned int binPowGranScale; /* binary power of gran. scaling factor */
unsigned long currTicks; /* current GTF tick number */
unsigned int relSysClkTicks; /* # system ticks per clock delay */
unsigned int maxTimerTicks; /* max timer tick value */
SL_LIST timerQueue; /* timer free queue */
unsigned int maxAllocTimer; /* # of timer in free queue */
unsigned int currAllocTimer; /* # of allocated timer in free queue */
WDOG_ID clock; /* clock */
SEM_ID mngrMutex; /* manager lock */
SEM_ID count; /* counting semaphore */
GTF_TICK_FUNC tickFunc; /* external tick function */
void * tickArg; /* second arg to external tick function */
SL_LIST timerBlocks; /* blocks of memory for allocated timers */
L_NODE * timerListMemory; /* Memory allocated for the heads of the */
/* timer lists, for use when deleting the */
/* manager */
spinlockIsr_t lock; /* manager lock */
} GTF_TIMER_MANAGER;
typedef struct gtfTimer
{
union
{
L_NODE expNode; /* node of expire list */
SL_NODE freeNode; /* node of free queue */
} timerLinking;
unsigned int timerTicks; /* timer ticks */
unsigned int timerUnit; /* timer unit */
unsigned int timerFlags; /* timer flags */
GTF_TIMER_HANDLER handler; /* timer handler */
void* arg; /* argument to timer handler */
} GTF_TIMER;
extern unsigned long _WRS_FASTDATA netGtfSeconds;
extern GTF_TIMER_MANAGER *
gtfTimerManagerCreate(unsigned int nbrTimerUnit,
unsigned int binPowTimerSlot,
unsigned int binPowGranScale,
unsigned int sizeTimerFreeQueue,
unsigned int hertz,
GTF_TICK_FUNC tickFunc,
void * tickArg
);
extern int gtfTimerManagerRun(GTF_TIMER_MANAGER *tm);
extern int gtfBookkeeping(GTF_TIMER_MANAGER *tm);
extern int gtfTimerManagerDelete(GTF_TIMER_MANAGER *tm);
extern GTF_TIMER *gtfTimerCreate(GTF_TIMER_MANAGER *tm);
extern int gtfTimerInit(GTF_TIMER_MANAGER* tm,
GTF_TIMER *t,
unsigned int toTicks,
GTF_TIMER_HANDLER th,
void* arg
);
extern int gtfTimerDelete(GTF_TIMER_MANAGER *tm,
GTF_TIMER *t);
extern int gtfTimerStart(GTF_TIMER_MANAGER *tm,
GTF_TIMER *t
);
extern int gtfTimerReset(GTF_TIMER_MANAGER* tm,
GTF_TIMER *t,
unsigned int toTicks,
GTF_TIMER_HANDLER th,
void* arg
);
extern int gtfTimerCancel(GTF_TIMER_MANAGER *tm,
GTF_TIMER *t
);
extern int gtfShow(GTF_TIMER_MANAGER *tm);
extern int gtfGetNbrFiredTimer(GTF_TIMER_MANAGER *tm,
unsigned int timerUnit
);
extern int gtfGetNbrOutstandTimer(GTF_TIMER_MANAGER *tm,
unsigned int timerUnit
);
#ifdef __cplusplus
}
#endif
#endif /* __INCgtf_coreh */
@@ -0,0 +1,92 @@
/* gtf_util.h - general timer facility - utility */
/*
* Copyright 1984-2005, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
01k,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
01j,31jan05,sar Fix defects found in GTF code inspection of 10/26/2004
as described in SPRs 106685 - 105688
01i,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01h,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5_networking-int/1)
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,05nov03,cdw Removal of unnecessary _KERNEL guards.
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,10jun03,vvv include netVersion.h
01b,15jan02,pas GTF_REQUIRE[_2] should test the condition even if
it's not logging the errors
01a,06jun01,deg written.
*/
#ifndef __INCgtf_utilh
#define __INCgtf_utilh
#include <netVersion.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#ifdef GTF_WITH_DEBUG
#define GTF_PRINT(s1,s2) PRINTF("**** %s : %10ld\n",s1, (unsigned long) s2)
#else
#define GTF_PRINT(s1,s2)
#endif
#if ! defined (_FREE_VERSION)
#ifdef GTF_WITH_REQUIRE
#define GTF_REQUIRE(cond, func, diag, retVal) if(!(cond)) \
{ \
GTF_ERROR_LOG(func, diag); \
return (retVal); \
}
#define GTF_REQUIRE_2(cond, func, diag) if(!(cond)) \
{ \
GTF_ERROR_LOG(func, diag); \
return; \
}
#else /* GTF_WITH_REQUIRE */
#define GTF_REQUIRE(cond, func, diag, retVal) if(!(cond)) \
{ \
return (retVal); \
}
#define GTF_REQUIRE_2(cond, func, diag) if(!(cond)) \
{ \
return; \
}
#endif /* GTF_WITH_REQUIRE */
#else /* defined (_FREE_VERSION) */
#define GTF_REQUIRE(cond, func, diag, retVal) do {} while (0)
#define GTF_REQUIRE_2(cond, func, diag) do {} while (0)
#endif /* defined (_FREE_VERSION) */
#define GTF_ERROR_LOG(func, diag) gtfErrorLog(__FILE__, func,__LINE__, diag);
extern void gtfErrorLog(char *file,
char *function,
int line,
char *diagnose
);
#ifdef __cplusplus
}
#endif
#endif /* __INCgtf_utilh */
@@ -0,0 +1,58 @@
/* gtf_wrapper.h - general timer facility - wrapper */
/* Copyright 2001-2003, 2005, 2010 Wind River Systems, Inc. */
/*
modification history
--------------------
01i,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
01h,31jan05,sar Fix defects found in GTF code inspection of 10/26/2004
as described in SPRs 106685 - 105688
01g,20nov03,niq Remove copyright_wrs.h file inclusion
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,23oct03,rlm updated #includes for header re-org
01c,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01b,02feb02,ham changed for tornado build
01a,06jun01,deg written.
*/
#ifndef __INCgtf_wrapperh
#define __INCgtf_wrapperh
#include <private/gtf_core.h>
#ifdef __cplusplus
extern "C" {
#endif
extern GTF_TIMER *gtfTimeout(GTF_TIMER_HANDLER th,
void* arg,
unsigned int toTicks,
GTF_TIMER_MANAGER *tm
);
extern void gtfUntimeout(GTF_TIMER_HANDLER th,
void* arg,
GTF_TIMER *t,
GTF_TIMER_MANAGER *tm
);
extern void gtfCalloutReset(GTF_TIMER *t,
unsigned int toTicks,
GTF_TIMER_HANDLER th,
void* arg,
GTF_TIMER_MANAGER *tm
);
extern void gtfCalloutStop(GTF_TIMER *t,
GTF_TIMER_MANAGER *tm
);
extern void gtfCalloutInit(GTF_TIMER *t);
#ifdef __cplusplus
}
#endif
#endif /* __INCgtf_wrapperh */
@@ -0,0 +1,79 @@
/* hostLibInt.h - private header for hostLib files */
/*
* Copyright (c) 2001-2005 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01h,09may05,vvv updated ip6_str2scopeid() prototype
01g,05dec03,vvv moved HOST_LIST_* definitions from hostLib.c
01f,24nov03,vvv updated for RTP support
01e,20nov03,niq Remove copyright_wrs.h file inclusion
01d,08sep03,vvv merged from ACCORDION_BASE6_MERGE_BASELINE
01c,21mar03,ann moved the definition of _hostconf and MAXHOSTCONF from
name6.c
01b,21jan02,ann adding the prototypes for gethostbyname, gethostbyaddr,
hostentAlloc and hostentFree
01a,19sep01,hgo creation
*/
#ifndef __INChostLibInth
#define __INChostLibInth
#ifdef __cplusplus
extern "C" {
#endif
/* Structure definitions */
struct _hostconf {
FUNCPTR hostGetByAddr;
FUNCPTR dnsGetByAddr;
};
#define HOST_LIST_SIZE 1
#define HOST_LIST_BUF 2
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
/* external functions that are shared within hostLib */
extern struct addrinfo *hostTblSearchByName2 (char *name, const struct addrinfo *hints);
extern struct hostent *hostTblSearchByAddr2 (const void *addr, int af);
extern struct hostent *getipnodebyaddr (const void *src, size_t len, int af, int *errp);
#ifdef INET6
extern int ip6_str2scopeid (char *scope, struct sockaddr_in6 *sin6, u_int32_t *);
#endif
extern struct hostent * _hpcopy (struct hostent * hp);
extern struct netent *getnetbyname (const char *name);
#else /* __STDC__ */
extern struct addrinfo *hostTblSearchByName2 ();
extern struct hostent *hostTblSearchByAddr2 ();
extern struct hostent *getipnodebyaddr ();
#ifdef INET6
extern int ip6_str2scopeid ();
#endif
extern struct hostent *_hpcopy ();
extern struct netent *getnetbyname ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INChostLibInth */
@@ -0,0 +1,149 @@
/* jobQueueLibP.h - private header file for jobQueueLib */
/*
* Copyright (c) 2005, 2007-2008 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01h,15jun12,xhs WIND00137567 - Network job queues can stall if a posting
task is deleted at just the wrong time
01g,30jul09,dlk WIND00168645 - use deterministic spin locks by default.
01f,18jun08,jpb Renamed _WRS_VX_SMP to _WRS_CONFIG_SMP. Added include path
for kernel configurations options set in vsb.
01e,16jan08,dlk Rename spinLockFastLib --> spinlockIsrNdLib.
01d,10dec07,dlk Use fast spin locks.
01c,20feb07,kch Merged from base6_iter12_smp-dev - Use spinlocks instead of
intLock.
01b,13jul05,dlk Added taskId member to JOB_QUEUE.
01a,06may05,dlk Written.
*/
/* Note, jobQueueLib.h should be included before this private header */
#ifndef __INCjobQueueLibPh
#define __INCjobQueueLibPh
#include <vsbConfig.h>
#include <semLib.h>
#include <private/semLibP.h>
#include <setjmp.h>
#include <intLib.h>
#ifdef _WRS_CONFIG_SMP
#ifdef _WRS_CONFIG_DETERMINISTIC
#include <spinLockLib.h>
#define JOBQ_LOCK(x, key) \
do { (void)(key); SPIN_LOCK_ISR_TAKE (x); } while ((0))
#define JOBQ_UNLOCK(x, key) \
do { SPIN_LOCK_ISR_GIVE (x); (void)(key); } while ((0))
#define JOBQ_LOCK_INIT(x) \
do { SPIN_LOCK_ISR_INIT (x, 0); } while ((0))
#else
#include <spinlockIsrNdLib.h>
#define JOBQ_LOCK(x, key) \
do { key = spinLockIsrNdTake (x); } while ((0))
#define JOBQ_UNLOCK(x, key) \
do { spinLockIsrNdGive ((x), (key)); } while ((0))
#define JOBQ_LOCK_INIT(x) \
do { spinLockIsrNdInit (x); } while ((0))
#endif /* _WRS_CONFIG_DETERMINISTIC */
#else /* Uniprocessor */
#define JOBQ_LOCK(x, key) \
do { key = INT_CPU_LOCK( ); } while ((0))
#define JOBQ_UNLOCK(x, key) \
do { INT_CPU_UNLOCK(key); } while ((0))
#define JOBQ_LOCK_INIT(x) do { } while ((0))
#endif /* _WRS_CONFIG_SMP */
#ifdef __cplusplus
extern "C" {
#endif
#define QJOB_ENQUEUED 0x100
#define QJOB_POOL_ALLOC 0x200
typedef struct _QJOB_QUEUE_HEAD
{
QJOB * pHead;
QJOB ** ppTail;
} QJOB_QUEUE_HEAD;
typedef struct _QJOB_FREE_HEAD
{
QJOB_STANDARD * pHead;
} QJOB_FREE_HEAD;
typedef QJOB_FREE_HEAD QJOB_BLOCK_HEAD; /* [;^] */
typedef struct _QJOB_STD_POOL
{
QJOB_FREE_HEAD free; /* The free list of standard jobs */
QJOB_BLOCK_HEAD blocks; /* The list of blocks of std. jobs */
#ifdef _WRS_CONFIG_SMP
#ifdef _WRS_CONFIG_DETERMINISTIC
spinlockIsr_t * qLock;
#else
spinlockIsrNd_t * qLock;
#endif
#endif
UINT32 refCount; /* How many attached job queues? */
} QJOB_STD_POOL;
typedef struct _QUIT_QJOB
{
QJOB job;
volatile int * pQuitValue;
jmp_buf * pJmpBuf;
VOIDFUNCPTR qFunc;
void * arg1;
void * arg2;
} QUIT_QJOB;
typedef struct _JOB_QUEUE
{
QJOB_QUEUE_HEAD jobs [32]; /* The enqueued jobs */
UINT32 activePri; /* which queues hold jobs? */
#ifdef JOBQ_PRI_MASKABLE
UINT32 priMask; /* which priorities are enabled? */
#endif
QJOB_STD_POOL * pStdPool; /* pool for standard jobs */
SEMAPHORE sem; /* binary semaphore */
QJOB_BLOCK_HEAD blocks; /* list of blocks of standard jobs */
UINT32 flags; /* Is queue in use? */
#define JOBQ_FLG_RUNNING 0x1
#define JOBQ_FLG_CREATED 0x2
#define JOBQ_FLG_AWAKE 0x4
TASK_ID taskId; /* Task currently running */
/* jobQueueProcess(). */
QUIT_QJOB quitJob;
void * userVal; /* reserved for queue creator */
#ifdef _WRS_CONFIG_SMP
#ifdef _WRS_CONFIG_DETERMINISTIC
spinlockIsr_t qLock;
#else
spinlockIsrNd_t qLock;
#endif
#endif
} JOB_QUEUE;
#define QUIT_JOB_TO_JOB_QUEUE(q) \
((JOB_QUEUE *)((char *)(q) - offsetof (JOB_QUEUE, quitJob)))
#ifdef __cplusplus
}
#endif
#endif /* __INCjobQueueLibPh */
@@ -0,0 +1,299 @@
/* muxL2VlanLibP.h - private definitions for the L2 VLAN MUX library */
/*
* Copyright (c) 1996-2007 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01i,30jul07,kch Added MUX-L2 hardware capabilities macros.
01h,30sep05,kch Added portCfi member to MUX_L2_PORT.
01g,15sep05,kch Moved MAX_VID, MIN_VID, MAX_VID, MIN_USER_PRIORITY,
MAX_USER_PRIORITY, IS_VALID_VID and IS_VALID_PRORITY macros
to muxL2Lib.h (SPR #112513).
01f,14sep05,kch Changed MUX_L2_VLAN_STATISTICS define to MUX_L2_VLAN_STAT.
Also renamed MUX_L2_VLAN_STAT structure tag to
MUX_L2_VLAN_PORT_STAT (SPR #112513).
01e,07sep05,kch Replaced vlanHwTaggingSupport and vlanMtuSupport booleans
with hwCaps that uses bit fields.
01d,27aug05,kch Renamed vlan id defines to reflect its actual usage.
01c,24aug05,kch Added MUX_L2_VLAN_STAT data structure and related macros.
Also added muxL2PortInDiscards and muxL2PortOutDiscards
to MUX_L2_PORT.
01b,23aug05,kch Added hwMtu as well as pointer to END_OBJ and NET_FUNCS
to MUX_L2_PORT. Moved vlan tag related macros to muxL2Lib.h.
01a,20jul05,kch written.
*/
#ifndef __INCmuxL2VlanLibPh
#define __INCmuxL2VlanLibPh
#include <muxL2Lib.h>
#include <endLib.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WRS_KERNEL
/* possible ethernet frame format */
typedef enum {
ETHER_TYPE2_FRAME_FORMAT = 0x01,
ETHER_8023_FRAME_FORMAT,
UNKNOWN_FRAME_FORMAT
} ETHER_FRAME_FORMAT;
typedef enum {
VLAN_TAGGED_FRAME = 1,
PRIORITY_TAGGED_FRAME,
UNTAGGED_FRAME,
INVALID_TAGGED_FRAME
} ETHER_FRAME_TYPE;
/* defines */
#define LLC_SNAP_FRAME_LEN 8
/*
* LLC with DSAP and SSAP of 0x42 is reserved for IEEE 802.1 use.
* These 802.3 ethernet encapsulation is used by Layer 2 protocols
* such as STP, GVRP, and GMRP.
*/
#define LLC_SAP 0x42
#define RESERVED_VID 4095 /* for internal use */
/*
* The following defines are the default port-base vlan setting maintained
* by the Layer 2 MUX.
*/
#define DEFAULT_PORT_VID 1
#define DEFAULT_PORT_USER_PRIORITY 0
#define DEFAULT_PORT_INGRESS_TYPE ADMIT_ALL_FRAMES
#define DEFAULT_PORT_INGRESS_FILTER FALSE
#define DEFAULT_PORT_EGRESS_TYPE UNTAGGED_FRAME
/*
* Marco for MUX-L2 Hardware L2 capabilities (used internally). These
* hardware capabilities macros are added to provide additional flexbility
* to MUX-L2 to distinguish the hardware (vlan tagging) capabilities for
* ingress and egress.
*/
/* hardware supports VLAN-compatible MTU */
#define MUX_L2_HW_CAP_VLAN_MTU 0x01
/*
* hardware supports extracting vlan tag from the received frame and stores
* the vlan tag information in m_pkthdr.vlan in host-byte order with the
* CSUM_VLAN CSUM flags set. The ethernet header from the received frame will
* be untagged.
*/
#define MUX_L2_HW_CAP_TAGGING_RX 0x02
/*
* hardware supports inserting vlan tag to ethernet header on egress using
* vlan tag information that is stored in m_pkthdr.vlan (in host-byte order)
* if the CSUM_VLAN CSUM flags is set.
*/
#define MUX_L2_HW_CAP_TAGGING_TX 0x04
#ifdef MUX_L2_VLAN_STATS
typedef struct mux_l2_vlan_port_stat
{
/*
* The number of valid frames received by this port which were classified
* as belonging to this vlan.
* RFC2674 MIB object: dot1qTpVlanPortInFrames
*/
unsigned long muxL2VlanPortInFrames;
/*
* The number of valid frames transmitted by this port for this vlan.
* RFC2674 MIB object: dot1qTpVlanPortOutFrames
*/
unsigned long muxL2VlanPortOutFrames;
/*
* The number of valid frames received by this port which were classified
* as belonging to this vlan but were discarded due to vlan related
* reasons. Specifically, the IEEE 802.1Q counters for Discard Inbound.
* RFC2674 MIB object: dot1qTpVlanPortInDiscards
* The description for the MIB object specifies that this object also
* implements the IEEE 802.1Q counter for Discard Ingress Filtering.
* We don't keep track that here because if a frame is discarded by
* ingress filtering, the port is not a member of the vlan, hence,
* the MUX_L2_VLAN_STAT is not allocated for that vlan for the port.
*/
unsigned long muxL2VlanPortInDiscards;
} MUX_L2_VLAN_PORT_STAT;
#endif /* MUX_L2_VLAN_STATS */
/*
* L2 per-port configuration
*/
typedef struct mux_l2_port
{
END_OBJ *pEnd; /* pointer back to the device's (END_OBJ *) */
/*
* The Port VLAN ID that is assigned to untagged frames or priority-tagged
* frames received on this port. Default: 1
* RFC2674 MIB object: dot1qPvid
*/
unsigned short portVid; /* Valid Vid: 1..4094 */
/*
* The default ingress User Priority for this port (assuming Ethernet
* media). Default: 0
* RFC2674 MIB object: dot1dPortDefaultUserPriority
*/
unsigned short portUpriority; /* Valid Priority: 0..7 */
/*
* Canonical format indicator (CFI), 0 or 1.
* - in token ring/source-routed FDDI MAC methods, this field is used
* to signal the bit order of address information carried in the
* encapsulated frame;
* - in 802.3/Ethernet and transparent FDDI MAC methods, this field is
* used to signal the presence or absence of an Embedded Souce-Routing
* Information Field (E-RIF), and in combination with the Non-canonical
* Format Indicator (NCFI) carried in the RIF, to signal the bit order
* of address information carried in the encapsulated frame.
* NOTE: For 802.3/Ethernet, MUX-L2 assumes this bit is always 0. That
* is, the received/transmitted tagged frame does not carry any
* embedded source routing information.
*/
unsigned short portCfi;
/*
* When set to ADMIT_TAGGED_ONLY_FRAMES(2), the device will discard
* untagged frames or priority-tagged frames received on this port.
* When set to ADMIT_ALL_FRAMES(1), untagged frames or priority-tagged
* frames received on this port will be accepted and assigned to the
* portPvid for this port.
* The setting does not affect VLAN independent BPDU frames, such as
* GVRP and STP but it does affect VLAN dependent BPDU frames, such as
* GMRP. Default: ADMIT_ALL_FRAMES(1)
* RFC2674 MIB object: dot1qPortAcceptableFrameTypes
*/
ACCEPT_FRAME_TYPE portIngressAcceptFrameType;
/*
* When this is true(1) the device will discard incoming frame for
* VLANs which do not include this Port in its Member set. When
* false(2), the port will accept all incoming frames. Default: false
* RFC2674 MIB object: dot1qPortIngressFiltering.
*/
BOOL portIngressFilter;
#ifdef VLAN_TAG
/* Function pointer for user-defined conversion function to convert
* IP TOS field to the 3-bit 802.1Q user priority. The conversion
* routine takes the IP TOS value as its input and returns the vlan
* user priority value (0-7) that needs to be inserted to the outgoing
* vlan tag header.
*/
unsigned char (*portTos2UpConvRtn) (unsigned char);
#endif /* VLAN_TAG */
/*
* VLAN membership for this L2 port. Each array element is a bit map
* represents a set of 8 unique VLAN IDs, with the first octet specifies
* VID 1 through 8, the second octet specifying VID 9 through 16, etc.
* Within each octet, the most significant bit represents the highest
* numbered VID. Thus, each VID is represented by a single bit. If that
* bit has a value of 1, then this L2 port is the member for that VID;
* the port is not a member its bit has a value of 0.
*/
unsigned char portVidMemberMap[512];
unsigned int numVid; /* number of vids configured for this port */
/* hardware layer 2 capabilities flags */
unsigned long hwCapabilities;
/* original driver's NET_FUNCS table */
NET_FUNCS *pEndNetFuncs;
/* driver's address format - Ethernet Type 2 or 802.3 addressing */
ETHER_FRAME_FORMAT endAddressFormat;
int hwMtu; /* hardware mtu size */
#ifdef MUX_L2_VLAN_STATS
MUX_L2_VLAN_PORT_STAT **muxL2VlanStat;
/*
* The number of valid frames received by this port which were discarded
* due to reasons such as vlan membership problem or invalid ingress
* frame type. Specifically, this implements the IEEE 802.1Q counter for
* Discard Ingress Filtering.
*/
unsigned long muxL2PortInDiscards;
/*
* The number of valid frames transmitted by this port which were
* discarded due to reasons such as vlan membership problem or invalid
* egress frame type
*/
unsigned long muxL2PortOutDiscards;
#endif /* MUX_L2_VLAN_STATS */
} MUX_L2_PORT;
#ifdef MUX_L2_VLAN_STATS
/*
* Macros for MUX_L2_VLAN_STAT statistics that apply to the port/vlan pairing
*/
#define MUX_L2_VLAN_PORT_IN_FRAMES_COUNT(vlps) \
{ \
if ((vlps) != NULL) \
(vlps)->muxL2VlanPortInFrames++; \
}
#define MUX_L2_VLAN_PORT_OUT_FRAMES_COUNT(vlps) \
{ \
if ((vlps) != NULL) \
(vlps)->muxL2VlanPortOutFrames++; \
}
#define MUX_L2_VLAN_PORT_IN_DISCARDS_COUNT(vlps) \
{ \
if ((vlps) != NULL) \
(vlps)->muxL2VlanPortInDiscards++; \
}
/*
* Macro for MUX_L2_PORT statistics that apply to the port
*/
#define MUX_L2_PORT_IN_DISCARDS_COUNT(vlp) vlp->muxL2PortInDiscards++;
#define MUX_L2_PORT_OUT_DISCARDS_COUNT(vlp) vlp->muxL2PortOutDiscards++
#else /* MUX_L2_VLAN_STATS not defined */
#define MUX_L2_VLAN_PORT_IN_FRAMES_COUNT(vlps)
#define MUX_L2_VLAN_PORT_OUT_FRAMES_COUNT(vlps)
#define MUX_L2_VLAN_PORT_IN_DISCARDS_COUNT(vlps)
#define MUX_L2_PORT_IN_DISCARDS_COUNT(vlp)
#define MUX_L2_PORT_OUT_DISCARDS_COUNT(vlp)
#endif /* MUX_L2_VLAN_STATS */
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* __INCmuxL2VlanLibPh */
@@ -0,0 +1,259 @@
/* muxLibP.h - private definitions for the MUX library */
/* Copyright 1998-2001, 2003, 2005, 2007-2008, 2010 Wind River Systems, Inc. */
/*
modification history
--------------------
02n,29may12,xhs Fix memory leak, defect WIND00340041
02m,10nov10,dlk Move extern "C" after last header file include. WIND00240828.
02l,28mar08,dlk Moved BIND_STYLE_* macros to muxLib.h for muxProtoInfoGet().
02k,22mar08,dlk MUX2 redesign. 1st checkin.
02j,12oct07,dlk Made muxEndRxJobQueue() public.
02i,25aug05,dlk Add section tags.
02h,27jul05,dlk Added muxEndRxJobQueue(). May be temporary.
02g,21nov03,wap Merge in changes from Snowflake
02f,20nov03,niq Remove copyright_wrs.h file inclusion
02e,04nov03,rlm Ran batch header path update for header re-org.
02d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
02c,01jul03,ann removed obsoleted code
02b,10sep01,ann correcting the directory paths
02a,15may01,ann major changes as per the MUX design doc for clarinet
- obsoleted the BIB and all its associated routines.
01r,25feb01,rae RFC2233 changes
01q,19apr00,ham merged TOR2_0-NPT-FCS (01a,06oct98,sj-01p,05oct99,pul).
01p,05oct99,pul removing rtRequest and mCastMap
01o,29apr99,pul Upgraded NPT phase3 code to tor2.0.0
01n,24mar99,sj changed tkFlag field in muxBindEntry to flags; added defines
01m,24mar99,sj added defines for flags field of NET_PROTOCOL structure
01l,18mar99,sj cleaned up: completed the cleanup postponed in 01j,05mar99,sj
01k,08mar99,sj added place holder for stackrcv routine in BIB entry
01j,05mar99,sj eliminated hooks; not cleanly though. next version will do that
01i,24feb99,sj added netSvcType and netDrvType fields to the BIB entry
01h,26jan99,sj moved BIB entry definition from muxTkLib.c to here
01g,05nov98,sj PCOOKIE_TO_ENDOBJ must check if pCookie is NULL
01f,03nov98,pul modified IPPROTO_MCAST_MAP_GET
01e,03nov98,sj doc update
01d,20oct98,pul don't return ERROR if hook is not valid
01c,15oct98,pul added ipProto Hooks
01b,12oct98,sj changed MUX_TK_ADDR_RES_FUNC_UPDATE, added WRS_*_MODULE
01a,06oct98,sj written.
*/
/*
DESCRIPTION
This file includes macros used by muxLib to avail features of the NPT
architecture if it is installed.
INCLUDE FILES:
*/
#ifndef __INCmuxLibPh
#define __INCmuxLibPh
#include <vxWorks.h>
#include <muxLib.h>
#ifndef MUX_NDEBUG
#include <assert.h>
#define MUX_ASSERT(x) \
do { \
if (!(x)) \
__assert("Assertion failed: "#x", file " \
__FILE__ ", line "_ASSERT_STR(__LINE__)"\n"); \
} while ((0))
#else
#define MUX_ASSERT(x) do {} while ((0))
#endif /* MUX_NDEBUG */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _MUX_END_STYLE_INFO
{
void * sendWrappers [NUM_BIND_STYLES];
void * pollSendWrappers [NUM_BIND_STYLES];
void * pollReceiveWrappers [NUM_BIND_STYLES];
void * rxRtn;
} MUX_END_STYLE_INFO;
extern MUX_END_STYLE_INFO muxEndStyles [NUM_END_STYLES];
typedef struct _MUX_BIND_STYLE_INFO
{
void * sendFilter [NUM_END_STYLES];
void * rxWrappers [NUM_END_STYLES];
void * snarfWrappers [NUM_END_STYLES];
} MUX_BIND_STYLE_INFO;
extern MUX_BIND_STYLE_INFO muxBindStyles [NUM_BIND_STYLES];
/*
* This structure is a row in our run time END table.
* Each row contains all the units started on a particular named device.
* I.e. all devices that are Lance 7990 Ethernet will be in the list
* off of the row with the name "ln".
*/
typedef struct end_tbl_row
{
NODE node; /* Needed by our list processing library. */
char name[END_NAME_MAX]; /* Name of the devices in row. (ln, etc.) */
LIST units; /* List of devices, i.e. 0, 1, etc.. */
} END_TBL_ROW;
/* MUX-private bit flags for the muxFlags member in a DEV_OBJ: */
#define MUX_END_FLAG_LOADING 0x00000001
#define MUX_END_FLAG_UNLOADING 0x00000002
/* we steal these defines from a END driver */
#define END_IOCTL(pEnd) \
(pEnd->pFuncTable->ioctl)
#define END_ALT_HADDR(pEnd) \
((pEnd)->pMib2Tbl->m2Data.mibIfTbl.ifPhysAddress.phyAddress)
#define END_ALT_HADDR_LEN(pEnd) \
((pEnd)->pMib2Tbl->m2Data.mibIfTbl.ifPhysAddress.addrLength)
#define END_HADDR(pEnd) \
((pEnd)->mib2Tbl.ifPhysAddress.phyAddress)
#define END_HADDR_LEN(pEnd) \
((pEnd)->mib2Tbl.ifPhysAddress.addrLength)
#define END_MIB2_TYPE(pEnd) \
((pEnd)->mib2Tbl.ifType)
typedef struct proto_entry PROTO_ENTRY; /* forward declaration typedef */
struct Ipcom_pkt_struct;
typedef int (*MUX_END_JOBQ_DO_FUNC) (END_OBJ * pEnd, void * arg);
typedef BOOL (* MUXBIND_PROTO_RX_RTN) (PROTO_COOKIE cookie, long type,
M_BLK_ID pMblk,
LL_HDR_INFO * pLinkHdrInfo,
void * callbackArg);
typedef BOOL (* MUXTKBIND_PROTO_RX_RTN) (void * callbackArg, long type,
M_BLK_ID pMblk, void * pSpareData);
typedef BOOL (* MUX2BIND_PROTO_RX_RTN) (void * callbackArg,
struct Ipcom_pkt_struct * pkt);
/*
* The PROTOCOL_BINDING structure represents the binding of a protocol to
* an END or NPT device. Additional or duplicate information, particularly
* that needed for receive, is stored in the PROTO_ENTRY structure in the
* interface's protocol table. The PROTO_ENTRY structure in turn contains
* a pointer back to this structure.
*/
typedef struct protocol_binding
{
END_OBJ * pEnd; /* Interface to which protocol is bound */
PROTO_ENTRY * pEntry; /* information needed by receive */
UINT16 netSvcType; /* Network service type */
UINT8 flags;
UINT8 bindStyle; /* BIND_STYLE_{MUXBIND|MUXTKBIND|MUX2} */
void * netCallbackId; /* Callback ID passed to muxBind */
BOOL (*stackRcvRtn) (); /* protocol's receive routine */
STATUS (*stackTxRestartRtn) (); /* Callback for restarting blocked tx. */
STATUS (*stackShutdownRtn) (); /* The routine to call to shutdown */
/* the protocol stack. */
void (*stackErrorRtn) (); /* Callback for device errors/events */
long netIfType; /* Interface type */
END_OUTPUT_FILTER outFilter; /* Used for MUX_PROTO_OUTPUT protocols */
char name[END_PROTO_NAME_MAX]; /* String name for this protocol. */
} PROTOCOL_BINDING;
/*
* Each device has a table of PROTO_ENTRY structures corresponding to
* the protocols bound to it. This structure contains information needed
* for receive, as well as a pointer to the corresponding PROTOCOL_BINDING
* structure. The caching of information needed for receive in the small
* PROTO_ENTRY structure is done purely for performance reasons.
*
* The protocol receive routine stored in the PROTO_ENTRY is in certain
* cases a wrapper function around the actual protocol receive routine.
*/
struct proto_entry
{
UINT16 type;
UINT16 reserved;
union /* protocol receive routine */
{
void * generic;
MUXBIND_PROTO_RX_RTN endRcv;
MUXTKBIND_PROTO_RX_RTN nptRcv;
MUX2BIND_PROTO_RX_RTN end2Rcv;
} rr;
void * recvRtnArg;
PROTOCOL_BINDING * pBinding;
};
/* A little bit of backwards compatibility */
typedef PROTOCOL_BINDING * MUX_ID;
/*
* Convert from a void * cookie (which is a PROTOCOL_BINDING) to an
* END_OBJ pointer:
*/
#define PCOOKIE_TO_ENDOBJ(pCookie) ((pCookie) ? ((MUX_ID)pCookie)->pEnd : NULL)
/*
* Note, a device cookie returned by muxDevLoad(), passed to muxDevStart(),
* etc., is not the same as a binding cookie returned by muxBind().
* Presently, a device cookie is just a pointer to the END_OBJ.
*/
#define PDEVCOOKIE_TO_ENDOBJ(pCookie) ((END_OBJ *)(pCookie))
/*
* These macros are used by muxAddrRecFuncXXX functions
*/
#define TK_ADDR_RES_GET 1
#define TK_ADDR_RES_ADD 2
#define TK_ADDR_RES_DEL 3
/* global variables */ /* XXX dlk - needed? */
extern SEM_ID muxLock;
/* prototypes */
extern STATUS muxTkLibInit (void);
extern void * muxBindCommon (int bindStyle, char * pName, int unit,
BOOL (*stackRcvRtn) (),
STATUS (*stackShutdownRtn) (),
STATUS (*stackTxRestartRtn) (),
void (*stackErrorRtn) (), long type,
char * pProtoName, void * pNetCallbackId,
void * pNetSvcInfo, void * pNetDrvInfo);
extern long muxIfTypeGet (END_OBJ * pEnd);
extern int muxEndJobQDo (END_OBJ * pEnd, MUX_END_JOBQ_DO_FUNC func,
void * arg);
extern struct Ipcom_pkt_struct * muxMblkToIpcomPktTx (M_BLK * pMblk);
extern M_BLK * muxIpcomPktToMblkTx (struct Ipcom_pkt_struct * pkt);
extern void muxRestoreIpcomPktFromMblkTx(M_BLK * pMblk, struct Ipcom_pkt_struct *pkt);
extern void muxIpcomPktFreeMblk (void * buf, M_BLK * pMblk);
extern void vxmux_mux_mblk_init (void);
#ifdef __cplusplus
}
#endif
#endif /* __INCmuxLibPh */
@@ -0,0 +1,133 @@
/* qosIngressLibP.h - private definitions for qos support on ingress */
/*
* Copyright (c) 2005 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01b,08sep05,niq Code review changes + enhanced statistics gathering
01a,09aug05 niq created.
*/
#ifndef __INCqosIngressLibPh
#define __INCqosIngressLibPh
#ifdef __cplusplus
extern "C" {
#endif
#define QOS_MAX_PRI 31 /* Maximum QOS priority */
/*
* Structure defining a queue for queuing packets for qos processing
* Each queue contains packets having the same priority.
* We have a array of 32 qos queues that allow 32 different priority
* queues.
*/
struct qosqueue
{
struct mbuf * qosq_head;
struct mbuf * qosq_tail;
#ifdef QOS_STATS
int qosq_len; /* Num packets in queue */
int qosq_maxlen; /* Max qlen at any time */
int qosq_total; /* Cumulative total of packets queued*/
int qosq_maxlim; /* Not used. Queue max limit */
int qosq_drops; /* Not used. Packets dropped */
#endif /* QOS_STATS */
};
struct qosqFlushJob
{
QJOB flushJob; /* Job for flushing packets on the qosq */
void * pEnd; /* Device whose pakcets have to be flushed*/
BOOL done;
};
typedef struct _qosqVars
{
QJOB processJob;/* Job for processing packets on the qosq */
UINT32 qosqActivePri;
JOB_QUEUE_ID pJobQueue; /* Job queue to use */
int qosDefaultPri; /* Default pri for queuing packets */
struct qosqueue qosqArr [QOS_MAX_PRI + 1];
#ifdef QOS_STATS
UINT32 numPackets;
UINT32 discards;
UINT32 delivered;
#endif /* QOS_STATS */
} QOSQ_VARS;
#ifdef QOS_STATS
#define INC_QLEN(qosq) \
do { \
(qosq)->qosq_len++; \
(qosq)->qosq_total++; \
if ((qosq)->qosq_maxlen < (qosq)->qosq_len) \
(qosq)->qosq_maxlen = (qosq)->qosq_len; \
} while (0)
#define DEC_QLEN(qosq) (qosq)->qosq_len--
#else
#define INC_QLEN(qosq)
#define DEC_QLEN(qosq)
#endif /* QOS_STATS */
/* These macros should be used to manipulate the qos queue */
/*
* We currently manipulate the queues inline for better performance. Hence
* these macros are ununsed for now.
*/
/* The following two macros are unused currently */
#define QOS_QFULL(qosq) ((qosq)->qosq_len >= (qosq)->qosq_maxlen)
#define QOS_DROP(qosq) ((qosq)->qosq_drops++)
#define QOS_ENQUEUE(qosq, m) \
do { \
(m)->m_nextpkt = 0; \
if ((qosq)->qosq_tail == 0) \
(qosq)->qosq_head = m; \
else \
(qosq)->qosq_tail->m_nextpkt = m; \
(qosq)->qosq_tail = m; \
INC_QLEN(qosq); \
} while (0)
/* The following macro is unused currently */
#define QOS_PREPEND(qosq, m) \
do { \
(m)->m_nextpkt = (qosq)->qosq_head; \
if ((qosq)->qosq_tail == 0) \
(qosq)->qosq_tail = (m); \
(qosq)->qosq_head = (m); \
INC_QLEN(qosq); \
} while (0)
#define QOS_DEQUEUE(qosq, m) \
do { \
(m) = (qosq)->qosq_head; \
if (m) { \
if (((qosq)->qosq_head = (m)->m_nextpkt) == 0) \
(qosq)->qosq_tail = 0; \
(m)->m_nextpkt = 0; \
DEC_QLEN(qosq); \
} \
} while (0)
#ifdef __cplusplus
}
#endif
#endif /* __INCqosIngressLibPh*/
@@ -0,0 +1,370 @@
/* wvNetDEventP.h - header file for WindView WindNet IPv6/IPv4 event ids */
/* Copyright 2003,2004,2008,2010 Wind River Systems, Inc.
*
* The right to copy, distribute, modify, or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*/
/*
modification history
--------------------
01t,13jul12,h_x Fix warnings.
01s,30dec10,vhe Changed pWvNetEventMap to pWvNetEvtMap (CQ:WIND00237112)
01r,06oct08,tcr fix Coverity warnings
01q,10sep08,tcr Fix WIND00133631 (exception dereferencing pWvNetEventMap if
INCLUDE_WV_NETD not present)
01p,15aug08,tcr temproary build fix
01o,31jul08,tcr code review changes
01n,09may08,tcr change name of event_point_handler
01m,25apr08,tcr change WV to use eventpoints
01m,27may08,jpb Modifications for source build. Renamed WV_INSTRUMENTATION
to _WRS_CONFIG_SV_INSTRUMENTATION.
01l,07jul04,vvv fixed warnings (statement not reached)
01k,02apr04,spm fixed virtual stack build: enabled required values
01j,24feb04,syy Update wvNetDEventInfo structure
01i,23jan04,syy Added WV class check to macros
01h,17dec03,syy Remove evtLogOBinary() workaround
01g,16dec03,syy Fixed a typo that caused build problem
01f,11dec03,syy Code adjustment and clean up
01e,08dec03,syy Networking WindView instrumentation merge
01d,04nov03,syy WV Instrumentation changes
01c,20oct03,syy Added #ifdef WV_INSTRUMENTATION
01b,04sep03,tar Windview instrumentation codereview changes
01a,05aug03,tar written
*/
#ifndef __INCwvNetDEventPh
#define __INCwvNetDEventPh
#ifdef __cplusplus
extern "C" {
#endif
typedef struct eventmask
{
UCHAR bitmap [8]; /* Map indicating selection status of events. */
}
EVENT_MASK;
IMPORT EVENT_MASK * pWvNetEvtMap;
#define MIN_WVNET_EVENTID 20000
#define MAX_WVNET_EVENTID 24999
#define WVNET_EVENT(id) (MIN_WVNET_EVENTID + id)
#define WVNET_MASKSIZE 8 /* Allows 57 to 64 events per level. */
#ifdef IPCOM_WV_INSTRUMENTATION
static char wvNetDEventBlob [8];
#endif
/*
* The WV_BLOCK_START macro prevents wasted cycles by determining if
* WindView is running and if the given class has been selected. It
* provides initial screening for reporting network events to WindView.
* WV_CLASS_3 is for "Additional Instrumentation" selection.
* The classId is NETD_IP4_DATAPATH_EVENT, NETD_IP4_CTRLPATH_EVENT,
* NETD_IP6_DATAPATH_EVENT or NETD_IP6_CTRLPATH_EVENT.
*/
#define WV_BLOCK_START(classId) \
if (ACTION_IS_SET && (pWvNetEvtMap != NULL)) \
{
/*
* The WV_NETD_EVENT_TEST macro evaluates to TRUE if the event is selected
* for inclusion in the WindView updates sent to the host. The event
* selection status is stored in a bitmap accessed by priority level.
* This macro is only valid within a test conditional after the
* WV_BLOCK_START macro verifies that the class is active. The eventLevel
* parameter has values determined by the constants defined below, and
* the offset indicates the ordinal number of the event for the given
* level (ranging from 0 upward).
*/
#define WV_NETD_EVENT_TEST(eventLevel, offset) \
pWvNetEvtMap [eventLevel - 1].bitmap [WVNET_MASKSIZE - 1 - (offset / 8)] & \
(1 << (offset % 8))
/*
* The WV_BLOCK_END provides a footer for all code which reports network
* events to WindView. It closes the open scopes caused by WV_BLOCK_START.
* The classId parameter is not used, but is included for symmetry.
*/
#define WV_BLOCK_END(classId) \
}
#if defined (_WRS_CONFIG_SV_INSTRUMENTATION) && defined (INCLUDE_WVNETD)
/*
* The macros stores all the arguments and the string into a structure to pass
* to the logging routine. The eventId is also stored in the structure, and a
* fixed eventId is passed to the eventpoint. The data collector will extract
* the eventId from the arguments, and pass it to the logging routines. This
* means that a single data collector can be used for all the network events.
*/
#define WV_EVT_LOG_OBIN(EVTID, NARGS, INFO, ARG1, ARG2, ARG3, ARG4, ARG5, SIZE, PAYLOAD) \
do { \
EVT_STR_NET_T evt_wv_net; \
evt_wv_net.args [0] = INFO; \
evt_wv_net.args [1] = ARG1; \
evt_wv_net.args [2] = ARG2; \
evt_wv_net.args [3] = ARG3; \
evt_wv_net.args [4] = ARG4; \
evt_wv_net.evtId = EVTID; \
evt_wv_net.nParams = NARGS; \
evt_wv_net.length = SIZE; \
evt_wv_net.pData = PAYLOAD; \
eventPointSwHandle (WV_NETD_BASE_EVENT, &evt_wv_net, sizeof(evt_wv_net) ); \
} while (0)
/*
* Event data binary block consists of three parts: the data format ID,
* two optional parameters, each can be either non IP address or IP address.
* The interpretation of the event data is governed by the format ID (the
* first byte). Various formats are defined in the section below.
*
* wvNetDEventBlob [0] - event data format
* wvNetDEventBlob [1-4] - first event data in UINT32 (optional)
* wvNetDEventBlob [5-8] - second event data in UINT32 (optional)
*/
/*
* Event data format indicator bit definitions
*/
#define WV_NETD_EVT_PARAM_ONE 0x01
#define WV_NETD_EVT_PARAM_TWO 0x02
#define WV_NETD_EVT_V4_ADDR 0x04
#define WV_NETD_EVT_V6_ADDR 0x08
/*
* List of allowed event data formats:
*
* WV_NETD_EVT_FMT_1P: one non- IP address parameter;
* WV_NETD_EVT_FMT_2P: two that non- IP address parameters;
* WV_NETD_EVT_FMT_1P_V4: one non- IP address parameter and one IPv4 address;
* WV_NETD_EVT_FMT_1P_V6: one non- IP address parameter and one ptr to the
* IPv6 address structure;
* WV_NETD_EVT_FMT_V4: two IPv4 addresses;
* WV_NETD_EVT_FMT_V6: two ptr's to the IPv6 addresse structures;
*/
#define WV_NETD_EVT_FMT_1P WV_NETD_EVT_PARAM_ONE
#define WV_NETD_EVT_FMT_2P WV_NETD_EVT_PARAM_ONE | WV_NETD_EVT_PARAM_TWO
#define WV_NETD_EVT_FMT_1P_V4 WV_NETD_EVT_PARAM_ONE | WV_NETD_EVT_V4_ADDR
#define WV_NETD_EVT_FMT_1P_V6 WV_NETD_EVT_PARAM_ONE | WV_NETD_EVT_V6_ADDR
#define WV_NETD_EVT_FMT_V4 WV_NETD_EVT_V4_ADDR
#define WV_NETD_EVT_FMT_V6 WV_NETD_EVT_V6_ADDR
/*
* The following macros accept an argument of struct sockaddr type and return the
* sockaddr_in for IPv4 and return the address of the struct for IPv6.
*/
#define WV_SOCKADDR_IN(s) (((struct sockaddr_in *)(s))->sin_addr.s_addr)
#ifdef INET6
#else
#define WV_ADDR_GET(pAddr) (pAddr == NULL ? 0 : \
(((struct sockaddr *)pAddr)->sa_family == AF_INET ? \
(((struct sockaddr_in *)pAddr)->sin_addr.s_addr) : 0))
#define WV_ADDR_FAMILY_GET(pAddr) (pAddr == NULL ? 0 : \
(((struct sockaddr *)pAddr)->sa_family == AF_INET ? \
WV_NETD_EVT_V4_ADDR : 0))
#endif /* INET6 */
/*
* The WV_EVT_INFO_SET_ALL macro constructs the WindView event information
* field in the event data using the following structure:
*
* <Component ID>:<Status>:<Filter ID>:<Entity ID>:<Module ID>:<Event Tag>
* (2 bits) (2 bits) (4 bits) (8 bits) (8 bits) (8 bits)
*
* The component ID is a fixed value for all WindNet IPv6/IPv4 stack code, The
* values of other fields, except Event Tag, use the constants defined
* below. The packet filter type (Filter ID), Entity ID and Module ID are
* assigned using local #defin'se within each module. The final field (Event
* Tag) is a unique identifier for each event within a given module.
*
* Currently, the packet filter is not used. But it may be used for refined
* event filtering someday.
*
* The resulting event information is stored in the ULONG variable
* wvNetDEventInfo, local to the file module.
*/
#define WV_EVT_INFO_SET_ALL(eventLevel, eventTag, status) \
do { \
wvNetDEventInfo = ((UINT32)(WV_NET_DUAL_ID << 30)) | (status << 28) \
| (wvNetDLocalFilter << 24) | (wvNetDEntityId << 16) \
| (wvNetDModuleId << 8) | eventTag; \
} while (0)
/* Macro sets evenInfo fields, except "Status" */
#define WV_EVT_INFO_SET(eventLevel, eventTag) \
do { \
wvNetDEventInfo = ((UINT32)(WV_NET_DUAL_ID << 30)) | (wvNetDLocalFilter << 24) \
| (wvNetDEntityId << 16) | (wvNetDModuleId << 8) \
| eventTag; \
} while (0)
/* Store the 4 bytes of an UINT32 into blob */
#define WV_ASSIGN_BLOB(blob, arg) \
do { \
*(&(blob)) = (UCHAR)((((UINT32) arg) >> 24) & 0xff); \
*(&(blob) + 1) = (UCHAR)((((UINT32) arg) >> 16) & 0xff); \
*(&(blob) + 2) = (UCHAR)((((UINT32) arg) >> 8) & 0xff); \
*(&(blob) + 3) = (UCHAR)((((UINT32) arg) >> 0) & 0xff); \
*(&(blob) + 4) = '\n'; \
} while (0)
/*
* To minimize the size of the log, for V6 address, only the ptr to struct
* sockadd will be logged.
*
* format: 0x1 - one parameter; 0x3 - two parameters;
*/
#define WV_EVT_BLOB_SET0(format, arg1, arg2) \
do { \
wvNetDEventBlob[0] = (UCHAR) format; \
if ((format) & WV_NETD_EVT_PARAM_ONE) \
WV_ASSIGN_BLOB(wvNetDEventBlob[1], arg1); \
if ((format) & WV_NETD_EVT_PARAM_TWO) \
WV_ASSIGN_BLOB(wvNetDEventBlob[5], arg2); \
} while (0)
/*
* The WindView for networking marker events handles cases which do not
* involve data transfer. The transmission direction (i.e. - status) field
* in the event identifier is always 0. Up to four additional parameters
* may be sent to the host.
*/
#define WV_NET_MARKER_1(classId, eventLevel, eventOffset, eventTag, eventId, arg1) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
WV_EVT_INFO_SET (eventLevel, eventTag); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, 0, 0, 0, 0, 0, NULL); \
} \
WV_BLOCK_END (classId)
#define WV_NET_MARKER_2(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
WV_EVT_INFO_SET (eventLevel, eventTag); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, 0, NULL); \
} \
WV_BLOCK_END (classId)
/* when the last argument is a parameter */
#define WV_NET_MARKER_3(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2, arg3) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UCHAR wvNetDEventBlob[12]; \
UINT32 wvNetDEventInfo; \
WV_EVT_INFO_SET (eventLevel, eventTag); \
WV_EVT_BLOB_SET0 (WV_NETD_EVT_FMT_1P, arg3, 0); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, \
sizeof (wvNetDEventBlob), (char *)wvNetDEventBlob); \
} \
WV_BLOCK_END (classId)
/* when the last two arguments are parameters */
#define WV_NET_MARKER_4(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2, arg3, arg4) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
UCHAR wvNetDEventBlob[12]; \
WV_EVT_INFO_SET (eventLevel, eventTag); \
WV_EVT_BLOB_SET0 (WV_NETD_EVT_FMT_2P, arg3, arg4); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, \
sizeof (wvNetDEventBlob), (char *)wvNetDEventBlob); \
} \
WV_BLOCK_END (classId)
/*
* The WindView for networking data transfer events store a transmission
* direction in the status field of the event identifier. Valid values are
* WV_NET_SEND and WV_NET_RECV. Up to four additional parameters may be sent
* to the host.
*/
#define WV_NET_EVENT_1(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
WV_EVT_INFO_SET_ALL (eventLevel, eventTag, status); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, 0, 0, 0, 0, 0, NULL); \
} \
WV_BLOCK_END (classId)
#define WV_NET_EVENT_2(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
WV_EVT_INFO_SET_ALL (eventLevel, eventTag, status); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, 0, NULL); \
} \
WV_BLOCK_END (classId)
#define WV_NET_EVENT_3(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2, arg3) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
int format = WV_NETD_EVT_FMT_1P; \
UINT32 wvNetDEventInfo; \
UCHAR wvNetDEventBlob[12]; \
WV_EVT_INFO_SET_ALL (eventLevel, eventTag, status); \
WV_EVT_BLOB_SET0 (format, arg3, 0); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, \
sizeof (wvNetDEventBlob), (char *)wvNetDEventBlob); \
} \
WV_BLOCK_END (classId)
#define WV_NET_EVENT_4(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2, arg3, arg4) \
WV_BLOCK_START (classId) \
if (WV_NETD_EVENT_TEST (eventLevel, eventOffset)) \
{ \
UINT32 wvNetDEventInfo; \
UCHAR wvNetDEventBlob[12]; \
WV_EVT_INFO_SET_ALL (eventLevel, eventTag, status); \
WV_EVT_BLOB_SET0 (WV_NETD_EVT_FMT_2P, arg3, arg4); \
WV_EVT_LOG_OBIN (eventId, 3, wvNetDEventInfo, (_Vx_usr_arg_t)arg1, (_Vx_usr_arg_t)arg2, 0, 0, 0, \
sizeof (wvNetDEventBlob), (char *)wvNetDEventBlob); \
} \
WV_BLOCK_END (classId)
#else /* when system viewer is excluded */
#define WV_ADDR_GET(pAddr) {}
#define WV_NET_MARKER_1(classId, eventLevel, eventOffset, eventTag, eventId, arg1) {}
#define WV_NET_MARKER_2(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2) {}
#define WV_NET_MARKER_3(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2, arg3) {}
#define WV_NET_MARKER_4(classId, eventLevel, eventOffset, eventTag, eventId, arg1, arg2, arg3, arg4) {}
#define WV_NET_EVENT_1(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1) {}
#define WV_NET_EVENT_2(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2) {}
#define WV_NET_EVENT_3(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2, arg3) {}
#define WV_NET_EVENT_4(classId, eventLevel, eventOffset, eventTag, eventId, status, arg1, arg2, arg3, arg4) {}
#endif /* _WRS_CONFIG_SV_INSTRUMENTATION && INCLUDE_WVNETD */
#ifdef __cplusplus
}
#endif
#endif /* __INCwvNetDEventPh */
+114
View File
@@ -0,0 +1,114 @@
/* remLib.h - structures for remLib.c */
/*
* Copyright (c) 1984-2005, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
modification history
--------------------
01k,09jan12,h_x Move extern "C" after last header file include.
01j,01oct10,rlp Removed iam and whoami prototypes.
01i,24jun05,vvv added rcmd_af()
01h,22feb05,wap Allow sysctl init routines to be scaled out
o1g,23feb04,kkz added new functions for user-space
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,24oct03,cdw update include statements post header re-org.
01c,09may03,vvv included socket.h
01b,10jun02,ann forward declarations for rresvportCommon() and
bindresvportCommon()
01a,06mar02,ann ported to clarinet from AE1.1 ver 02d
*/
#ifndef __INCremLibh
#define __INCremLibh
#include <netinet/in.h>
#include <sockLib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_IDENTITY_LEN 100
#define MIN_RESV_PORT 600
#define MAX_RESV_PORT 1023
/* status messages */
#define S_remLib_ALL_PORTS_IN_USE (M_remLib | 1)
#define S_remLib_RSH_ERROR (M_remLib | 2)
#define S_remLib_IDENTITY_TOO_BIG (M_remLib | 3)
#define S_remLib_RSH_STDERR_SETUP_FAILED (M_remLib | 4)
#define S_remLib_RCMD_INPUT_ERROR (M_remLib | 5)
/* variable declarations */
extern int remLastResvPort; /* last port num used (from bootroms) */
/* function declarations */
#if defined(__STDC__) || defined(__cplusplus)
extern void remLibInit (long timeout);
extern void remLibSysctlInit(void);
extern STATUS bindresvport (int sd, struct sockaddr_in *sin);
extern STATUS bindresvport_af (int sd, struct sockaddr *sin, int family);
extern int rcmd (char *host, int remotePort, char *localUser,
char *remoteUser, char *cmd, int *fd2p);
extern int rcmd_af (char *host, int remotePort, char *localUser,
char *remoteUser, char *cmd, int *fd2p, int family);
extern int rresvport (int *alport);
extern int rresvport_af (int *alport, int family);
extern void remCurIdGet (char *user, char *passwd);
#ifdef _WRS_KERNEL
extern STATUS remCurIdSet (char *newUser, char *newPasswd);
#else
extern STATUS setlogin (char * login);
extern STATUS getlogin_r (char * login, size_t length);
extern STATUS setpassword(char * passwd);
extern STATUS getpassword_r(char * passwd, size_t length);
#endif
/* deprecated functions - use rresvport_af and bindresvport_af instead */
extern int rresvportCommon (int *alport, int family);
extern STATUS bindresvportCommon (int sd, struct sockaddr *sin, int family);
#else /* __STDC__ */
extern void remLibInit ();
extern void remLibSysctlInit();
extern STATUS bindresvport ();
extern STATUS bindresvport_af ();
extern int rcmd ();
extern int rresvport ();
extern int rresvport_af ();
extern void remCurIdGet ();
#ifdef _WRS_KERNEL
extern STATUS remCurIdSet ();
extern STATUS iam ();
extern void whoami ();
#else
extern STATUS setlogin ();
extern STATUS getlogin_r ();
extern STATUS setpassword ();
extern STATUS getpassword_r ();
#endif
/* deprecated functions - use rresvport_af and bindresvport_af instead */
extern STATUS bindresvportCommon ();
extern int rresvportCommon ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCremLibh */
+47
View File
@@ -0,0 +1,47 @@
/* rlogLib.h - header file for rlogLib.c */
/* Copyright 1984-2004, 2006, 2009 Wind River Systems, Inc. */
/*
modification history
--------------------
01l,27may11,rjq Fix for WIND00277167.
01k,02jun09,dlk LP64 adaptation. Also WIND00169357. Remove private
types and information to rlogLib.c.
01j,14aug06,tkf Cleanup for IPNET integration.
01i,25feb04,asr updates resulting from review comments
01h,06feb04,asr included lstlib.h
01g,30jan04,dlk Remove extra tokens at end of #ifndef directives.
01f,12dec03,rp support for multiple rlogin sessions
01e,05nov03,cdw Removal of unnecessary _KERNEL guards.
01d,04nov03,rlm Ran batch header path update for header re-org.
01c,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01b,02oct02,ant virtualization changes
01c,06aug03,nee Accordion Base6 merge from ACCORDION_BASE6_MERGE_BASELINE
label
01b,10jun03,vvv include netVersion.h
01a,10jun02,ann ported to clarinet from AE1.1 ver 02b
*/
#ifndef __INCrlogLibh
#define __INCrlogLibh
#ifdef __cplusplus
extern "C" {
#endif
/* function declarations */
extern STATUS rlogin (char *host);
extern void rlogcInit(int client_number);
#ifdef _WRS_KERNEL
extern STATUS rlogInit (long maxclients);
extern void rlogind (void);
#endif /* _WRS_KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* __INCrlogLibh */
+111
View File
@@ -0,0 +1,111 @@
/* sntpcLib.h - SNTP client backward-compatible APIs library */
/*
* Copyright (c) 1997-2006 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
Modification history
--------------------
01g,07nov06,kch Cleanup for IPNet integration.
01f,23aug04,rp merged from COMP_WN_IPV6_BASE6_ITER5_TO_UNIFIED_PRE_MERGE
01e,04nov03,rlm Ran batch header path update for header re-org.
01d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01c,25aug99,cno Add extern "C" definition (SPR21825)
01b,15jul97,spm code cleanup, documentation, and integration; entered in
source code control
01a,20apr97,kyc written
*/
#ifndef __INCsntpch
#define __INCsntpch
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* Public header file of SNTP client.
*/
/*
DESCRIPTION
This library contains the backward-compatible APIs provided by the WindRiver SNTP client.
INCLUDE FILES: ipcom_type.h, ipcom_time.h
*/
/* includes */
#include <timers.h>
/* defines */
#define S_sntpcLib_INVALID_PARAMETER (M_sntpcLib | 1)
#define S_sntpcLib_INVALID_ADDRESS (M_sntpcLib | 2)
#define S_sntpcLib_TIMEOUT (M_sntpcLib | 3)
#define S_sntpcLib_VERSION_UNSUPPORTED (M_sntpcLib | 4)
#define S_sntpcLib_SERVER_UNSYNC (M_sntpcLib | 5)
#ifdef __cplusplus
extern "C" {
#endif
/*******************************************************************************
*
* sntpcTimeGet - retrieve the current time from a remote source
*
* This routine stores the current time as reported by an SNTP/NTP server in
* the location indicated by <pCurrTime>. The reported time is first converted
* to the elapsed time since January 1, 1970, 00:00, GMT, which is the base value
* used by UNIX systems. If <pServerAddr> is NULL, the routine listens for
* messages sent by an SNTP/NTP server in broadcast (mulitcast in case of IPv6)
* mode. Otherwise, this routine sends a request to the specified SNTP/NTP
* server and extracts the reported time from the reply. In either case, an
* error is returned if no message is received within the interval specified
* by <timeout>. Typically, SNTP/NTP servers operating in broadcast (mulitcast
* in case of IPv6) mode send update messages every 64 to 1024 seconds. An
* infinite timeout value is specified by WAIT_FOREVER.
*
* Parameters:
* \is
* \i <pServerAddr>
* A pointer to the server IP address or hostname.
* \i <timeout>
* timeout interval in ticks.
* \i <pCurrTime>
* storage for retrieved time value.
* \ie
*
* RETURNS: \is
* \i 'OK'.
* successful.
* \i 'ERROR'
* unsuccessful.
* \ie
*
* ERRNO:
*/
STATUS sntpcTimeGet
(
char *pServerAddr,
int timeout,
struct timespec *pCurrTime
);
#ifdef __cplusplus
}
#endif
#endif /* __INCsntpch */
+150
View File
@@ -0,0 +1,150 @@
/* sntpsLib.h - SNTP server backward-compatible APIs library */
/*
* Copyright (c) 1997-2013 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement. No license to Wind River intellectual property rights
* is granted herein. All rights not licensed by Wind River are reserved
* by Wind River.
*/
/*
Modification history
--------------------
01b,13sep13,rjq Fix for WIND00431901.
01a,13oct09,rjq written
*/
#ifndef __INCsntpsh
#define __INCsntpsh
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* Public header file of SNTP server APIs.
*/
/*
DESCRIPTION
This library contains the backward-compatible APIs provided by the WindRiver SNTP server.
INCLUDE FILES: ipcom_type.h, ipcom_time.h
*/
/* defines */
#define S_sntpsLib_INVALID_PARAMETER (M_sntpsLib | 1)
#ifdef __cplusplus
extern "C" {
#endif
/* Values for "request" parameter to clock hook routine. */
#define IPSNTPS_ID 1
#define IPSNTPS_RESOLUTION 2
#define IPSNTPS_TIME 3
typedef struct sntpsTimeData
{
ULONG seconds;
ULONG fraction;
} SNTP_TIMESTAMP;
IMPORT int ipsntpsGetTime(Ip_u32 *sec, Ip_u32 *frac);
/*******************************************************************************
*
* sntpsClockSet - assign a routine to access the reference clock
*
* This routine installs a hook routine that is called to access the
* reference clock used by the SNTP server. This hook routine must use the
* following interface:
* .CS
* STATUS sntpsClockHook (int request, void *pBuffer);
* .CE
* The hook routine should copy one of three settings used by the server to
* construct outgoing NTP messages into <pBuffer> according to the value of
* the <request> parameter. If the requested setting is available, the
* installed routine should return OK (or ERROR otherwise).
*
* This routine calls the given hook routine with the <request> parameter
* set to SNTPS_ID to get the 32-bit reference identifier in the format
* specified in RFC 1769. It also calls the hook routine with <request>
* set to SNTPS_RESOLUTION to retrieve a 32-bit value containing the clock
* resolution in nanoseconds. That value will be used to determine the 8-bit
* signed integer indicating the clock precision (according to the format
* specified in RFC 1769). Other library routines will set the <request>
* parameter to SNTPS_TIME to retrieve the current 64-bit NTP timestamp
* from <pBuffer> in host byte order. The routine sntpsNsecToFraction() will
* convert a value in nanoseconds to the format required for the NTP
* fractional part.
*
* Parameters:
* \is
* \i <pClockHookRtn>
* A pointer to the new interface to reference clock.
* \ie
*
* RETURNS: \is
* \i 'OK'.
* successful.
* \i 'ERROR'
* unsuccessful.
* \ie
*
* ERRNO:
*/
STATUS sntpsClockSet
(
FUNCPTR pClockHookRtn
);
/*******************************************************************************
*
* sntpsNsecToFraction - convert portions of a second to NTP format
*
* This routine is provided for convenience in fulfilling an SNTPS_TIME request
* to the clock hook. It converts a value in nanoseconds to the fractional part
* of the NTP timestamp format. The routine is not designed to convert
* non-normalized values greater than or equal to one second. Although the NTP
* time format provides a precision of about 200 pico-seconds, rounding errors
* in the conversion process decrease the accuracy as the input value increases.
* In the worst case, only the 24 most significant bits are valid, which reduces
* the precision to tenths of a micro-second.
*
* INTERNAL
* Floating-point calculations can't be used because some boards (notably
* the SPARC architectures) disable software floating point by default to
* speed up context switching. These boards abort with an exception when
* floating point operations are encountered.
*
* Parameters:
* \is
* \i <nsecs>
* nanoseconds to convert to binary fraction.
* \ie
*
* RETURNS: Value for NTP fractional part in host-byte order.
*
* ERRNO:
*/
ULONG sntpsNsecToFraction
(
ULONG nsecs
);
#ifdef __cplusplus
}
#endif
#endif /* __INCsntpsh */
+250
View File
@@ -0,0 +1,250 @@
/* sockFunc.h - socket function table header */
/*
* Copyright 1984-2006, 2009-2010 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
02p,05jan11,h_x Fix WIND00248759
02o,17feb10,dlk Remove FUNCPTR function pointer use entirely.
02n,29may09,dlk LP64 conversion and POSIXification.
02m,20jun06,jpb Removed I960 check.
02l,14sep04,dlk Omit entire contents of this file unless _WRS_KERNEL is
defined.
02k,29jun04,dlk Merged from BASE6_ITER5_FRZ27.
02l,28may04,dlk Use single socket IO-system device driver with wrappers
calling back-end routines.
02k,24mar04,mcm Including time.h instead of sys/time.h.
02j,15mar04,bwa added multiple concurrent backends capabalities.
02j,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5-int/2)
02i,08dec03,vvv updated based on inspection comments
02h,03dec03,asr Fix compile errors after dinkum libc check-in
02g,14nov03,nee Adding closeRtn to SOCK_FUNC
02f,05nov03,cdw Removal of unnecessary _KERNEL guards.
02e,04nov03,rlm Ran batch header path update for header re-org.
02d,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
02c,10jun03,vvv include netVersion.h
02b,02feb02,ham changed for tornado build
02a,15aug01,ann ported to clarinet from AE1.1 version 01f
*/
#ifndef __INCsockFunch
#define __INCsockFunch
#ifdef _WRS_KERNEL
/* includes */
#include <netVersion.h>
#include <sys/times.h>
#if defined (_WRS_VXWORKS_MAJOR) && (_WRS_VXWORKS_MAJOR >= 6)
#include <ioLib.h> /* For type DEV_HDR */
#else
#include <iosLib.h>
#endif /* defined (_WRS_VXWORKS_MAJOR) && (_WRS_VXWORKS_MAJOR >= 6) */
#ifdef __cplusplus
extern "C" {
#endif
/* HIDDEN */
/* typedefs */
typedef struct sockFunc SOCK_FUNC;
struct socket; /* defined in net/socketvar.h */
typedef SOCK_FUNC * (*SOCK_FUNC_INIT) (void);
#ifdef __cplusplus
}
#endif
/*
* sys/socket.h has circular dependencies on this header file, more
* specifically on type SOCK_FUNC which must be defined. This is why
* this file must be included after SOCK_FUNC has been defined.
*/
#include <sys/socket.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*SOCK_FUNC_ACCEPT)
(struct socket **pso,
struct sockaddr * addr,
socklen_t * pAddrlen);
typedef STATUS (*SOCK_FUNC_BIND)
(struct socket * so,
const struct sockaddr * name,
socklen_t namelen);
typedef STATUS (*SOCK_FUNC_CONNECT)
(struct socket * so,
const struct sockaddr * name,
socklen_t namelen);
typedef STATUS (*SOCK_FUNC_CONN_TIMEO)
(struct socket * so,
const struct sockaddr * name,
socklen_t namelen,
const struct timeval * tv);
typedef STATUS (*SOCK_FUNC_GETPEERNAME)
(struct socket * so,
struct sockaddr * addr,
socklen_t * pAddrlen);
typedef STATUS (*SOCK_FUNC_GETSOCKNAME)
(struct socket * so,
struct sockaddr * addr,
socklen_t * pAddrlen);
typedef STATUS (*SOCK_FUNC_LISTEN)
(struct socket * so,
int backlog);
typedef ssize_t (*SOCK_FUNC_RECV)
(struct socket * so,
void * buf,
size_t bufLen,
int flags);
typedef ssize_t (*SOCK_FUNC_RECVFROM)
(struct socket * so,
void * buf,
size_t bufLen,
int flags,
struct sockaddr * from,
socklen_t * pFromLen);
typedef ssize_t (*SOCK_FUNC_RECVMSG)
(struct socket * so,
struct msghdr * msg,
int flags);
typedef ssize_t (*SOCK_FUNC_SEND)
(struct socket * so,
const void * buf,
size_t bufLen,
int flags);
typedef ssize_t (*SOCK_FUNC_SENDTO)
(struct socket * so,
const void * buf,
size_t bufLen,
int flags,
const struct sockaddr * name,
socklen_t namelen);
typedef ssize_t (*SOCK_FUNC_SENDMSG)
(struct socket * so,
const struct msghdr * msg,
int flags);
typedef STATUS (*SOCK_FUNC_SHUTDOWN)
(struct socket * so,
int how);
typedef STATUS (*SOCK_FUNC_SOCKET)
(int domain,
int type,
int protocol,
struct socket ** pso);
typedef STATUS (*SOCK_FUNC_GETSOCKOPT)
(struct socket * so,
int level,
int optname,
void * optval,
socklen_t * optlen);
typedef STATUS (*SOCK_FUNC_SETSOCKOPT)
(struct socket * so,
int level,
int optname,
const void * optval,
socklen_t optlen);
typedef BOOL (*SOCK_FUNC_ZBUF) (void); /* Does the back end support zbufs? */
typedef int (*SOCK_FUNC_CLOSE)
(struct socket * so);
typedef ssize_t (*SOCK_FUNC_WRITE)
(struct socket * so,
const char * buf,
size_t maxBytes);
typedef ssize_t (*SOCK_FUNC_READ)
(struct socket * so,
char * buf,
size_t maxBytes);
typedef int (*SOCK_FUNC_IOCTL)
(struct socket *,
int code,
_Vx_usr_arg_t arg,
void * nullForKernel); /* last arg is NULL if from kernel, non-NULL for
system call originating in user space. */
struct sockFunc /* SOCK_FUNC */
{
SOCK_FUNC_INIT libInitRtn; /* Unused */
SOCK_FUNC_ACCEPT acceptRtn;
SOCK_FUNC_BIND bindRtn;
SOCK_FUNC_CONNECT connectRtn;
SOCK_FUNC_CONN_TIMEO connectWithTimeoutRtn;
SOCK_FUNC_GETPEERNAME getpeernameRtn;
SOCK_FUNC_GETSOCKNAME getsocknameRtn;
SOCK_FUNC_LISTEN listenRtn;
SOCK_FUNC_RECV recvRtn;
SOCK_FUNC_RECVFROM recvfromRtn;
SOCK_FUNC_RECVMSG recvmsgRtn;
SOCK_FUNC_SEND sendRtn;
SOCK_FUNC_SENDTO sendtoRtn;
SOCK_FUNC_SENDMSG sendmsgRtn;
SOCK_FUNC_SHUTDOWN shutdownRtn;
SOCK_FUNC_SOCKET socketRtn;
SOCK_FUNC_GETSOCKOPT getsockoptRtn;
SOCK_FUNC_SETSOCKOPT setsockoptRtn;
SOCK_FUNC_ZBUF zbufRtn;
/*
* The following IO-system handlers are called via wrappers in
* sockLib.c:
*/
SOCK_FUNC_CLOSE closeRtn;
SOCK_FUNC_READ readRtn;
SOCK_FUNC_WRITE writeRtn;
SOCK_FUNC_IOCTL ioctlRtn;
};
extern DEV_HDR socketDevHdr; /* I/O system device driver header */
/* END_HIDDEN */
/* Memory validation function pointers */
extern int (*pSockIoctlMemVal) (unsigned int cmd, void * data);
extern STATUS (*pUnixIoctlMemVal) (unsigned int cmd, const void * pData);
#ifdef __cplusplus
}
#endif
#endif /* _WRS_KERNEL */
#endif /* __INCsockFunch */
+120
View File
@@ -0,0 +1,120 @@
/* sockLib.h - UNIX BSD 4.3 compatible socket library header */
/*
* Copyright (c) 1984-2005, 2009 Wind River Systems, Inc.
*
* The right to copy, distribute or otherwise make use of this software
* may be licensed only pursuant to the terms of an applicable Wind River
* license agreement.
*/
/*
modification history
--------------------
03p,05jan11,h_x Fix WIND00248759
03o,28may09,dlk Change to Posix-compatible signatures, apart from 'restrict'
(LP64 conversion).
03n,17aug05,mcm Using sys/time.h for RTP space.
03m,14sep04,dlk Omit kernel APIs when _WRS_KERNEL is not defined.
03n,28may04,dlk Make all socket back-ends share a single IO system device.
Remove fdMax parameter to sockLibInit().
03m,24mar04,mcm Including time.h instead of sys/time.h.
03m,28may04,niq Merging from base6 label POST_ITER5_FRZ16_REBASE (ver
/main/vdt/base6_itn5-int/1)
03l,18nov03,nee adding <sys/time.h> for RTPs
03k,05nov03,cdw Removal of unnecessary _KERNEL guards.
03j,04nov03,rlm Ran batch header path update for header re-org.
03i,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
03h,27oct03,cdw update include statements post header re-org.
03g,24oct03,cdw update include statements post header re-org.
03f,10jun03,vvv include netVersion.h
03e,27feb02,ann correcting the path to sockFunc.h after relocation
03d,02feb02,ham changed for tornado build.
03c,30oct01,ppp merging from munich
03b,28aug01,ann correcting the return value in the prototype for sockLibInit
03a,15aug01,ann ported to clarinet from AE1.1 version 02l.
*/
#ifndef __INCsockLibh
#define __INCsockLibh
#ifdef _WRS_KERNEL
#include <sys/times.h>
#else
#include <sys/time.h>
#endif
#include <sys/socket.h>
#include <netVersion.h>
#include <version.h>
/* typedefs */
#ifdef _WRS_KERNEL
#include <sockFunc.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WRS_KERNEL
typedef struct sockLibMap
{
int domainMap; /* mapping address family */
int domainReal; /* real address family */
SOCK_FUNC * pSockFunc; /* socket function table */
struct sockLibMap * pNext; /* next socket lib mapping */
} SOCK_LIB_MAP;
#endif /* _WRS_KERNEL */
struct sockFunc; /* See sockFunc.h */
typedef struct sockFunc * (*SOCK_LIB_INIT_RTN) (void);
/* function declarations */
#ifdef _WRS_KERNEL
extern STATUS sockLibInit (void);
extern STATUS sockLibAdd (SOCK_LIB_INIT_RTN sockLibInitRtn, int domainMap,
int domainReal);
#endif /* _WRS_KERNEL */
extern int accept (int s, struct sockaddr *addr, socklen_t *addrlen);
extern STATUS bind (int s, const struct sockaddr *name, socklen_t namelen);
extern STATUS connect (int s, const struct sockaddr *name,
socklen_t namelen);
#if defined(_WRS_KERNEL) || \
defined(RUNTIME_64BIT_NAME) /* FIXME */ || \
(_WRS_VXWORKS_MAJOR >= 6 && _WRS_VXWORKS_MINOR >= 9)
extern STATUS connectWithTimeout (int sock, const struct sockaddr *adrs,
socklen_t adrsLen, const struct timeval *timeVal);
#else
extern STATUS connectWithTimeout (int sock, struct sockaddr *adrs,
int adrsLen, struct timeval *timeVal);
#endif
extern STATUS getpeername (int s, struct sockaddr *name, socklen_t *namelen);
extern STATUS getsockname (int s, struct sockaddr *name, socklen_t *namelen);
extern STATUS getsockopt (int s, int level, int optname, void *optval,
socklen_t *optlen);
extern STATUS listen (int s, int backlog);
extern ssize_t recv (int s, void *buf, size_t bufLen, int flags);
extern ssize_t recvfrom (int s, void *buf, size_t bufLen, int flags,
struct sockaddr *from, socklen_t *pFromLen);
extern ssize_t recvmsg (int sd, struct msghdr *mp, int flags);
extern ssize_t send (int s, const void *buf, size_t bufLen, int flags);
extern ssize_t sendmsg (int sd, const struct msghdr *mp, int flags);
extern ssize_t sendto (int s, const void *buf, size_t bufLen, int flags,
const struct sockaddr *to, socklen_t tolen);
extern int setsockopt (int s, int level, int optname, const void *optval,
socklen_t optlen);
extern STATUS shutdown (int s, int how);
extern int socket (int domain, int type, int protocol);
#ifdef __cplusplus
}
#endif
#endif /* __INCsockLibh */
+15
View File
@@ -0,0 +1,15 @@
/* socket.h - obsolete vxWorks 5.0 header file */
/* Copyright 1993 Wind River Systems, Inc. */
/*
modification history
--------------------
01a,09feb93,rrr written for compatibility with 5.0
*/
#ifndef _VXCORIP_SOCKET_H_
#define _VXCORIP_SOCKET_H_
#include "sys/socket.h"
#endif
+376
View File
@@ -0,0 +1,376 @@
/* cdefs.h - C definitions */
/* Copyright 2001-2003 Wind River Systems, Inc. */
/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Berkeley Software Design, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
* $FreeBSD: src/sys/sys/cdefs.h,v 1.28.2.8 2002/09/18 04:05:13 mikeh Exp $
*/
/*
modification history
--------------------
01i,28mar06,hya Fixed compile warnings.
01h,20nov03,niq Remove copyright_wrs.h file inclusion
01g,05nov03,cdw Removal of unnecessary _KERNEL guards.
01f,04nov03,rlm Ran batch header path update for header re-org.
01e,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01d,10jun03,vvv include netVersion.h
01c,08apr03,syy Fixed Diab compile warnings
01b,01feb03,pas merge from FreeBSD 4.7 - added POSIX stuff
*/
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_
#if defined(__cplusplus)
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
#define __BEGIN_DECLS
#define __END_DECLS
#endif
#include <netVersion.h>
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
* mode -- there must be no spaces between its arguments, and for nested
* __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
* concatenate double-quoted strings produced by the __STRING macro, but
* this only works with ANSI C.
*
* __XSTRING is like __STRING, but it expands any macros in its argument
* first. It is only available with ANSI C.
*/
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#define __STRING(x) #x /* stringify without expanding x */
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
#define __const const /* define reserved names to standard */
#define __signed signed
#define __volatile volatile
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
#ifndef __GNUC__
#define __inline /* delete GCC keyword */
#endif /* !__GNUC__ */
#endif /* !__cplusplus */
#else /* !(__STDC__ || __cplusplus) */
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
#ifndef __GNUC__
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif /* !NO_ANSI_KEYWORDS */
#endif /* !__GNUC__ */
#endif /* !(__STDC__ || __cplusplus) */
/*
* Compiler-dependent macros to help declare dead (non-returning) and
* pure (no side effects) functions, and unused variables. They are
* null except for versions of gcc that are known to support the features
* properly (old versions of gcc-2 supported the dead and pure features
* in a different (wrong) way).
*/
#if !defined(__GNUC__) || \
(defined(__GNUC__) && (__GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5))
#define __dead2
#define __pure2
#define __unused
#endif
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused
#endif
#if defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ == 3)
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused __attribute__((__unused__))
#endif
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if !(defined(__GNUC__) && (__GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3))
#ifndef __func__
#define __func__ NULL
#endif
#endif
#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901)
#define __LONG_LONG_SUPPORTED
#endif
/*
* GCC 2.95 provides `__restrict' as an extention to C90 to support the
* C99-specific `restrict' type qualifier. We happen to use `__restrict' as
* a way to define the `restrict' type qualifier without disturbing older
* software that is unaware of C99 keywords.
*/
#if !((defined(__GNUC__) && __GNUC__ == 2) && __GNUC_MINOR__ == 95)
#if !defined(__STDC_VERSION__) || \
(defined(__STDC_VERSION__) && __STDC_VERSION__ < 199901)
#define __restrict
#else
#define __restrict restrict
#endif
#endif
/*
* Compiler-dependent macros to declare that functions take printf-like
* or scanf-like arguments. They are null except for versions of gcc
* that are known to support the features properly (old versions of gcc-2
* didn't permit keeping the keywords out of the application namespace).
*/
#if !defined(__GNUC__) || \
(defined(__GNUC__) && (__GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 7))
#define __printflike(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#else
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#endif
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
#else
#define __printf0like(fmtarg, firstvararg)
#endif
#ifdef __GNUC__
#define __strong_reference(sym,aliassym) \
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
#ifdef __ELF__
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".weak " #alias); \
__asm__(".equ " #alias ", " #sym)
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning." #sym); \
__asm__(".asciz \"" msg "\""); \
__asm__(".previous")
#else
#define __weak_reference(sym,alias) \
__asm__(".weak alias"); \
__asm__(".equ alias, sym")
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning.sym"); \
__asm__(".asciz \"msg\""); \
__asm__(".previous")
#endif /* __STDC__ */
#else /* !__ELF__ */
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".stabs \"_" #alias "\",11,0,0,0"); \
__asm__(".stabs \"_" #sym "\",1,0,0,0")
#define __warn_references(sym,msg) \
__asm__(".stabs \"" msg "\",30,0,0,0"); \
__asm__(".stabs \"_" #sym "\",1,0,0,0")
#else
#define __weak_reference(sym,alias) \
__asm__(".stabs \"_/**/alias\",11,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0")
#define __warn_references(sym,msg) \
__asm__(".stabs msg,30,0,0,0"); \
__asm__(".stabs \"_/**/sym\",1,0,0,0")
#endif /* __STDC__ */
#endif /* __ELF__ */
#endif /* __GNUC__ */
#if defined(__GNUC__) && defined(__ELF__)
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
#else
#define __IDSTRING(name,string) static const char name[] __unused = string
#endif
#ifndef __RCSID
#define __RCSID(s) __IDSTRING(rcsid,s)
#endif
/*
* Embed the rcs id of a source file in the resulting library. Note that in
* more recent ELF binutils, we use .ident allowing the ID to be stripped.
* Usage:
* __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.28.2.8 2002/09/18 04:05:13 mikeh Exp $");
*/
#ifndef __FBSDID
#if !defined(lint) && !defined(STRIP_FBSDID)
#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
#define __FBSDID(s) struct __hack
#endif
#endif
#ifndef __RCSID_SOURCE
#define __RCSID_SOURCE(s) __IDSTRING(rcsid_source,s)
#endif
#ifndef __COPYRIGHT
#define __COPYRIGHT(s) __IDSTRING(copyright,s)
#endif
/*-
* The following definitions are an extension of the behavior originally
* implemented in <sys/_posix.h>, but with a different level of granularity.
* POSIX.1 requires that the macros we test be defined before any standard
* header file is included.
*
* Here's a quick run-down of the versions:
* defined(_POSIX_SOURCE) 1003.1-1988
* _POSIX_C_SOURCE == 1 1003.1-1990
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
* _POSIX_C_SOURCE == 199309 1003.1b-1993
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
* _POSIX_C_SOURCE == 200112 1003.1-2001
*
* In addition, the X/Open Portability Guide, which is now the Single UNIX
* Specification, defines a feature-test macro which indicates the version of
* that specification, and which subsumes _POSIX_C_SOURCE.
*
* Our macros begin with two underscores to avoid namespace screwage.
*/
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if _XOPEN_SOURCE - 0 >= 600
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#elif _XOPEN_SOURCE - 0 >= 500
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
#endif
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 198808
#endif
#ifdef _POSIX_C_SOURCE
#if _POSIX_C_SOURCE >= 200112
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#elif _POSIX_C_SOURCE >= 199506
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199309
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199209
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#elif _POSIX_C_SOURCE >= 199009
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
#else
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#ifdef _ANSI_SOURCE /* Hide almost everything. */
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#else /* Default environment: show everything. */
#define __POSIX_VISIBLE 200112
#define __XSI_VISIBLE 600
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 1999
#endif
#endif
#endif /* !_SYS_CDEFS_H_ */
@@ -0,0 +1,72 @@
/* fnv_hash.h */
/* Copyright 2001-2005 Wind River Systems, Inc. */
/*
* Fowler / Noll / Vo Hash (FNV Hash)
* http://www.isthe.com/chongo/tech/comp/fnv/
*
* This is an implementation of the algorithms posted above.
* This file is placed in the public domain by Peter Wemm.
*
* $FreeBSD: src/sys/sys/fnv_hash.h,v 1.2.2.1 2001/03/21 10:50:59 peter Exp $
*/
/*
modification history
--------------------
01n,09jan12,h_x Move extern "C" after last header file include.
01m,07feb05,vvv _KERNEL cleanup
01l,17jan05,vvv osdep.h cleanup
01k,16jul04,vvv moved function definitions to fnvHash.c to fix compiler
warnings
01j,20nov03,niq Remove copyright_wrs.h file inclusion
01i,05nov03,cdw Removal of unnecessary _KERNEL guards.
01h,04nov03,rlm Ran batch header path update for header re-org.
01g,03nov03,rlm Removed wrn/coreip/ prefix from #includes for header re-org.
01f,23jul03,vvv added _KERNEL protection to fix warnings (SPR #89813)
01e,10jun03,vvv include netVersion.h
01d,15may03,pas changed u_int64_t (from internal types.h) to uint64_t
(from Tornado types.h)
01c,05may03,ppp adding inclusion of clarinet.h for non-coreip build
01b,29apr03,syy Added #ifdef for __cplusplus
01a,01jan03,pas Ported from FreeBSD 4.7
*/
#ifndef __INCfnv_hashh
#define __INCfnv_hashh
#ifdef _WRS_KERNEL
#include <vxWorks.h>
#include <netVersion.h>
#include <sys/cdefs.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint32_t Fnv32_t;
typedef uint64_t Fnv64_t;
#define FNV1_32_INIT ((Fnv32_t) 33554467UL)
#define FNV1_64_INIT ((Fnv64_t) 0xcbf29ce484222325ULL)
#define FNV_32_PRIME ((Fnv32_t) 0x01000193UL)
#define FNV_64_PRIME ((Fnv64_t) 0x100000001b3ULL)
extern __inline Fnv32_t fnv_32_buf(const void *buf, size_t len, Fnv32_t hval);
extern __inline Fnv32_t fnv_32_str(const char *str, Fnv32_t hval);
extern __inline Fnv64_t fnv_64_buf(const void *buf, size_t len, Fnv64_t hval);
extern __inline Fnv64_t fnv_64_str(const char *str, Fnv64_t hval);
#ifdef __cplusplus
}
#endif
#endif
#endif /* ! __INCfnv_hashh */

Some files were not shown because too many files have changed in this diff Show More