www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - TCP/IP API


PPP_Client_SetOptions

Set PPP options for the PPP client.

int PPP_Client_SetOptions ( const PPP_Option far *ptr );

Parameters

ptr

Pointer to an array of PPP_Option type data structures

Return Value

-3 : PPP Connection already established
-2 : PPP client is not installed
-1 : Invalid Option(s)
0   : Success

Comments

If you want to use this function, you have to call it before opening a connection.   Setting options during an established connection does not work!    The settings are only valid for the next established connection.   While establishing a connection the PPP_Option structure referenced by the ptr parameter must remain valid.   After the PPP_Client_Open function is finished, the structure can then be released.

The array of data structures at ptr is terminated by the first structure encountered with a NULL optionValuePtr member.

            
// Simplified C-Example:
unsigned int  ipcp_comp   = 1;
unsigned long DNS_Pri_IP  = 0L;
unsigned long DNS_Sec_IP  = 0L;

PPP_Option My_Options[] = {

  // Allow remote to peer to use VJ TCPIP header compression.
  { PPP_IPCP_PROTOCOL, PPP_OPTION_ALLOW, PPP_IPCP_COMP_PROTOCOL,
	  (const char *)&ipcp_comp, sizeof(ipcp_comp)},

  // Allow remote to peer to set primary DNS IP.
  { PPP_IPCP_PROTOCOL, PPP_OPTION_WANT, PPP_IPCP_DNS_PRI,
	  (const char *)&DNS_Pri_IP, sizeof(DNS_Pri_IP)},

  // Allow remote to peer to set secondary DNS IP.
  { PPP_IPCP_PROTOCOL, PPP_OPTION_WANT, PPP_IPCP_DNS_SEC,
	  (const char *)&DNS_Sec_IP, sizeof(DNS_Sec_IP)},

  // Terminate list of options.
  { 0, 0, 0, NULL, 0}
} ;

//***** call the functions like this ****

// Install option with CLIB function
PPP_Client_SetOptions(&My_Options[0]);  // Point to first member of array

PPP_Client_Open(&pppclient);           // Open the connection

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    V1.02V1.00V1.00V0.90

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document