Changeset 7ae3d6f in mainline for uspace/app/nettest1/nettest.h


Ignore:
Timestamp:
2010-11-03T20:27:45Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4057f5
Parents:
49d819b4 (diff), b445803 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jakub/helenos/net.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nettest1/nettest.h

    r49d819b4 r7ae3d6f  
    2828
    2929/** @addtogroup nettest
    30  *  @{
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  Networking test support functions.
     34 * Networking test support functions.
    3535 */
    3636
    37 #ifndef __NET_TEST__
    38 #define __NET_TEST__
     37#ifndef NET_TEST_
     38#define NET_TEST_
    3939
    4040#include <net/socket.h>
    4141
    42 /** Prints a mark.
    43  *  If the index is a multiple of ten, a different mark is printed.
    44  *  @param[in] index The index of the mark to be printed.
    45  */
    46 extern void print_mark(int index);
    47 
    48 /** Creates new sockets.
    49  *  @param[in] verbose A value indicating whether to print out verbose information.
    50  *  @param[out] socket_ids A field to store the socket identifiers.
    51  *  @param[in] sockets The number of sockets to create. Should be at most the size of the field.
    52  *  @param[in] family The socket address family.
    53  *  @param[in] type The socket type.
    54  *  @returns EOK on success.
    55  *  @returns Other error codes as defined for the socket() function.
    56  */
    57 extern int sockets_create(int verbose, int * socket_ids, int sockets, int family, sock_type_t type);
    58 
    59 /** Closes sockets.
    60  *  @param[in] verbose A value indicating whether to print out verbose information.
    61  *  @param[in] socket_ids A field of stored socket identifiers.
    62  *  @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
    63  *  @returns EOK on success.
    64  *  @returns Other error codes as defined for the closesocket() function.
    65  */
    66 extern int sockets_close(int verbose, int * socket_ids, int sockets);
    67 
    68 /** Connects sockets.
    69  *  @param[in] verbose A value indicating whether to print out verbose information.
    70  *  @param[in] socket_ids A field of stored socket identifiers.
    71  *  @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
    72  *  @param[in] address The destination host address to connect to.
    73  *  @param[in] addrlen The length of the destination address in bytes.
    74  *  @returns EOK on success.
    75  *  @returns Other error codes as defined for the connect() function.
    76  */
    77 extern int sockets_connect(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen);
    78 
    79 /** Sends data via sockets.
    80  *  @param[in] verbose A value indicating whether to print out verbose information.
    81  *  @param[in] socket_ids A field of stored socket identifiers.
    82  *  @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
    83  *  @param[in] address The destination host address to send data to.
    84  *  @param[in] addrlen The length of the destination address in bytes.
    85  *  @param[in] data The data to be sent.
    86  *  @param[in] size The data size in bytes.
    87  *  @param[in] messages The number of datagrams per socket to be sent.
    88  *  @returns EOK on success.
    89  *  @returns Other error codes as defined for the sendto() function.
    90  */
    91 extern int sockets_sendto(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages);
    92 
    93 /** Receives data via sockets.
    94  *  @param[in] verbose A value indicating whether to print out verbose information.
    95  *  @param[in] socket_ids A field of stored socket identifiers.
    96  *  @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
    97  *  @param[in] address The source host address of received datagrams.
    98  *  @param[in,out] addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead.
    99  *  @param[out] data The received data.
    100  *  @param[in] size The maximum data size in bytes.
    101  *  @param[in] messages The number of datagrams per socket to be received.
    102  *  @returns EOK on success.
    103  *  @returns Other error codes as defined for the recvfrom() function.
    104  */
    105 extern int sockets_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
    106 
    107 /** Sends and receives data via sockets.
    108  *  Each datagram is sent and a reply read consequently.
    109  *  The next datagram is sent after the reply is received.
    110  *  @param[in] verbose A value indicating whether to print out verbose information.
    111  *  @param[in] socket_ids A field of stored socket identifiers.
    112  *  @param[in] sockets The number of sockets in the field. Should be at most the size of the field.
    113  *  @param[in,out] address The destination host address to send data to. The source host address of received datagrams is set instead.
    114  *  @param[in] addrlen The length of the destination address in bytes.
    115  *  @param[in,out] data The data to be sent. The received data are set instead.
    116  *  @param[in] size The data size in bytes.
    117  *  @param[in] messages The number of datagrams per socket to be received.
    118  *  @returns EOK on success.
    119  *  @returns Other error codes as defined for the recvfrom() function.
    120  */
    121 extern int sockets_sendto_recvfrom(int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t * addrlen, char * data, int size, int messages);
     42extern void print_mark(int);
     43extern int sockets_create(int, int *, int, int, sock_type_t);
     44extern int sockets_close(int, int *, int);
     45extern int sockets_connect(int, int *, int, struct sockaddr *, socklen_t);
     46extern int sockets_sendto(int, int *, int, struct sockaddr *, socklen_t, char *, int, int);
     47extern int sockets_recvfrom(int, int *, int, struct sockaddr *, socklen_t *, char *, int, int);
     48extern int sockets_sendto_recvfrom(int, int *, int, struct sockaddr *, socklen_t *, char *, int, int);
    12249
    12350#endif
     
    12552/** @}
    12653 */
     54
Note: See TracChangeset for help on using the changeset viewer.