Changeset 50c06df in mainline for uspace/lib
- Timestamp:
- 2011-01-21T13:07:18Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7d540c8
- Parents:
- e2b1548 (diff), 5d00e40 (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. - Location:
- uspace/lib
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/icmp_common.c
re2b1548 r50c06df 27 27 */ 28 28 29 /** @addtogroup libc 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 38 38 #include <net/modules.h> 39 39 #include <net/icmp_common.h> 40 41 40 #include <ipc/services.h> 42 41 #include <ipc/icmp.h> 43 44 42 #include <sys/time.h> 45 43 #include <async.h> 46 44 47 /** Connect sto the ICMP module.45 /** Connect to the ICMP module. 48 46 * 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 * 54 53 */ 55 int icmp_connect_module(s ervices_t service, suseconds_t timeout)54 int icmp_connect_module(suseconds_t timeout) 56 55 { 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); 64 57 } 65 58 -
uspace/lib/c/include/adt/hash_table.h
re2b1548 r50c06df 41 41 typedef unsigned long hash_count_t; 42 42 typedef 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. */ 45 typedef 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; 45 73 46 74 /** Hash table structure. */ 47 struct hash_table{75 typedef struct { 48 76 link_t *entry; 49 77 hash_count_t entries; 50 78 hash_count_t max_keys; 51 79 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; 80 81 81 82 #define hash_table_get_instance(item, type, member) \ -
uspace/lib/c/include/ipc/icmp.h
re2b1548 r50c06df 33 33 /** @file 34 34 * ICMP module messages. 35 * @see icmp_ interface.h35 * @see icmp_remote.h 36 36 */ 37 37 … … 48 48 /** ICMP module messages. */ 49 49 typedef enum { 50 /** Send secho request. @see icmp_echo() */50 /** Send echo request. @see icmp_echo() */ 51 51 NET_ICMP_ECHO = NET_ICMP_FIRST, 52 52 53 53 /** 54 * Send sdestination unreachable error message.54 * Send destination unreachable error message. 55 55 * @see icmp_destination_unreachable_msg() 56 56 */ … … 58 58 59 59 /** 60 * Send ssource quench error message.60 * Send source quench error message. 61 61 * @see icmp_source_quench_msg() 62 62 */ … … 64 64 65 65 /** 66 * Send stime exceeded error message.66 * Send time exceeded error message. 67 67 * @see icmp_time_exceeded_msg() 68 68 */ … … 70 70 71 71 /** 72 * Send sparameter problem error message.72 * Send parameter problem error message. 73 73 * @see icmp_parameter_problem_msg() 74 74 */ 75 NET_ICMP_PARAMETERPROB, 76 77 /** Initializes new connection. */ 78 NET_ICMP_INIT 79 } icmp_messages; 75 NET_ICMP_PARAMETERPROB 76 } icmp_messages_t; 80 77 81 78 /** @name ICMP specific message parameters definitions */ -
uspace/lib/c/include/net/icmp_common.h
re2b1548 r50c06df 41 41 #include <sys/time.h> 42 42 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 45 45 46 extern int icmp_connect_module(s ervices_t, suseconds_t);46 extern int icmp_connect_module(suseconds_t); 47 47 48 48 #endif -
uspace/lib/net/include/icmp_header.h
re2b1548 r50c06df 45 45 46 46 /** ICMP header size in bytes. */ 47 #define ICMP_HEADER_SIZE sizeof(icmp_header_t) 48 49 /** Type definition of the echo specific data. 50 * @see icmp_echo 51 */ 52 typedef struct icmp_echo icmp_echo_t; 47 #define ICMP_HEADER_SIZE sizeof(icmp_header_t) 53 48 54 49 /** Echo specific data. */ 55 struct icmp_echo {50 typedef struct icmp_echo { 56 51 /** Message idintifier. */ 57 52 icmp_param_t identifier; 58 53 /** Message sequence number. */ 59 54 icmp_param_t sequence_number; 60 } __attribute__ ((packed)); 61 62 /** Type definition of the internet control message header. 63 * @see icmp_header 64 */ 65 typedef struct icmp_header icmp_header_t; 55 } __attribute__((packed)) icmp_echo_t; 66 56 67 57 /** Internet control message header. */ 68 struct icmp_header {58 typedef struct icmp_header { 69 59 /** The type of the message. */ 70 60 uint8_t type; … … 83 73 */ 84 74 uint16_t checksum; 85 75 86 76 /** Message specific data. */ 87 77 union { 88 78 /** Echo specific data. */ 89 icmp_echo_t 79 icmp_echo_t echo; 90 80 /** Proposed gateway value. */ 91 81 in_addr_t gateway; … … 107 97 } param; 108 98 } un; 109 } __attribute__ ((packed));99 } __attribute__((packed)) icmp_header_t; 110 100 111 101 #endif -
uspace/lib/net/include/icmp_remote.h
re2b1548 r50c06df 27 27 */ 28 28 29 /** @addtogroup libnet 29 /** @addtogroup libnet 30 30 * @{ 31 31 */ 32 32 33 #ifndef LIBNET_ICMP_ INTERFACE_H_34 #define LIBNET_ICMP_ INTERFACE_H_33 #ifndef LIBNET_ICMP_REMOTE_H_ 34 #define LIBNET_ICMP_REMOTE_H_ 35 35 36 36 #include <net/socket_codes.h> … … 54 54 extern int icmp_source_quench_msg(int, packet_t *); 55 55 extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t *); 56 extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, packet_t *); 56 extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, 57 packet_t *); 57 58 58 59 /*@}*/ -
uspace/lib/net/include/tl_skel.h
re2b1548 r50c06df 61 61 extern int tl_initialize(int net_phone); 62 62 63 /** Per-connection module initialization. 64 * 65 * This has to be implemented in user code. 66 * 67 */ 68 extern void tl_connection(void); 69 63 70 /** Process the transport layer module message. 64 71 * … … 74 81 * 75 82 */ 76 extern int tl_m odule_message(ipc_callid_t, ipc_call_t *,83 extern int tl_message(ipc_callid_t, ipc_call_t *, 77 84 ipc_call_t *, size_t *); 78 85 -
uspace/lib/net/tl/icmp_remote.c
re2b1548 r50c06df 33 33 /** @file 34 34 * ICMP interface implementation for remote modules. 35 * @see icmp_ interface.h35 * @see icmp_remote.h 36 36 */ 37 37 38 #include <icmp_ interface.h>38 #include <icmp_remote.h> 39 39 #include <net/modules.h> 40 40 #include <packet_client.h> -
uspace/lib/net/tl/tl_common.c
re2b1548 r50c06df 27 27 */ 28 28 29 /** @addtogroup libnet 29 /** @addtogroup libnet 30 30 * @{ 31 31 */ … … 39 39 #include <packet_client.h> 40 40 #include <packet_remote.h> 41 #include <icmp_ interface.h>41 #include <icmp_remote.h> 42 42 #include <ip_remote.h> 43 43 #include <ip_interface.h> -
uspace/lib/net/tl/tl_skel.c
re2b1548 r50c06df 56 56 ipc_answer_0(iid, EOK); 57 57 58 /* Per-connection initialization */ 59 tl_connection(); 60 58 61 while (true) { 59 62 ipc_call_t answer; … … 68 71 69 72 /* Process the message */ 70 int res = tl_module_message(callid, &call, &answer, 71 &count); 73 int res = tl_message(callid, &call, &answer, &count); 72 74 73 75 /* -
uspace/lib/usb/src/recognise.c
re2b1548 r50c06df 203 203 uint8_t cur_descr_len = current_descriptor[0]; 204 204 uint8_t cur_descr_type = current_descriptor[1]; 205 206 if (cur_descr_len == 0) { 207 return ENOENT; 208 } 205 209 206 210 position += cur_descr_len;
Note:
See TracChangeset
for help on using the changeset viewer.