ce/ip.h File Reference

Definitions of IP protocol oriented functions. More...

Go to the source code of this file.

Enumerations

enum  t_ip_err {
  IP_OK = 0, IP_PARAM, IP_INIT, IP_SOCK,
  IP_SETSOCKOPT, IP_BIND, IP_SEND
}
 Errors returned by routines in the IP module. More...

Functions

short ip_init ()
 Initializes the Windows IP stack.
void ip_cleanup ()
 Releases the Windows IP stack.
t_ip_err ip_udpbcsend (const char *aString, unsigned int aPort)
 Sends the given message as UDP to the given port on localhost.
t_ip_err ip_udpbcprint (unsigned int aPort, const char *anFmt,...)
 Sends a formated string the given UDP port on localhost.


Detailed Description

Definitions of IP protocol oriented functions.


Enumeration Type Documentation

enum t_ip_err

Errors returned by routines in the IP module.

Enumerator:
IP_OK  Everything is OK.
IP_PARAM  Wrong parameter in the function call
IP_INIT  WSA initialization error.
IP_SOCK  Unable to create socket.
IP_SETSOCKOPT  Setsockopt call failed for enabling broadcast option.
IP_BIND  Unable to bind the socket.
IP_SEND  Unable to send message.


Function Documentation

void ip_cleanup (  ) 

Releases the Windows IP stack.

Calls WSACleanup if the stack has been initialized.

short ip_init (  ) 

Initializes the Windows IP stack.

Calls WSAStartup if not called yet.

Returns:
0 on error, != 0 on success.

t_ip_err ip_udpbcprint ( unsigned int  aPort,
const char *  anFmt,
  ... 
)

Sends a formated string the given UDP port on localhost.

Like ip_udpbcsend, but printf-like string formating can be used.

Parameters:
aPort UDP port to send the message to.
Returns:
IP_OK or error message.

t_ip_err ip_udpbcsend ( const char *  aString,
unsigned int  aPort 
)

Sends the given message as UDP to the given port on localhost.

Parameters:
aString the message to send.
aPort UDP port to send the message to.
Returns:
IP_OK or error message.


Generated on Mon Jul 12 14:51:51 2010 for cetoys by  doxygen 1.5.6