## SafeFire PPP

### v1.0

# Sample InfoBus scripts

### Introduction

To show all the features of SafeFire PPP message hook system, we've decided to create set of scripts that can be good samples and useful add-ons at the same time.

This help describe in details how to use sample scripts provided

If you want to create your own scripts, please see General REXX API reference.

### General Information

Here is some notes regarding usage of all scripts:

1. All the scripts can be configured from the configuration file. Usually section name where configuration variables must be stored has the same name as the script itself.

   Example: To configure branch.scr put all variables to the `[branch.scr]` section.

   Note: This is just a naming convention, not a requirement of SafeFire PPP.

2. All sample scripts are stored in the /doc/samples directory. To use script either copy it to the /bin subdirectory or provide full path.

   Note: Scripts that are already used in SafeFire PPP sample configuration files have already copied to /bin sub directory.

3. To use script it must be called. Script can be called either directly or indirectly.

   To setup script to be called directly add following lines to the configuration file:

   > `[plugman]
   > message.hook = Script_Name`

   Note: Only single script can be set up to be called directly. And most sample configuration files already has such a script set. So by using direct call you can loose some functionality.

   To overcome this problem indirect calling can be used. See description of multiscr.scr below to get more information.

### multiscr.scr

This script was created to allow user to call multiple scripts for each InfoBus message.

This script is using variables in the `[multiscr.scr]` section to know what scripts to call.

To add one more script to be called use following variable:

> `script = Script_Name`

There can be multiple instances of such a variable in the sections. Scripts will be called in the same order they have been specified. If script is specified multiple times it will be called exactly same number of times.

Example:

> `[plugman]
> message.hook = multiscr.scr
> [multiscr.scr]
> script = dnshook.scr
> script = branch.scr
> script = user_script.scr`

### branch.scr

This script was created to allow user to call different scripts on defined events like Connect, Disconnect, Timer.

This script is using variables in the `[branch.scr]` section to know what scripts on what events to call.

To set up script to be called on event use following variable:

> `Event = Script_Name`

You can set up single script to be called on multiple events by using multiple variables.

Also you can set up multiple scripts on single event

As Event you can use either message names (see Message Bus reference) or aliases. Both are case insensitive.

List of aliases that are available:

Message Name | Message Alias
--- | ---
MSG_00000001 | TIMER
MSG_00000003 | CONNECT
MSG_00000004 | DISCONNECT
MSG_000000F0 | INIT
MSG_000000F1 | DONE

Example:

> `[plugman]
> message.hook = branch.scr
> [branch.scr]
> Connect = processconnect.scr
> Disconnect = processconnect.scr
> Init = dnshook.cmd
> Done = dnshook.cmd
> MSG_00000063 = dnshook.cmd
> MSG_00000064 = dnshook.cmd
> `

### dnshook.cmd

This script has been created to set up OS/2 domain name services for the connect time. It can use both auto detected and user defined name server addresses.

This script is using variables in the `[dnshook.cmd]` section to know what scripts on what events to call.

It uses following configuration variables:

1. domain

   > This variables specifies you domain name (usually `company.com` or `provider.net`).

   > Default value is `your.domain.com`

   > Note: default value provided only for reference and should be replaced with real domain name!

   > Since domain name is used by some programs (Netscape Communicator for example) you are encouraged to fill in this variable.

   > If you don't know what to fill in, either ask your network administrator, provider or use domain name part of your e-mail address.

   > Example: If you e-mail address is john@company.com fill in company.com as domain name.

2. detectdns

   > This variable specifies if dnshook will use detected domain servers. Set this variable to 0 if you has problems with domain servers detection.

   > Note: You must either fill in static domain server variable or disable dnshook.cmd if domain server auto detection is not working or disabled to use server names (you can still use IP addresses even with non-functioning domain name resolving).

3. server

   > Specify static name server addresses using this variable. You can specify multiple static name server addresses using multiple server variables.

   > Note:Yet you can use both static and detected name server addresses at one time, detected servers will have priority and will be used first. Only if detected servers are not available, static server addresses will be used. You can change this behavior by changing dnshook.cmd.

Example:

> `[dnshook.cmd]
> domain=my.domain.com
> detectdns=1
> server=198.41.0.4
> server=128.9.0.107
> server=192.33.4.12
> `

Note: If you don't know any static name server addresses and auto detection is not working, try using addresses from the example above. This are addresses of real existing core name servers from Internet domain name system.

Return to documentation index | SafeFire PPP (C) Link Guard Solutions 1999, 2000