| # ITK Programmer's Guide
Table of contents | Intro | General | TCP Low Level | TCP High Level | UDP | DNS | PPP Encoding/Decoding | Internet Config | Goodies | Cryptography & SSL | Appendix
Chapter 7 : PPP control routines
Chapter contents: | ITK_PPPStatus ITK_PPPOpen ITK_PPPClose
About this chapter... | This chapter describes PPP related routines that can be used to control the PPP layers.
Note: | PPP routines are only supported in the Windows version of ITK starting with ITK v2.0.3. PPP routine are compatible with OT/PPP, ARA 3.0 and FreePPP v2.6 and above. Under Windows, be aware that milti-link miltihoming allows several different links to connect to remote hosts (for example one Ethernet card, and one PPP link thru a modem). Under Windows, ITK_PPPOpen will use the default "Dialup Networking" setup and the current user login/password to connect. you can specify a different phonenumber, login and password if needed. Under MacOS, the current PPP setup will be used.

ITK_PPPStatus
Syntax: | result := ITK_PPPStatus
Description: | Returns the current status of PPP.
Params: |
In/Out | Parameter | Type |  | Example or note
<- | result | Longint | Current PPP status | 0 = not connected 1 = connected negative = PPP not installed
Example: |
    If (ITK_PPPStatus=0) ` PPP not connected
      $err := ITK_PPPOpen ` open PPP connection with current phonenumber, login and password
      If ($err = 0)
        ...
        If (ITK_PPPStatus=1) ` still connected via PPP ?
          ITK_PPPClose
        End If
      End If
    End If

Back to top

ITK_PPPOpen
Syntax: | result := ITK_PPPOpen (phoneNum; login; password)
Description: | Opens PPP connection.
Params: |
In/Out | Parameter | Type |  | Example or note
-> | phoneNum | String | PPP Server phonenumber to call | Only used in the Windows version. If empty, the default phonenumber in the "Dialup Networking" setup will be used.
-> | login | String | Login to use | Only used in the Windows version. If empty, the current Windows user login will be used automatically.
-> | password | String | Password to use | Only used in the Windows version. If empty, the current Windows user password will be used automatically.
<- | result | Longint | Result code | 0 = no error negative result = error (not connected)
Example: |
    If (ITK_PPPStatus=0) ` PPP not connected
      $err := ITK_PPPOpen ` open PPP connection with current phonenumber, login and password
      If ($err = 0)
        ...
        If (ITK_PPPStatus=1) ` still connected via PPP ?
          ITK_PPPClose
        End If
      End If
    End If

Back to top

ITK_PPPClose
Syntax: | result := ITK_PPPClose (closeType)
Description: | Closes PPP connection. The parameter can be used to specify hard or soft close.
Params: |
In/Out | Parameter | Type |  | Example or note
-> | closeType | Longint | Type of close (hard or soft). | 0 = soft close 1 = hard close
<- | result | Longint | Result code | Currently always returns 0
Example: |
    If (ITK_PPPStatus=0) ` PPP not connected
      $err := ITK_PPPOpen ` open PPP connection with current phonenumber, login and password
      If ($err = 0)
        ...
        If (ITK_PPPStatus=1) ` still connected via PPP ?
          ITK_PPPClose
                 End If
      End If
    End If

Back to top

CQ/22-June-1999