Network Developers Kit API  3.76.00.05
Modules | Data Structures | Macros | Typedefs | Functions
Configuration Manager

The Configuration Manager is a collection of API functions to help you create and manipulate a configuration. The manager API is independent of the configuration specification. More...

Collaboration diagram for Configuration Manager:

Modules

 Configuration Manager Error Codes
 Config API error-related services.
 

Data Structures

struct  _ci_srvargs
 Common service arguments. More...
 
struct  _ci_ipnet
 
struct  _ci_route
 
struct  _ci_client
 
struct  _ci_acct
 

Macros

#define CFGOP_REMOVE   0
 
#define CFGOP_ADD   1
 
#define CFG_ADDMODE_UNIQUE   0x0001
 
#define CFG_ADDMODE_DUPLICATE   0x0002
 
#define CFG_ADDMODE_NOSAVE   0x0004
 
#define CFGTAG_OS   0x0001
 
#define CFGTAG_IP   0x0002
 
#define CFGTAG_SERVICE   0x0003
 
#define CFGTAG_IPNET   0x0004
 
#define CFGTAG_ROUTE   0x0005
 
#define CFGTAG_CLIENT   0x0006
 
#define CFGTAG_SYSINFO   0x0007
 
#define CFGTAG_ACCT   0x0008
 
#define CFGTAG_MAX   0x0010
 Maxiumum number of config tags. More...
 
#define CFGITEM_SERVICE_TELNET   0x0001
 
#define CFGITEM_SERVICE_RESERVED1   0x0002 /* was HTTP */
 
#define CFGITEM_SERVICE_NAT   0x0003
 
#define CFGITEM_SERVICE_DHCPSERVER   0x0004
 
#define CFGITEM_SERVICE_DHCPCLIENT   0x0005
 
#define CFGITEM_SERVICE_DNSSERVER   0x0006
 
#define CFGITEM_SERVICE_MAX   0x0006
 
#define CFG_DOMAIN_MAX   64
 
#define CFG_NETTYPE_DYNAMIC   0x0001 /* Address created by DHCP CLIENT */
 
#define CFG_NETTYPE_VIRTUAL   0x0002 /* Virtual (one per IF) */
 
#define CFG_NETTYPE_DHCPS   0x0004 /* DHCPS Server IP */
 
#define CFG_HOSTNAME_MAX   256
 
#define CFG_CLIENTTYPE_DYNAMIC   1 /* Entry created via DHCPS */
 
#define CFG_CLIENTTYPE_STATIC   2 /* Create manually */
 
#define CFG_CLIENTSTATUS_PENDING   1 /* Supplied by OFFER */
 
#define CFG_CLIENTSTATUS_VALID   2 /* Validated by REQUEST */
 
#define CFG_CLIENTSTATUS_STATIC   3 /* Given by a INFORM */
 
#define CFG_CLIENTSTATUS_INVALID   4 /* Invalidated by DECLINE */
 
#define CFGITEM_ACCT_SYSTEM   1
 
#define CFGITEM_ACCT_PPP   1
 
#define CFGITEM_ACCT_REALM   1
 
#define CFG_ACCTSTR_MAX   32
 
#define CFG_ACCTFLG_CH1   0x1000
 
#define CFG_ACCTFLG_CH2   0x2000
 
#define CFG_ACCTFLG_CH3   0x4000
 
#define CFG_ACCTFLG_CH4   0x8000
 
#define CFG_ACCTFLG_CHALL   0xF000
 
#define CFGITEM_DHCP_DOMAINNAMESERVER   6 /* Stack's DNS servers */
 
#define CFGITEM_DHCP_HOSTNAME   12 /* Stack's host name */
 
#define CFGITEM_DHCP_NBNS   44 /* Stack's NBNS servers */
 
#define CFGITEM_DHCP_CLIENT_OPTION   61 /* Stack DHCP Client Identifier */
 
#define CFGITEM_SYSINFO_REALM1   256 /* Realm Name 1 (max 31 chars) */
 
#define CFGITEM_SYSINFO_REALM2   257 /* Realm Name 2 (max 31 chars) */
 
#define CFGITEM_SYSINFO_REALM3   258 /* Realm Name 3 (max 31 chars) */
 
#define CFGITEM_SYSINFO_REALM4   259 /* Realm Name 4 (max 31 chars) */
 
#define CFGITEM_SYSINFO_REALMPPP   260 /* Realm Name PPP (max 31 chars) */
 
#define CFGITEM_IP_ICMPDOREDIRECT   1 /* Add route on ICMP redirect (1=Yes) */
 
#define CFGITEM_IP_ICMPTTL   2 /* TTL for ICMP msgs (RFC1700 says 64) */
 
#define CFGITEM_IP_ICMPTTLECHO   3 /* TTL for ICMP echo (RFC1700 says 64) */
 
#define CFGITEM_IP_IPINDEXSTART   4 /* IP Protocol Start Index */
 
#define CFGITEM_IP_IPFORWARDING   5 /* IP Forwarding Enable (1=Yes) */
 
#define CFGITEM_IP_IPNATENABLE   6 /* IP NAT Translation Enable (1=Yes) */
 
#define CFGITEM_IP_IPFILTERENABLE   7 /* IP Filtering Enable (1=Yes) */
 
#define CFGITEM_IP_IPREASMMAXTIME   8 /* Max IP reassembly time in seconds */
 
#define CFGITEM_IP_IPREASMMAXSIZE   9 /* Max IP reassembly packet size */
 
#define CFGITEM_IP_DIRECTEDBCAST   10 /* Directed BCast IP addresses (1=Yes) */
 
#define CFGITEM_IP_TCPREASMMAXPKT   11 /* Out of order pkts held by TCP socket */
 
#define CFGITEM_IP_RTCENABLEDEBUG   12 /* Route control dbg messages (1=Yes) */
 
#define CFGITEM_IP_RTCADVTIME   13 /* Seconds to send Router Adv. (0=don't) */
 
#define CFGITEM_IP_RTCADVLIFE   14 /* Lifetime of route in RtAdv if active */
 
#define CFGITEM_IP_RTCADVPREF   15 /* Preference of route in RvAdv if active */
 
#define CFGITEM_IP_RTARPDOWNTIME   16 /* Time 5 failed ARPs keeps route down */
 
#define CFGITEM_IP_RTKEEPALIVETIME   17 /* Timeout of validated route in seconds */
 
#define CFGITEM_IP_RTARPINACTIVITY   18 /* Time in seconds beyond which a route if */
 
#define CFGITEM_IP_RTCLONETIMEOUT   19 /* Timeout of new cloned route in seconds */
 
#define CFGITEM_IP_RTDEFAULTMTU   20 /* MTU for internal routes */
 
#define CFGITEM_IP_SOCKTTLDEFAULT   21 /* Default IP TTL for Sockets */
 
#define CFGITEM_IP_SOCKTOSDEFAULT   22 /* Default IP TOS for Sockets */
 
#define CFGITEM_IP_SOCKMAXCONNECT   23 /* Max connections on listening socket */
 
#define CFGITEM_IP_SOCKTIMECONNECT   24 /* Max time for connect socket */
 
#define CFGITEM_IP_SOCKTIMEIO   25 /* Default Max time for socket send/rcv */
 
#define CFGITEM_IP_SOCKTCPTXBUF   26 /* TCP Transmit buffer size */
 
#define CFGITEM_IP_SOCKTCPRXBUF   27 /* TCP Receive buffer size (copy mode) */
 
#define CFGITEM_IP_SOCKTCPRXLIMIT   28 /* TCP Receive limit (non-copy mode) */
 
#define CFGITEM_IP_SOCKUDPRXLIMIT   29 /* UDP Receive limit */
 
#define CFGITEM_IP_SOCKMINTX   30 /* Default min space for "able to write" */
 
#define CFGITEM_IP_SOCKMINRX   31 /* Default min data for "able to read" */
 
#define CFGITEM_IP_PIPETIMEIO   32 /* Max time for pipe send/rcv call */
 
#define CFGITEM_IP_PIPEBUFMAX   33 /* Pipe internal buffer size */
 
#define CFGITEM_IP_PIPEMINTX   34 /* Pipe min tx space for "able to write" */
 
#define CFGITEM_IP_PIPEMINRX   35 /* Pipe min rx data for "able to read" */
 
#define CFGITEM_IP_TCPKEEPIDLE   36 /* Idle time before 1st TCP keep probe */
 
#define CFGITEM_IP_TCPKEEPINTVL   37 /* TCP keep probe interval */
 
#define CFGITEM_IP_TCPKEEPMAXIDLE   38 /* Max TCP keep probing time before drop */
 
#define CFGITEM_IP_ICMPDONTREPLYBCAST   39 /* Dont Reply To ICMP ECHO REQ */
 
#define CFGITEM_IP_ICMPDONTREPLYMCAST   40 /* Dont Reply To ICMP ECHO REQ */
 
#define CFGITEM_IP_RTGARP   41 /* How to handle received gratuitous ARP */
 
#define CFGITEM_IP_ICMPDONTREPLYECHO   42 /* Don't Reply To ICMP ECHO REQ */
 
#define CFGITEM_IP_UDPSENDICMPPORTUNREACH   43 /* Send ICMP Port Unreachable */
 
#define CFGITEM_IP_TCPSENDRST   44 /* Send RST if TCP port is not */
 
#define CFGITEM_IP_SOCKRAWETHRXLIMIT   45 /* Raw Eth Receive limit */
 
#define CFGITEM_IP_MAX   46 /* Max CFGTAG_IP item */
 
#define CFGITEM_OS_DBGPRINTLEVEL   1 /* Debug msg print threshhold */
 
#define CFGITEM_OS_DBGABORTLEVEL   2 /* Debug msg sys abort theshhold */
 
#define CFGITEM_OS_TASKPRILOW   3 /* Lowest priority for stack task */
 
#define CFGITEM_OS_TASKPRINORM   4 /* Normal priority for stack task */
 
#define CFGITEM_OS_TASKPRIHIGH   5 /* High priority for stack task */
 
#define CFGITEM_OS_TASKPRIKERN   6 /* Kernel-level priority (highest) */
 
#define CFGITEM_OS_TASKSTKLOW   7 /* Minimum stack size */
 
#define CFGITEM_OS_TASKSTKNORM   8 /* Normal stack size */
 
#define CFGITEM_OS_TASKSTKHIGH   9 /* Stack size for high volume tasks */
 
#define CFGITEM_OS_TASKSTKBOOT   10 /* Stack size for NS_BootTask */
 
#define CFGITEM_OS_MAX   10 /* Max CFGTAG_OS item */
 

Typedefs

typedef struct _ci_srvargs CISARGS
 Common service arguments. More...
 
typedef struct _ci_ipnet CI_IPNET
 
typedef struct _ci_route CI_ROUTE
 
typedef struct _ci_client CI_CLIENT
 
typedef struct _ci_acct CI_ACCT
 

Functions

void * CfgNew ()
 Create a new configuration. More...
 
void CfgFree (void *hCfg)
 Destroy a new configuration. More...
 
void CfgSetDefault (void *hCfg)
 Set default configuration handle. More...
 
void * CfgGetDefault ()
 Get default configuration handle. More...
 
int CfgLoad (void *hCfg, int Size, unsigned char *pData)
 Load a config from a linear memory block. More...
 
int CfgSave (void *hCfg, int *pSize, unsigned char *pData)
 Save a config to a linear memory block. More...
 
int CfgSetExecuteOrder (void *hCfg, uint32_t Tags, uint32_t *pOpenOrder, uint32_t *pCloseOrder)
 Set the Tag initialization and shutdown order on execute. More...
 
int CfgExecute (void *hCfg, uint32_t fExecute)
 Set the execution state (active/inactive) of the config. More...
 
int CfgSetService (void *hCfg, uint32_t Tag, int(*pCb)(void *, uint32_t, uint32_t, uint32_t, void *))
 Set service callback for configuration Tag. More...
 
int CfgAddEntry (void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Mode, int Size, unsigned char *pData, void **phCfgEntry)
 Add configuration entry to configuration. More...
 
int CfgRemoveEntry (void *hCfg, void *hCfgEntry)
 Remove config entry from configuration by handle. More...
 
int CfgGetEntryCnt (void *hCfg, uint32_t Tag, uint32_t Item)
 Get the number of entry instances for a Tag/Item pair. More...
 
int CfgGetEntry (void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Index, void **phCfgEntry)
 Get configuration entry from configuration. More...
 
int CfgGetNextEntry (void *hCfg, void *hCfgEntry, void **phCfgEntryNext)
 Get the next entry instance matching the supplied entry handle. More...
 
int CfgGetImmediate (void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Index, int Size, unsigned char *pData)
 Get config entry data. More...
 
int CfgEntryRef (void *hCfgEntry)
 Add a reference to a configuration entry handle. More...
 
int CfgEntryDeRef (void *hCfgEntry)
 Remove a reference to a config entry handle. More...
 
int CfgEntryGetData (void *hCfgEntry, int *pSize, unsigned char *pData)
 Get configuration entry data. More...
 
int CfgEntrySetData (void *hCfgEntry, int Size, unsigned char *pData)
 Set/reset configuration entry data. More...
 
int CfgEntryInfo (void *hCfgEntry, int *pSize, unsigned char **ppData)
 Get information on a configuration entry. More...
 

Detailed Description

The Configuration Manager is a collection of API functions to help you create and manipulate a configuration. The manager API is independent of the configuration specification.

Macro Definition Documentation

§ CFGOP_REMOVE

#define CFGOP_REMOVE   0

Item was removed

§ CFGOP_ADD

#define CFGOP_ADD   1

Item was added

§ CFG_ADDMODE_UNIQUE

#define CFG_ADDMODE_UNIQUE   0x0001

Replace all previous instances

§ CFG_ADDMODE_DUPLICATE

#define CFG_ADDMODE_DUPLICATE   0x0002

Allow duplicate data entry

§ CFG_ADDMODE_NOSAVE

#define CFG_ADDMODE_NOSAVE   0x0004

Don't include this entry in CfgSave()

§ CFGTAG_OS

#define CFGTAG_OS   0x0001

OS Configuration

§ CFGTAG_IP

#define CFGTAG_IP   0x0002

IP Stack Configuration

§ CFGTAG_SERVICE

#define CFGTAG_SERVICE   0x0003

Service

§ CFGTAG_IPNET

#define CFGTAG_IPNET   0x0004

IP Network

§ CFGTAG_ROUTE

#define CFGTAG_ROUTE   0x0005

Gateway Route

§ CFGTAG_CLIENT

#define CFGTAG_CLIENT   0x0006

DHCPS Client

§ CFGTAG_SYSINFO

#define CFGTAG_SYSINFO   0x0007

System Information

§ CFGTAG_ACCT

#define CFGTAG_ACCT   0x0008

User Account

§ CFGTAG_MAX

#define CFGTAG_MAX   0x0010

Maxiumum number of config tags.

Remarks
Users are allowed to add their own tags, which may require changing this value. Note that changes to this value require rebuilding the NETTOOLS library.

§ CFGITEM_SERVICE_TELNET

#define CFGITEM_SERVICE_TELNET   0x0001

§ CFGITEM_SERVICE_RESERVED1

#define CFGITEM_SERVICE_RESERVED1   0x0002 /* was HTTP */

§ CFGITEM_SERVICE_NAT

#define CFGITEM_SERVICE_NAT   0x0003

§ CFGITEM_SERVICE_DHCPSERVER

#define CFGITEM_SERVICE_DHCPSERVER   0x0004

§ CFGITEM_SERVICE_DHCPCLIENT

#define CFGITEM_SERVICE_DHCPCLIENT   0x0005

§ CFGITEM_SERVICE_DNSSERVER

#define CFGITEM_SERVICE_DNSSERVER   0x0006

§ CFGITEM_SERVICE_MAX

#define CFGITEM_SERVICE_MAX   0x0006

§ CFG_DOMAIN_MAX

#define CFG_DOMAIN_MAX   64

§ CFG_NETTYPE_DYNAMIC

#define CFG_NETTYPE_DYNAMIC   0x0001 /* Address created by DHCP CLIENT */

§ CFG_NETTYPE_VIRTUAL

#define CFG_NETTYPE_VIRTUAL   0x0002 /* Virtual (one per IF) */

§ CFG_NETTYPE_DHCPS

#define CFG_NETTYPE_DHCPS   0x0004 /* DHCPS Server IP */

§ CFG_HOSTNAME_MAX

#define CFG_HOSTNAME_MAX   256

§ CFG_CLIENTTYPE_DYNAMIC

#define CFG_CLIENTTYPE_DYNAMIC   1 /* Entry created via DHCPS */

§ CFG_CLIENTTYPE_STATIC

#define CFG_CLIENTTYPE_STATIC   2 /* Create manually */

§ CFG_CLIENTSTATUS_PENDING

#define CFG_CLIENTSTATUS_PENDING   1 /* Supplied by OFFER */

§ CFG_CLIENTSTATUS_VALID

#define CFG_CLIENTSTATUS_VALID   2 /* Validated by REQUEST */

§ CFG_CLIENTSTATUS_STATIC

#define CFG_CLIENTSTATUS_STATIC   3 /* Given by a INFORM */

§ CFG_CLIENTSTATUS_INVALID

#define CFG_CLIENTSTATUS_INVALID   4 /* Invalidated by DECLINE */

§ CFGITEM_ACCT_SYSTEM

#define CFGITEM_ACCT_SYSTEM   1

§ CFGITEM_ACCT_PPP

#define CFGITEM_ACCT_PPP   1

§ CFGITEM_ACCT_REALM

#define CFGITEM_ACCT_REALM   1

§ CFG_ACCTSTR_MAX

#define CFG_ACCTSTR_MAX   32

§ CFG_ACCTFLG_CH1

#define CFG_ACCTFLG_CH1   0x1000

§ CFG_ACCTFLG_CH2

#define CFG_ACCTFLG_CH2   0x2000

§ CFG_ACCTFLG_CH3

#define CFG_ACCTFLG_CH3   0x4000

§ CFG_ACCTFLG_CH4

#define CFG_ACCTFLG_CH4   0x8000

§ CFG_ACCTFLG_CHALL

#define CFG_ACCTFLG_CHALL   0xF000

§ CFGITEM_DHCP_DOMAINNAMESERVER

#define CFGITEM_DHCP_DOMAINNAMESERVER   6 /* Stack's DNS servers */

§ CFGITEM_DHCP_HOSTNAME

#define CFGITEM_DHCP_HOSTNAME   12 /* Stack's host name */

§ CFGITEM_DHCP_NBNS

#define CFGITEM_DHCP_NBNS   44 /* Stack's NBNS servers */

§ CFGITEM_DHCP_CLIENT_OPTION

#define CFGITEM_DHCP_CLIENT_OPTION   61 /* Stack DHCP Client Identifier */

§ CFGITEM_SYSINFO_REALM1

#define CFGITEM_SYSINFO_REALM1   256 /* Realm Name 1 (max 31 chars) */

§ CFGITEM_SYSINFO_REALM2

#define CFGITEM_SYSINFO_REALM2   257 /* Realm Name 2 (max 31 chars) */

§ CFGITEM_SYSINFO_REALM3

#define CFGITEM_SYSINFO_REALM3   258 /* Realm Name 3 (max 31 chars) */

§ CFGITEM_SYSINFO_REALM4

#define CFGITEM_SYSINFO_REALM4   259 /* Realm Name 4 (max 31 chars) */

§ CFGITEM_SYSINFO_REALMPPP

#define CFGITEM_SYSINFO_REALMPPP   260 /* Realm Name PPP (max 31 chars) */

§ CFGITEM_IP_ICMPDOREDIRECT

#define CFGITEM_IP_ICMPDOREDIRECT   1 /* Add route on ICMP redirect (1=Yes) */

§ CFGITEM_IP_ICMPTTL

#define CFGITEM_IP_ICMPTTL   2 /* TTL for ICMP msgs (RFC1700 says 64) */

§ CFGITEM_IP_ICMPTTLECHO

#define CFGITEM_IP_ICMPTTLECHO   3 /* TTL for ICMP echo (RFC1700 says 64) */

§ CFGITEM_IP_IPINDEXSTART

#define CFGITEM_IP_IPINDEXSTART   4 /* IP Protocol Start Index */

§ CFGITEM_IP_IPFORWARDING

#define CFGITEM_IP_IPFORWARDING   5 /* IP Forwarding Enable (1=Yes) */

§ CFGITEM_IP_IPNATENABLE

#define CFGITEM_IP_IPNATENABLE   6 /* IP NAT Translation Enable (1=Yes) */

§ CFGITEM_IP_IPFILTERENABLE

#define CFGITEM_IP_IPFILTERENABLE   7 /* IP Filtering Enable (1=Yes) */

§ CFGITEM_IP_IPREASMMAXTIME

#define CFGITEM_IP_IPREASMMAXTIME   8 /* Max IP reassembly time in seconds */

§ CFGITEM_IP_IPREASMMAXSIZE

#define CFGITEM_IP_IPREASMMAXSIZE   9 /* Max IP reassembly packet size */

§ CFGITEM_IP_DIRECTEDBCAST

#define CFGITEM_IP_DIRECTEDBCAST   10 /* Directed BCast IP addresses (1=Yes) */

§ CFGITEM_IP_TCPREASMMAXPKT

#define CFGITEM_IP_TCPREASMMAXPKT   11 /* Out of order pkts held by TCP socket */

§ CFGITEM_IP_RTCENABLEDEBUG

#define CFGITEM_IP_RTCENABLEDEBUG   12 /* Route control dbg messages (1=Yes) */

§ CFGITEM_IP_RTCADVTIME

#define CFGITEM_IP_RTCADVTIME   13 /* Seconds to send Router Adv. (0=don't) */

§ CFGITEM_IP_RTCADVLIFE

#define CFGITEM_IP_RTCADVLIFE   14 /* Lifetime of route in RtAdv if active */

§ CFGITEM_IP_RTCADVPREF

#define CFGITEM_IP_RTCADVPREF   15 /* Preference of route in RvAdv if active */

§ CFGITEM_IP_RTARPDOWNTIME

#define CFGITEM_IP_RTARPDOWNTIME   16 /* Time 5 failed ARPs keeps route down */

§ CFGITEM_IP_RTKEEPALIVETIME

#define CFGITEM_IP_RTKEEPALIVETIME   17 /* Timeout of validated route in seconds */

§ CFGITEM_IP_RTARPINACTIVITY

#define CFGITEM_IP_RTARPINACTIVITY   18 /* Time in seconds beyond which a route if */

§ CFGITEM_IP_RTCLONETIMEOUT

#define CFGITEM_IP_RTCLONETIMEOUT   19 /* Timeout of new cloned route in seconds */

§ CFGITEM_IP_RTDEFAULTMTU

#define CFGITEM_IP_RTDEFAULTMTU   20 /* MTU for internal routes */

§ CFGITEM_IP_SOCKTTLDEFAULT

#define CFGITEM_IP_SOCKTTLDEFAULT   21 /* Default IP TTL for Sockets */

§ CFGITEM_IP_SOCKTOSDEFAULT

#define CFGITEM_IP_SOCKTOSDEFAULT   22 /* Default IP TOS for Sockets */

§ CFGITEM_IP_SOCKMAXCONNECT

#define CFGITEM_IP_SOCKMAXCONNECT   23 /* Max connections on listening socket */

§ CFGITEM_IP_SOCKTIMECONNECT

#define CFGITEM_IP_SOCKTIMECONNECT   24 /* Max time for connect socket */

§ CFGITEM_IP_SOCKTIMEIO

#define CFGITEM_IP_SOCKTIMEIO   25 /* Default Max time for socket send/rcv */

§ CFGITEM_IP_SOCKTCPTXBUF

#define CFGITEM_IP_SOCKTCPTXBUF   26 /* TCP Transmit buffer size */

§ CFGITEM_IP_SOCKTCPRXBUF

#define CFGITEM_IP_SOCKTCPRXBUF   27 /* TCP Receive buffer size (copy mode) */

§ CFGITEM_IP_SOCKTCPRXLIMIT

#define CFGITEM_IP_SOCKTCPRXLIMIT   28 /* TCP Receive limit (non-copy mode) */

§ CFGITEM_IP_SOCKUDPRXLIMIT

#define CFGITEM_IP_SOCKUDPRXLIMIT   29 /* UDP Receive limit */

§ CFGITEM_IP_SOCKMINTX

#define CFGITEM_IP_SOCKMINTX   30 /* Default min space for "able to write" */

§ CFGITEM_IP_SOCKMINRX

#define CFGITEM_IP_SOCKMINRX   31 /* Default min data for "able to read" */

§ CFGITEM_IP_PIPETIMEIO

#define CFGITEM_IP_PIPETIMEIO   32 /* Max time for pipe send/rcv call */

§ CFGITEM_IP_PIPEBUFMAX

#define CFGITEM_IP_PIPEBUFMAX   33 /* Pipe internal buffer size */

§ CFGITEM_IP_PIPEMINTX

#define CFGITEM_IP_PIPEMINTX   34 /* Pipe min tx space for "able to write" */

§ CFGITEM_IP_PIPEMINRX

#define CFGITEM_IP_PIPEMINRX   35 /* Pipe min rx data for "able to read" */

§ CFGITEM_IP_TCPKEEPIDLE

#define CFGITEM_IP_TCPKEEPIDLE   36 /* Idle time before 1st TCP keep probe */

§ CFGITEM_IP_TCPKEEPINTVL

#define CFGITEM_IP_TCPKEEPINTVL   37 /* TCP keep probe interval */

§ CFGITEM_IP_TCPKEEPMAXIDLE

#define CFGITEM_IP_TCPKEEPMAXIDLE   38 /* Max TCP keep probing time before drop */

§ CFGITEM_IP_ICMPDONTREPLYBCAST

#define CFGITEM_IP_ICMPDONTREPLYBCAST   39 /* Dont Reply To ICMP ECHO REQ */

§ CFGITEM_IP_ICMPDONTREPLYMCAST

#define CFGITEM_IP_ICMPDONTREPLYMCAST   40 /* Dont Reply To ICMP ECHO REQ */

§ CFGITEM_IP_RTGARP

#define CFGITEM_IP_RTGARP   41 /* How to handle received gratuitous ARP */

§ CFGITEM_IP_ICMPDONTREPLYECHO

#define CFGITEM_IP_ICMPDONTREPLYECHO   42 /* Don't Reply To ICMP ECHO REQ */

§ CFGITEM_IP_UDPSENDICMPPORTUNREACH

#define CFGITEM_IP_UDPSENDICMPPORTUNREACH   43 /* Send ICMP Port Unreachable */

§ CFGITEM_IP_TCPSENDRST

#define CFGITEM_IP_TCPSENDRST   44 /* Send RST if TCP port is not */

§ CFGITEM_IP_SOCKRAWETHRXLIMIT

#define CFGITEM_IP_SOCKRAWETHRXLIMIT   45 /* Raw Eth Receive limit */

§ CFGITEM_IP_MAX

#define CFGITEM_IP_MAX   46 /* Max CFGTAG_IP item */

§ CFGITEM_OS_DBGPRINTLEVEL

#define CFGITEM_OS_DBGPRINTLEVEL   1 /* Debug msg print threshhold */

§ CFGITEM_OS_DBGABORTLEVEL

#define CFGITEM_OS_DBGABORTLEVEL   2 /* Debug msg sys abort theshhold */

§ CFGITEM_OS_TASKPRILOW

#define CFGITEM_OS_TASKPRILOW   3 /* Lowest priority for stack task */

§ CFGITEM_OS_TASKPRINORM

#define CFGITEM_OS_TASKPRINORM   4 /* Normal priority for stack task */

§ CFGITEM_OS_TASKPRIHIGH

#define CFGITEM_OS_TASKPRIHIGH   5 /* High priority for stack task */

§ CFGITEM_OS_TASKPRIKERN

#define CFGITEM_OS_TASKPRIKERN   6 /* Kernel-level priority (highest) */

§ CFGITEM_OS_TASKSTKLOW

#define CFGITEM_OS_TASKSTKLOW   7 /* Minimum stack size */

§ CFGITEM_OS_TASKSTKNORM

#define CFGITEM_OS_TASKSTKNORM   8 /* Normal stack size */

§ CFGITEM_OS_TASKSTKHIGH

#define CFGITEM_OS_TASKSTKHIGH   9 /* Stack size for high volume tasks */

§ CFGITEM_OS_TASKSTKBOOT

#define CFGITEM_OS_TASKSTKBOOT   10 /* Stack size for NS_BootTask */

§ CFGITEM_OS_MAX

#define CFGITEM_OS_MAX   10 /* Max CFGTAG_OS item */

Typedef Documentation

§ CISARGS

typedef struct _ci_srvargs CISARGS

Common service arguments.

All services share this common, base structure.

§ CI_IPNET

typedef struct _ci_ipnet CI_IPNET

§ CI_ROUTE

typedef struct _ci_route CI_ROUTE

§ CI_CLIENT

typedef struct _ci_client CI_CLIENT

§ CI_ACCT

typedef struct _ci_acct CI_ACCT

Function Documentation

§ CfgNew()

void* CfgNew ( )

Create a new configuration.

Creates a configuration handle that can be used with other configuration functions. The new handle defaults to the inactive state (see CfgExecute()).

Returns
Success: handle to new configuration
Failure: NULL
See also
CfgFree()

§ CfgFree()

void CfgFree ( void *  hCfg)

Destroy a new configuration.

Destroys a configuration. Unloads and frees all configuration entries and frees the configuration handle. After this call, the configuration handle hCfg is invalid.

Parameters
[in]hCfgHandle to configuration
See also
CfgNew()

§ CfgSetDefault()

void CfgSetDefault ( void *  hCfg)

Set default configuration handle.

This function sets the current default configuration handle to that specified in hCfg. The default handle is used in any function that takes a hCfg parameter, when the specified parameter is NULL. At initialization, there is no default configuration. It must be allocated by CfgNew() and then specified via CfgSetDefault(). Normally, the default configuration is reserved for system use. The default configuration handle should not be freed until it is cleared by calling CfgSetDefault(NULL).

Parameters
[in]hCfgHandle to configuration to set as default, or NULL to clear default.
See also
CfgGetDefault()

§ CfgGetDefault()

void* CfgGetDefault ( )

Get default configuration handle.

This function returns the current default configuration handle. The default handle is used in any function that takes a hCfg parameter, when the specified parameter is NULL. At initialization, there is no default configuration. It must be allocated by CfgNew() and then specified via CfgSetDefault().

Remarks
Normally, the default configuration is reserved for system use.
See also
CfgSetDefault()

§ CfgLoad()

int CfgLoad ( void *  hCfg,
int  Size,
unsigned char *  pData 
)

Load a config from a linear memory block.

Parameters
[in,out]hCfgHandle to configuration
[in]SizeSize of memory block to load
[in]pDataPointer to memory block to load
Remarks
The configuration system features the ability for the manager to convert a configuration database to a linear block of memory for storage in non-volatile memory. The configuration can then be converted back on reboot.
This function converts a linear block of memory to a configuration by loading each configuration entry it finds in the coded data block. Note that CfgLoad() can be used to load entries into a configuration that already has pre-existing entries, but the method of entry is not preserved (see Mode parameter of CfgAddEntry() ). To ensure that the resulting configuration exactly matches the one converted with CfgSave() , this function should only be called on an empty configuration handle.
Returns
Success: > 0 - number of bytes loaded
Failure: < 0, see Configuration Manager Error Codes
See also
CfgSave()

§ CfgSave()

int CfgSave ( void *  hCfg,
int *  pSize,
unsigned char *  pData 
)

Save a config to a linear memory block.

Parameters
[in]hCfgHandle to configuration
[in,out]pSizePointer to size of memory block
[in]pDataPointer to memory block to load
Remarks
One of the features of the configuration system is the ability for the manager to convert a configuration database to a linear block of memory for storage in non-volatile memory. The configuration can then be converted back on reboot.
This function saves the contents of the configuration specified by hCfg into the linear block of memory pointed to by pData.
The size of the data buffer is initially pointed to by the pSize parameter. If this size value pointed to by this pointer is zero (pSize cannot itself be NULL), the function does not attempt to save the configuration but rather calculates the size required and writes this value to the location specified by pSize. In fact, any time the value at pSize is less than the size required to store the configuration, the function returns 0 and the value at pSize is set to the size required to store the data.
The pData parameter points to the data buffer to receive the configuration information. This pointer can be NULL if *pSize is zero. Note that the pointer pSize must always be valid.
Returns
Success: > 0 - number of bytes written
Failure:
See also
CfgSave()

§ CfgSetExecuteOrder()

int CfgSetExecuteOrder ( void *  hCfg,
uint32_t  Tags,
uint32_t *  pOpenOrder,
uint32_t *  pCloseOrder 
)

Set the Tag initialization and shutdown order on execute.

Parameters
[in]hCfgHandle to configuration
[in]TagsNumber of Tag values in pOpenOrder and pCloseOder. Must match CFGTAG_MAX.
[in]pOpenOrderPointer to array of Tag values in init order
[in]pCloseOrderPointer to array of Tag values in shutdown order
Remarks
The configuration API has no knowledge of the configuration database specification. Thus, it has no concept of a priority in loading and unloading configuration entries. The default order for both loading and unloading is by ascending tag value.
You may require that the application specify the exact order in which entries should be initialized (specified in pOpenOrder) and shut down (specified in pCloseOder).
Both arrays must be provided - even if they are identical pointers.
The number of elements in each array is specified by the Tags parameter. This must exactly match the maximum number of tags in the system defined by CFGTAG_MAX. An entry of 0 in either order array is used as a placeholder for tags that have not yet been defined.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
See also
CfgExecute()

§ CfgExecute()

int CfgExecute ( void *  hCfg,
uint32_t  fExecute 
)

Set the execution state (active/inactive) of the config.

Parameters
[in]hCfgHandle to configuration
[in]fExecuteDesired execute state (1 = active)
Remarks
When a configuration is first created, it is in an inactive state, so changes to the configuration are not reflected by changes to the system.
Executing the configuration (setting fExecute to 1) causes all current entries in the configuration to be loaded, and any further changes in the configuration to be immediately reflected in the system.
Disabling execution of the configuration (setting fExecute to 0) causes all configuration entries to be unloaded from the system (note that they are not removed from the configuration). Any further changes to the configuration are not reflected by changes to the system.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
See also
CfgNew()

§ CfgSetService()

int CfgSetService ( void *  hCfg,
uint32_t  Tag,
int(*)(void *, uint32_t, uint32_t, uint32_t, void *)  pCb 
)

Set service callback for configuration Tag.

Parameters
[in]hCfgHandle to configuration
[in]TagTag value to set callback for
[in]pCbPointer to service callback function
Remarks
To give the configuration the ability to be active - i.e., to make real-time changes to the system as the configuration changes, the configuration manager must have the ability to make changes to the system. To enable this in a generic fashion, the configuration manager allows for the installation of service callback functions for each configuration tag value.
This function sets the service function for the provided Tag. Service function pointers default to NULL, and when they are NULL, no service is performed for the configuration entry (it becomes information data only).
When invoked, the service callback function is passed information about the affected entry. The callback function is defined as:
int CbSrv(void *hCfg, uint32_t Tag, uint32_t Item, uint32_t Op,
void *hCfgEntry);
Remarks
where:
  • hCfg: Pointer to Config
  • Tag: Tag value of entry changed
  • Item: Item value of entry changed
  • Op: Operation (CFGOP_ADD or CFGOP_REMOVE)
  • hCfgEntry: Non-Referenced pointer to entry added or removed
pCb should return 1 on success, 0 on pass, and <0 on error.
Note
The configuration entry handle passed to the callback function is not referenced, as its scope expires when the callback function returns.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
See also
CfgNew()

§ CfgAddEntry()

int CfgAddEntry ( void *  hCfg,
uint32_t  Tag,
uint32_t  Item,
uint32_t  Mode,
int  Size,
unsigned char *  pData,
void **  phCfgEntry 
)

Add configuration entry to configuration.

This function creates a new configuration entry and adds it to the configuration.

Parameters
[in]hCfgHandle to configuration
[in]TagTag value of new entry
[in]ItemItem value of new entry
[in]ModeMode flags for how to add entry
[in]SizeSize of entry pointed to by pData
[in]pDataPointer to entry data
[in,out]phCfgEntryPointer to storage for the handle to the new configuration entry.
Remarks
phCfgEntry is an optional pointer that can return a handle to the newly added configuration entry. When the phCfgEntry parameter is non-NULL, the function writes the referenced handle of the new configuration entry to the location specified by this parameter. It is then the caller's responsibility to dereference this handle when it is finished with it. When phCfgEntry is NULL, no entry handle is returned, but the function return value is still valid.
Configuration entry handles are dereferenced by calling one of the following:
If the execution state of the configuration is active (see CfgExecute()), the addition of the configuration entry is immediately reflected in the operating state of the system.
On a service error, the configuration entry is still added to the configuration, and an entry handle is written to phCfgEntry, when supplied.
Multiple configuration entries can exist with the same Tag and Item key values. The system creates a third key (Instance) to track these duplicate keyed entries. However, by default, the configuration system does not allow for fully duplicate entries. Entries are full duplicates if there exists another entry with the same Tag and Item key values and an exact duplicate data section (size and content). When a full duplicate entry is detected, the new (duplicate) entry is not created.
There are some options that determine how the entry is added to the configuration by using flags that can be set in the Mode parameter. The default behavior when adding an object is as follows:
  • Multiple instances with the same Tag and Item values are allowed.
  • However, duplicate instances with the same Tag, Item, Size, and pData contents are ignored.
  • New entries are saved to the linear buffer if or when CfgSave() is used.
To modify the default behavior, one or more of the following flags can be set:
Setting both the CFG_ADDMODE_UNIQUE and CFG_ADDMODE_DUPLICATE flags is the same as only setting CFG_ADDMODE_UNIQUE.
Returns
Success:
  • 1 on success with successful processing by a service callback function (see CfgSetService())
  • 0 on success with no processing performed by a service callback function
Failure:
See also
CfgRemoveEntry()
CfgEntryDeRef()
CfgRemoveEntry()
CfgGetNextEntry()
CFG_GET_SERVICE_ERROR()

§ CfgRemoveEntry()

int CfgRemoveEntry ( void *  hCfg,
void *  hCfgEntry 
)

Remove config entry from configuration by handle.

Parameters
[in]hCfgHandle to configuration
[in]hCfgEntryConfiguration entry to remove
Remarks
This function removes a config entry from a configuration.
If the execution state of the configuration is active (see CfgExecute()), then the removal of the configuration entry is immediately reflected in the operating state of the system.
This function also performs a single dereference operation on the configuration entry handle, so the handle is invalid after the call (unless there was more than one reference made). Although the entry handle is not freed until all handle references have been removed, it is always removed from the configuration immediately.
Note
hCfgEntry is not dereferenced in the event of an error.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
See also
CfgExecute()

§ CfgGetEntryCnt()

int CfgGetEntryCnt ( void *  hCfg,
uint32_t  Tag,
uint32_t  Item 
)

Get the number of entry instances for a Tag/Item pair.

Parameters
[in]hCfgHandle to configuration
[in]TagTag value of entry
[in]ItemItem value of entry
Remarks
This function searches the configuration for all instances matching the supplied Tag and Item parameters and returns the number of instances found.
Returns
Success: >= 0 - the number of instances found
Failure: < 0, see Configuration Manager Error Codes
See also
CfgGetEntry()

§ CfgGetEntry()

int CfgGetEntry ( void *  hCfg,
uint32_t  Tag,
uint32_t  Item,
uint32_t  Index,
void **  phCfgEntry 
)

Get configuration entry from configuration.

Parameters
[in]hCfgHandle to configuration
[in]TagTag value of entry
[in]ItemItem value of entry
[in]IndexInstance index to get (1 to n)
[in,out]phCfgEntryOptional pointer to location to store config entry handle
Remarks
This function searches the configuration for an entry matching the supplied Tag and Item parameters and an index matching the supplied Index parameter. For example, when Index is 1, the first instance is returned, when Index is 2, the second instance is returned. The total number of instances can be found by calling CfgGetEntryCnt().
The phCfgEntry parameter is an optional pointer that can return the handle of the configuration entry found. When phCfgEntry parameter is valid, the referenced handle of the configuration entry found is written into to this pointer. It is the caller's responsibility to dereference the handle when it is no longer needed. When the parameter phCfgEntry is NULL, no entry handle is returned, but the function return value is still valid (found or not found).
Configuration entry handles are dereferenced by calling one of the following:
Note
Do not attempt to use the Index value to enumerate all entry instances in the configuration. The index of an entry handle is valid only at the time of the call as an item can move up and down in the list as configuration changes are made. To enumerate every entry for a Tag / Item pair, start with Index 1, and then use CfgGetNextEntry() to get additional entries.
Returns
Success: 1 - a matching entry was found
Failure:
See also
CfgEntryDeRef()
CfgRemoveEntry()
CfgGetNextEntry()

§ CfgGetNextEntry()

int CfgGetNextEntry ( void *  hCfg,
void *  hCfgEntry,
void **  phCfgEntryNext 
)

Get the next entry instance matching the supplied entry handle.

Parameters
[in]hCfgHandle to configuration
[in]hCfgEntryHandle to last configuration entry
[in,out]phCfgEntryNextOptional pointer to receive handle to next config entry
Remarks
This function serves two purposes. First, it dereferences the configuration entry handle supplied in hCfgEntry. After this call, the handle is invalid (unless there was more than one reference to it). Secondly, this function returns a referenced configuration entry handle to the next instance (if any) of an entry that matches the Tag and Item values of the supplied entry.
When the parameter phCfgEntryNext is NULL, no entry handle is returned, but the function always returns 1 if such an entry was found and 0 when not.
When phCfgEntryNext is not NULL, the function writes a referenced handle to the configuration entry to the location specified by this parameter. It is then the caller's responsibility to dereference this handle when it is finished with it.
Configuration entry handles are dereferenced by calling one of the following:
Note
hCfgEntry is not dereferenced in the event of an error.
Returns
Success: 1 - a next entry was found
Failure:
See also
CfgGetEntry()

§ CfgGetImmediate()

int CfgGetImmediate ( void *  hCfg,
uint32_t  Tag,
uint32_t  Item,
uint32_t  Index,
int  Size,
unsigned char *  pData 
)

Get config entry data.

Parameters
[in]hCfgHandle to configuration
[in]TagTag value of entry
[in]ItemItem value of entry
[in]IndexInstance index to get (1 to n)
[in]SizeSize of buffer to receive data
[in,out]pDataPointer to data buffer to receive data
Remarks
This function is a useful shortcut when searching the configuration for well-known entries. It searches the configuration for entries matching the supplied Tag and Item parameters and uses the item matching the supplied Index parameter. For example, if Index is 1, the first instance is used, if Index is 2, the second instance is used. The total number of instances can be found by calling CfgGetEntryCnt().
Instead of returning a referenced handle to the configuration entry (as with the more generic CfgGetEntry() function), this function immediately gets the entry data for this entry and copies it to the data buffer pointed to by pData.
The increased simplicity does decrease the function's flexibility. This function returns the number of bytes copied, so it will return 0 for any of the following reasons:
  • A supplied parameter is incorrect
  • The item was not found
  • The supplied buffer size (specified by Size) was not large enough to hold the data
Returns
The number of bytes copied
See also
CfgGetEntry()

§ CfgEntryRef()

int CfgEntryRef ( void *  hCfgEntry)

Add a reference to a configuration entry handle.

Parameters
[in]hCfgEntryHandle to configuration entry
Remarks
This function adds a reference to the configuration entry handle supplied in hCfgEntry. It is called by an application when it intends to use a configuration entry handle beyond the scope of the function that obtained it from the configuration. This normally occurs when one user function calls another and passes it a handle.
Configuration entry handles should be dereferenced when no longer needed by calling one of the following:
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
See also
CfgEntryDeRef()
CfgRemoveEntry()
CfgGetNextEntry()

§ CfgEntryDeRef()

int CfgEntryDeRef ( void *  hCfgEntry)

Remove a reference to a config entry handle.

Parameters
[in]hCfgEntryHandle to configuration entry
Remarks
This function removes a reference to the configuration entry handle supplied in hCfgEntry. It is called by an application when it wishes to discard a referenced configuration entry handle. Once this function is called, the handle should no longer be used.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes

§ CfgEntryGetData()

int CfgEntryGetData ( void *  hCfgEntry,
int *  pSize,
unsigned char *  pData 
)

Get configuration entry data.

Parameters
[in]hCfgEntryHandle to configuration entry
[in,out]pSizePointer to size of data buffer in pData
[in,out]pDataPointer to data buffer
Remarks
This function acquires the entry data of the configuration entry specified by the entry handle in hCfgEntry.
The value pointed to by pSize is set to the size of the supplied buffer, or zero to get the required size (the pointer pSize must be valid, but the value at the pointer can be zero). If the value at pSize is zero, or less than the number of bytes required to hold the entry data, this function returns 0, and the number of bytes required to hold the data is stored at pSize.
pData points to the data buffer to receive the configuration entry data. This pointer can be NULL if *pSize is zero.
Returns
Success: number of bytes written
Failure:

§ CfgEntrySetData()

int CfgEntrySetData ( void *  hCfgEntry,
int  Size,
unsigned char *  pData 
)

Set/reset configuration entry data.

Parameters
[in]hCfgEntryHandle to configuration entry
[in]SizeSize of data buffer in pData
[in]pDataPointer to data buffer
Remarks
This function replaces the entry data of the configuration entry specified by hCfgEntry.
The new entry data is pointed to by pData, with a size indicated by Size. Note that the new data must be an exact replacement for the old. The size of the new buffer must exactly match the old size.
This function should be used for configuration entries that are for information purposes only. Note that if a service provider callback is associated with the Tag value of this entry, the processing function is not called as a result of this data update. This function only updates the data stored for this configuration entry.
Returns
Success: number of bytes written
Failure:
See also
CfgEntryGetData

§ CfgEntryInfo()

int CfgEntryInfo ( void *  hCfgEntry,
int *  pSize,
unsigned char **  ppData 
)

Get information on a configuration entry.

Parameters
[in]hCfgEntryHandle to configuration entry
[in,out]pSizePointer to receive the size of the config entry data buffer
[in,out]ppDataLocation to receive the pointer to the config* entry data buffer
Remarks
This function acquires the size and pointer to a configuration entry's data buffer.
The entry handle is supplied hCfgEntry. A pointer to receive the size of the entry's data buffer is supplied in pSize, and a pointer to receive a pointer to the entry's data buffer is supplied in ppData. Either pointer parameter can be left NULL if the information is not required.
This function should be used with great care. Direct manipulation of the configuration entry data should only be attempted on informational tags, and only when the caller holds a referenced handle to the configuration entry. This function is used in configuration service callback functions, which are called only when the configuration is in a protected state.
Returns
Success: 0
Failure: < 0, see Configuration Manager Error Codes
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale