Changes in uspace/app/nettest1/nettest.h [3d459fc:849ed54] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nettest1/nettest.h
r3d459fc r849ed54 28 28 29 29 /** @addtogroup nettest 30 * @{30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * Networking test support functions.34 * Networking test support functions. 35 35 */ 36 36 37 #ifndef NET_TEST_38 #define NET_TEST_37 #ifndef __NET_TEST__ 38 #define __NET_TEST__ 39 39 40 #include < net/socket.h>40 #include <socket.h> 41 41 42 extern void print_mark(int); 43 extern int sockets_create(int, int *, int, int, sock_type_t); 44 extern int sockets_close(int, int *, int); 45 extern int sockets_connect(int, int *, int, struct sockaddr *, socklen_t); 46 extern int sockets_sendto(int, int *, int, struct sockaddr *, socklen_t, char *, int, int); 47 extern int sockets_recvfrom(int, int *, int, struct sockaddr *, socklen_t *, char *, int, int); 48 extern int sockets_sendto_recvfrom(int, int *, int, struct sockaddr *, socklen_t *, char *, int, int); 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); 49 122 50 123 #endif … … 52 125 /** @} 53 126 */ 54
Note:
See TracChangeset
for help on using the changeset viewer.