Changeset 858fc90 in mainline for uspace/srv/net/socket/socket_core.h
- Timestamp:
- 2010-03-15T19:35:25Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6092b56e
- Parents:
- 92307f1 (diff), 4684368 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/socket/socket_core.h
r92307f1 r858fc90 93 93 /** Socket identifier. 94 94 */ 95 int 95 int socket_id; 96 96 /** Client application phone. 97 97 */ 98 int 98 int phone; 99 99 /** Bound port. 100 100 */ 101 int 101 int port; 102 102 /** Received packets queue. 103 103 */ 104 dyn_fifo_t 104 dyn_fifo_t received; 105 105 /** Sockets for acceptance queue. 106 106 */ 107 dyn_fifo_t 107 dyn_fifo_t accepted; 108 108 /** Protocol specific data. 109 109 */ 110 void * 110 void * specific_data; 111 111 /** Socket ports map key. 112 112 */ 113 const char * 113 const char * key; 114 114 /** Length of the Socket ports map key. 115 115 */ 116 size_t 116 size_t key_length; 117 117 }; 118 118 … … 120 120 * The key is the socket identifier. 121 121 */ 122 INT_MAP_DECLARE( socket_cores, socket_core_t);122 INT_MAP_DECLARE(socket_cores, socket_core_t); 123 123 124 124 /** Bount port sockets map. 125 125 * The listening socket has the SOCKET_MAP_KEY_LISTENING key identifier whereas the other use the remote addresses. 126 126 */ 127 GENERIC_CHAR_MAP_DECLARE( socket_port_map, socket_core_ref);127 GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_ref); 128 128 129 129 /** Ports map. 130 130 * The key is the port number. 131 131 */ 132 INT_MAP_DECLARE( socket_ports, socket_port_t);132 INT_MAP_DECLARE(socket_ports, socket_port_t); 133 133 134 134 /** Destroys local sockets. … … 139 139 * @param[in] socket_release The client release callback function. 140 140 */ 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));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)); 142 142 143 143 /** Binds the socket to the port. … … 158 158 * @returns Other error codes as defined for the socket_bind_insert() function. 159 159 */ 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);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); 161 161 162 162 /** Binds the socket to a free port. … … 171 171 * @returns Other error codes as defined for the socket_bind_insert() function. 172 172 */ 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);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); 174 174 175 175 /** Creates a new socket. … … 182 182 * @returns ENOMEM if there is not enough memory left. 183 183 */ 184 int socket_create( socket_cores_ref local_sockets, int app_phone, void * specific_data, int * socket_id);184 int socket_create(socket_cores_ref local_sockets, int app_phone, void * specific_data, int * socket_id); 185 185 186 186 /** Destroys the socket. … … 195 195 * @returns ENOTSOCK if the socket is not found. 196 196 */ 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));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)); 198 198 199 199 /** Replies the packet or the packet queue data to the application via the socket. … … 206 206 * @returns Other error codes as defined for the data_reply() function. 207 207 */ 208 int socket_reply_packets( packet_t packet, size_t * length);208 int socket_reply_packets(packet_t packet, size_t * length); 209 209 210 210 /** Finds the bound port socket. … … 216 216 * @returns NULL if no socket was found. 217 217 */ 218 socket_core_ref socket_port_find( socket_ports_ref global_sockets, int port, const char * key, size_t key_length);218 socket_core_ref socket_port_find(socket_ports_ref global_sockets, int port, const char * key, size_t key_length); 219 219 220 220 /** Releases the socket port. … … 224 224 * @param[in] socket The socket to be unbound. 225 225 */ 226 void socket_port_release( socket_ports_ref global_sockets, socket_core_ref socket);226 void socket_port_release(socket_ports_ref global_sockets, socket_core_ref socket); 227 227 228 228 /** Adds the socket to an already bound port. … … 236 236 * @returns Other error codes as defined for the socket_port_add_core() function. 237 237 */ 238 int socket_port_add( socket_ports_ref global_sockets, int port, socket_core_ref socket, const char * key, size_t key_length);238 int socket_port_add(socket_ports_ref global_sockets, int port, socket_core_ref socket, const char * key, size_t key_length); 239 239 240 240 #endif
Note:
See TracChangeset
for help on using the changeset viewer.