/branches/network/uspace/srv/net/app/parse.h |
---|
38,8 → 38,8 |
#define __NET_APP_PARSE__ |
/** Prints the parameter unrecognized message and the application help. |
* @param index The index of the parameter. Input parameter. |
* @param parameter The parameter name. Input parameter. |
* @param[in] index The index of the parameter. |
* @param[in] parameter The parameter name. |
*/ |
void print_unrecognized( int index, const char * parameter ); |
46,12 → 46,12 |
/** Parses the next parameter as an integral number. |
* The actual parameter is pointed by the index. |
* Parses the offseted actual parameter value if the offset is set or the next one if not. |
* @param argc The total number of the parameters. Input parameter. |
* @param argv The parameters. Input parameter. |
* @param index The actual parameter index. The index is incremented by the number of processed parameters. Input/output parameter. |
* @param value The parsed parameter value. Output parameter. |
* @param name The parameter name to be printed on errors. Input parameter. |
* @param offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. Input parameter. |
* @param[in] argc The total number of the parameters. |
* @param[in] argv The parameters. |
* @param[in,out] index The actual parameter index. The index is incremented by the number of processed parameters. |
* @param[out] value The parsed parameter value. |
* @param[in] name The parameter name to be printed on errors. |
* @param[in] offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. |
* @returns EOK on success. |
* @returns EINVAL if the parameter is missing. |
* @returns EINVAL if the parameter is in wrong format. |
62,12 → 62,12 |
* The actual parameter is pointed by the index. |
* Uses the offseted actual parameter value if the offset is set or the next one if not. |
* Increments the actual index by the number of processed parameters. |
* @param argc The total number of the parameters. Input parameter. |
* @param argv The parameters. Input parameter. |
* @param index The actual parameter index. The index is incremented by the number of processed parameters. Input/output parameter. |
* @param value The parsed parameter value. Output parameter. |
* @param name The parameter name to be printed on errors. Input parameter. |
* @param offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. Input parameter. |
* @param[in] argc The total number of the parameters. |
* @param[in] argv The parameters. |
* @param[in,out] index The actual parameter index. The index is incremented by the number of processed parameters. |
* @param[out] value The parsed parameter value. |
* @param[in] name The parameter name to be printed on errors. |
* @param[in] offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. |
* @returns EOK on success. |
* @returns EINVAL if the parameter is missing. |
*/ |
78,13 → 78,13 |
* Uses the offseted actual parameter if the offset is set or the next one if not. |
* Translates the parameter using the parse_value function. |
* Increments the actual index by the number of processed parameters. |
* @param argc The total number of the parameters. Input parameter. |
* @param argv The parameters. Input parameter. |
* @param index The actual parameter index. The index is incremented by the number of processed parameters. Input/output parameter. |
* @param value The parsed parameter value. Output parameter. |
* @param name The parameter name to be printed on errors. Input parameter. |
* @param offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. Input parameter. |
* @param parse_value The translation function to parse the named value. |
* @param[in] argc The total number of the parameters. |
* @param[in] argv The parameters. |
* @param[in,out] index The actual parameter index. The index is incremented by the number of processed parameters. |
* @param[out] value The parsed parameter value. |
* @param[in] name The parameter name to be printed on errors. |
* @param[in] offset The value offset in the actual parameter. If not set, the next parameter is parsed instead. |
* @param[in] parse_value The translation function to parse the named value. |
* @returns EOK on success. |
* @returns EINVAL if the parameter is missing. |
* @returns ENOENT if the parameter name has not been found. |
/branches/network/uspace/srv/net/app/nettest1/nettest1.c |
---|
60,8 → 60,8 |
/** Module entry point. |
* Starts testing. |
* @param argc The number of command line parameters. Input parameter. |
* @param argv The command line parameters. Input parameter. |
* @param[in] argc The number of command line parameters. |
* @param[in] argv The command line parameters. |
* @returns EOK on success. |
*/ |
int main( int argc, char * argv[] ); |
71,7 → 71,7 |
void print_help( void ); |
/** Translates the character string to the protocol family number. |
* @param name The protocol family name. Input parameter. |
* @param[in] name The protocol family name. |
* @returns The corresponding protocol family number. |
* @returns EPFNOSUPPORTED if the protocol family is not supported. |
*/ |
78,7 → 78,7 |
int parse_protocol_family( const char * name ); |
/** Translates the character string to the socket type number. |
* @param name The socket type name. Input parameter. |
* @param[in] name The socket type name. |
* @returns The corresponding socket type number. |
* @returns ESOCKNOSUPPORTED if the socket type is not supported. |
*/ |
86,17 → 86,17 |
/** Refreshes the data. |
* Fills the data block with the NETTEST1_TEXT pattern. |
* @param data The data block. Output parameter. |
* @param size The data block size in bytes. Input parameter |
* @param[out] data The data block. |
* @param[in] size The data block size in bytes. |
*/ |
void refresh_data( char * data, size_t size ); |
/** Creates new sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field to store the socket identifiers. Output parameter. |
* @param sockets The number of sockets to create. Should be at most the size of the field. Input parameter. |
* @param family The socket address family. Input parameter. |
* @param type The socket type. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[out] socket_ids A field to store the socket identifiers. |
* @param[in] sockets The number of sockets to create. Should be at most the size of the field. |
* @param[in] family The socket address family. |
* @param[in] type The socket type. |
* @returns EOK on success. |
* @returns Other error codes as defined for the socket() function. |
*/ |
103,9 → 103,9 |
int sockets_create( int verbose, int * socket_ids, int sockets, int family, sock_type_t type ); |
/** Closes sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @returns EOK on success. |
* @returns Other error codes as defined for the closesocket() function. |
*/ |
112,11 → 112,11 |
int sockets_close( int verbose, int * socket_ids, int sockets ); |
/** Connects sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to connect to. Input parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The destination host address to connect to. |
* @param[in] addrlen The length of the destination address in bytes. |
* @returns EOK on success. |
* @returns Other error codes as defined for the connect() function. |
*/ |
123,14 → 123,14 |
int sockets_connect( int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen ); |
/** Sends data via sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to send data to. Input parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param data The data to be sent. Input parameter. |
* @param size The data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be sent. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The destination host address to send data to. |
* @param[in] addrlen The length of the destination address in bytes. |
* @param[in] data The data to be sent. |
* @param[in] size The data size in bytes. |
* @param[in] messages The number of datagrams per socket to be sent. |
* @returns EOK on success. |
* @returns Other error codes as defined for the sendto() function. |
*/ |
137,14 → 137,14 |
int sockets_sendto( int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages ); |
/** Receives data via sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The source host address of received datagrams. Input parameter. |
* @param addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead. Input/output parameter. |
* @param data The received data. Output parameter. |
* @param size The maximum data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be received. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The source host address of received datagrams. |
* @param[in,out] addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead. |
* @param[out] data The received data. |
* @param[in] size The maximum data size in bytes. |
* @param[in] messages The number of datagrams per socket to be received. |
* @returns EOK on success. |
* @returns Other error codes as defined for the recvfrom() function. |
*/ |
153,14 → 153,14 |
/** 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. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to send data to. The source host address of received datagrams is set instead. Input/output parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param data The data to be sent. The received data are set instead. Input/output parameter. |
* @param size The data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be received. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in,out] address The destination host address to send data to. The source host address of received datagrams is set instead. |
* @param[in] addrlen The length of the destination address in bytes. |
* @param[in,out] data The data to be sent. The received data are set instead. |
* @param[in] size The data size in bytes. |
* @param[in] messages The number of datagrams per socket to be received. |
* @returns EOK on success. |
* @returns Other error codes as defined for the recvfrom() function. |
*/ |
168,7 → 168,7 |
/** Prints a mark. |
* If the index is a multiple of ten, a different mark is printed. |
* @param index The index of the mark to be printed. Input parameter. |
* @param[in] index The index of the mark to be printed. |
*/ |
void print_mark( int index ); |
/branches/network/uspace/srv/net/app/nettest2/nettest2.c |
---|
60,8 → 60,8 |
/** Module entry point. |
* Starts testing. |
* @param argc The number of command line parameters. Input parameter. |
* @param argv The command line parameters. Input parameter. |
* @param[in] argc The number of command line parameters. |
* @param[in] argv The command line parameters. |
* @returns EOK on success. |
*/ |
int main( int argc, char * argv[] ); |
71,7 → 71,7 |
void print_help( void ); |
/** Translates the character string to the protocol family number. |
* @param name The protocol family name. Input parameter. |
* @param[in] name The protocol family name. |
* @returns The corresponding protocol family number. |
* @returns EPFNOSUPPORTED if the protocol family is not supported. |
*/ |
78,7 → 78,7 |
int parse_protocol_family( const char * name ); |
/** Translates the character string to the socket type number. |
* @param name The socket type name. Input parameter. |
* @param[in] name The socket type name. |
* @returns The corresponding socket type number. |
* @returns ESOCKNOSUPPORTED if the socket type is not supported. |
*/ |
86,17 → 86,17 |
/** Refreshes the data. |
* Fills the data block with the NETTEST1_TEXT pattern. |
* @param data The data block. Output parameter. |
* @param size The data block size in bytes. Input parameter |
* @param[out] data The data block. |
* @param[in] size The data block size in bytes. |
*/ |
void refresh_data( char * data, size_t size ); |
/** Creates new sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field to store the socket identifiers. Output parameter. |
* @param sockets The number of sockets to create. Should be at most the size of the field. Input parameter. |
* @param family The socket address family. Input parameter. |
* @param type The socket type. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[out] socket_ids A field to store the socket identifiers. |
* @param[in] sockets The number of sockets to create. Should be at most the size of the field. |
* @param[in] family The socket address family. |
* @param[in] type The socket type. |
* @returns EOK on success. |
* @returns Other error codes as defined for the socket() function. |
*/ |
103,9 → 103,9 |
int sockets_create( int verbose, int * socket_ids, int sockets, int family, sock_type_t type ); |
/** Closes sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @returns EOK on success. |
* @returns Other error codes as defined for the closesocket() function. |
*/ |
112,11 → 112,11 |
int sockets_close( int verbose, int * socket_ids, int sockets ); |
/** Connects sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to connect to. Input parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The destination host address to connect to. |
* @param[in] addrlen The length of the destination address in bytes. |
* @returns EOK on success. |
* @returns Other error codes as defined for the connect() function. |
*/ |
123,14 → 123,14 |
int sockets_connect( int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen ); |
/** Sends data via sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to send data to. Input parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param data The data to be sent. Input parameter. |
* @param size The data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be sent. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The destination host address to send data to. |
* @param[in] addrlen The length of the destination address in bytes. |
* @param[in] data The data to be sent. |
* @param[in] size The data size in bytes. |
* @param[in] messages The number of datagrams per socket to be sent. |
* @returns EOK on success. |
* @returns Other error codes as defined for the sendto() function. |
*/ |
137,14 → 137,14 |
int sockets_sendto( int verbose, int * socket_ids, int sockets, struct sockaddr * address, socklen_t addrlen, char * data, int size, int messages ); |
/** Receives data via sockets. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The source host address of received datagrams. Input parameter. |
* @param addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead. Input/output parameter. |
* @param data The received data. Output parameter. |
* @param size The maximum data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be received. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in] address The source host address of received datagrams. |
* @param[in,out] addrlen The maximum length of the source address in bytes. The actual size of the source address is set instead. |
* @param[out] data The received data. |
* @param[in] size The maximum data size in bytes. |
* @param[in] messages The number of datagrams per socket to be received. |
* @returns EOK on success. |
* @returns Other error codes as defined for the recvfrom() function. |
*/ |
153,14 → 153,14 |
/** 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. |
* @param verbose A value indicating whether to print out verbose information. Input parameter. |
* @param socket_ids A field of stored socket identifiers. Input parameter. |
* @param sockets The number of sockets in the field. Should be at most the size of the field. Input parameter. |
* @param address The destination host address to send data to. The source host address of received datagrams is set instead. Input/output parameter. |
* @param addrlen The length of the destination address in bytes. Input parameter. |
* @param data The data to be sent. The received data are set instead. Input/output parameter. |
* @param size The data size in bytes. Input parameter |
* @param messages The number of datagrams per socket to be received. Input parameter. |
* @param[in] verbose A value indicating whether to print out verbose information. |
* @param[in] socket_ids A field of stored socket identifiers. |
* @param[in] sockets The number of sockets in the field. Should be at most the size of the field. |
* @param[in,out] address The destination host address to send data to. The source host address of received datagrams is set instead. |
* @param[in] addrlen The length of the destination address in bytes. |
* @param[in,out] data The data to be sent. The received data are set instead. |
* @param[in] size The data size in bytes. |
* @param[in] messages The number of datagrams per socket to be received. |
* @returns EOK on success. |
* @returns Other error codes as defined for the recvfrom() function. |
*/ |
168,7 → 168,7 |
/** Prints a mark. |
* If the index is a multiple of ten, a different mark is printed. |
* @param index The index of the mark to be printed. Input parameter. |
* @param[in] index The index of the mark to be printed. |
*/ |
void print_mark( int index ); |
/branches/network/uspace/srv/net/app/print_error.h |
---|
38,13 → 38,13 |
#define __NET_APP_PRINT__ |
/** Returns whether the error code may be an ICMP error code. |
* @param error_code The error code. Input parameter. |
* @param[in] error_code The error code. |
* @returns A value indicating whether the error code may be an ICMP error code. |
*/ |
#define IS_ICMP_ERROR( error_code ) (( error_code ) > 0 ) |
/** Returns whether the error code may be socket error code. |
* @param error_code The error code. Input parameter. |
* @param[in] error_code The error code. |
* @returns A value indicating whether the error code may be a socket error code. |
*/ |
#define IS_SOCKET_ERROR( error_code ) (( error_code ) < 0 ) |
51,26 → 51,26 |
/** Prints the error description. |
* Supports ICMP and socket error codes. |
* @param output The description output stream. May be NULL. Input parameter. |
* @param error_code The error code. Input parameter. |
* @param prefix The error description prefix. May be NULL. Input parameter. |
* @param suffix The error description suffix. May be NULL. Input parameter. |
* @param[in] output The description output stream. May be NULL. |
* @param[in] error_code The error code. |
* @param[in] prefix The error description prefix. May be NULL. |
* @param[in] suffix The error description suffix. May be NULL. |
*/ |
void print_error( FILE * output, int error_code, const char * prefix, const char * suffix ); |
/** Prints the specific ICMP error description. |
* @param output The description output stream. May be NULL. Input parameter. |
* @param error_code The ICMP error code. Input parameter. |
* @param prefix The error description prefix. May be NULL. Input parameter. |
* @param suffix The error description suffix. May be NULL. Input parameter. |
* @param[in] output The description output stream. May be NULL. |
* @param[in] error_code The ICMP error code. |
* @param[in] prefix The error description prefix. May be NULL. |
* @param[in] suffix The error description suffix. May be NULL. |
*/ |
void icmp_print_error( FILE * output, int error_code, const char * prefix, const char * suffix ); |
/** Prints the specific socket error description. |
* @param output The description output stream. May be NULL. Input parameter. |
* @param error_code The socket error code. Input parameter. |
* @param prefix The error description prefix. May be NULL. Input parameter. |
* @param suffix The error description suffix. May be NULL. Input parameter. |
* @param[in] output The description output stream. May be NULL. |
* @param[in] error_code The socket error code. |
* @param[in] prefix The error description prefix. May be NULL. |
* @param[in] suffix The error description suffix. May be NULL. |
*/ |
void socket_print_error( FILE * output, int error_code, const char * prefix, const char * suffix ); |
/branches/network/uspace/srv/net/app/ping/ping.c |
---|
58,8 → 58,8 |
/** Module entry point. |
* Reads command line parameters and pings. |
* @param argc The number of command line parameters. Input parameter. |
* @param argv The command line parameters. Input parameter. |
* @param[in] argc The number of command line parameters. |
* @param[in] argv The command line parameters. |
* @returns EOK on success. |
*/ |
int main( int argc, char * argv[] ); |
69,7 → 69,7 |
void print_help( void ); |
/** Translates the character string to the address family number. |
* @param name The address family name. Input parameter. |
* @param[in] name The address family name. |
* @returns The corresponding address family number. |
* @returns EAFNOSUPPORTED if the address family is not supported. |
*/ |
/branches/network/uspace/srv/net/app/echo/echo.c |
---|
56,8 → 56,8 |
/** Module entry point. |
* Reads command line parameters and starts listenning. |
* @param argc The number of command line parameters. Input parameter. |
* @param argv The command line parameters. Input parameter. |
* @param[in] argc The number of command line parameters. |
* @param[in] argv The command line parameters. |
* @returns EOK on success. |
*/ |
int main( int argc, char * argv[] ); |
64,23 → 64,23 |
/** Prints the application help. |
*/ |
void print_help( void ); |
void echo_print_help( void ); |
/** Translates the character string to the protocol family number. |
* @param name The protocol family name. Input parameter. |
* @param[in] name The protocol family name. |
* @returns The corresponding protocol family number. |
* @returns EPFNOSUPPORTED if the protocol family is not supported. |
*/ |
int parse_protocol_family( const char * name ); |
int echo_parse_protocol_family( const char * name ); |
/** Translates the character string to the socket type number. |
* @param name The socket type name. Input parameter. |
* @param[in] name The socket type name. |
* @returns The corresponding socket type number. |
* @returns ESOCKNOSUPPORTED if the socket type is not supported. |
*/ |
int parse_socket_type( const char * name ); |
int echo_parse_socket_type( const char * name ); |
void print_help( void ){ |
void echo_print_help( void ){ |
printf( |
"Network Echo aplication\n" \ |
"Usage: echo [options]\n" \ |
114,7 → 114,7 |
); |
} |
int parse_protocol_family( const char * name ){ |
int echo_parse_protocol_family( const char * name ){ |
if( str_lcmp( name, "PF_INET", 7 ) == 0 ){ |
return PF_INET; |
}else if( str_lcmp( name, "PF_INET6", 8 ) == 0 ){ |
123,7 → 123,7 |
return EPFNOSUPPORT; |
} |
int parse_socket_type( const char * name ){ |
int echo_parse_socket_type( const char * name ){ |
if( str_lcmp( name, "SOCK_DGRAM", 11 ) == 0 ){ |
return SOCK_DGRAM; |
}else if( str_lcmp( name, "SOCK_STREAM", 12 ) == 0 ){ |
170,9 → 170,9 |
break; |
case 'c': ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & count, "message count", 0 )); |
break; |
case 'f': ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & family, "protocol family", 0, parse_protocol_family )); |
case 'f': ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & family, "protocol family", 0, echo_parse_protocol_family )); |
break; |
case 'h': print_help(); |
case 'h': echo_print_help(); |
return EOK; |
break; |
case 'p': ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & value, "port number", 0 )); |
183,7 → 183,7 |
case 's': ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & value, "receive size", 0 )); |
size = (value >= 0 ) ? ( size_t ) value : 0; |
break; |
case 't': ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & value, "socket type", 0, parse_socket_type )); |
case 't': ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & value, "socket type", 0, echo_parse_socket_type )); |
type = ( sock_type_t ) value; |
break; |
case 'v': verbose = 1; |
193,9 → 193,9 |
}else if( str_lcmp( argv[ index ] + 2, "count=", 6 ) == 0 ){ |
ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & count, "message count", 8 )); |
}else if( str_lcmp( argv[ index ] + 2, "family=", 7 ) == 0 ){ |
ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & family, "protocol family", 9, parse_protocol_family )); |
ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & family, "protocol family", 9, echo_parse_protocol_family )); |
}else if( str_lcmp( argv[ index ] + 2, "help", 5 ) == 0 ){ |
print_help(); |
echo_print_help(); |
return EOK; |
}else if( str_lcmp( argv[ index ] + 2, "port=", 5 ) == 0 ){ |
ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & value, "port number", 7 )); |
206,24 → 206,24 |
ERROR_PROPAGATE( parse_parameter_int( argc, argv, & index, & value, "receive size", 7 )); |
size = (value >= 0 ) ? ( size_t ) value : 0; |
}else if( str_lcmp( argv[ index ] + 2, "type=", 5 ) == 0 ){ |
ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & value, "socket type", 7, parse_socket_type )); |
ERROR_PROPAGATE( parse_parameter_name_int( argc, argv, & index, & value, "socket type", 7, echo_parse_socket_type )); |
type = ( sock_type_t ) value; |
}else if( str_lcmp( argv[ index ] + 2, "verbose", 8 ) == 0 ){ |
verbose = 1; |
}else{ |
print_unrecognized( index, argv[ index ] + 2 ); |
print_help(); |
echo_print_help(); |
return EINVAL; |
} |
break; |
default: |
print_unrecognized( index, argv[ index ] + 1 ); |
print_help(); |
echo_print_help(); |
return EINVAL; |
} |
}else{ |
print_unrecognized( index, argv[ index ] ); |
print_help(); |
echo_print_help(); |
return EINVAL; |
} |
} |