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
@@ -0,0 +1,107 @@
/*
Copyright 2000-2005 Wind River Systems, Inc.
@format.tab-size 8
modification history
--------------------
01n,21apr16,l_y added bridge aging time.(VXW6-85482)
01m,16nov06,tlu Added contatenate symbol "\" for bridge dependencies
01l,16aug06,tlu Added INCLUDE_ETHERNET and INCLUDE_NET_POOL as bridge
dependency
01k,24jun05,svk Remove tabs from IPv6 prefix length default value
01j,04may05,zhu Updated parameter name and synopsis
01i,28apr05,zhu Moved bridge to layer2 folder and updated case of the name
01h,19mar05,zhu Changed the string format to be consistent with NAT and
Firewall
01g,28mar05,svk Allow bridge to attach to IPv6 stack
01f,25apr03,zhu Updated copyright
01e,29apr02,zhu Changed INIT order with DHCPS
01d,24apr02,vks Removed mirror parameters, renamed mirror addr and mask
parameters, modified usrNetBridgeInit() call
01c,10apr02,vks Merged mirror and bridge configlettes
01b,09apr02,svk Added configuration parameters
01a,16feb01,ann Written
DESCRIPTION
This file contains the Bridge component description.
*/
#ifdef _WRS_CONFIG_COMPONENT_BRIDGE
Component INCLUDE_BRIDGE
{
NAME Learning Bridge
SYNOPSIS Core Bridge module
MODULES bridge.o
CONFIGLETTES usrNetBridgeCfg.c
HDR_FILES wrn/bridge/bridge.h
INIT_RTN usrNetBridgeInit (BRIDGE_PORTS, \
BRIDGE_IP_ADDR, BRIDGE_IP_MASK, \
BRIDGE_IPV6_ADDR, BRIDGE_IPV6_PREFIXLEN, \
BRIDGE_AGING_TIMEOUT);
CFG_PARAMS BRIDGE_PORTS \
BRIDGE_IP_ADDR \
BRIDGE_IP_MASK \
BRIDGE_IPV6_ADDR \
BRIDGE_IPV6_PREFIXLEN \
BRIDGE_AGING_TIMEOUT
REQUIRES INCLUDE_MUX \
INCLUDE_ETHERNET \
INCLUDE_NET_POOL
_INIT_ORDER usrNetAppInit
INIT_BEFORE INCLUDE_DHCPS
}
Parameter BRIDGE_PORTS
{
NAME Bridge port list
SYNOPSIS Specify list of interfaces to be added as bridge ports.\
e.g.,"fei,0,fei,1,elPci,0"
TYPE string
DEFAULT ""
}
Parameter BRIDGE_IP_ADDR
{
NAME Bridge IP address
SYNOPSIS Specify the bridge IP address. e.g.,"10.11.12.1"
TYPE string
DEFAULT ""
}
Parameter BRIDGE_IP_MASK
{
NAME Bridge network mask
SYNOPSIS Specify the network mask of the bridge. e.g.,0xFF000000
TYPE int
DEFAULT 0
}
Parameter BRIDGE_IPV6_ADDR
{
NAME Bridge IPv6 address
SYNOPSIS Specify the IPv6 address of the bridge. \
e.g.,"2001:DB8:1234:100::1"
TYPE string
DEFAULT ""
}
Parameter BRIDGE_IPV6_PREFIXLEN
{
NAME Bridge IPv6 prefix length
SYNOPSIS Specify the IPv6 prefix length of the bridge. e.g.,64
TYPE int
DEFAULT 0
}
Parameter BRIDGE_AGING_TIMEOUT
{
NAME Bridge aging timeout time
SYNOPSIS Specify the bridge aging time. e.g.,300
TYPE int
DEFAULT 300
}
#endif
@@ -0,0 +1,12 @@
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.4 $
# $Source: /home/interpeak/CVSRoot/vxbridge/config/common.vxconfig,v $
# $Author: myakan $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#hidden option that enables BRIDGE
config SUPPORTS_BRIDGE
bool
default y
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,13 @@
IPTARGETS := lib
ifneq ($(IPMAKEFILE),)
include $(IPMAKEFILE)
else
include $(IPCOM_ROOT)/Makefile
endif
include vxbridge.mk
include $(IPCOM_ROOT)/gmake/ipcom_make.mk
lib: dirs $(IPLIBFILE)
@@ -0,0 +1,81 @@
#############################################################################
# VXNETAPPS.MK
#
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: vxbridge.mk,v $ $Revision: 1.3 $
# $Source: /home/interpeak/CVSRoot/vxbridge/gmake/vxbridge.mk,v $
# $Author: fguo $ $Date: 2010-07-09 11:45:05 $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#
#############################################################################
#############################################################################
# PRODUCT
###########################################################################
IPPROD ?= vxbridge
#############################################################################
# DEFINE
###########################################################################
IPDEFINE += -DVXBRIDGE
ifdef _WRS_CONFIG_COMPONENT_IPFIREWALL_SUPPORT
IPDEFINE += -DINCLUDE_IPFIREWALL_SUPPORT
IPDEFINE += -DIPCOM_STORE_PHYSICAL_IF
IPDEFINE += -DIPFIREWALL_PHYSICAL_IF_SUPPORT
endif
ifdef _WRS_CONFIG_COMPONENT_OPTION82_SUPPORT
IPDEFINE += -DINCLUDE_DHCP_RELAY_AGENT
endif
#############################################################################
# INCLUDE
###########################################################################
IPINCLUDE += -I$(VXBRIDGE_ROOT)/config
IPINCLUDE += -I$(VXBRIDGE_ROOT)/include
#############################################################################
# OBJECTS
###########################################################################
# Configuration
# Main
IPLIBOBJECTS += bridge.o
IPLIBOBJECTS += mirrorEnd.o
IPLIBOBJECTS += mirrorUtils.o
#############################################################################
# VPATH
###########################################################################
IPSRCDIRS += $(VXBRIDGE_ROOT)/src
TGT_DIR=$(WIND_BASE)/target
#DOC_FILES= bridge.c mirrorEnd.c mirrorUtils.c
ifeq ($(IP_PORT_VXWORKS),)
WR_IPCOM_NAME := vxworks
WR_IPCOM_VERSION := $(filter-out $(WR_IPCOM_NAME), $(subst -, ,$(WIND_PLATFORM)))
WR_IPCOM_VERSION := $(subst .,,$(WR_IPCOM_VERSION))
EXTRA_DEFINE += -DIP_PORT_VXWORKS=$(WR_IPCOM_VERSION)
endif
IPNET_ROOT_PATH := $(subst \,/,$(WRVX_COMPBASE))/$(subst \,/,$(COMP_IPNET2))
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipnet2/include
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipnet2/config
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipcom/port/vxworks/include
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipcom/port/vxworks/config
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipcom/include
INCLUDE_CC += -I$(IPNET_ROOT_PATH)/ipcom/config
#############################################################################
# LIB
###########################################################################
IPLIBS += $(IPLIBROOT)/libvxbridge.a
###########################################################################
# END BRIDGE.MK
###########################################################################
@@ -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
***************************************************************************/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,104 @@
/* mirrorUtils.c - utility routines for the mirror END driver */
/* Copyright 1984-2005 Wind River Systems, Inc. */
#include "copyright_wrs.h"
/*
modification history
--------------------
01i,14nov06,tlu Fixed coverity warning (defect 70020)
01h,04oct06,kch Fixed warning.
01g,15aug06,tlu Ported to IPNET
01f,15apr05,svk Update API descriptions
01e,17apr03,svk Update copyright date
01d,15apr02,zhu made changes for docs
01c,04apr02,svk Replace hard-coded device name and unit number
01b,12mar01,ann fixing some compilation warnings
01a,22feb01,ann written
*/
/*
DESCRIPTION
This library contains the utility routines for implementing the
mirror END driver.
INCLUDE FILES: muxLib.h
*/
#include <muxLib.h>
#include <string.h>
/* Uncomment the line below to enable debug messages */
/* #define B_DEBUG */
#ifdef B_DEBUG
int b_debug = 1;
#define DBG_PRINT(X) \
do { \
if (b_debug) \
printf X; \
}while(0)
#else
#define DBG_PRINT(X)
#endif
LOCAL char* baseDeviceName = "";
LOCAL int baseUnitNum = 0;
void mirrorEnetAddrGet (char * pAddress);
void mirrorBaseParamsSet (char * devName, int unit);
/*******************************************************************************
* mirrorEnetAddrGet - get the MAC address for an interface
*
* This routine copies the MAC address from the END object of the
* interface specified. The data is copied into the buffer provided
* to this routine.
*
* RETURNS: n/a
*
*/
void mirrorEnetAddrGet
(
char * pAddress /* Buffer for the MAC address */
)
{
END_OBJ * pEndObj = NULL;
DBG_PRINT(("Calling mirrorEnetAddrGet\n"));
pEndObj = endFindByName (baseDeviceName, baseUnitNum);
if (pEndObj != NULL)
bcopy ((char *)pEndObj->mib2Tbl.ifPhysAddress.phyAddress,
pAddress, pEndObj->mib2Tbl.ifPhysAddress.addrLength);
else
DBG_PRINT(("ERROR: mirrorEnetAddrGet -- can't find pEndObj\n"));
}
/*******************************************************************************
* mirrorBaseParamsSet - store the base device name and unit number
*
* This routine stores the base device name and unit number. It is needed for
* mirrorEnetAddrGet() to work.
*
* RETURNS: n/a
*/
void mirrorBaseParamsSet
(
char * devName,
int unit
)
{
DBG_PRINT(("Calling mirrorBaseParamsSet\n"));
baseDeviceName = devName;
baseUnitNum = unit;
}