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,139 @@
/* 02comp_ipnet_dhcp.cdf - IPNet DHCP configuration file */
/*
* Copyright (c) 2006-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
--------------------
01v,11aug10,h_s move from osconfig and split from 02comp_ipnet_dhcp.cdf
01u,05jul10,lzq Added INCLUDE_IPDHCPC6_CMD component
01t,04sep09,h_s Modify the DHCPC,DHCPR,DHCPS related callback function to 0 instead of NULL
to make gnu compile correct.
01s,04jun09,ggz Added DHCPC ip address lease time
01r,29may09,spw Add DHCPS_NO_STRICT_SUBNET_MATCH param
01q,11feb08,spw Add support for user defined client options
01p,10oct08,spw Add max message size, ttl, auto enable interface configs
01o,27aug08,spw Add option to remove existing addresses from interface
when starting negotiation
01n,27aug08,spw Modify option callback param name, add netmask option
01m,30may08,spw Add bootp mode and some more options
01l,23sep08,rme Misspelled words corrected
01k,19sep07,rme Added missing backslash
01n,07sep07,rme Replaced SELECTION_IPCOM_FS with SELECT_IPCOM_FS in INCLUDE_IPDHCPC6
01m,07sep07,rme Replaced SELECTION_IPCOM_FS with SELECT_IPCOM_FS in INCLUDE_IPDHCPS
01l,10sep07,mze INCLUDE_IPCOM_FS_SELECTION changed to SELECT_IPCOM_FS
01k,21aug07,mze fixed mistake in INCLUDE_IPDHCPS MODULES line continued without "\"
01j,28aug07,ps Add DHCPc6 authentication parameters
01i,07feb07,tkf Add IPDHCPS dependency on SELECT_IPCOM_FS.
01h,22jan07,kch Added DHCPC_RFC2131_INIT_DELAY, DHCPC_RFC2131_EXP_BACKOFF,
DHCPC_DISCOVER_RETRIES and DHCPC_OFFER_TIMEOUT configuration
macros (WIND00086146).
01g,03jan07,kch Changed DHCPC_SERVER_PORT default value from 68 to 67.
Renamed DHCPC_IFLIST_REQ_OPTS and DHCPC_IFLIST_CLIENT_ID
macros to DHCPC_IF_REQ_OPTS_LIST and DHCPC_IF_CLIENT_ID_LIST.
01f,19dec06,mwv Correct typos throughout (WIND00083100)
01e,15dec06,kch Corrected typo for DHCPC6_IF_IA_NA_DEFAULT_LIST description.
01d,11dec06,kch Added configuration parameters for DHCP client, relay
and server callback hooks. Also added DHCPS_NETCONF_SYSVAR
and DHCPR_NETCONF_SYSVAR. Added ipnet/ipDHCPc_example.c
configlette to INCLUDE_IPDHCPC as well.
01c,01dec06,kch Added additional configuration parameters for DHCP6 Client.
01b,23sep06.kch Added INCLUDE_IPDHCPS6_CMD.
01a,14sep06,tkf Written
*/
#ifdef _WRS_CONFIG_COMPONENT_IPDHCPR
Component INCLUDE_IPDHCPR {
NAME DHCP Relay Agent
SYNOPSIS DHCP Relay Agent
MODULES ipdhcpr.o ipdhcpr_cmd_dhcpr.o
REQUIRES INCLUDE_IPCOM
CONFIGLETTES ipdhcpr_config.c
CFG_PARAMS DHCPR_SERVER_PORT DHCPR_CLIENT_PORT DHCPR_MAX_PKT_SIZE \
DHCPR_HOPS_THRESHOLD DHCPR_NETCONF_SYSVAR \
DHCPR_INSTALL_CALLBACK_HOOK DHCPR_START_CALLBACK_HOOK
_CHILDREN FOLDER_DHCP
}
/* INCLUDE_IPDHCPR configuration parameters */
Parameter DHCPR_SERVER_PORT {
NAME UDP port used by the DHCP server
SYNOPSIS Defines the UDP port used for reception by dhcp/bootp \
servers handled by DHCP relay agent
TYPE char *
DEFAULT "67"
}
Parameter DHCPR_CLIENT_PORT {
NAME UDP port used by the DHCP/bootp clients
SYNOPSIS Defines the UDP port used for reception by DHCP/bootp \
clients handled by DHCP relay agent.
TYPE char *
DEFAULT "68"
}
Parameter DHCPR_MAX_PKT_SIZE {
NAME Max DHCP relay packet size
SYNOPSIS Defines the packet size used by DHCP relay agent for \
sending and receiving. The size must never be less than \
576 bytes, which is the standard DHCP packet size.
TYPE char *
DEFAULT "576"
}
Parameter DHCPR_HOPS_THRESHOLD {
NAME Maximum number of hops
SYNOPSIS Defines the maximum number of relay agents allowed between \
a client and a server. Packets with a hops count greater \
than this threshold value are silently dropped
TYPE char *
DEFAULT "3"
}
Parameter DHCPR_NETCONF_SYSVAR {
NAME DHCP relay network pre-configuration
SYNOPSIS DHCP relay network pre-configuration array is used to \
statically configure the DHCP relay with a pre-configured \
setup of networks and hosts when initiated. Each system \
variable in this array must be named according to the syntax \
ipdhcpr.netconf.<index>, where <index> is a unique line \
indicator. The value of each system variable must consist \
of a IPDHCPR shell command (without the preceding dhcpr \
that is used only when executing from a shell). The commands \
are executed in the order they are defined. See \
ipdhcpr_netconf_sysvar Ipcom_sysvar array in ipdhcpr_config.c \
configlette for the example usage.
TYPE void *
DEFAULT NULL
}
Parameter DHCPR_INSTALL_CALLBACK_HOOK {
NAME Install dhcp relay callback routine
SYNOPSIS Determine if the user-defined DHCP relay callback routines \
as specified by the macro DHCPR_START_CALLBACK_HOOK \
should be installed. If FALSE, the DHCPR_START_CALLBACK_HOOK \
configuration is not applicable.
TYPE BOOL
DEFAULT FALSE
}
Parameter DHCPR_START_CALLBACK_HOOK {
NAME DHCP relay startup callback routine
SYNOPSIS DHCP relay startup callback routine. This routine, if \
provided, will be called by DHCP relay at startup. It is \
intended to be used for user supplied startup configuration \
of the DHCP relay. The DHCPR_INSTALL_CALLBACK_HOOK must \
also be set to TRUE in order to install this callback hook.
TYPE FUNCPTR
DEFAULT 0
}
#endif
@@ -0,0 +1,12 @@
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.6 $
# $Source: /home/interpeak/CVSRoot/ipdhcpr/config/common.vxconfig,v $
# $Author: myakan $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#hidden option that enables IPDHCPR
config SUPPORTS_DHCPR
bool
default y
@@ -0,0 +1,255 @@
/*
******************************************************************************
* IPCOM CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpr_config.c,v $ $Revision: 1.9 $
* $Source: /home/interpeak/CVSRoot/ipdhcpr/config/ipdhcpr_config.c,v $
* $Author: fguo $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Jonas Rendel <jonas@interpeak.se>
******************************************************************************
*/
/*
modification history
--------------------
01g,11aug10.h_s merge two config.c file for <Networking Configuration Enhancements>.
01f,04sep09,h_s Fix WIND00184353.
01e,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01d,14dec06,kch Modified ipdhcpr_start_hook() to allow for user configurable
callback hook. Also added DHCPR_NETCONF_SYSVAR to allow
preconfigure network configurations.
01c,13sep06,kch Refresh with Sept 08, 2006 code drop
01b,05sep06,dlk Eliminate some compiler warnings.
01a,28aug06,kch Update based on Aug 22, 2006 code drop.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include "ipcom_config.h"
#include "ipcom_err.h"
#include "ipcom_sysvar.h"
#include "ipdhcpr_config.h"
#if defined(IP_WB_BUILD)
/*
****************************************************************************
* 3 TYPES
****************************************************************************
*/
/* typedef to make compiler happy... */
typedef int (*ipdhcpr_start_cb)(void);
#endif
/*
****************************************************************************
* 4 GENERAL
****************************************************************************
*/
/*
*===========================================================================
* ipdhcpr_conf_sysvar
*===========================================================================
* Description: Initiates mandatory system configuration variables specific
* for IPDHCPR.
*
*/
IP_STATIC IP_CONST Ipcom_sysvar ipdhcpr_conf_sysvar[] =
{
/*
* server_port
*
* UDP port used by the DHCP server.
*
* Default: 67
*/
IP_SYSVAR( "ipdhcpr.ServerPort", "67", DHCPR_SERVER_PORT),
/*
* client_port
*
* UDP port used by the dhcp/bootp clients.
*
* Default: 68
*/
IP_SYSVAR( "ipdhcpr.ClientPort", "68", DHCPR_CLIENT_PORT),
/*
* packet_size
*
* Max DHCP packet size the DHCPR can handle
*
* Default: 576
*/
IP_SYSVAR( "ipdhcpr.PacketSize", "576", DHCPR_MAX_PKT_SIZE),
/*
* hops_treshold
*
* Max number of relay agent allowed between a client and | *
* and a server. Packets with a hops count greater than this | * Default: 67
* treshold value are silently dropped.
*
* Default: 3
*/
IP_SYSVAR( "ipdhcpr.HopsThreshold", "3", DHCPR_HOPS_THRESHOLD),
{ IP_NULL, IP_NULL}
};
/*
*===========================================================================
* ipdhcpr_netconf_sysvar
*===========================================================================
* Description: example implementation of dhcp relay network
* configuration array
*
* DHCP relay network pre-configuratio array is used to statically configure
* the dhcp relay with a preconfigured setup of networks and hosts when
* initiated. Each system variable in this array must be named according to
* the syntax ipdhcpr.netconf.<index>, where <index> is a unique line
* indicator. The value of each system variable must consist of a IPDHCPR
* shell command (without the preceeding dhcpr that is used only when
* executing from a shell). The commands are executed in the order they
* are defined.
*/
#ifdef IPDHCPR_INCLUDE_CMD
IP_STATIC IP_CONST Ipcom_sysvar ipdhcpr_netconf_sysvar[] =
{
#if defined(IPDHCPR_USE_EXAMPLE) || defined(INCLUDE_IPDHCPR_USE_EXAMPLE)
{"ipdhcpr.netconf.0", "server add 10.1.2.165"},
#endif /* IPDHCPR_USE_EXAMPLE || INCLUDE_IPDHCPR_USE_EXAMPLE */
{IP_NULL, IP_NULL}
};
#endif /* IPDHCPR_INCLUDE_CMD */
#ifdef IP_WB_BUILD
#if DHCPR_INSTALL_CALLBACK_HOOK == TRUE
/*
* forward declarations for the user-defined dhcp relay callback hooks
* to satisfy the compiler.
*/
#if (DHCPR_START_CALLBACK_HOOK != 0)
int DHCPR_START_CALLBACK_HOOK (void);
#endif
#else
/*
* DHCPR_START_CALLBACK_HOOK is applicable only if DHCPR_INSTALL_CALLBACK_HOOK
* is set to TRUE. Explicitly re-define the hook to NULL so that we don't get
* compiler errors
*/
#undef DHCPR_START_CALLBACK_HOOK
#define DHCPR_START_CALLBACK_HOOK NULL
#endif /* DHCPR_INSTALL_CALLBACK_HOOK */
#endif /* IP_WB_BUILD */
/*
****************************************************************************
* 10 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipdhcpr_start_hook
*===========================================================================
* Description: This routine is called by IPDHCPR at start-up. It is
* intended to be used for static configuration of IPDHCPR.
*
* Parameters: -
* Returns: 0 - success
* -1 - failure
*
*/
IP_GLOBAL int
ipdhcpr_start_hook (void)
{
#ifdef IP_WB_BUILD
ipdhcpr_start_cb dhcpr_cb;
dhcpr_cb = (DHCPR_START_CALLBACK_HOOK != NULL) ?
DHCPR_START_CALLBACK_HOOK : NULL;
/*
* call the user callback routine if provided. Otherwise, simply return 0.
*/
return (dhcpr_cb != NULL) ? dhcpr_cb() : 0;
#else
return 0;
#endif
}
/*
****************************************************************************
* 11 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipdhcps_configure
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err
ipdhcpr_configure(void)
{
/* Initialize IPDHCPR system configuration. */
(void)ipcom_sysvar_setv(ipdhcpr_conf_sysvar, 0);
/*
* Note: IPDHCPR_INCLUDE_CMD is defined in ipdhcpr_config.h. If
* changing that define, the <ipdhcpr> directory must be
* recompiled
*/
#ifdef IPDHCPR_INCLUDE_CMD
#ifdef IP_WB_BUILD
{
Ipcom_sysvar *entries;
if ((entries = (Ipcom_sysvar *)DHCPR_NETCONF_SYSVAR) != NULL)
{
/* Initialize IPDHCPR network preconfiguration */
(void)ipcom_sysvar_setv(entries, 0);
}
}
#else
/* Initialize IPDHCPR network preconfiguration */
(void)ipcom_sysvar_setv(ipdhcpr_netconf_sysvar, 0);
#endif /* IP_WB_BUILD */
#endif
return IPCOM_SUCCESS;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,76 @@
/*
******************************************************************************
* IPNET_CONFIG.H
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpr_config.h,v $ $Revision: 1.4 $
* $Source: /home/interpeak/CVSRoot/ipdhcpr/config/ipdhcpr_config.h,v $
* $Author: jonas $ $Date: 2004-02-17 08:39:26 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Jonas Rendel <jonas@interpeak.se>
******************************************************************************
*/
#ifndef IPDHCPR_CONFIG_H
#define IPDHCPR_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*
* Configuration for IPDHCPR. Parameters that are macros can only be changed
* before compiling, variables can be changed before compiling and linking.
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_config.h>
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include "ipdhcpr.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 3 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/*
*===========================================================================
* IPDHCPR_INCLUDE_CMD
*===========================================================================
* Define to include DHCP Server shell command 'dhcpr'.
*/
#define IPDHCPR_INCLUDE_CMD
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/