Network Developers Kit API 3.61.01.01

Data Fields
_ci_srvargs Struct Reference
Configuration Manager

Common service arguments. More...

`#include <netcfg.h>`

Collaboration diagram for _ci_srvargs:

## 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)

## Detailed Description

Common service arguments.

All services share this common, base structure.

## Field Documentation

## § Item

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.

## § hService

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.

## § Mode

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:

- CIS_FLG_IFIDXVALID: Specifies the `IfIdx` field is valid.
- CIS_FLG_RESOLVEIP: Requests that `IfIdx` be resolved to an IP address before service execution is initiated.
- CIS_FLG_CALLBYIP: Specifies that the service should be invoked by IP address. (This is the default behavior when CIS_FLG_IFIDXVALID is not set, but this flag can be set with CIS_FLG_IFIDXVALID when CIS_FLG_RESOLVEIP is also set. If CIS_FLG_IFIDXVALID is set and this bit is not set, the service is invoked by physical device.)
- CIS_FLG_RESTARTIPTERM: A service that is dependent on a valid IP address (as determined by the CIS_FLG_RESOLVEIP flag) is shut down if the IP address becomes invalid. When this flag is set, the service will be restarted when a new address becomes available. Otherwise; the service will not be restarted.

## § Status

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:

- CIS_SRV_STATUS_DISABLED: Service not active (NULL state)
- CIS_SRV_STATUS_WAIT: Net Control is waiting on IP resolution to start service CIS_SRV_STATUS_IPTERM: Service was terminated because it lost its IP address
- CIS_SRV_STATUS_FAILED: Service failed to initialize via its NETTOOLS open function
- CIS_SRV_STATUS_ENABLED: Service enabled and initialized properly

## § ReportCode

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.

## § IfIdx

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`.

## § IPAddr

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.

## § pCbSrv

void(* _ci_srvargs::pCbSrv) (uint32_t Item, uint32_t Status, uint32_t Code, void *hCfgEntry)

Callback for status changes

Parameters

  Item | Item value of entry changed
  Status | New status
  Code | Report code (if any)
  hCfgEntry | Non-referenced pointer to entry with status change

Note
  `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.

The documentation for this struct was generated from the following file:

- ti/ndk/inc/nettools/netcfg.h

© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale