Network Developers Kit API
3.76.00.05
|
Common service arguments. More...
#include <netcfg.h>
Data Fields | |
uint32_t | Item |
void * | hService |
uint32_t | Mode |
uint32_t | Status |
uint32_t | ReportCode |
uint32_t | IfIdx |
uint32_t | IPAddr |
void(* | pCbSrv )(uint32_t Item, uint32_t Status, uint32_t Code, void *hCfgEntry) |
Common service arguments.
All services share this common, base structure.
uint32_t _ci_srvargs::Item |
This is a copy of the Item value used when the entry is added to the configuration. Its initial value should be NULL, but it is overwritten by the service provider callback. It is used so that the status callback function can be provided with the original Item value.
void* _ci_srvargs::hService |
This is the handle to the service as returned by the NETTOOLS function corresponding to the type of service requested. Its initial value should be NULL, and it is initialized by the service callback function when the service is started. The value is needed to shut down the service when the configuration is unloaded.
uint32_t _ci_srvargs::Mode |
The mode parameter is a collection of flags representing the desired execution behavior of the service. One or more of the following flags can be set:
IfIdx
field is valid.IfIdx
be resolved to an IP address before service execution is initiated.uint32_t _ci_srvargs::Status |
The status parameter contains the service status as detected by the Net Control service callback function that initiates the service with NETTOOLS. The value of status should be initialized to NULL. Its defined values are:
uint32_t _ci_srvargs::ReportCode |
All the services available via the configuration can also be launched directly via a NETTOOLS API. The NETTOOLS service API has a standard service reporting callback function that is mirrored by the configuration system via the Net Control service provider callback. This variable holds the last report code reported by the NETTOOLS service invoked by this configuration entry.
uint32_t _ci_srvargs::IfIdx |
This is the physical device Index (1 to n) on which the service is to be executed. For example, when launching a DHCP server service, the physical interface is that connected to the home network. For more generic services (like Telnet), the service can be launched by a pre-defined IP address (or INADDR_ANY as a wildcard). When launching by IP address only, this field is left NULL. If the field is valid, the CIS_FLG_IFIDXVALID flag should be set in Mode
.
uint32_t _ci_srvargs::IPAddr |
This is the IP address (in network format) on which to initiate the service. This IP address can specify the wildcard INADDR_ANY, in which case the service will accept connections to any valid IP address on any device. Note that some services (like DHCP server) do not support being launched by an IP address and require a device Index (supplied in IfIdx
) on which to execute.
Callback for status changes
Item | Item value of entry changed |
Status | New status |
Code | Report code (if any) |
hCfgEntry | Non-referenced pointer to entry with status change |
Status
is the same as the Status
field described in the CISARGS structure.Code
is that returned by the NETTOOLS service callback, which is a lower-level status callback function used by Net Control.