Networking tests
[Applications]

Collaboration diagram for Networking tests:

Files

file  nettest.c
 

Networking test support functions implementation.


file  nettest.h
 

Networking test support functions.


file  nettest1.c
 

Networking test 1 application - sockets.


file  nettest2.c
 

Networking test 2 application - transfer.


Defines

#define NAME   "Nettest1"
 Echo module name.
#define NETTEST1_TEXT   "Networking test 1 - sockets"
 Packet data pattern.
#define NAME   "Nettest2"
 Echo module name.
#define NETTEST2_TEXT   "Networking test 2 - transfer"
 Packet data pattern.

Functions

int sockets_create (int verbose, int *socket_ids, int sockets, int family, sock_type_t type)
 Creates new sockets.
int sockets_close (int verbose, int *socket_ids, int sockets)
 Closes sockets.
int sockets_connect (int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t addrlen)
 Connects sockets.
int sockets_sendto (int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t addrlen, char *data, int size, int messages)
 Sends data via sockets.
int sockets_recvfrom (int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t *addrlen, char *data, int size, int messages)
 Receives data via sockets.
int sockets_sendto_recvfrom (int verbose, int *socket_ids, int sockets, struct sockaddr *address, socklen_t *addrlen, char *data, int size, int messages)
 Sends and receives data via sockets.
void print_mark (int index)
 Prints a mark.
int main (int argc, char *argv[])
 Module entry point.
void nettest1_print_help (void)
 Prints the application help.
void nettest1_refresh_data (char *data, size_t size)
 Refreshes the data.
void nettest2_print_help (void)
 Prints the application help.
void nettest2_refresh_data (char *data, size_t size)
 Refreshes the data.

Define Documentation

#define NAME   "Nettest2"

Echo module name.

#define NAME   "Nettest1"

Echo module name.

#define NETTEST1_TEXT   "Networking test 1 - sockets"

Packet data pattern.

Referenced by nettest1_refresh_data().

#define NETTEST2_TEXT   "Networking test 2 - transfer"

Packet data pattern.

Referenced by nettest2_refresh_data().


Function Documentation

int main ( int  argc,
char *  argv[] 
)
void nettest1_print_help ( void   ) 

Prints the application help.

void nettest1_refresh_data ( char *  data,
size_t  size 
)

Refreshes the data.

Fills the data block with the NETTEST1_TEXT pattern.

Parameters:
[out] data The data block.
[in] size The data block size in bytes.

References NETTEST1_TEXT.

void nettest2_print_help ( void   ) 

Prints the application help.

Referenced by main().

Here is the caller graph for this function:

void nettest2_refresh_data ( char *  data,
size_t  size 
)

Refreshes the data.

Fills the data block with the NETTEST1_TEXT pattern.

Parameters:
[out] data The data block.
[in] size The data block size in bytes.

References NETTEST2_TEXT.

Referenced by main().

Here is the caller graph for this function:

void print_mark ( int  index  ) 

Prints a mark.

If the index is a multiple of ten, a different mark is printed.

Parameters:
[in] index The index of the mark to be printed.
int sockets_close ( int  verbose,
int *  socket_ids,
int  sockets 
)

Closes sockets.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[in] socket_ids A field of stored socket identifiers.
[in] sockets The number of sockets in the field. Should be at most the size of the field.
Returns:
EOK on success.
Other error codes as defined for the closesocket() function.

Referenced by main().

Here is the caller graph for this function:

int sockets_connect ( int  verbose,
int *  socket_ids,
int  sockets,
struct sockaddr address,
socklen_t  addrlen 
)

Connects sockets.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[in] socket_ids A field of stored socket identifiers.
[in] sockets The number of sockets in the field. Should be at most the size of the field.
[in] address The destination host address to connect to.
[in] addrlen The length of the destination address in bytes.
Returns:
EOK on success.
Other error codes as defined for the connect() function.

Referenced by main().

Here is the caller graph for this function:

int sockets_create ( int  verbose,
int *  socket_ids,
int  sockets,
int  family,
sock_type_t  type 
)

Creates new sockets.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[out] socket_ids A field to store the socket identifiers.
[in] sockets The number of sockets to create. Should be at most the size of the field.
[in] family The socket address family.
[in] type The socket type.
Returns:
EOK on success.
Other error codes as defined for the socket() function.

Referenced by main().

Here is the caller graph for this function:

int sockets_recvfrom ( int  verbose,
int *  socket_ids,
int  sockets,
struct sockaddr address,
socklen_t addrlen,
char *  data,
int  size,
int  messages 
)

Receives data via sockets.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[in] socket_ids A field of stored socket identifiers.
[in] sockets The number of sockets in the field. Should be at most the size of the field.
[in] address The source host address of received datagrams.
[in,out] addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead.
[out] data The received data.
[in] size The maximum data size in bytes.
[in] messages The number of datagrams per socket to be received.
Returns:
EOK on success.
Other error codes as defined for the recvfrom() function.

Referenced by main().

Here is the caller graph for this function:

int sockets_sendto ( int  verbose,
int *  socket_ids,
int  sockets,
struct sockaddr address,
socklen_t  addrlen,
char *  data,
int  size,
int  messages 
)

Sends data via sockets.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[in] socket_ids A field of stored socket identifiers.
[in] sockets The number of sockets in the field. Should be at most the size of the field.
[in] address The destination host address to send data to.
[in] addrlen The length of the destination address in bytes.
[in] data The data to be sent.
[in] size The data size in bytes.
[in] messages The number of datagrams per socket to be sent.
Returns:
EOK on success.
Other error codes as defined for the sendto() function.

Referenced by main().

Here is the caller graph for this function:

int sockets_sendto_recvfrom ( int  verbose,
int *  socket_ids,
int  sockets,
struct sockaddr address,
socklen_t addrlen,
char *  data,
int  size,
int  messages 
)

Sends and receives data via sockets.

Each datagram is sent and a reply read consequently. The next datagram is sent after the reply is received.

Parameters:
[in] verbose A value indicating whether to print out verbose information.
[in] socket_ids A field of stored socket identifiers.
[in] sockets The number of sockets in the field. Should be at most the size of the field.
[in,out] address The destination host address to send data to. The source host address of received datagrams is set instead.
[in] addrlen The length of the destination address in bytes.
[in,out] data The data to be sent. The received data are set instead.
[in] size The data size in bytes.
[in] messages The number of datagrams per socket to be received.
Returns:
EOK on success.
Other error codes as defined for the recvfrom() function.

Referenced by main().

Here is the caller graph for this function:


Generated on Thu Mar 11 20:48:19 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1