Network Developers Kit API
3.76.00.05
|
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...
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... | |
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.
#define CFGOP_REMOVE 0 |
Item was removed
#define CFGOP_ADD 1 |
Item was added
#define CFG_ADDMODE_UNIQUE 0x0001 |
Replace all previous instances
#define CFG_ADDMODE_DUPLICATE 0x0002 |
Allow duplicate data entry
#define CFG_ADDMODE_NOSAVE 0x0004 |
Don't include this entry in CfgSave()
#define CFGTAG_OS 0x0001 |
OS Configuration
#define CFGTAG_IP 0x0002 |
IP Stack Configuration
#define CFGTAG_SERVICE 0x0003 |
Service
#define CFGTAG_IPNET 0x0004 |
IP Network
#define CFGTAG_ROUTE 0x0005 |
Gateway Route
#define CFGTAG_CLIENT 0x0006 |
DHCPS Client
#define CFGTAG_SYSINFO 0x0007 |
System Information
#define CFGTAG_ACCT 0x0008 |
User Account
#define CFGTAG_MAX 0x0010 |
Maxiumum number of config tags.
#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 */ |
typedef struct _ci_srvargs CISARGS |
Common service arguments.
All services share this common, base structure.
typedef struct _ci_client CI_CLIENT |
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()).
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.
[in] | hCfg | Handle to configuration |
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)
.
[in] | hCfg | Handle to configuration to set as default, or NULL to clear default. |
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().
int CfgLoad | ( | void * | hCfg, |
int | Size, | ||
unsigned char * | pData | ||
) |
Load a config from a linear memory block.
[in,out] | hCfg | Handle to configuration |
[in] | Size | Size of memory block to load |
[in] | pData | Pointer to memory block to load |
int CfgSave | ( | void * | hCfg, |
int * | pSize, | ||
unsigned char * | pData | ||
) |
Save a config to a linear memory block.
[in] | hCfg | Handle to configuration |
[in,out] | pSize | Pointer to size of memory block |
[in] | pData | Pointer to memory block to load |
hCfg
into the linear block of memory pointed to by pData
.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.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.pSize
will be set to the required size)int CfgSetExecuteOrder | ( | void * | hCfg, |
uint32_t | Tags, | ||
uint32_t * | pOpenOrder, | ||
uint32_t * | pCloseOrder | ||
) |
Set the Tag initialization and shutdown order on execute.
[in] | hCfg | Handle to configuration |
[in] | Tags | Number of Tag values in pOpenOrder and pCloseOder . Must match CFGTAG_MAX. |
[in] | pOpenOrder | Pointer to array of Tag values in init order |
[in] | pCloseOrder | Pointer to array of Tag values in shutdown order |
pOpenOrder
) and shut down (specified in pCloseOder
).int CfgExecute | ( | void * | hCfg, |
uint32_t | fExecute | ||
) |
Set the execution state (active/inactive) of the config.
[in] | hCfg | Handle to configuration |
[in] | fExecute | Desired execute state (1 = active) |
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.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.int CfgSetService | ( | void * | hCfg, |
uint32_t | Tag, | ||
int(*)(void *, uint32_t, uint32_t, uint32_t, void *) | pCb | ||
) |
Set service callback for configuration Tag.
[in] | hCfg | Handle to configuration |
[in] | Tag | Tag value to set callback for |
[in] | pCb | Pointer to service callback function |
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).pCb
should return 1 on success, 0 on pass, and <0 on error.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.
[in] | hCfg | Handle to configuration |
[in] | Tag | Tag value of new entry |
[in] | Item | Item value of new entry |
[in] | Mode | Mode flags for how to add entry |
[in] | Size | Size of entry pointed to by pData |
[in] | pData | Pointer to entry data |
[in,out] | phCfgEntry | Pointer to storage for the handle to the new configuration entry. |
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.phCfgEntry
, when supplied.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.Mode
parameter. The default behavior when adding an object is as follows:Tag
and Item
values are allowed.Tag
, Item
, Size
, and pData
contents are ignored.Tag
, Item
, and entry data). Requests to add duplicates are normally ignored.int CfgRemoveEntry | ( | void * | hCfg, |
void * | hCfgEntry | ||
) |
Remove config entry from configuration by handle.
[in] | hCfg | Handle to configuration |
[in] | hCfgEntry | Configuration entry to remove |
hCfgEntry
is not dereferenced in the event of an error.int CfgGetEntryCnt | ( | void * | hCfg, |
uint32_t | Tag, | ||
uint32_t | Item | ||
) |
Get the number of entry instances for a Tag/Item pair.
[in] | hCfg | Handle to configuration |
[in] | Tag | Tag value of entry |
[in] | Item | Item value of entry |
Tag
and Item
parameters and returns the number of instances found.int CfgGetEntry | ( | void * | hCfg, |
uint32_t | Tag, | ||
uint32_t | Item, | ||
uint32_t | Index, | ||
void ** | phCfgEntry | ||
) |
Get configuration entry from configuration.
[in] | hCfg | Handle to configuration |
[in] | Tag | Tag value of entry |
[in] | Item | Item value of entry |
[in] | Index | Instance index to get (1 to n) |
[in,out] | phCfgEntry | Optional pointer to location to store config entry handle |
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().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).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.int CfgGetNextEntry | ( | void * | hCfg, |
void * | hCfgEntry, | ||
void ** | phCfgEntryNext | ||
) |
Get the next entry instance matching the supplied entry handle.
[in] | hCfg | Handle to configuration |
[in] | hCfgEntry | Handle to last configuration entry |
[in,out] | phCfgEntryNext | Optional pointer to receive handle to next config entry |
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.phCfgEntryNext
is NULL, no entry handle is returned, but the function always returns 1 if such an entry was found and 0 when not.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.hCfgEntry
is not dereferenced in the event of an error.int CfgGetImmediate | ( | void * | hCfg, |
uint32_t | Tag, | ||
uint32_t | Item, | ||
uint32_t | Index, | ||
int | Size, | ||
unsigned char * | pData | ||
) |
Get config entry data.
[in] | hCfg | Handle to configuration |
[in] | Tag | Tag value of entry |
[in] | Item | Item value of entry |
[in] | Index | Instance index to get (1 to n) |
[in] | Size | Size of buffer to receive data |
[in,out] | pData | Pointer to data buffer to receive data |
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().pData
.Size
) was not large enough to hold the dataint CfgEntryRef | ( | void * | hCfgEntry | ) |
Add a reference to a configuration entry handle.
[in] | hCfgEntry | Handle to configuration entry |
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.int CfgEntryDeRef | ( | void * | hCfgEntry | ) |
Remove a reference to a config entry handle.
[in] | hCfgEntry | Handle to configuration entry |
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.int CfgEntryGetData | ( | void * | hCfgEntry, |
int * | pSize, | ||
unsigned char * | pData | ||
) |
Get configuration entry data.
[in] | hCfgEntry | Handle to configuration entry |
[in,out] | pSize | Pointer to size of data buffer in pData |
[in,out] | pData | Pointer to data buffer |
hCfgEntry
.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.pSize
will be set to required size)int CfgEntrySetData | ( | void * | hCfgEntry, |
int | Size, | ||
unsigned char * | pData | ||
) |
Set/reset configuration entry data.
[in] | hCfgEntry | Handle to configuration entry |
[in] | Size | Size of data buffer in pData |
[in] | pData | Pointer to data buffer |
hCfgEntry
.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.int CfgEntryInfo | ( | void * | hCfgEntry, |
int * | pSize, | ||
unsigned char ** | ppData | ||
) |
Get information on a configuration entry.
[in] | hCfgEntry | Handle to configuration entry |
[in,out] | pSize | Pointer to receive the size of the config entry data buffer |
[in,out] | ppData | Location to receive the pointer to the config* entry data buffer |
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.