Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Communications Channel Functions


Functions

DLL_EXPORT_NAME vpn_error_t
CDECLAPI 
vpn_channel_init (vpn_channel_t *channel, uint32_t *msgtypes, const struct vpn_callback_table *callbacks)
 initialize a communications channel to the VPN service component
DLL_EXPORT_NAME vpn_error_t
CDECLAPI 
vpn_channel_destroy (vpn_channel_t channel)
 destroy the communictations channel
DLL_EXPORT_NAME SOCKET CDECLAPI vpn_channel_get_socket (vpn_channel_t channel)
 retreives a OS-level descriptor for the channel.
DLL_EXPORT_NAME vpn_error_t
CDECLAPI 
vpn_channel_event (vpn_channel_t channel)
 event handling function
DLL_EXPORT_NAME vpn_error_t
CDECLAPI 
vpn_process_events (vpn_channel_t channel, unsigned int max_wait)
 simplified event handling function
DLL_EXPORT_NAME uint32_t CDECLAPI vpn_channel_get_msgtypes (vpn_channel_t channel)
 retrieve msgtypes flags that were set in call to vpn_channel_init()

Detailed Description

types of messages that client wants to send/recieve

Function Documentation

DLL_EXPORT_NAME vpn_error_t CDECLAPI vpn_channel_destroy vpn_channel_t  channel  ) 
 

destroy the communictations channel

Parameters:
channel will be destroyed by this function.

DLL_EXPORT_NAME vpn_error_t CDECLAPI vpn_channel_event vpn_channel_t  channel  ) 
 

event handling function

call this function when the socket from vpn_channel_get_socket() becomes readable. All calls to callback functions will be made from within this function.

Parameters:
channel 

DLL_EXPORT_NAME uint32_t CDECLAPI vpn_channel_get_msgtypes vpn_channel_t  channel  ) 
 

retrieve msgtypes flags that were set in call to vpn_channel_init()

Parameters:
channel 
Returns:
a bitmask of VPN_MSGTYPES

DLL_EXPORT_NAME SOCKET CDECLAPI vpn_channel_get_socket vpn_channel_t  channel  ) 
 

retreives a OS-level descriptor for the channel.

This descriptor should only be used to initialize an event loop, either with select(), WaitForMultipleObjects() or similar functions

Parameters:
channel 
Returns:
a socket descriptor

DLL_EXPORT_NAME vpn_error_t CDECLAPI vpn_channel_init vpn_channel_t channel,
uint32_t *  msgtypes,
const struct vpn_callback_table callbacks
 

initialize a communications channel to the VPN service component

Parameters:
channel will be set by this function
msgtypes should be set to some of flags above. On return, it will be set to the VPN_MSGTYPEs that can actually be sent.
callbacks should be initialized with pointers to the callback funcitons you want to use

DLL_EXPORT_NAME vpn_error_t CDECLAPI vpn_process_events vpn_channel_t  channel,
unsigned int  max_wait
 

simplified event handling function

this function implements a simple event loop, which calls vpn_channel_event().

this function.

Parameters:
channel 
max_wait maximum time to wait for events.


Generated on Fri Sep 1 14:26:03 2006 for Raptor by  doxygen 1.4.4