Requesting Services

After the stack is initialized and enabled, the application can obtain protocol services using the API function lgo_Open(). Services are identified to lgo_Open() by name. A service name is a user-defined string of up to 31 characters (without embedded tabs or spaces). The names are stored in the service database where each name is associated with the description of the protocol service it represents. (See The Service database in the LayGO Configuration Manual for more information.) If lgo_Open() finds a valid entry in the service database and succeeds in allocating resources for the service, it returns a Connection Identifier (CID) which the application uses to manipulate the protocol service.

When a service is opened, it receives the default configuration defined for the layer. After being opened, it can be reconfigured using lgo_SetConfiguration(). (The current configuration profile can be retrieved using lgo_GetConfiguration()). Preset configuration profiles created using edcfg can also be loaded from disk using lgo_LoadConfiguration(). These functions allow the application to configure each service independently of others using the same protocol.

The structures describing the configuration data for each protocol is found in a file with a name of the form xxxx_api.h where xxxx is a protocol abbreviation, such as pkt for the X.25 packet layer.