Changeset 5d00e40 in mainline for uspace/lib/c


Ignore:
Timestamp:
2011-01-21T12:55:13Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50c06df, 85d0cf8, aa9f0a4
Parents:
d08abdb7 (diff), 7e36c8d (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 mainline changes

Location:
uspace/lib/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/icmp_common.c

    rd08abdb7 r5d00e40  
    2727 */
    2828
    29 /** @addtogroup libc 
     29/** @addtogroup libc
    3030 *  @{
    3131 */
     
    3838#include <net/modules.h>
    3939#include <net/icmp_common.h>
    40 
    4140#include <ipc/services.h>
    4241#include <ipc/icmp.h>
    43 
    4442#include <sys/time.h>
    4543#include <async.h>
    4644
    47 /** Connects to the ICMP module.
     45/** Connect to the ICMP module.
    4846 *
    49  * @param service       The ICMP module service. Ignored parameter.
    50  * @param[in] timeout   The connection timeout in microseconds. No timeout if
    51  *                      set to zero.
    52  * @return              The ICMP module phone on success.
    53  * @return              ETIMEOUT if the connection timeouted.
     47 * @param[in] timeout Connection timeout in microseconds, zero
     48 *                    for no timeout.
     49 *
     50 * @return ICMP module phone on success.
     51 * @return ETIMEOUT if the connection timeouted.
     52 *
    5453 */
    55 int icmp_connect_module(services_t service, suseconds_t timeout)
     54int icmp_connect_module(suseconds_t timeout)
    5655{
    57         int phone;
    58 
    59         phone = connect_to_service_timeout(SERVICE_ICMP, timeout);
    60         if (phone >= 0)
    61                 async_req_0_0(phone, NET_ICMP_INIT);
    62 
    63         return phone;
     56        return connect_to_service_timeout(SERVICE_ICMP, timeout);
    6457}
    6558
  • uspace/lib/c/include/adt/hash_table.h

    rd08abdb7 r5d00e40  
    4141typedef unsigned long hash_count_t;
    4242typedef unsigned long hash_index_t;
    43 typedef struct hash_table hash_table_t;
    44 typedef struct hash_table_operations hash_table_operations_t;
     43
     44/** Set of operations for hash table. */
     45typedef struct {
     46        /** Hash function.
     47         *
     48         * @param key Array of keys needed to compute hash index.
     49         *            All keys must be passed.
     50         *
     51         * @return Index into hash table.
     52         *
     53         */
     54        hash_index_t (*hash)(unsigned long key[]);
     55       
     56        /** Hash table item comparison function.
     57         *
     58         * @param key Array of keys that will be compared with item. It is
     59         *            not necessary to pass all keys.
     60         *
     61         * @return True if the keys match, false otherwise.
     62         *
     63         */
     64        int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
     65       
     66        /** Hash table item removal callback.
     67         *
     68         * @param item Item that was removed from the hash table.
     69         *
     70         */
     71        void (*remove_callback)(link_t *item);
     72} hash_table_operations_t;
    4573
    4674/** Hash table structure. */
    47 struct hash_table {
     75typedef struct {
    4876        link_t *entry;
    4977        hash_count_t entries;
    5078        hash_count_t max_keys;
    5179        hash_table_operations_t *op;
    52 };
    53 
    54 /** Set of operations for hash table. */
    55 struct hash_table_operations {
    56         /** Hash function.
    57          *
    58          * @param key   Array of keys needed to compute hash index. All keys
    59          *              must be passed.
    60          *
    61          * @return      Index into hash table.
    62          */
    63         hash_index_t (* hash)(unsigned long key[]);
    64        
    65         /** Hash table item comparison function.
    66          *
    67          * @param key   Array of keys that will be compared with item. It is
    68          *              not necessary to pass all keys.
    69          *
    70          * @return      true if the keys match, false otherwise.
    71          */
    72         int (*compare)(unsigned long key[], hash_count_t keys, link_t *item);
    73 
    74         /** Hash table item removal callback.
    75          *
    76          * @param item  Item that was removed from the hash table.
    77          */
    78         void (*remove_callback)(link_t *item);
    79 };
     80} hash_table_t;
    8081
    8182#define hash_table_get_instance(item, type, member) \
  • uspace/lib/c/include/ipc/icmp.h

    rd08abdb7 r5d00e40  
    3333/** @file
    3434 * ICMP module messages.
    35  * @see icmp_interface.h
     35 * @see icmp_remote.h
    3636 */
    3737
     
    4848/** ICMP module messages. */
    4949typedef enum {
    50         /** Sends echo request. @see icmp_echo() */
     50        /** Send echo request. @see icmp_echo() */
    5151        NET_ICMP_ECHO = NET_ICMP_FIRST,
    5252       
    5353        /**
    54          * Sends destination unreachable error message.
     54         * Send destination unreachable error message.
    5555         * @see icmp_destination_unreachable_msg()
    5656         */
     
    5858       
    5959        /**
    60          * Sends source quench error message.
     60         * Send source quench error message.
    6161         * @see icmp_source_quench_msg()
    6262         */
     
    6464       
    6565        /**
    66          * Sends time exceeded error message.
     66         * Send time exceeded error message.
    6767         * @see icmp_time_exceeded_msg()
    6868         */
     
    7070       
    7171        /**
    72          * Sends parameter problem error message.
     72         * Send parameter problem error message.
    7373         * @see icmp_parameter_problem_msg()
    7474         */
    75         NET_ICMP_PARAMETERPROB,
    76        
    77         /** Initializes new connection. */
    78         NET_ICMP_INIT
    79 } icmp_messages;
     75        NET_ICMP_PARAMETERPROB
     76} icmp_messages_t;
    8077
    8178/** @name ICMP specific message parameters definitions */
  • uspace/lib/c/include/net/icmp_common.h

    rd08abdb7 r5d00e40  
    4141#include <sys/time.h>
    4242
    43 /** Default timeout for incoming connections in microseconds. */
    44 #define ICMP_CONNECT_TIMEOUT    (1 * 1000 * 1000)
     43/** Default timeout for incoming connections in microseconds (1 sec). */
     44#define ICMP_CONNECT_TIMEOUT  1000000
    4545
    46 extern int icmp_connect_module(services_t, suseconds_t);
     46extern int icmp_connect_module(suseconds_t);
    4747
    4848#endif
Note: See TracChangeset for help on using the changeset viewer.