www.beck-ipc.com

@CHIP-RTOS C Library V2.00 - 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.)   Settings options when the PPP server is active (state 2,3,4,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 long DNS_Pri_IP  = 0L;   // allow remote to peer to set primary DNS IP, but do no request for it
unsigned long DNS_Sec_IP  = 0L;   // allow remote to peer to set secondary DNS IP , but do no request for it
unsigned int  ipcp_comp   = 1;    // allow remote to peer to use VJ TCPIP header compression

static PPP_Option My_Options[] = {
   { PPP_IPCP_PROTOCOL, PPP_OPTION_ALLOW, PPP_IPCP_COMP_PROTOCOL, (const char *)&ipcp_comp, sizeof(ipcp_comp)},
   { PPP_IPCP_PROTOCOL, PPP_OPTION_ALLOW, PPP_IPCP_DNS_PRI, (const char *)&DNS_Pri_IP, sizeof(DNS_Pri_IP)},
   { 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.


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


End of document