Changeset 849ed54 in mainline for uspace/lib/socket/include
- Timestamp:
- 2010-03-30T18:39:04Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7553689
- Parents:
- 7d6fe4db
- Location:
- uspace/lib/socket/include
- Files:
-
- 32 moved
-
adt/char_map.h (moved) (moved from uspace/srv/net/structures/char_map.h ) (5 diffs)
-
adt/dynamic_fifo.h (moved) (moved from uspace/srv/net/structures/dynamic_fifo.h ) (5 diffs)
-
adt/generic_char_map.h (moved) (moved from uspace/srv/net/structures/generic_char_map.h ) (1 diff)
-
adt/generic_field.h (moved) (moved from uspace/srv/net/structures/generic_field.h )
-
adt/int_map.h (moved) (moved from uspace/srv/net/structures/int_map.h )
-
adt/measured_strings.h (moved) (moved from uspace/srv/net/structures/measured_strings.h ) (6 diffs)
-
icmp_api.h (moved) (moved from uspace/srv/net/include/icmp_api.h ) (2 diffs)
-
icmp_codes.h (moved) (moved from uspace/srv/net/include/icmp_codes.h )
-
icmp_common.h (moved) (moved from uspace/srv/net/include/icmp_common.h ) (1 diff)
-
icmp_messages.h (moved) (moved from uspace/srv/net/tl/icmp/icmp_messages.h ) (1 diff)
-
in.h (moved) (moved from uspace/srv/net/include/in.h ) (1 diff)
-
in6.h (moved) (moved from uspace/srv/net/include/in6.h ) (1 diff)
-
inet.h (moved) (moved from uspace/srv/net/include/inet.h ) (3 diffs)
-
ip_codes.h (moved) (moved from uspace/srv/net/include/ip_codes.h )
-
ip_protocols.h (moved) (moved from uspace/srv/net/include/ip_protocols.h )
-
net_byteorder.h (moved) (moved from uspace/srv/net/include/byteorder.h )
-
net_device.h (moved) (moved from uspace/srv/net/include/device.h ) (1 diff)
-
net_err.h (moved) (moved from uspace/srv/net/err.h )
-
net_messages.h (moved) (moved from uspace/srv/net/messages.h ) (1 diff)
-
net_modules.h (moved) (moved from uspace/srv/net/modules.h ) (8 diffs)
-
netdb.h (moved) (moved from uspace/srv/net/include/netdb.h )
-
packet/packet.h (moved) (moved from uspace/srv/net/structures/packet/packet.h ) (12 diffs)
-
packet/packet_client.h (moved) (moved from uspace/srv/net/structures/packet/packet_client.h ) (14 diffs)
-
packet/packet_header.h (moved) (moved from uspace/srv/net/structures/packet/packet_header.h ) (1 diff)
-
packet/packet_messages.h (moved) (moved from uspace/srv/net/structures/packet/packet_messages.h ) (1 diff)
-
packet/packet_server.h (moved) (moved from uspace/srv/net/structures/packet/packet_server.h ) (1 diff)
-
socket.h (moved) (moved from uspace/srv/net/include/socket.h ) (13 diffs)
-
socket_codes.h (moved) (moved from uspace/srv/net/include/socket_codes.h )
-
socket_core.h (moved) (moved from uspace/srv/net/socket/socket_core.h ) (10 diffs)
-
socket_errno.h (moved) (moved from uspace/srv/net/include/socket_errno.h )
-
socket_messages.h (moved) (moved from uspace/srv/net/socket/socket_messages.h ) (1 diff)
-
tcp_codes.h (moved) (moved from uspace/srv/net/include/tcp_codes.h )
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/socket/include/adt/char_map.h
r7d6fe4db r849ed54 89 89 * @returns Other error codes as defined for the char_map_add_item() function. 90 90 */ 91 int char_map_add(char_map_ref map, const char * identifier, size_t length, const int value);91 extern int char_map_add(char_map_ref map, const char * identifier, size_t length, const int value); 92 92 93 93 /** Clears and destroys the map. 94 94 * @param[in,out] map The character string to integer map. 95 95 */ 96 void char_map_destroy(char_map_ref map);96 extern void char_map_destroy(char_map_ref map); 97 97 98 98 /** Excludes the value assigned to the key from the map. … … 104 104 * @returns CHAR_MAP_NULL if the key is not assigned a value. 105 105 */ 106 int char_map_exclude(char_map_ref map, const char * identifier, size_t length);106 extern int char_map_exclude(char_map_ref map, const char * identifier, size_t length); 107 107 108 108 /** Returns the value assigned to the key from the map. … … 113 113 * @returns CHAR_MAP_NULL if the key is not assigned a value. 114 114 */ 115 int char_map_find(const char_map_ref map, const char * identifier, size_t length);115 extern int char_map_find(const char_map_ref map, const char * identifier, size_t length); 116 116 117 117 /** Initializes the map. … … 121 121 * @returns ENOMEM if there is not enough memory left. 122 122 */ 123 int char_map_initialize(char_map_ref map);123 extern int char_map_initialize(char_map_ref map); 124 124 125 125 /** Adds or updates the value with the key to the map. … … 135 135 * @returns Other error codes as defined for the char_map_add_item() function. 136 136 */ 137 int char_map_update(char_map_ref map, const char * identifier, size_t length, const int value);137 extern int char_map_update(char_map_ref map, const char * identifier, size_t length, const int value); 138 138 139 139 #endif -
uspace/lib/socket/include/adt/dynamic_fifo.h
r7d6fe4db r849ed54 79 79 * @returns ENOMEM if there is not enough memory left. 80 80 */ 81 int dyn_fifo_initialize(dyn_fifo_ref fifo, int size);81 extern int dyn_fifo_initialize(dyn_fifo_ref fifo, int size); 82 82 83 83 /** Appends a new item to the queue end. … … 89 89 * @returns ENOMEM if there is not enough memory left. 90 90 */ 91 int dyn_fifo_push(dyn_fifo_ref fifo, int value, int max_size);91 extern int dyn_fifo_push(dyn_fifo_ref fifo, int value, int max_size); 92 92 93 93 /** Returns and excludes the first item in the queue. … … 97 97 * @returns ENOENT if the queue is empty. 98 98 */ 99 int dyn_fifo_pop(dyn_fifo_ref fifo);99 extern int dyn_fifo_pop(dyn_fifo_ref fifo); 100 100 101 101 /** Returns and keeps the first item in the queue. … … 105 105 * @returns ENOENT if the queue is empty. 106 106 */ 107 int dyn_fifo_value(dyn_fifo_ref fifo);107 extern int dyn_fifo_value(dyn_fifo_ref fifo); 108 108 109 109 /** Clears and destroys the queue. … … 112 112 * @returns EINVAL if the queue is not valid. 113 113 */ 114 int dyn_fifo_destroy(dyn_fifo_ref fifo);114 extern int dyn_fifo_destroy(dyn_fifo_ref fifo); 115 115 116 116 #endif -
uspace/lib/socket/include/adt/generic_char_map.h
r7d6fe4db r849ed54 41 41 #include <unistd.h> 42 42 43 #include "../err.h"43 #include <net_err.h> 44 44 45 #include "char_map.h"46 #include "generic_field.h"45 #include <adt/char_map.h> 46 #include <adt/generic_field.h> 47 47 48 48 /** Internal magic value for a map consistency check. -
uspace/lib/socket/include/adt/measured_strings.h
r7d6fe4db r849ed54 71 71 * @returns NULL if there is not enough memory left. 72 72 */ 73 measured_string_ref measured_string_create_bulk(const char * string, size_t length);73 extern measured_string_ref measured_string_create_bulk(const char * string, size_t length); 74 74 75 75 /** Copies the given measured string with separated header and data parts. … … 79 79 * @returns NULL if there is not enough memory left. 80 80 */ 81 measured_string_ref measured_string_copy(measured_string_ref source);81 extern measured_string_ref measured_string_copy(measured_string_ref source); 82 82 83 83 /** Receives a measured strings array from a calling module. … … 95 95 * @returns Other error codes as defined for the async_data_write_finalize() function. 96 96 */ 97 int measured_strings_receive(measured_string_ref * strings, char ** data, size_t count);97 extern int measured_strings_receive(measured_string_ref * strings, char ** data, size_t count); 98 98 99 99 /** Replies the given measured strings array to a calling module. … … 108 108 * @returns Other error codes as defined for the async_data_read_finalize() function. 109 109 */ 110 int measured_strings_reply(const measured_string_ref strings, size_t count);110 extern int measured_strings_reply(const measured_string_ref strings, size_t count); 111 111 112 112 /** Receives a measured strings array from another module. … … 124 124 * @returns Other error codes as defined for the async_data_read_start() function. 125 125 */ 126 int measured_strings_return(int phone, measured_string_ref * strings, char ** data, size_t count);126 extern int measured_strings_return(int phone, measured_string_ref * strings, char ** data, size_t count); 127 127 128 128 /** Sends the given measured strings array to another module. … … 136 136 * @returns Other error codes as defined for the async_data_write_start() function. 137 137 */ 138 int measured_strings_send(int phone, const measured_string_ref strings, size_t count);138 extern int measured_strings_send(int phone, const measured_string_ref strings, size_t count); 139 139 140 140 #endif -
uspace/lib/socket/include/icmp_api.h
r7d6fe4db r849ed54 40 40 #include <sys/types.h> 41 41 42 #include "device.h" 43 44 #include "../structures/measured_strings.h" 45 #include "../structures/packet/packet.h" 46 47 #include "inet.h" 48 #include "ip_codes.h" 49 #include "socket_codes.h" 50 51 #include "icmp_codes.h" 52 #include "icmp_common.h" 42 #include <net_device.h> 43 #include <adt/measured_strings.h> 44 #include <packet/packet.h> 45 #include <inet.h> 46 #include <ip_codes.h> 47 #include <socket_codes.h> 48 #include <icmp_codes.h> 49 #include <icmp_common.h> 53 50 54 51 /** Miliseconds type definition. … … 79 76 * @returns EPARTY if there was an internal error. 80 77 */ 81 int icmp_echo_msg(int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen);78 extern int icmp_echo_msg(int icmp_phone, size_t size, mseconds_t timeout, ip_ttl_t ttl, ip_tos_t tos, int dont_fragment, const struct sockaddr * addr, socklen_t addrlen); 82 79 83 80 /*@}*/ -
uspace/lib/socket/include/icmp_common.h
r7d6fe4db r849ed54 53 53 * @returns ETIMEOUT if the connection timeouted. 54 54 */ 55 int icmp_connect_module(services_t service, suseconds_t timeout);55 extern int icmp_connect_module(services_t service, suseconds_t timeout); 56 56 57 57 #endif -
uspace/lib/socket/include/icmp_messages.h
r7d6fe4db r849ed54 40 40 41 41 #include <ipc/ipc.h> 42 43 42 #include <sys/types.h> 44 43 45 #include "../../include/icmp_codes.h" 46 47 #include "../../messages.h" 44 #include <icmp_codes.h> 45 #include <net_messages.h> 48 46 49 47 /** ICMP module messages. -
uspace/lib/socket/include/in.h
r7d6fe4db r849ed54 40 40 #include <sys/types.h> 41 41 42 #include "ip_protocols.h"43 #include "inet.h"42 #include <ip_protocols.h> 43 #include <inet.h> 44 44 45 45 /** INET string address maximum length. -
uspace/lib/socket/include/in6.h
r7d6fe4db r849ed54 40 40 #include <sys/types.h> 41 41 42 #include "ip_protocols.h"43 #include "inet.h"42 #include <ip_protocols.h> 43 #include <inet.h> 44 44 45 45 /** INET6 string address maximum length. -
uspace/lib/socket/include/inet.h
r7d6fe4db r849ed54 40 40 #include <sys/types.h> 41 41 42 #include "byteorder.h"42 #include <net_byteorder.h> 43 43 44 44 /** Type definition of the socket address. … … 62 62 * @returns ENOTSUP if the address family is not supported. 63 63 */ 64 int inet_ntop(uint16_t family, const uint8_t * data, char * address, size_t length);64 extern int inet_ntop(uint16_t family, const uint8_t * data, char * address, size_t length); 65 65 66 66 /** Parses the character string into the address. … … 74 74 * @returns ENOTSUP if the address family is not supported. 75 75 */ 76 int inet_pton(uint16_t family, const char * address, uint8_t * data);76 extern int inet_pton(uint16_t family, const char * address, uint8_t * data); 77 77 78 78 /** Socket address. -
uspace/lib/socket/include/net_device.h
r7d6fe4db r849ed54 38 38 #define __NET_DEVICE_ID_TYPE_H__ 39 39 40 #include "../structures/int_map.h"40 #include <adt/int_map.h> 41 41 42 42 /** Device identifier to generic type map declaration. -
uspace/lib/socket/include/net_messages.h
r7d6fe4db r849ed54 43 43 #include <ipc/services.h> 44 44 45 #include "include/device.h" 46 47 #include "structures/measured_strings.h" 48 #include "structures/packet/packet.h" 45 #include <net_device.h> 46 #include <adt/measured_strings.h> 47 #include <packet/packet.h> 49 48 50 49 /** Returns a value indicating whether the value is in the interval. -
uspace/lib/socket/include/net_modules.h
r7d6fe4db r849ed54 70 70 * @param[in] answer_count The number of answer parameters. 71 71 */ 72 void answer_call(ipc_callid_t callid, int result, ipc_call_t * answer, int answer_count);72 extern void answer_call(ipc_callid_t callid, int result, ipc_call_t * answer, int answer_count); 73 73 74 74 /** Creates bidirectional connection with the needed module service and registers the message receiver. … … 81 81 * @returns Other error codes as defined for the ipc_connect_to_me() function. 82 82 */ 83 int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver);83 extern int bind_service(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver); 84 84 85 85 /** Creates bidirectional connection with the needed module service and registers the message receiver. … … 94 94 * @returns Other error codes as defined for the ipc_connect_to_me() function. 95 95 */ 96 int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout);96 extern int bind_service_timeout(services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout); 97 97 98 98 /** Connects to the needed module. … … 100 100 * @returns The phone of the needed service. 101 101 */ 102 int connect_to_service(services_t need);102 extern int connect_to_service(services_t need); 103 103 104 104 /** Connects to the needed module. … … 108 108 * @returns ETIMEOUT if the connection timeouted. 109 109 */ 110 int connect_to_service_timeout(services_t need, suseconds_t timeout);110 extern int connect_to_service_timeout(services_t need, suseconds_t timeout); 111 111 112 112 /** Receives data from the other party. … … 120 120 * @returns Other error codes as defined for the async_data_write_finalize() function. 121 121 */ 122 int data_receive(void ** data, size_t * length);122 extern int data_receive(void ** data, size_t * length); 123 123 124 124 /** Replies the data to the other party. … … 130 130 * @returns Other error codes as defined for the async_data_read_finalize() function. 131 131 */ 132 int data_reply(void * data, size_t data_length);132 extern int data_reply(void * data, size_t data_length); 133 133 134 134 /** Refreshes answer structure and parameters count. … … 137 137 * @param[in,out] answer_count The number of answer parameters. 138 138 */ 139 void refresh_answer(ipc_call_t * answer, int * answer_count);139 extern void refresh_answer(ipc_call_t * answer, int * answer_count); 140 140 141 141 #endif -
uspace/lib/socket/include/packet/packet.h
r7d6fe4db r849ed54 89 89 * @returns NULL if the mapping does not exist. 90 90 */ 91 packet_t pm_find(packet_id_t packet_id);91 extern packet_t pm_find(packet_id_t packet_id); 92 92 93 93 /** Adds the packet mapping. … … 98 98 * @returns ENOMEM if there is not enough memory left. 99 99 */ 100 int pm_add(packet_t packet);100 extern int pm_add(packet_t packet); 101 101 102 102 /** Initializes the packet map. … … 104 104 * @returns ENOMEM if there is not enough memory left. 105 105 */ 106 int pm_init(void);106 extern int pm_init(void); 107 107 108 108 /** Releases the packet map. 109 109 */ 110 void pm_destroy(void);110 extern void pm_destroy(void); 111 111 112 112 /** Add packet to the sorted queue. … … 121 121 * @returns EINVAL if the packet is not valid. 122 122 */ 123 int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric);123 extern int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric); 124 124 125 125 /** Finds the packet with the given order. … … 130 130 * @returns NULL if the packet is not found. 131 131 */ 132 packet_t pq_find(packet_t first, size_t order);132 extern packet_t pq_find(packet_t first, size_t order); 133 133 134 134 /** Inserts packet after the given one. … … 138 138 * @returns EINVAL if etiher of the packets is invalid. 139 139 */ 140 int pq_insert_after(packet_t packet, packet_t new_packet);140 extern int pq_insert_after(packet_t packet, packet_t new_packet); 141 141 142 142 /** Detach the packet from the queue. … … 146 146 * @returns NULL if the packet is not valid. 147 147 */ 148 packet_t pq_detach(packet_t packet);148 extern packet_t pq_detach(packet_t packet); 149 149 150 150 /** Sets the packet order and metric attributes. … … 155 155 * @returns EINVAL if the packet is invalid.. 156 156 */ 157 int pq_set_order(packet_t packet, size_t order, size_t metric);157 extern int pq_set_order(packet_t packet, size_t order, size_t metric); 158 158 159 159 /** Sets the packet order and metric attributes. … … 164 164 * @returns EINVAL if the packet is invalid.. 165 165 */ 166 int pq_get_order(packet_t packet, size_t * order, size_t * metric);166 extern int pq_get_order(packet_t packet, size_t * order, size_t * metric); 167 167 168 168 /** Releases the whole queue. … … 171 171 * @param[in] packet_release The releasing function called for each of the packets after its detachment. 172 172 */ 173 void pq_destroy(packet_t first, void (*packet_release)(packet_t packet));173 extern void pq_destroy(packet_t first, void (*packet_release)(packet_t packet)); 174 174 175 175 /** Returns the next packet in the queue. … … 179 179 * @returns NULL if the packet is not valid. 180 180 */ 181 packet_t pq_next(packet_t packet);181 extern packet_t pq_next(packet_t packet); 182 182 183 183 /** Returns the previous packet in the queue. … … 187 187 * @returns NULL if the packet is not valid. 188 188 */ 189 packet_t pq_previous(packet_t packet);189 extern packet_t pq_previous(packet_t packet); 190 190 191 191 /*@}*/ -
uspace/lib/socket/include/packet/packet_client.h
r7d6fe4db r849ed54 88 88 * @returns NULL if there is not enough memory left. 89 89 */ 90 void * packet_prefix(packet_t packet, size_t length);90 extern void * packet_prefix(packet_t packet, size_t length); 91 91 92 92 /** Allocates the specified space right after the actual packet content and returns its pointer. … … 96 96 * @returns NULL if there is not enough memory left. 97 97 */ 98 void * packet_suffix(packet_t packet, size_t length);98 extern void * packet_suffix(packet_t packet, size_t length); 99 99 100 100 /** Trims the actual packet content by the specified prefix and suffix lengths. … … 106 106 * @returns ENOMEM if there is not enough memory left. 107 107 */ 108 int packet_trim(packet_t packet, size_t prefix, size_t suffix);108 extern int packet_trim(packet_t packet, size_t prefix, size_t suffix); 109 109 110 110 /** Copies the specified data to the beginning of the actual packet content. … … 117 117 * @returns ENOMEM if there is not enough memory left. 118 118 */ 119 int packet_copy_data(packet_t packet, const void * data, size_t length);119 extern int packet_copy_data(packet_t packet, const void * data, size_t length); 120 120 121 121 /** Returns the packet identifier. … … 124 124 * @returns Zero (0) if the packet is not valid. 125 125 */ 126 packet_id_t packet_get_id(const packet_t packet);126 extern packet_id_t packet_get_id(const packet_t packet); 127 127 128 128 /** Returns the packet content length. … … 131 131 * @returns Zero (0) if the packet is not valid. 132 132 */ 133 size_t packet_get_data_length(const packet_t packet);133 extern size_t packet_get_data_length(const packet_t packet); 134 134 135 135 /** Returns the pointer to the beginning of the packet content. … … 138 138 * @returns NULL if the packet is not valid. 139 139 */ 140 void * packet_get_data(const packet_t packet);140 extern void * packet_get_data(const packet_t packet); 141 141 142 142 /** Returns the stored packet addresses and their length. … … 148 148 * @returns EINVAL if the packet is not valid. 149 149 */ 150 int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest);150 extern int packet_get_addr(const packet_t packet, uint8_t ** src, uint8_t ** dest); 151 151 152 152 /** Sets the packet addresses. … … 159 159 * @returns ENOMEM if there is not enough memory left. 160 160 */ 161 int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len);161 extern int packet_set_addr(packet_t packet, const uint8_t * src, const uint8_t * dest, size_t addr_len); 162 162 163 163 /** Translates the packet identifier to the packet reference. … … 172 172 * @returns Other error codes as defined for the packet_return() function. 173 173 */ 174 int packet_translate(int phone, packet_ref packet, packet_id_t packet_id);174 extern int packet_translate(int phone, packet_ref packet, packet_id_t packet_id); 175 175 176 176 /** Obtains the packet of the given dimensions. … … 184 184 * @returns NULL on error. 185 185 */ 186 packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);186 extern packet_t packet_get_4(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix); 187 187 188 188 /** Obtains the packet of the given content size. … … 193 193 * @returns NULL on error. 194 194 */ 195 packet_t packet_get_1(int phone, size_t content);195 extern packet_t packet_get_1(int phone, size_t content); 196 196 197 197 /** Releases the packet queue. … … 202 202 * @param[in] packet_id The packet identifier. 203 203 */ 204 void pq_release(int phone, packet_id_t packet_id);204 extern void pq_release(int phone, packet_id_t packet_id); 205 205 206 206 /** Returns the packet copy. … … 212 212 * @returns NULL on error. 213 213 */ 214 packet_t packet_get_copy(int phone, packet_t packet);214 extern packet_t packet_get_copy(int phone, packet_t packet); 215 215 216 216 /*@}*/ -
uspace/lib/socket/include/packet/packet_header.h
r7d6fe4db r849ed54 38 38 #define __NET_PACKET_HEADER_H__ 39 39 40 #include "packet.h"40 #include <packet/packet.h> 41 41 42 42 /** Returns the actual packet data length. -
uspace/lib/socket/include/packet/packet_messages.h
r7d6fe4db r849ed54 40 40 #include <ipc/ipc.h> 41 41 42 #include "../../messages.h"42 #include <net_messages.h> 43 43 44 44 /** Packet server module messages. -
uspace/lib/socket/include/packet/packet_server.h
r7d6fe4db r849ed54 56 56 * @returns Other error codes as defined for the packet_release_wrapper() function. 57 57 */ 58 int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);58 extern int packet_server_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count); 59 59 60 60 #endif -
uspace/lib/socket/include/socket.h
r7d6fe4db r849ed54 40 40 #define __NET_SOCKET_H__ 41 41 42 #include "byteorder.h" 43 #include "in.h" 44 #include "in6.h" 45 #include "inet.h" 46 47 #include "socket_codes.h" 48 #include "socket_errno.h" 42 #include <net_byteorder.h> 43 #include <in.h> 44 #include <in6.h> 45 #include <inet.h> 46 #include <socket_codes.h> 47 #include <socket_errno.h> 49 48 50 49 /** @name Socket application programming interface … … 65 64 * @returns Other error codes as defined for the bind_service_timeout() function. 66 65 */ 67 int socket(int domain, int type, int protocol);66 extern int socket(int domain, int type, int protocol); 68 67 69 68 /** Binds the socket to a port address. … … 77 76 * @returns Other error codes as defined for the NET_SOCKET_BIND message. 78 77 */ 79 int bind(int socket_id, const struct sockaddr * my_addr, socklen_t addrlen);78 extern int bind(int socket_id, const struct sockaddr * my_addr, socklen_t addrlen); 80 79 81 80 /** Sets the number of connections waiting to be accepted. … … 87 86 * @returns Other error codes as defined for the NET_SOCKET_LISTEN message. 88 87 */ 89 int listen(int socket_id, int backlog);88 extern int listen(int socket_id, int backlog); 90 89 91 90 /** Accepts waiting socket. … … 100 99 * @returns Other error codes as defined for the NET_SOCKET_ACCEPT message. 101 100 */ 102 int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen);101 extern int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen); 103 102 104 103 /** Connects socket to the remote server. … … 112 111 * @returns Other error codes as defined for the NET_SOCKET_CONNECT message. 113 112 */ 114 int connect(int socket_id, const struct sockaddr * serv_addr, socklen_t addrlen);113 extern int connect(int socket_id, const struct sockaddr * serv_addr, socklen_t addrlen); 115 114 116 115 /** Closes the socket. … … 121 120 * @returns Other error codes as defined for the NET_SOCKET_CLOSE message. 122 121 */ 123 int closesocket(int socket_id);122 extern int closesocket(int socket_id); 124 123 125 124 /** Sends data via the socket. … … 134 133 * @returns Other error codes as defined for the NET_SOCKET_SEND message. 135 134 */ 136 int send(int socket_id, void * data, size_t datalength, int flags);135 extern int send(int socket_id, void * data, size_t datalength, int flags); 137 136 138 137 /** Sends data via the socket to the remote address. … … 150 149 * @returns Other error codes as defined for the NET_SOCKET_SENDTO message. 151 150 */ 152 int sendto(int socket_id, const void * data, size_t datalength, int flags, const struct sockaddr * toaddr, socklen_t addrlen);151 extern int sendto(int socket_id, const void * data, size_t datalength, int flags, const struct sockaddr * toaddr, socklen_t addrlen); 153 152 154 153 /** Receives data via the socket. … … 163 162 * @returns Other error codes as defined for the NET_SOCKET_RECV message. 164 163 */ 165 int recv(int socket_id, void * data, size_t datalength, int flags);164 extern int recv(int socket_id, void * data, size_t datalength, int flags); 166 165 167 166 /** Receives data via the socket. … … 178 177 * @returns Other error codes as defined for the NET_SOCKET_RECVFROM message. 179 178 */ 180 int recvfrom(int socket_id, void * data, size_t datalength, int flags, struct sockaddr * fromaddr, socklen_t * addrlen);179 extern int recvfrom(int socket_id, void * data, size_t datalength, int flags, struct sockaddr * fromaddr, socklen_t * addrlen); 181 180 182 181 /** Gets socket option. … … 192 191 * @returns Other error codes as defined for the NET_SOCKET_GETSOCKOPT message. 193 192 */ 194 int getsockopt(int socket_id, int level, int optname, void * value, size_t * optlen);193 extern int getsockopt(int socket_id, int level, int optname, void * value, size_t * optlen); 195 194 196 195 /** Sets socket option. … … 206 205 * @returns Other error codes as defined for the NET_SOCKET_SETSOCKOPT message. 207 206 */ 208 int setsockopt(int socket_id, int level, int optname, const void * value, size_t optlen);207 extern int setsockopt(int socket_id, int level, int optname, const void * value, size_t optlen); 209 208 210 209 /*@}*/ -
uspace/lib/socket/include/socket_core.h
r7d6fe4db r849ed54 40 40 #include <sys/types.h> 41 41 42 #include "../include/in.h" 43 #include "../include/device.h" 44 45 #include "../structures/generic_char_map.h" 46 #include "../structures/dynamic_fifo.h" 47 #include "../structures/int_map.h" 48 #include "../structures/packet/packet.h" 42 #include <in.h> 43 #include <net_device.h> 44 #include <adt/generic_char_map.h> 45 #include <adt/dynamic_fifo.h> 46 #include <adt/int_map.h> 47 #include <packet/packet.h> 49 48 50 49 /** Initial size of the received packet queue. … … 139 138 * @param[in] socket_release The client release callback function. 140 139 */ 141 void socket_cores_release(int packet_phone, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void (*socket_release)(socket_core_ref socket));140 extern void socket_cores_release(int packet_phone, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void (*socket_release)(socket_core_ref socket)); 142 141 143 142 /** Binds the socket to the port. … … 158 157 * @returns Other error codes as defined for the socket_bind_insert() function. 159 158 */ 160 int socket_bind(socket_cores_ref local_sockets, socket_ports_ref global_sockets, int socket_id, void * addr, size_t addrlen, int free_ports_start, int free_ports_end, int last_used_port);159 extern int socket_bind(socket_cores_ref local_sockets, socket_ports_ref global_sockets, int socket_id, void * addr, size_t addrlen, int free_ports_start, int free_ports_end, int last_used_port); 161 160 162 161 /** Binds the socket to a free port. … … 171 170 * @returns Other error codes as defined for the socket_bind_insert() function. 172 171 */ 173 int socket_bind_free_port(socket_ports_ref global_sockets, socket_core_ref socket, int free_ports_start, int free_ports_end, int last_used_port);172 extern int socket_bind_free_port(socket_ports_ref global_sockets, socket_core_ref socket, int free_ports_start, int free_ports_end, int last_used_port); 174 173 175 174 /** Creates a new socket. … … 182 181 * @returns ENOMEM if there is not enough memory left. 183 182 */ 184 int socket_create(socket_cores_ref local_sockets, int app_phone, void * specific_data, int * socket_id);183 extern int socket_create(socket_cores_ref local_sockets, int app_phone, void * specific_data, int * socket_id); 185 184 186 185 /** Destroys the socket. … … 195 194 * @returns ENOTSOCK if the socket is not found. 196 195 */ 197 int socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void (*socket_release)(socket_core_ref socket));196 extern int socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void (*socket_release)(socket_core_ref socket)); 198 197 199 198 /** Replies the packet or the packet queue data to the application via the socket. … … 206 205 * @returns Other error codes as defined for the data_reply() function. 207 206 */ 208 int socket_reply_packets(packet_t packet, size_t * length);207 extern int socket_reply_packets(packet_t packet, size_t * length); 209 208 210 209 /** Finds the bound port socket. … … 216 215 * @returns NULL if no socket was found. 217 216 */ 218 socket_core_ref socket_port_find(socket_ports_ref global_sockets, int port, const char * key, size_t key_length);217 extern socket_core_ref socket_port_find(socket_ports_ref global_sockets, int port, const char * key, size_t key_length); 219 218 220 219 /** Releases the socket port. … … 224 223 * @param[in] socket The socket to be unbound. 225 224 */ 226 void socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket);225 extern void socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket); 227 226 228 227 /** Adds the socket to an already bound port. … … 236 235 * @returns Other error codes as defined for the socket_port_add_core() function. 237 236 */ 238 int socket_port_add(socket_ports_ref global_sockets, int port, socket_core_ref socket, const char * key, size_t key_length);237 extern int socket_port_add(socket_ports_ref global_sockets, int port, socket_core_ref socket, const char * key, size_t key_length); 239 238 240 239 #endif -
uspace/lib/socket/include/socket_messages.h
r7d6fe4db r849ed54 42 42 #include <ipc/ipc.h> 43 43 44 #include "../messages.h" 45 46 #include "../include/socket_codes.h" 44 #include <net_messages.h> 45 #include <socket_codes.h> 47 46 48 47 /** Socket client messages.
Note:
See TracChangeset
for help on using the changeset viewer.
