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,711 @@
/* 00comp_ipnet_apps.cdf - IPNet Applications configuration file */
/*
* Copyright (c) 2006-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
--------------------
30dec15,wjf Fix defect VXW6-83989
25Jan13,lzq Fix defect WIND00400196
06dec11,xhs Fix defect WIND00253073
19oct11,rjq Add parameter FTPC_BIND_ADDRESS
03Aug10,rjq New file for Networking Configuration VSB restructuring.
*/
#ifdef _WRS_CONFIG_COMPONENT_IPAPPL
Folder FOLDER_TFTP {
NAME TFTP Components
SYNOPSIS TFTP Components
CHILDREN INCLUDE_IPTFTP_COMMON \
INCLUDE_IPTFTPC \
INCLUDE_IPTFTP_CLIENT_CMD \
INCLUDE_IPTFTPS \
INCLUDE_TFTP_CLIENT
_CHILDREN FOLDER_NET_L5_APPLICATIONS
}
Folder FOLDER_FTP {
NAME FTP Components
SYNOPSIS FTP Components
CHILDREN INCLUDE_FTP \
INCLUDE_FTP6 \
INCLUDE_IPFTPC \
INCLUDE_IPFTPS \
INCLUDE_IPFTP_CMD \
INCLUDE_IPFTPS_TLS
_CHILDREN FOLDER_NET_L5_APPLICATIONS
}
Component INCLUDE_IPDHCPC {
NAME DHCP Client
SYNOPSIS DHCP Client
MODULES ipdhcpc.o
CONFIGLETTES ipdhcpc_config.c ipdhcpc_example.c
REQUIRES INCLUDE_IPCOM
CFG_PARAMS DHCPC_CLIENT_PORT DHCPC_SERVER_PORT DHCPC_REQ_OPTS \
DHCPC_CLIENT_ID DHCPC_CLIENT_UUID DHCPC_RFC2131_INIT_DELAY \
DHCPC_RFC2131_EXP_BACKOFF DHCPC_DISCOVER_RETRIES \
DHCPC_OFFER_TIMEOUT DHCPC_IF_REQ_OPTS_LIST \
DHCPC_IF_CLIENT_ID_LIST \
DHCPC_INSTALL_OPTION_CALLBACK_HOOK \
DHCPC_INSTALL_REPLY_CALLBACK_HOOK \
DHCPC_OPTION_CALLBACK_HOOK DHCPC_REPLY_CALLBACK_HOOK \
DHCPC_BOOTP_MODE DHCPC_BOOT_FILENAME \
DHCPC_SERVER_HOSTNAME DHCPC_OPTION_HOSTNAME \
DHCPC_OPTION_NETMASK DHCPC_OPTION_VENDOR_CLASS_ID \
DHCPC_OPTION_IPADDRESS_LEASE_TIME \
DHCPC_OPTION_VI_VENDOR_CLASS \
DHCPC_REMOVE_EXISTING_ADDRESSES \
DHCPC_REMOVE_LEASED_ADDRESS \
DHCPC_AUTO_DISABLE \
DHCPC_TTL \
DHCPC_OPTION_MAX_MESSAGE_SIZE \
DHCPC_OPTION_USER_SPECIFIED \
DHCPC_IF_INFORMATION_ONLY_LIST \
DHCPC_FLAGS_BIT_BROADCAST
_CHILDREN FOLDER_DHCP
}
Component INCLUDE_IPDNSC {
NAME DNS Client
SYNOPSIS DNS Client
MODULES ipdnsc.o
REQUIRES INCLUDE_IPCOM
CONFIGLETTES ipdnsc_config.c
CFG_PARAMS DNSC_SERVER_PORT DNSC_TIMEOUT DNSC_RETRIES \
DNSC_DOMAIN_NAME DNSC_PRIMARY_NAME_SERVER \
DNSC_SECONDARY_NAME_SERVER DNSC_TERTIARY_NAME_SERVER \
DNSC_QUATERNARY_NAME_SERVER DNSC_IP4_ZONE \
DNSC_IP6_ZONE
_CHILDREN FOLDER_NET_L5_APPLICATIONS
}
Component INCLUDE_IPFTPC {
NAME FTP Client
SYNOPSIS FTP Client
MODULES ipftpc.o
REQUIRES INCLUDE_IPCOM
CFG_PARAMS FTPC_BIND_ADDRESS
CONFIGLETTES ipftpc_config.c
}
Component INCLUDE_IPFTPS {
NAME FTP Server
SYNOPSIS FTP Server
MODULES ipftps.o
REQUIRES INCLUDE_IPCOM
CONFIGLETTES ipftps_config.c ipftps_example.c
CFG_PARAMS FTPS_AUTH_ATTEMPTS FTPS_SLEEP_TIME FTPS_LOCAL_PORT_BASE \
FTPS_PEER_PORT_BASE FTPS_ENABLE_PROXY FTPS_MODE \
FTPS_ROOT_DIR FTPS_INITIAL_DIR FTPS_MAX_SESSIONS \
FTPS_PORT_NUM FTPS_RECV_TIMEOUT FTPS_SEND_TIMEOUT \
FTPS_INACTIVITY_TIMEOUT FTPS_SOCKET_BACKLOG FTPS_SYS_TYPE \
FTPS_AUTH_CALLBACK_HOOK FTPS_DATABUF_SIZE
}
Component INCLUDE_IPTFTP_COMMON {
NAME TFTP common configurations
SYNOPSIS TFTP common configurations
MODULES iptftp_common.o
REQUIRES INCLUDE_IPCOM
CONFIGLETTES iptftps_config.c
CFG_PARAMS TFTPS_DIRS TFTPS_RETRANSMIT_TIMEOUT TFTPS_RETRIES
}
Component INCLUDE_IPTFTPC {
NAME TFTP Client
SYNOPSIS TFTP Client
MODULES iptftpc.o
REQUIRES INCLUDE_IPCOM INCLUDE_IPTFTP_COMMON
CONFIGLETTES iptftpc_config.c
}
Component INCLUDE_IPTFTPS {
NAME TFTP Server
SYNOPSIS TFTP Server
MODULES iptftps.o
REQUIRES INCLUDE_IPCOM INCLUDE_IPTFTP_COMMON
}
#ifdef _WRS_CONFIG_IPFTP_USE_TLS
Component INCLUDE_IPFTPS_TLS {
NAME FTP Server with TLS
SYNOPSIS FTP Server with TLS
MODULES ipftps_tls.o
REQUIRES INCLUDE_IPFTPS INCLUDE_IPSSL
CFG_PARAMS FTPS_TLS FTPS_TLS_CERT_FILE FTPS_TLS_KEY_FILE FTPS_TLS_SECRECT_KEY\
ENABLE_ADVANCE_FTPS_KEY_PRIVACY
_CHILDREN FOLDER_FTP
}
#endif
/******************** Configuration Parameters *****************************/
/* INCLUDE_IPDHCPC configuration parameters */
Parameter DHCPC_CLIENT_PORT {
NAME DHCP Client Port
SYNOPSIS DHCP client port as a quoted string: e.g. "68"
TYPE char *
DEFAULT "68"
}
Parameter DHCPC_SERVER_PORT {
NAME DHCP Server Port
SYNOPSIS DHCP server port as a quoted string: e.g. "68"
TYPE char *
DEFAULT "67"
}
Parameter DHCPC_RFC2131_INIT_DELAY {
NAME RFC2131 Initialization Delay identifier
SYNOPSIS Enable(1) /disable(0) RFC2131 Initialization Delay identifier.
TYPE char *
DEFAULT "1"
}
Parameter DHCPC_RFC2131_EXP_BACKOFF {
NAME RFC2131 Exponential Back-off Delay
SYNOPSIS Enable(1) /disable(0) RFC2131 Exponential Back-off Delay.
TYPE char *
DEFAULT "1"
}
Parameter DHCPC_DISCOVER_RETRIES {
NAME DHCP Client Retries
SYNOPSIS Number of DHCP client retries.
TYPE char *
DEFAULT "4"
}
Parameter DHCPC_OFFER_TIMEOUT {
NAME DHCP Offer Time-Out
SYNOPSIS DHCP offer time-out in milliseconds.
TYPE char *
DEFAULT "2000"
}
Parameter DHCPC_INSTALL_OPTION_CALLBACK_HOOK {
NAME Install DHCP Client Option Callback Routine
SYNOPSIS Determine if the user-defined DHCP client callback routine \
as specified by the macro DHCPC_OPTION_CALLBACK_HOOK should \
be installed. If FALSE, the DHCPC_OPTION_CALLBACK_HOOK \
configuration is not applicable.
TYPE BOOL
DEFAULT FALSE
}
Parameter DHCPC_OPTION_CALLBACK_HOOK {
NAME Option Callback Routine
SYNOPSIS This user-defined DHCP option processing callback routine \
is called once for each option prior to IPDHCPC is acting \
on the option, i.e. this callback can be used to change \
the contents of the DHCP server reply (caution!). If not \
specified, the internal option callback routine will be \
used. The DHCPC_INSTALL_OPTION_CALLBACK_HOOK must also be set to \
TRUE in order to install this callback routine.
TYPE FUNCPTR
DEFAULT ipdhcpc_option_default_callback
}
Parameter DHCPC_INSTALL_REPLY_CALLBACK_HOOK {
NAME Install DHCP Client Reply Callback Routine
SYNOPSIS Determine if the user-defined DHCP client callback routine \
as specified by the macro DHCPC_REPLY_CALLBACK_HOOK should \
be installed. If FALSE, the DHCPC_REPLY_CALLBACK_HOOK \
configuration is not applicable.
TYPE BOOL
DEFAULT FALSE
}
Parameter DHCPC_REPLY_CALLBACK_HOOK {
NAME Reply Callback Routine
SYNOPSIS This callback can be used to change the contents of the DHCP \
server reply (caution!). If not specified, the internal reply \
callback routine will be used. The DHCPC_INSTALL_REPLY_CALLBACK_HOOK \
must also be set to TRUE in order to install this callback \
routine.
TYPE FUNCPTR
DEFAULT ipdhcpc_reply_default_callback
}
Parameter DHCPC_BOOTP_MODE {
NAME BOOTP Mode
SYNOPSIS Operate as a BOOTP client only. \
That is, do not append a DHCP "message type" \
option to requests. "1" to enable, "0" to disable
TYPE char *
DEFAULT "0"
}
Parameter DHCPC_BOOT_FILENAME {
NAME DHCP Boot Filename
SYNOPSIS Specify an optional filename to use in dhcp/bootp requests.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_SERVER_HOSTNAME {
NAME DHCP Server Hostname
SYNOPSIS Specify an optional server hostname to use in dhcp/bootp requests.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_IF_REQ_OPTS_LIST {
NAME Interface Specific Option: Parameter Request List (55)
SYNOPSIS An interface name followed by comma separated list of DHCP \
options numbers that the DHCP client wants the server to \
provide in the format <ifparam>=<opts>. Each pair of \
<ifparam>=<opts> is semicolon separated, e.g. \
"eth0=1,2,3,4;eth1=2,3,4,5".
TYPE char *
DEFAULT ""
}
Parameter DHCPC_IF_CLIENT_ID_LIST {
NAME Interface Specific Option: Client Identifier (61)
SYNOPSIS A string of characters that the DHCP client wants the server \
to identify it by in the format <ifparam>=<id>. Each pair of \
<ifparam>=<id> is semicolon separated, e.g. \
"eth0=my_red_computer_eth0" or \
"eth0=my_red_computer_eth0;eth1=my_blue_computer_eth1".
TYPE char *
DEFAULT ""
}
Parameter DHCPC_REQ_OPTS {
NAME Global Option: Parameter Request List (55)
SYNOPSIS A comma separated list of DHCP options numbers that the \
DHCP client wants the server to provide, e.g. "1,2,3,4"
TYPE char *
DEFAULT NULL
}
Parameter DHCPC_CLIENT_ID {
NAME Global Option: Client Identifier (61)
SYNOPSIS A string of characters that the DHCP client wants the server \
to identify it by, e.g. "my_red_computer". If DHCPC_CLIENT_UUID \
is set "true", it should be defined like "4c:5f:00:ff"
TYPE char *
DEFAULT NULL
}
Parameter DHCPC_CLIENT_UUID {
NAME Global Option: Client Identifier type
SYNOPSIS Determine if DHCP client identifier type is uuid \
If "false", DHCPC_CLIENT_ID parameter should be treated as string \
If "true", DHCPC_CLIENT_ID parameter should be treated as char array.
TYPE char *
DEFAULT "false"
}
Parameter DHCPC_OPTION_HOSTNAME {
NAME Global Option: Hostname (12)
SYNOPSIS Defines the hostname option to use in requests.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_OPTION_NETMASK {
NAME Global Option: Netmask (1)
SYNOPSIS Defines the subnet mask option to use in requests.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_OPTION_IPADDRESS_LEASE_TIME {
NAME IP address lease time
SYNOPSIS This option is used in a client request to allow the client to request \
a lease time for the IP address. 0 value means no lease time is specified. \
The time is in units of seconds.
TYPE char *
DEFAULT "0"
}
Parameter DHCPC_OPTION_VENDOR_CLASS_ID {
NAME Global Option: Vendor Class ID (60)
SYNOPSIS Defines the vendor class id option.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_OPTION_VI_VENDOR_CLASS {
NAME Global Option: Vendor Identifying Vendor Class (124)
SYNOPSIS Defines the vendor identifying vendor class option. \
Expected format: enterprise_number1=data1;enterprise_number2=data2;... \
All data fields should be specified in network byte order
TYPE char *
DEFAULT ""
}
Parameter DHCPC_OPTION_MAX_MESSAGE_SIZE {
NAME Global Option: Maximum DHCP Message Size (57)
SYNOPSIS Maximum message size this client is prepared to accept. Must be \
at least 576 as per RFC 2131.
TYPE char *
DEFAULT "576"
}
Parameter DHCPC_OPTION_USER_SPECIFIED {
NAME Global Option: User Specified List
SYNOPSIS Defines a list of options and associated data not supported \
explicitly by other option configuration parameters. \
Expected format: <option>=<option_data>. \
Each pair of <option_number>=<option_data> is semicolon separated. \
In addition, <option_data> must be specified in hex with network byte order. \
e.g. "3=C0A80101;4=C0A80102" specifies a router option (3) with address \
at 192.168.1.1 and a time server option (4) with address at \
192.168.1.2.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_REMOVE_EXISTING_ADDRESSES {
NAME Remove Existing Addresses Before Negotiation
SYNOPSIS Remove all unicast addresses from the interface before \
negotiation begins. "1" to remove, "0" to retain
TYPE char *
DEFAULT "1"
}
Parameter DHCPC_REMOVE_LEASED_ADDRESS {
NAME Remove Leased Address After Expiration
SYNOPSIS Remove any leased address from the interface if \
the lease expires or DHCP is manually disabled. \
"1" to remove, "0" to retain
TYPE char *
DEFAULT "1"
}
Parameter DHCPC_AUTO_DISABLE {
NAME DHCP Auto Disable
SYNOPSIS Disable DHCP on the specified interface if another address \
is subsequently added via manual configuration. \
"1" to turn on, "0" to turn off
TYPE char *
DEFAULT "0"
}
Parameter DHCPC_TTL {
NAME DHCP TTL
SYNOPSIS Set Time To Live for DHCP packets. May be increased \
to interoperate with certain relay agents.
TYPE char *
DEFAULT "128"
}
Parameter DHCPC_IF_INFORMATION_ONLY_LIST {
NAME DHCP information only interface
SYNOPSIS Set interface that only receives information.
TYPE char *
DEFAULT ""
}
Parameter DHCPC_FLAGS_BIT_BROADCAST {
NAME DHCP Flag Field broadcast bit
SYNOPSIS Set the value of broadcast bit.
TYPE char *
DEFAULT "0"
}
/* INCLUDE_IPDNSC configuration parameters */
Parameter DNSC_SERVER_PORT {
NAME DNS server listening port
SYNOPSIS Specifies the port used by IPDNSC for DNS queries, e.g. "53"
TYPE char *
DEFAULT "53"
}
Parameter DNSC_TIMEOUT {
NAME Timeout in seconds when waiting for responses to DNS queries
SYNOPSIS Defines the number of seconds before a retry if the DNS \
server fails to answer, e.g. "10"
TYPE char *
DEFAULT "10"
}
Parameter DNSC_RETRIES {
NAME Number of retries for DNS queries
SYNOPSIS Defines the number of retries on each name server, e.g. "2"
TYPE char *
DEFAULT "2"
}
Parameter DNSC_DOMAIN_NAME {
NAME DNS domain name
SYNOPSIS Defines the domain where the local host is located. \
If this system variable is not defined, no local domain \
is used and the user must provide fully qualified domain \
names in address lookups for hosts in the same domain as \
the local host.
TYPE char *
DEFAULT "windriver.com"
}
Parameter DNSC_PRIMARY_NAME_SERVER {
NAME DNS primary name server
SYNOPSIS Defines the address to the primary name server. If this \
system variable is not defined no primary name server is used.
TYPE char *
DEFAULT ""
}
Parameter DNSC_SECONDARY_NAME_SERVER {
NAME DNS secondary name server
SYNOPSIS Defines the address to the secondary name server. If this \
system variable is not defined no secondary name server is used.
TYPE char *
DEFAULT ""
}
Parameter DNSC_TERTIARY_NAME_SERVER {
NAME DNS tertiary name server
SYNOPSIS Defines the address to the tertiary name server. If this \
system variable is not defined no tertiary name server is used.
TYPE char *
DEFAULT ""
}
Parameter DNSC_QUATERNARY_NAME_SERVER {
NAME DNS quaternary name server
SYNOPSIS Defines the address to the quaternary name server. If this \
system variable is not defined no quaternary name server is used.
TYPE char *
DEFAULT ""
}
Parameter DNSC_IP4_ZONE {
NAME Zone for IPv4 address to name lookups
SYNOPSIS Defines the zone to use for address to name lookups of IPv4 \
addresses.
TYPE char *
DEFAULT "in-addr.arpa"
}
Parameter DNSC_IP6_ZONE {
NAME Zone for IPv6 address to name lookups
SYNOPSIS Defines the zone to use for address to name lookups of IPv6 \
addresses. Set to "ip6.int" to support RFC1886 or to \
"ip6.arpa" to support RC3152.
TYPE char *
DEFAULT "ip6.int"
}
/* INCLUDE_IPFTPC configuration parameters */
Parameter FTPC_BIND_ADDRESS {
NAME FTP client bind address
SYNOPSIS Specify the bind address of FTP client.
TYPE char *
DEFAULT NULL
}
/* INCLUDE_IPFTPS configuration parameters */
Parameter FTPS_AUTH_ATTEMPTS {
NAME Authentication attempts before disconnect
SYNOPSIS The number of authentication attempts that are allowed \
before the server disconnects.
TYPE char *
DEFAULT "3"
}
Parameter FTPS_SLEEP_TIME {
NAME Time to sleep after authentication fail
SYNOPSIS Defines how many seconds the server will sleep before \
replying to an unsuccessful authentication.
TYPE char *
DEFAULT "5"
}
Parameter FTPS_LOCAL_PORT_BASE {
NAME Local port base number
SYNOPSIS Local port base which defines the port range the server \
uses for the data connection. A value of 0 instructs the \
server to use port 20.
TYPE char *
DEFAULT "49151"
}
Parameter FTPS_PEER_PORT_BASE {
NAME Peer port base number
SYNOPSIS Peer port base defines the port range that the client is \
allowed to use when setting up the data connection.
TYPE char *
DEFAULT "1023"
}
Parameter FTPS_ENABLE_PROXY {
NAME Enable proxy FTP support
SYNOPSIS Specifies whether to enable proxy FTP support.
TYPE char *
DEFAULT "0"
}
Parameter FTPS_MODE {
NAME Read/write mode
SYNOPSIS Read-only mode disables write access to the file system, \
which means that only read commands will be accepted. \
Default value is 0, which means read/write access.
TYPE char *
DEFAULT "0"
}
Parameter FTPS_ROOT_DIR {
NAME FTP root directory
SYNOPSIS Defines the topmost directory that the client can see.
TYPE char *
DEFAULT ""
}
Parameter FTPS_INITIAL_DIR {
NAME FTP initial directory
SYNOPSIS Defines the initial directory for an FTP session.
TYPE char *
DEFAULT IPCOM_FILE_ROOT
}
Parameter FTPS_MAX_SESSIONS {
NAME Max number of simultaneous sessions
SYNOPSIS Maximum number of simultaneous FTP sessions.
TYPE char *
DEFAULT "8"
}
Parameter FTPS_PORT_NUM {
NAME Server port number
SYNOPSIS Server port number.
TYPE char *
DEFAULT "21"
}
Parameter FTPS_RECV_TIMEOUT {
NAME Data receive timeout
SYNOPSIS Timeout in seconds when receiving data from the client.
TYPE char *
DEFAULT "30"
}
Parameter FTPS_SEND_TIMEOUT {
NAME Data send timeout
SYNOPSIS Timeout in seconds when sending data to the client.
TYPE char *
DEFAULT "30"
}
Parameter FTPS_INACTIVITY_TIMEOUT {
NAME User inactivity timeout
SYNOPSIS Timeout in seconds when waiting for a command from the client.
TYPE char *
DEFAULT "300"
}
Parameter FTPS_SOCKET_BACKLOG {
NAME Control socket backlog queue
SYNOPSIS Determines the backlog queue length of FTP server control socket. \
The default value is 0.
TYPE char *
DEFAULT "0"
}
Parameter FTPS_SYS_TYPE {
NAME Reported system type
SYNOPSIS Operating system name.
TYPE char *
DEFAULT "UNIX"
}
Parameter FTPS_AUTH_CALLBACK_HOOK {
NAME Authentication callback routine
SYNOPSIS User-defined authentication callback routine used by FTP \
server. If not specified, internal authentication callback \
routine ipftps_authenticate_default_callback will be used.
TYPE FUNCPTR
DEFAULT ipftps_authenticate_default_callback
}
Parameter FTPS_DATABUF_SIZE {
NAME Data transfer buffer size
SYNOPSIS Data transfer buffer size used in each FTP session
TYPE char *
DEFAULT "4096"
}
/* INCLUDE_IPTFTPS configuration parameters */
Parameter TFTPS_DIRS {
NAME TFTP server working directory
SYNOPSIS Specifies tftp server working directory.
TYPE char *
DEFAULT IPCOM_FILE_ROOT "tftpdir"
}
Parameter TFTPS_RETRANSMIT_TIMEOUT {
NAME TFTP retransmit timeout in seconds
SYNOPSIS Specifies the time until the first retry is sent. Further \
retries use an exponential back-off algorithm.
TYPE char *
DEFAULT "5"
}
Parameter TFTPS_RETRIES {
NAME TFTP number of retries
SYNOPSIS Specifies the number of times a tftp message will be \
retried if an acknowledgment is not received from the peer.
TYPE char *
DEFAULT "2"
}
#ifdef _WRS_CONFIG_IPFTP_USE_TLS
Parameter ENABLE_ADVANCE_FTPS_KEY_PRIVACY {
NAME Enable Advance option for FTPS Key Privacy
SYNOPSIS If "1", private key will be saved to KEY DB. This will \
protect the private key can't be access by others.\
If "0", Private key won't be saved to KEY DB.\
If want to use KEY DB, need include INCLUDE_IPCOM_USE_RAM_DISK.
REQUIRES INCLUDE_IPCOM_USE_KEY_DB
TYPE char *
DEFAULT "0"
}
Parameter FTPS_TLS_KEY_FILE {
NAME TLS key file
SYNOPSIS
REQUIRES INCLUDE_IPSSL
TYPE char *
DEFAULT ""
}
Parameter FTPS_TLS_CERT_FILE {
NAME TLS certificate file
SYNOPSIS
REQUIRES INCLUDE_IPSSL
TYPE char *
DEFAULT ""
}
Parameter FTPS_TLS {
NAME Enable FTP server with TLS
SYNOPSIS
REQUIRES INCLUDE_IPSSL
TYPE char *
DEFAULT "0"
}
Parameter FTPS_TLS_SECRECT_KEY {
NAME TLS secret key
SYNOPSIS
REQUIRES INCLUDE_IPSSL
TYPE char *
DEFAULT ""
}
#endif
#endif
@@ -0,0 +1,12 @@
# Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: common.vxconfig,v $ $Revision: 1.5 $
# $Source: /home/interpeak/CVSRoot/ipappl/config/common.vxconfig,v $
# $Author: myakan $
# $State: Exp $ $Locker: $
#
# INTERPEAK_COPYRIGHT_STRING
#hidden option that enables IPAPPL
config SUPPORTS_APPL
bool
default y
@@ -0,0 +1,270 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpc_config.c,v $ $Revision: 1.7.12.3 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipdhcpc_config.c,v $
* $Author: jwang9 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01j,30Dec15,wjf Add for defect VXW6-83989.
01i,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01h,04jul09,ggz Added DHCPC ip address lease time
01g,11oct07,uol Defect WIND00107491, add DHCP capabilities in bootrom.
01f,22jan07,kch Added rfc2131_init_delay, rfc2131_exponential_backoff,
discover_retries and offer_timeout sysvars (WIND00086146).
01e,03jan07,kch Renamed DHCPC_IFLIST_REQ_OPTS and DHCPC_IFLIST_CLIENT_ID
macros to DHCPC_IF_REQ_OPTS_LIST and DHCPC_IF_CLIENT_ID_LIST.
01d,01dec06,kch Updated CVS revision log entry.
01c,13sep06,kch Refresh with Sept 08, 2006 code drop
01b,28aug06,kch Update based on Aug 22, 2006 code drop.
01a,07aug06,kch Added ipdhcpc_conf_sysvar_ext[] to support per-interface
sysvar configurations.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
#if defined(BOOTAPP_DHCPC_REQ_OPTS)
#undef DHCPC_REQ_OPTS
#define DHCPC_REQ_OPTS BOOTAPP_DHCPC_REQ_OPTS
#endif
#if defined(BOOTAPP_DHCPC_IF_REQ_OPTS_LIST)
#undef DHCPC_IF_REQ_OPTS_LIST
#define DHCPC_IF_REQ_OPTS_LIST BOOTAPP_DHCPC_IF_REQ_OPTS_LIST
#endif
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err ipdhcpc_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* SYSTEM VARIABLES
*===========================================================================
*/
/*
*===========================================================================
* ipdhcpc_conf_sysvar
*===========================================================================
* DHCP Client Configuration Variables
*/
IP_CONST Ipcom_sysvar ipdhcpc_conf_sysvar[] =
{
#if defined(IP_WB_BUILD)
/* DHCP client port (default 68) */
{"ipdhcpc.client_port", DHCPC_CLIENT_PORT},
/* DHCP server port (default 67) */
{"ipdhcpc.server_port", DHCPC_SERVER_PORT},
/* RFC2131 Initialization Delay identifier */
/* 1 enabled , 0 disabled */
{"ipdhcpc.rfc2131_init_delay", DHCPC_RFC2131_INIT_DELAY},
/* RFC2131 Exponential Back-off Delay */
/* 1 enabled, 0 disabled */
{"ipdhcpc.rfc2131_exponential_backoff", DHCPC_RFC2131_EXP_BACKOFF},
/* Number of DHCP client retries */
{"ipdhcpc.discover_retries", DHCPC_DISCOVER_RETRIES},
/* DHCP offer time-out in milliseconds */
{"ipdhcpc.offer_timeout", DHCPC_OFFER_TIMEOUT},
/* DHCP bootp mode */
/* 1 enabled, 0 disabled */
{"ipdhcpc.bootp_mode", DHCPC_BOOTP_MODE},
/* DHCP boot filename */
{"ipdhcpc.boot_filename", DHCPC_BOOT_FILENAME},
/* Global server hostname */
{"ipdhcpc.server_hostname", DHCPC_SERVER_HOSTNAME},
{"ipdhcpc.client_identifier_uuid", DHCPC_CLIENT_UUID},
/* Global hostname option */
{"ipdhcpc.option.hostname", DHCPC_OPTION_HOSTNAME},
/* Global netmask option */
{"ipdhcpc.option.netmask", DHCPC_OPTION_NETMASK},
/* IP address lease time option */
{"ipdhcpc.option.lease_time", DHCPC_OPTION_IPADDRESS_LEASE_TIME},
/* Global vendor class identifier option */
{"ipdhcpc.option.vendor_class_id", DHCPC_OPTION_VENDOR_CLASS_ID},
/* Global vendor identifying vendor options option */
{"ipdhcpc.option.vendor_identifying_vendor_class", DHCPC_OPTION_VI_VENDOR_CLASS},
/* Global list of requested DHCP options */
{"ipdhcpc.option.requested_options", DHCPC_REQ_OPTS},
/* Global client identifier */
{"ipdhcpc.option.client_identifier", DHCPC_CLIENT_ID},
/* Global user specified options */
{"ipdhcpc.option.user_specified", DHCPC_OPTION_USER_SPECIFIED},
/* Remove existing unicast addresses before negotiation begins */
{"ipdhcpc.remove_existing_addresses", DHCPC_REMOVE_EXISTING_ADDRESSES},
/* Remove negotiated addresses from interface when lease expires */
{"ipdhcpc.remove_leased_address", DHCPC_REMOVE_LEASED_ADDRESS},
/* Disable DHCP on the interface if a static address is manually applied */
{"ipdhcpc.auto_disable", DHCPC_AUTO_DISABLE},
/* Global DHCP maximum message size */
{"ipdhcpc.option.max_message_size", DHCPC_OPTION_MAX_MESSAGE_SIZE},
/* Global Time To Live (TTL) for DHCP packets */
{"ipdhcpc.ttl", DHCPC_TTL},
/* Set the value of flag field:broadcast bit */
{"ipdhcpc.flags.bit.broadcast", DHCPC_FLAGS_BIT_BROADCAST},
/*
* Interface specific list of sysvar configurations are defined in
* ipdhcpc_conf_sysvar_ext[]
*/
#endif
{ IP_NULL, IP_NULL }
};
#if defined(IP_WB_BUILD)
/* Interface specific list configurations */
IP_CONST Ipcom_sysvar_ext ipdhcpc_conf_sysvar_ext[] =
{
/*
* Interface specific list of requested DHCP options with interface name
* followed by comma separated list of DHCP options numbers that the
* DHCP client wants the server to provide in the format <ifparam>=<opts>.
* Each pair of <ifparam>=<opts> is semicolon separated, e.g.
* "eth0=1,2,3,4;eth1=2,3,4,5".
*/
{"ipdhcpc", "option.requested_options", DHCPC_IF_REQ_OPTS_LIST},
/*
* Interface specific client identifier with a string of characters that
* the DHCP client wants the server to identify it by in the format
* <ifparam>=<id>. Each pair of <ifparam>=<id> is semicolon separated, e.g.
* "eth0=my_red_computer_eth0" or
* "eth0=my_red_computer_eth0;eth1=my_blue_computer_eth1".
*/
{"ipdhcpc", "option.client_identifier", DHCPC_IF_CLIENT_ID_LIST},
/* Interfaces that only receive information
* list eth0=enable, or eth0=enable;eth1=enable*/
{"ipdhcpc.if", "information_only", DHCPC_IF_INFORMATION_ONLY_LIST},
{ IP_NULL, IP_NULL, IP_NULL }
};
#endif
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipdhcpc_configure
*===========================================================================
* Description: Configure DHCP client.
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err
ipdhcpc_configure(void)
{
Ip_err ret;
ret = ipcom_sysvar_setv(ipdhcpc_conf_sysvar, 0);
#if defined(IP_WB_BUILD)
if (ret == IPCOM_SUCCESS)
{
/* now configure the interface-specific sysvars */
return ipcom_sysvar_ext_setv (ipdhcpc_conf_sysvar_ext, 0);
}
#endif
return ret;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,180 @@
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpc_config.h,v $ $Revision: 1.17.44.3 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipdhcpc_config.h,v $
* $Author: svc-cmnet $ $Date: 2014-12-04 23:32:39 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
*
******************************************************************************
*/
#ifndef IPDHCPC_CONFIG_H
#define IPDHCPC_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
*===========================================================================
* IPDHCPC_INCLUDE_CMD
*===========================================================================
* Define to include DHCP Client shell command 'dhcpc'.
*/
#define IPDHCPC_INCLUDE_CMD
/*
*===========================================================================
* DHCP_MAX_MESSAGE_SIZE
*===========================================================================
* Maximum DHCP message size the client is willing to accept.
* Minimum valid value is 576 bytes. Including IP and UDP header length.
*/
#define IPDHCPC_MAX_MESSAGE_SIZE 576
/*
*===========================================================================
* IPDHCPC_CLIENT_ID_MAXSIZE
*===========================================================================
* Maximum size of the DHCP client-identifier size contents (code 61).
*/
#define IPDHCPC_CLIENT_ID_MAXSIZE 32
/*
*===========================================================================
* IPDHCPC_RFC2131_INIT_DELAY
*===========================================================================
* RFC-compliant Congestion Avoidance Initialization Delay.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_RFC2131_INIT_DELAY 1
/*
*===========================================================================
* IPDHCPC_RFC2131_EXP_BACKOFF_DELAY
*===========================================================================
* RFC-compliant Exponential Back-off Delay between retries.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_RFC2131_EXP_BACKOFF_DELAY 1
/*
*===========================================================================
* IPDHCPC_DISCOVER_RETRIES
*===========================================================================
* Number of DHCP Client Attempts.
*/
#define IPDHCPC_DISCOVER_RETRIES 4
/*
*===========================================================================
* IPDHCPC_OFFER_TIMEOUT
*===========================================================================
* Number of milliseconds to wait for initial offer from Server. Minimum 200.
*/
#define IPDHCPC_OFFER_TIMEOUT 2000
/*
*===========================================================================
* IPDHCPC_BOOTP_MODE
*===========================================================================
* Operate as BOOTP client only.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_BOOTP_MODE 0
/*
*===========================================================================
* IPDHCPC_REMOVE_EXISTING_ADDRESSES
*===========================================================================
* Delete all unicast addresses from the interface before negotiation begins.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_REMOVE_EXISTING_ADDRESSES 1
/*
*===========================================================================
* IPDHCPC_REMOVE_LEASED_ADDRESS
*===========================================================================
* Delete negotiated addresses from interface when lease expires.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_REMOVE_LEASED_ADDRESS 1
/*
*===========================================================================
* IPDHCPC_AUTO_DISABLE
*===========================================================================
* Disable DHCP on the interface if a static address is manually applied.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_AUTO_DISABLE 1
/*
*===========================================================================
* IPDHCPC_TTL
*===========================================================================
* IP Time-To-Live Default Setting. Default is 1. May be increased to
* better interoperate with certain DHCP relay agents.
*/
#define IPDHCPC_TTL 1
/*
*===========================================================================
* IPDHCPC_ASSIGN_IP_TIMEOUT
*===========================================================================
* Number of seconds to wait for an address to be assigned to an interface.
* To allow for address collision detection (if enabled)
*/
#define IPDHCPC_ASSIGN_IP_TIMEOUT 15
/*
*===========================================================================
* IPDHCPC_FLAGS_BIT_BROADCAST
*===========================================================================
* Set the value of flag field:broadcast bit, default is 0.
* 1 = enabled, 0 = disabled.
*/
#define IPDHCPC_FLAGS_BIT_BROADCAST 0
/*
*===========================================================================
* IPDHCPC_SOCK_MIN_RECV_BUFSIZE
*===========================================================================
* Minimal dhcpc sock recv bufsize
*/
#define IPDHCPC_SOCK_MIN_RECV_BUFSIZE 16800
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,295 @@
/*
******************************************************************************
* INTERPEAK EXAMPLE SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpc_example.c,v $ $Revision: 1.11.10.4 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipdhcpc_example.c,v $
* $Author: hxu0 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Lennart Bang <lob@interpeak.se>
******************************************************************************
*/
/*
modification history
--------------------
01h,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01g,04sep09,h_s Fix the callback compile error when using gnu.
01f,02oct09,spw Declare option, reply callback only if param not null.
01e,02dec08,spw Fix WIND00146283 and add REPLY_CB_EVENT_OFFER case
01d,04jun08,spw Change Syslog facility, cleanup
01c,11oct07,uol Defect WIND00107491, add DHCP capabilities in bootrom.
01b,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01a,11dec06,kch Integrated to VxWorks build infrastructure.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include "ipdhcpc_config.h"
#include "ipcom_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#ifdef IPCOM_USE_CLIB_PROTO
#undef IPCOM_USE_CLIB_PROTO
#endif
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_shell.h>
#include <ipcom_syslog.h>
#include <ipdhcpc.h>
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#if defined(IP_WB_BUILD) || defined(INCLUDE_BOOT_DHCPC)
IP_EXTERN FUNCPTR _ipdhcpc_callback_hook;
#endif
/* typedef to make compiler happy... */
typedef Ip_err (*ipdhcpc_option_cb)(Ipdhcpc_handle *handle, Ip_u8 *option);
#if DHCPC_INSTALL_OPTION_CALLBACK_HOOK == TRUE
/*
* forward declarations for the user-defined dhcp client callback hooks
* to satisfy the compiler.
*/
#ifdef DHCPC_OPTION_CALLBACK_HOOK
Ip_err DHCPC_OPTION_CALLBACK_HOOK (Ipdhcpc_handle *, Ip_u8 *);
#endif
#else
/*
* DHCPC_OPTION_CALLBACK_HOOK is applicable only if
* DHCPC_INSTALL_OPTION_CALLBACK_HOOK is set to TRUE. Explicitly re-define
* these hooks to NULL so that we don't get compiler errors
*/
#undef DHCPC_OPTION_CALLBACK_HOOK
#define DHCPC_OPTION_CALLBACK_HOOK IP_NULL
#endif /* DHCPC_INSTALL_OPTION_CALLBACK_HOOK */
#if DHCPC_INSTALL_REPLY_CALLBACK_HOOK == TRUE
/*
* forward declarations for the user-defined dhcp client callback hooks
* to satisfy the compiler.
*/
#ifdef DHCPC_REPLY_CALLBACK_HOOK
Ip_err DHCPC_REPLY_CALLBACK_HOOK (Ipdhcpc_handle *, int);
#endif
#else
/*
* DHCPC_REPLY_CALLBACK_HOOK is applicable only if
* DHCPC_INSTALL_REPLY_CALLBACK_HOOK is set to TRUE. Explicitly re-define
* these hooks to NULL so that we don't get compiler errors
*/
#undef DHCPC_REPLY_CALLBACK_HOOK
#endif /* DHCPC_INSTALL_REPLY_CALLBACK_HOOK */
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
Ip_err
ipdhcpc_option_default_callback(Ipdhcpc_handle *handle, Ip_u8 *option);
Ip_err
ipdhcpc_reply_default_callback(Ipdhcpc_handle *handle, int event);
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
/*
****************************************************************************
* 9 LOCAL FUNCTIONS
****************************************************************************
*/
/*
*****************************************************************************
*
* ipdhcpc_option_default_callback - default dhcp client callback routine
*
* This is an example implementation of the dhcp client option callback
* routine. It is called if no dhcp client option callback routine is
* assigned to the macro DHCPC_OPTION_CALLBACK_HOOK.
*
* NOMANUAL
*/
Ip_err
ipdhcpc_option_default_callback(Ipdhcpc_handle *handle, Ip_u8 *option)
{
(void)handle;
switch (*option)
{
case IPDHCPC_OPTCODE_VENDOR_ENCAPSULATED_OPTIONS:
break;
default:
break;
}
/* Let IPDHCPC act on option */
return IP_TRUE;
}
/*
*****************************************************************************
*
* ipdhcpc_reply_default_callback - default dhcp client callback routine
*
* This is an example implementation of the dhcp client reply callback
* routine. It is called if no dhcp client option callback routine is
* assigned to the macro DHCPC_REPLY_CALLBACK_HOOK.
*
* NOMANUAL
*/
Ip_err
ipdhcpc_reply_default_callback(Ipdhcpc_handle *handle, int event)
{
/* Informational only in this implementation. */
if (handle == IP_NULL)
goto fail;
switch(event)
{
case IPDHCPC_REPLY_CB_EVENT_OFFER:
break;
case IPDHCPC_REPLY_CB_EVENT_ACK:
break;
default:
break;
}
return IPCOM_SUCCESS;
fail:
return IPCOM_ERR_FAILED;
}
/*****************************************************************************
*
* ipdhcpc_option_callback - dhcp client option callback routine
*
* This routine called once for each option prior to IPDHCPC is acting on the
* option, i.e. this callback can be used to change the contents of the DHCP
* server reply (caution!)
*
* .IP <option>
* Pointer to start of option, i.e. option[0] = Code; option[1] = Len;
* option[2-i] = Optional option data
* .IP <handle>
* Pointer to request handle
*
* RETURNS:
* IP_TRUE to let IPDHCPC act on the option (recommended) or IP_FALSE if
* option should be ignored by IPDHCPC.
*
* NOMANUAL
*/
IP_PUBLIC Ip_err
ipdhcpc_option_callback(Ipdhcpc_handle *handle, Ip_u8 *option)
{
ipdhcpc_option_cb dhcpc_cb;
/*eliminate warning when compiling with gnu*/
#if defined(IP_WB_BUILD) || defined(INCLUDE_BOOT_DHCPC)
dhcpc_cb = (NULL!=DHCPC_OPTION_CALLBACK_HOOK) ? DHCPC_OPTION_CALLBACK_HOOK :
_ipdhcpc_callback_hook ? _ipdhcpc_callback_hook :
ipdhcpc_option_default_callback;
#else
dhcpc_cb = ipdhcpc_option_default_callback;
#endif
return dhcpc_cb(handle, option);
}
/*****************************************************************************
*
* ipdhcpc_reply_callback - dhcp client reply callback routine
*
* this callback can be used to change the contents of the DHCP
* server reply (caution!)
*
* .IP <handle>
* Pointer to ipdhcpc handle object, containing, i.e. option[0] = Code; option[1] = Len;
* option[2-i] = Optional option data
*
* .IP <event>
* The reply type (ACK, NACK, etc)
*
* RETURNS:
* IPCOM_SUCCESS to let IPDHCPC act on the reply (recommended) or !IPCOM_SUCCESS if
* reply should be declined by IPDHCPC.
*
* NOMANUAL
*/
IP_PUBLIC Ip_err
ipdhcpc_reply_callback(Ipdhcpc_handle *handle, int event)
{
Ipdhcpc_reply_cb dhcpc_cb;
/*eliminate warning when compiling with gnu*/
#if defined(IP_WB_BUILD) && defined (DHCPC_REPLY_CALLBACK_HOOK)
dhcpc_cb = DHCPC_REPLY_CALLBACK_HOOK;
#else
dhcpc_cb = ipdhcpc_reply_default_callback;
#endif
if(dhcpc_cb != IP_NULL)
return dhcpc_cb(handle, event);
else
return IPCOM_SUCCESS;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,192 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdnsc_config.c,v $ $Revision: 1.12 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipdnsc_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01j,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01i,11sep07,dlk Change parameter names for tertiary and quaternary name
servers to match those used in 00comp_ipnet_apps.cdf.
01h,28feb07,dlk Replace _gethostbyname, _gethostbyaddr function pointers
with reentrant versions _ipcom_gethostbyname_r,
_ipcom_gethostbyaddr_r.
01g,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01f,01dec06,kch Added support for additional configuration parameters.
01e,13sep06,kch Refresh with Sept 08, 2006 code drop
01d,28aug06,kch Corrected ipcom_gethostbyaddr() prototype declaration.
01c,28aug06,tkf Remove dependency on hostLib.
01b,23aug06,tkf Add a call to gethostbynameInit() and gethostbynameInit()
01a,03aug06,kch Renamed INCLUDE_NSLOOKUP_CMD to INCLUDE_IPNSLOOKUP_CMD.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* DNS client configuration.
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
#include <ipcom_shell.h>
#include <ipcom_sock2.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
#if defined(INCLUDE_IPNSLOOKUP_CMD) || !defined(IP_WB_BUILD)
IP_EXTERN int ipdnsc_cmd_nslookup(int argc, char **argv);
#endif
#if defined(IP_WB_BUILD)
IP_EXTERN FUNCPTR _ipcom_gethostbyname_r;
IP_EXTERN FUNCPTR _ipcom_gethostbyaddr_r;
#endif
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err ipdnsc_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* ipdnsc_conf_sysvar
*===========================================================================
* DNS Client Configuration Variables
*/
IP_CONST Ipcom_sysvar ipdnsc_conf_sysvar[] =
{
/* DNS server listening port */
IP_SYSVAR( "ipdnsc.port", "53", DNSC_SERVER_PORT),
/* Timeout in seconds when waiting for responses to DNS queries */
IP_SYSVAR( "ipdnsc.timeout", "3", DNSC_TIMEOUT),
/* Number of retries for DNS queries */
IP_SYSVAR( "ipdnsc.retries", "1", DNSC_RETRIES),
/* DNS domain name */
IP_SYSVAR( "ipdnsc.domainname", "interpeak.se", DNSC_DOMAIN_NAME),
/* DNS primary name server */
IP_SYSVAR( "ipdnsc.primaryns", "", DNSC_PRIMARY_NAME_SERVER),
/* DNS secondary name server */
IP_SYSVAR( "ipdnsc.secondaryns", "", DNSC_SECONDARY_NAME_SERVER),
/* DNS tertiary name server */
IP_SYSVAR( "ipdnsc.tertiaryns", "", DNSC_TERTIARY_NAME_SERVER),
/* DNS quaternary name server */
IP_SYSVAR( "ipdnsc.quaternaryns", "", DNSC_QUATERNARY_NAME_SERVER),
/* Zone for ipv4 address to name lookups */
IP_SYSVAR( "ipdnsc.ip4.zone", "in-addr.arpa", DNSC_IP4_ZONE),
/* Zone for ipv6 address to name lookups */
IP_SYSVAR( "ipdnsc.ip6.zone", "ip6.int", DNSC_IP6_ZONE), /* RFC1886: "ip6.int" RFC3152: "ip6.arpa" */
{ IP_NULL, IP_NULL }
};
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipdnsc_configure
*===========================================================================
* Description: Configure DNS client.
* Parameters: None.
* Returns: IPCOM_SUCCESS or IPCOM_ERR_XXX if failed.
*/
IP_PUBLIC Ip_err
ipdnsc_configure(void)
{
Ip_err ret;
ret = ipcom_sysvar_setv(ipdnsc_conf_sysvar, 0);
if(ret != IPCOM_SUCCESS)
return ret;
#if defined(IP_WB_BUILD)
/* Initialize _gethostby* func pointers */
_ipcom_gethostbyname_r = (FUNCPTR)ipcom_gethostbyname_r;
_ipcom_gethostbyaddr_r = (FUNCPTR)ipcom_gethostbyaddr_r;
#endif
#if defined(INCLUDE_IPNSLOOKUP_CMD) || !defined(IP_WB_BUILD)
ret = ipcom_shell_add_cmd("nslookup", "nslookup [ options ] <modifier...>",
"Query Internet name servers interactively",
ipdnsc_cmd_nslookup,
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
#endif
return ret;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,104 @@
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdnsc_config.h,v $ $Revision: 1.22 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipdnsc_config.h,v $
* $Author: jren $ $Date: 2010-10-13 01:07:40 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
#ifndef IPDNSC_CONFIG_H
#define IPDNSC_CONFIG_H
#include <ipcom_config.h>
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* DNS Client compile time configuration.
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#ifdef IPTESTENGINE
#if !defined(IPDNSC_USE_TEST)
#define IPDNSC_USE_TEST
#endif
#endif
/* Define to include support for gated-style MD5 authentication. */
#ifdef IPCOM_USE_MD5
#define IPDNSC_INCLUDE_MD5
#endif
/*
*===========================================================================
* IPDNSC_CONF_DNS_HOSTS
*===========================================================================
* A list of known hosts.
*
*/
#define IPDNSC_CONF_DNS_HOSTS { "127.0.0.1", "localhost" }, \
{ "::1", "localhost6" }, \
{ IP_NULL, IP_NULL }
/*
*===========================================================================
* IPDNSC_CONF_MAX_CACHE_ENTRIES
*===========================================================================
* The maximum number of entries in the DNS cache.
*
*/
#define IPDNSC_CONF_MAX_CACHE_ENTRIES 32
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,98 @@
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftpc_api_config.h,v $ $Revision: 1.8 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftpc_api_config.h,v $
* $Author: jren $ $Date: 2010-08-06 08:11:32 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Ulf Olofsson <ulf@interpeak.se>
******************************************************************************
*/
#ifndef IPFTPC_API_CONFIG_H
#define IPFTPC_API_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/* Define this to enable verbatim console output */
/*#define IPFTPC_USE_VERBATIM_CONOUT*/
/* Define this to remove partially transferred files */
/*#define IPFTPC_USE_REMOVE_FILE_ON_ERROR*/
/* Data transfer buffer size */
#define IPFTPC_DATABUFSIZE 4096
/* FTP command buffer size */
#define IPFTPC_SINBUFSIZE 1024
/* Max no of simultaneous sessions */
#define IPFTPC_MAX_SESSIONS 8
/* Max no of arguments for FTP command */
#define IPFTPC_MAX_ARGS 10
/* Argument delimiters */
#define IPFTPC_DELIMITERS " ,|\r\n"
/* Directory path separators */
#define IPFTPC_DIRSEP "/\\"
/* Timeout when sending data to socket */
#define IPFTPC_SEND_TIMEOUT 30
/* Timeout when receiving data to socket */
#define IPFTPC_RECEIVE_TIMEOUT 30
/* Attempts to bind data socket when using random ports */
#define IPFTPC_BIND_ATTEMPTS 5
/* Version */
#define IPFTPC_VERSION_API 1
/* Transport protocol for FTPC */
#undef IPFTPC_USE_SCTP
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,84 @@
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftpc_cmd_config.h,v $ $Revision: 1.8 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftpc_cmd_config.h,v $
* $Author: jren $ $Date: 2010-10-21 22:54:15 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Ulf Olofsson <ulf@interpeak.se>
******************************************************************************
*/
#ifndef IPFTPC_CMD_CONFIG_H
#define IPFTPC_CMD_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include <ipcom_config.h>
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/* Test system requires 'IPFTPS_USE_TEST' */
#ifdef IPTESTENGINE
#if !defined(IPFTPC_USE_TEST)
#define IPFTPC_USE_TEST
#endif
#endif
/* Command buffer size */
#define IPFTPC_CMDBUFSIZE IP_PATH_MAX
/* Max no of arguments for FTP command */
#define IPFTPC_MAX_ARGS 10
/* Max length of username and password */
#define IPFTPC_MAX_USERNAME 32
#define IPFTPC_MAX_PASSWORD 32
/* Argument delimiters */
#define IPFTPC_WHITESPACE " \t\r\n"
/* Version */
#define IPFTPC_VERSIONSTR "1.1.3"
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,146 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftpc_config.c,v $ $Revision: 1.4.12.1 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftpc_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01f,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01e,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01d,01dec06,kch Updated CVS revision log entry.
01c,13sep06,kch Refresh with Sept 08, 2006 code drop
01b,28aug06,kch Update based on Aug 22, 2006 code drop.
01a,03aug06,kch Renamed INCLUDE_FTP_CMD to INCLUDE_IPFTP_CMD.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
#include <ipcom_shell.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
#if defined(INCLUDE_IPFTP_CMD) || !defined(IP_WB_BUILD)
IP_EXTERN int ipftpc_cmd_main(int argc, char *argv[]);
#endif
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err ipftpc_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* ipftpc_conf_sysvar
*===========================================================================
* FTP Client Configuration Variables
*/
IP_CONST Ipcom_sysvar ipftpc_conf_sysvar[] =
{
/* The FTP client src IPvX address */
IP_SYSVAR("ipftpc.bindaddress", IP_NULL, FTPC_BIND_ADDRESS),
{IP_NULL, IP_NULL}
};
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipftpc_configure
*===========================================================================
* Description: Configure FTP client.
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err
ipftpc_configure(void)
{
Ip_err ret = IPCOM_SUCCESS;
(void)ipcom_sysvar_setv(ipftpc_conf_sysvar, 0);
#if defined(INCLUDE_IPFTP_CMD) || !defined(IP_WB_BUILD)
ret = ipcom_shell_add_cmd("ftp", "ftp [options] [host]", "FTP client",
ipftpc_cmd_main,
IPCOM_SHELL_PRIO_SAME,
IPCOM_PROC_STACK_DEFAULT);
#endif
return ret;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,222 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftps_config.c,v $ $Revision: 1.8.10.4 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftps_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01h,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01g,19dec,09ggz Added ipftps data socket linger time to sysvar.Defect WIND00127796.
01f,08dec08,ggz Added FTPS_SOCKET_BACKLOG parameter for FTP control socket
01e,27feb07,kch ipftps.versionstr should not be made configurable
(WIND00089286).
01d,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01c,01dec06,kch Updated CVS revision log entry.
01b,13sep06,kch Refresh with Sept 08, 2006 code drop
01a,28aug06,kch Update based on Aug 22, 2006 code drop.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
#ifndef IPCOM_IPFTPS_ROOT
#define IPCOM_IPFTPS_ROOT IPCOM_FILE_ROOT
#endif
#ifndef FTPS_DATA_SOCKET_LINGER
#define FTPS_DATA_SOCKET_LINGER "10" /* Data socket linger time */
#endif
#ifndef FTPS_DATABUF_SIZE
#define FTPS_DATABUF_SIZE "4096" /* Data transfer buffer size */
#endif
#ifdef IPFTP_TLS
#ifdef IPCOM_USE_KEY_DB
#define IPFTPS_USE_PRIVACY
#else
#warning " IPCOM_USE_KEY_DB is not defined !!"
#endif
#ifndef FTPS_TLS
#define FTPS_TLS "0"
#endif
#ifndef ENABLE_ADVANCE_FTPS_KEY_PRIVACY
#define ENABLE_ADVANCE_FTPS_KEY_PRIVACY "0"
#endif
#ifndef FTPS_TLS_KEY_FILE
#define FTPS_TLS_KEY_FILE ""
#endif
#ifndef FTPS_TLS_CERT_FILE
#define FTPS_TLS_CERT_FILE ""
#endif
#ifndef FTPS_TLS_SECRECT_KEY
#define FTPS_TLS_SECRECT_KEY ""
#endif
#endif
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err ipftps_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* ipftps_conf_sysvar
*===========================================================================
* FTP Server Configuration Variables
*/
IP_CONST Ipcom_sysvar ipftps_conf_sysvar[] =
{
/* Defaults for new sessions */
/* Auth attempts before disconnect */
IP_SYSVAR("ipftps.authentications", "3", FTPS_AUTH_ATTEMPTS),
/* Time to sleep after auth fail */
IP_SYSVAR("ipftps.authsleep", "5", FTPS_SLEEP_TIME),
/* Use local ports from lportbase+1 */
IP_SYSVAR("ipftps.lportbase", "49151", FTPS_LOCAL_PORT_BASE),
/* Reject peer ports <= pportbase */
IP_SYSVAR("ipftps.pportbase", "1023", FTPS_PEER_PORT_BASE),
IP_SYSVAR("ipftps.proxy", "0", FTPS_ENABLE_PROXY), /* Disable proxy FTP */
IP_SYSVAR("ipftps.readonly", "0", FTPS_MODE), /* Read/write mode */
IP_SYSVAR("ipftps.root", "/", FTPS_ROOT_DIR), /* Directory root */
IP_SYSVAR("ipftps.dir", IPCOM_IPFTPS_ROOT, FTPS_INITIAL_DIR), /* Initial directory */
/* General defaults */
/* Max no of simultaneous sessions */
IP_SYSVAR("ipftps.max_sessions", "8", FTPS_MAX_SESSIONS),
IP_SYSVAR("ipftps.port_number", "21", FTPS_PORT_NUM), /* Server port number */
IP_SYSVAR("ipftps.receive_timeout", "30", FTPS_RECV_TIMEOUT), /* Data receive timeout */
IP_SYSVAR("ipftps.send_timeout", "30", FTPS_SEND_TIMEOUT), /* Data send timeout */
/* Socket backlog queue number set by listen */
IP_SYSVAR("ipftps.socket_backlog", IP_NULL, FTPS_SOCKET_BACKLOG),
/* Data socket linger time */
IP_SYSVAR("ipftps.dsock_linger", IP_NULL, FTPS_DATA_SOCKET_LINGER),
/* Data transfer buffer size */
IP_SYSVAR("ipftps.databuf_size", "4096", FTPS_DATABUF_SIZE),
/* User inactivity timeout */
IP_SYSVAR("ipftps.session_timeout", "300", FTPS_INACTIVITY_TIMEOUT),
IP_SYSVAR("ipftps.system", "UNIX", FTPS_SYS_TYPE), /* Reported system type */
IP_SYSVAR("ipftps.versionstr", "6.8", "6.8"), /* Reported version */
#ifdef IPFTP_TLS
IP_SYSVAR("ipftps.tls.enable","0",FTPS_TLS),
#ifdef IPFTPS_USE_PRIVACY
IP_SYSVAR("ipftps.tls.private.enable","0",ENABLE_ADVANCE_FTPS_KEY_PRIVACY),
#endif
IP_SYSVAR("ipftps.tls.secret.key",IP_NULL,FTPS_TLS_SECRECT_KEY),
IP_SYSVAR("ipftps.tls.key_file",IP_NULL,FTPS_TLS_KEY_FILE),
IP_SYSVAR("ipftps.tls.cert_file",IP_NULL,FTPS_TLS_CERT_FILE),
#endif
{IP_NULL, IP_NULL}
};
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipftps_configure
*===========================================================================
* Description: Configure FTP server.
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err
ipftps_configure(void)
{
(void)ipcom_sysvar_setv(ipftps_conf_sysvar, 0);
return IPCOM_SUCCESS;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,105 @@
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftps_config.h,v $ $Revision: 1.7.12.5 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftps_config.h,v $
* $Author: jren $ $Date: 2017-05-17 07:08:20 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Ulf Olofsson <ulf@interpeak.se>
******************************************************************************
*/
#ifndef IPFTPS_CONFIG_H
#define IPFTPS_CONFIG_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include <ipcom_config.h>
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/* Test system requires 'IPFTPS_USE_TEST' */
#ifdef IPTESTENGINE
#if !defined(IPFTPS_USE_TEST)
#define IPFTPS_USE_TEST
#endif
#endif
/* Data transfer buffer size */
#define IPFTPS_DATABUFSIZE 4096
/* FTP command buffer size */
#define IPFTPS_CMDBUFSIZE 1024
/* Max no of arguments for FTP command */
#define IPFTPS_MAX_ARGS 10
/* Argument delimiters */
#define IPFTPS_DELIMITERS " ,|"
/* PASS cmd argument delimiters */
#define IPFTPS_PASS_DELIMITERS "\r\n"
/* Directory path separators */
#define IPFTPS_DIRSEP "/\\"
/* Attempts to bind data socket when using random ports */
#define IPFTPS_BIND_ATTEMPTS 5
/* Mimic IIS behaviour (send 150 before establishing data connection) */
/*#define IPFTPS_USE_IIS_150*/
/* Transport protocol for FTPS */
#undef IPFTPS_USE_SCTP
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,278 @@
/*
******************************************************************************
* INTERPEAK EXAMPLE SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipftps_example.c,v $ $Revision: 1.12.10.5 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/ipftps_example.c,v $
* $Author: qsun $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Ulf Olofsson <ulf@interpeak.se>
******************************************************************************
*/
/*
modification history
--------------------
01h,08Oct13,qsn Usage update for WIND00420146
01g,26jul12,h_x Fix WIND00362583
01f,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01e,01dec09,rjq Fix for defect WIND00185613.
01d,02oct07,uol Remove default ftp/interpeak username/password.
01c,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01b,28dec06,tkf Remove debug statements.
01a,11dec06,kch Integrated to VxWorks build infrastructure.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include "ipftps_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#ifdef IP_PORT_UNIX
#define IPCOM_USE_CLIB_PROTO
#elif defined(IPCOM_USE_CLIB_PROTO)
#undef IPCOM_USE_CLIB_PROTO
#endif
#include <ipcom.h>
#include <ipcom_config.h>
#include <ipcom_os.h>
#include <ipcom_auth.h>
#include "ipftps.h"
#ifdef IP_PORT_VXWORKS
#include <vxWorks.h>
#include <private/loginLibP.h>
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/* typedef to make compiler happy... */
typedef int (*ipftps_cb)(Ipftps_session *session, char *password);
#if defined(IP_WB_BUILD)
/*
* forward declarations for the user-defined ftp server authentication
* callback hook to satisfy the compiler.
*/
#ifdef FTPS_AUTH_CALLBACK_HOOK
int FTPS_AUTH_CALLBACK_HOOK (Ipftps_session *, char *);
#else
#undef FTPS_AUTH_CALLBACK_HOOK
#define FTPS_AUTH_CALLBACK_HOOK IP_NULL
#endif
#endif
/*
****************************************************************************
* 6 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 7 LOCAL PROTOTYPES
****************************************************************************
*/
int
ipftps_authenticate_default_callback(Ipftps_session *session, char *password);
/*
****************************************************************************
* 8 DATA
****************************************************************************
*/
/*
****************************************************************************
* 9 LOCAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* ipftps_authenticate_default_callback - default ftps callback routine
*
* This is an example implementation of the ftp server authentication
* callback routine. It is called if no ftp server callback routine is
* assigned to the macro FTPS_AUTH_CALLBACK_HOOK.
*
* NOMANUAL
*/
int
ipftps_authenticate_default_callback(Ipftps_session *session, char *password)
{
/*
** This is a simple authentication skeleton,
** please modify to suit your purposes.
*/
#ifdef IP_PORT_VXWORKS
#ifdef IPFTPS_USE_TEST
if(0)
#else
if (systemSecurityIsEnabled == FALSE)
#endif
{
#endif
if (ipcom_strcmp(session->username, "anonymous") == 0)
{
/* IPCOM_LOG1(INFO, "Anonymous login with password %s", password); */
/* Access restrictions apply for anonymous users */
session->readonly = 1;
}
#ifdef IP_PORT_VXWORKS
}
#endif
#ifdef IPFTPS_USE_TEST
else if (ipcom_strcmp(session->username, "ftp") == 0 &&
ipcom_strcmp(password, "interpeak") == 0)
{
/* IPCOM_LOG1(INFO, "Hard-coded 'ftp' login with password %s",
password); */
}
#endif
#if defined(IP_WB_BUILD)
#ifdef INCLUDE_IPCOM_USE_AUTH
else if (ipcom_auth_login(session->username, password,
IP_NULL, IP_NULL, IP_NULL) == IPCOM_SUCCESS)
{
/* IPCOM_LOG1(INFO, "User '%s' login", session->username); */
}
#endif
#else
#ifdef IPCOM_USE_AUTH
else if (ipcom_auth_login(session->username, password,
IP_NULL, IP_NULL, IP_NULL) == IPCOM_SUCCESS)
{
/* IPCOM_LOG1(INFO, "User '%s' login", session->username); */
}
#endif
#endif
else
{
/* IPCOM_LOG2(WARNING, "Login attempt with user: %s, pw: %s",
session->username, password); */
return 1;
}
#if 0
/*
** Set security parameters individually for the session if the
** default values defined as sysvars aren't appropriate:
**
** readonly: Write commands disallowed.
** proxy: Allow that data and control connections
** use different IP addresses.
** lportbase: Use local ports above this value.
** Set to 0 to use port 20.
** pportbase: Refuse to connect to peer ports <= this value.
** Set to 65535 to entirely disable PORT and EPRT commands.
** root: Root directory for the session.
*/
session->readonly = 1; /* Readonly mode */
session->proxy = 0; /* Disable proxy FTP */
session->lportbase = 49151; /* Use local ports from lportbase+1 */
session->pportbase = 1023; /* Reject peer ports <= pportbase */
/* Limit access to the filesystem */
/* Note: using ipcom_strdup is necessary here, internally session->root
* points to a buffer that can only hold default/configured content.
*/
ipftps_free(session->root);
if ((session->root = ipcom_strdup("/pub")) == IP_NULL)
{
IPCOM_LOG(ERR, "Out of memory") IPCOM_END;
return 1;
}
/* Note: session->cwd points to an internally allocated buffer which you can use directly */
ipcom_strcpy(session->cwd, "/pub");
#endif
/* IPCOM_LOG1(INFO, "User %s logged in", session->username); */
return 0;
}
/*****************************************************************************
*
* ipftps_authenticate - ftp server authentication callback routine
*
* The FTP sessions may be configured individually by setting session options.
* This is done after the authentication is complete, and enables clients to
* be given permissions according to general policies, local databases or
* even a RADIUS request to a remote host. The options are normally set in
* the ipftps_authenticate() routine and are accessed through the session
* pointer.
*
* .IP <session>
* Session descriptor.
* .IP <password>
* Password.
*
* RETURNS:
* 0 for successful authentication, 1 otherwise.
*
* NOMANUAL
*/
IP_PUBLIC int
ipftps_authenticate(Ipftps_session *session, char *password)
{
ipftps_cb ftps_cb;
/*eliminate warning when compiling with gnu*/
#if defined(IP_WB_BUILD) && defined(FTPS_AUTH_CALLBACK_HOOK)
ftps_cb = FTPS_AUTH_CALLBACK_HOOK;
#else
ftps_cb = ipftps_authenticate_default_callback;
#endif
return ftps_cb(session, password);
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,133 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: iptftpc_config.c,v $ $Revision: 1.6 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/iptftpc_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01f,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01e,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01d,01dec06,kch Updated CVS revision log entry.
01c,13sep06,kch Refresh with Sept 08, 2006 code drop
01b,28aug06,kch Update based on Aug 22, 2006 code drop.
01a,03aug06,kch Renamed INCLUDE_TFTP_CLIENT_CMD to INCLUDE_IPTFTP_CLIENT_CMD.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* TFTP client configuration.
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
#include <ipcom_shell.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
#if defined(INCLUDE_IPTFTP_CLIENT_CMD) || !defined(IP_WB_BUILD)
IP_EXTERN int iptftp_cmd_tftp(int argc, char **argv);
#endif
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err iptftpc_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
IP_EXTERN IP_CONST Ipcom_sysvar iptftp_conf_sysvar[];
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* iptftpc_configure
*===========================================================================
* Description: Configure TFTP client.
* Parameters: none.
* Returns: nothing.
*/
IP_PUBLIC Ip_err
iptftpc_configure(void)
{
Ip_err ret = IPCOM_SUCCESS;
(void)ipcom_sysvar_setv(iptftp_conf_sysvar, IPCOM_SYSVAR_FLAG_OVERWRITE);
#if defined(INCLUDE_IPTFTP_CLIENT_CMD) || !defined(IP_WB_BUILD)
ret = ipcom_shell_add_cmd("tftp", "tftp [-a] <get|put> <host> ...",
"Trivial FTP client",
iptftp_cmd_tftp,
IPCOM_SHELL_PRIO_SAME, IPCOM_PROC_STACK_DEFAULT);
#endif
return ret;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
@@ -0,0 +1,151 @@
/*
******************************************************************************
* INTERPEAK CONFIGURATION SOURCE FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: iptftps_config.c,v $ $Revision: 1.7 $
* $Source: /home/interpeak/CVSRoot/ipappl/config/iptftps_config.c,v $
* $Author: jren $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
******************************************************************************
*/
/*
modification history
--------------------
01e,03Aug10,rjq New file for Networking Configuration VSB restructuring.
01d,03jan07,kch Updated CVS revision log entry for Jan 03 code drop.
01c,01dec06,kch Updated CVS revision log entry.
01b,13sep06,kch Refresh with Sept 08, 2006 code drop
01a,28aug06,kch Update based on Aug 22, 2006 code drop.
*/
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
* TFTP server configuration
*/
/*
****************************************************************************
* 2 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include <ipcom_err.h>
#include <ipcom_sysvar.h>
/*
****************************************************************************
* 3 DEFINES
****************************************************************************
*/
#define TFTPS_PORT "69 " /* TFTP server listening port */
#define TFTPC_PEER_PORT "69 " /* TFTP port used by client to send packets */
/*
****************************************************************************
* 4 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 5 EXTERN PROTOTYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 LOCAL PROTOTYPES
****************************************************************************
*/
IP_PUBLIC Ip_err iptftps_configure(void);
/*
****************************************************************************
* 7 DATA
****************************************************************************
*/
/*
*===========================================================================
* SYSTEM VARIABLES
*===========================================================================
*/
/*
*===========================================================================
* iptftp_conf_sysvar
*===========================================================================
* TFTP Configuration Variables. Both client and server.
*/
IP_CONST Ipcom_sysvar iptftp_conf_sysvar[] =
{
/* TFTP server working directory */
IP_SYSVAR( "iptftp.dir", IPCOM_FILE_ROOT "tftpdir", TFTPS_DIRS ),
/* TFTP retransmit timeout in seconds */
IP_SYSVAR( "iptftp.timeout", "5", TFTPS_RETRANSMIT_TIMEOUT),
/* TFTP number of retries */
IP_SYSVAR( "iptftp.retries", "2", TFTPS_RETRIES),
/* TFTP server listening port */
IP_SYSVAR( "iptftp.srvPort", TFTPS_PORT, TFTPS_PORT),
/* TFTP port used by client to send packets */
IP_SYSVAR( "iptftp.clntSrvPort", TFTPC_PEER_PORT, TFTPC_PEER_PORT),
{ IP_NULL, IP_NULL }
};
/*
****************************************************************************
* 8 STATIC FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 9 GLOBAL FUNCTIONS
****************************************************************************
*/
/*
****************************************************************************
* 10 PUBLIC FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* iptftps_configure
*===========================================================================
* Description: Configure TFTP server
* Parameters: none.
* Returns: nothing.
*/
IP_PUBLIC Ip_err
iptftps_configure(void)
{
(void)ipcom_sysvar_setv(iptftp_conf_sysvar, IPCOM_SYSVAR_FLAG_OVERWRITE);
return IPCOM_SUCCESS;
}
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/