www.beck-ipc.com

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


PPP_Server_SetOptions

Set PPP options for the PPP server.

int PPP_Server_SetOptions ( const PPP_Option far *ptr );

Parameters

ptr

Pointer to an array of PPP_Option type data structures (defined in tcpipapi.h).

Return Value

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

Comments

It is only possible to set PPP options when the PPP server is suspended.   (PPP server status reported by PPP_Server_GetStatus must be 1.)   Setting options when the PPP server is active (states 2, 3, 4 and 5) does not have any effect.   The installed options take affect when the PPP server is activated.   If you want to reset the options, call this function with a null ptr parameter.

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;

static 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, but do no request for it.
  { PPP_IPCP_PROTOCOL, PPP_OPTION_ALLOW, PPP_IPCP_DNS_PRI,
	 (const char *)&DNS_Pri_IP, sizeof(DNS_Pri_IP)},

  // Allow remote to peer to set secondary DNS IP, but do no request for it.
  { PPP_IPCP_PROTOCOL, PPP_OPTION_ALLOW, PPP_IPCP_DNS_SEC,
	 (const char *)&DNS_Sec_IP, sizeof(DNS_Sec_IP)},

  { 0, 0, 0, NULL, 0}   // End of array marker
} ;

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

PPP_Server_Suspend(20);                 // Suspend the PPP server
// Install option with CLIB function
PPP_Server_SetOptions(&My_Options[0]);  // point to first member of array

PPP_Server_Activate(20);                // Activate

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.03V1.00V1.00V0.90

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


End of document