Changes in uspace/lib/net/tl/socket_core.c [0ab68f6:aaa3f33a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/net/tl/socket_core.c
r0ab68f6 raaa3f33a 68 68 INT_MAP_IMPLEMENT(socket_cores, socket_core_t); 69 69 70 GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_ ref);70 GENERIC_CHAR_MAP_IMPLEMENT(socket_port_map, socket_core_t *); 71 71 72 72 INT_MAP_IMPLEMENT(socket_ports, socket_port_t); … … 85 85 */ 86 86 static void 87 socket_destroy_core(int packet_phone, socket_core_ refsocket,88 socket_cores_ ref local_sockets, socket_ports_refglobal_sockets,89 void (* socket_release)(socket_core_ refsocket))87 socket_destroy_core(int packet_phone, socket_core_t *socket, 88 socket_cores_t *local_sockets, socket_ports_t *global_sockets, 89 void (* socket_release)(socket_core_t *socket)) 90 90 { 91 91 int packet_id; … … 121 121 */ 122 122 void 123 socket_cores_release(int packet_phone, socket_cores_ reflocal_sockets,124 socket_ports_ refglobal_sockets,125 void (* socket_release)(socket_core_ refsocket))123 socket_cores_release(int packet_phone, socket_cores_t *local_sockets, 124 socket_ports_t *global_sockets, 125 void (* socket_release)(socket_core_t *socket)) 126 126 { 127 127 int index; … … 160 160 */ 161 161 static int 162 socket_port_add_core(socket_port_ ref socket_port, socket_core_refsocket,162 socket_port_add_core(socket_port_t *socket_port, socket_core_t *socket, 163 163 const char *key, size_t key_length) 164 164 { 165 socket_core_ ref*socket_ref;165 socket_core_t **socket_ref; 166 166 int rc; 167 167 … … 200 200 */ 201 201 static int 202 socket_bind_insert(socket_ports_ ref global_sockets, socket_core_refsocket,202 socket_bind_insert(socket_ports_t *global_sockets, socket_core_t *socket, 203 203 int port) 204 204 { 205 socket_port_ refsocket_port;205 socket_port_t *socket_port; 206 206 int rc; 207 207 … … 258 258 */ 259 259 int 260 socket_bind(socket_cores_ ref local_sockets, socket_ports_refglobal_sockets,260 socket_bind(socket_cores_t *local_sockets, socket_ports_t *global_sockets, 261 261 int socket_id, void *addr, size_t addrlen, int free_ports_start, 262 262 int free_ports_end, int last_used_port) 263 263 { 264 socket_core_ refsocket;265 socket_port_ refsocket_port;264 socket_core_t *socket; 265 socket_port_t *socket_port; 266 266 struct sockaddr *address; 267 267 struct sockaddr_in *address_in; … … 328 328 */ 329 329 int 330 socket_bind_free_port(socket_ports_ ref global_sockets, socket_core_refsocket,330 socket_bind_free_port(socket_ports_t *global_sockets, socket_core_t *socket, 331 331 int free_ports_start, int free_ports_end, int last_used_port) 332 332 { … … 370 370 * @returns ELIMIT if there is no socket identifier available. 371 371 */ 372 static int socket_generate_new_id(socket_cores_ reflocal_sockets, int positive)372 static int socket_generate_new_id(socket_cores_t *local_sockets, int positive) 373 373 { 374 374 int socket_id; … … 415 415 */ 416 416 int 417 socket_create(socket_cores_ reflocal_sockets, int app_phone,417 socket_create(socket_cores_t *local_sockets, int app_phone, 418 418 void *specific_data, int *socket_id) 419 419 { 420 socket_core_ refsocket;420 socket_core_t *socket; 421 421 int positive; 422 422 int rc; … … 437 437 } 438 438 439 socket = (socket_core_ ref) malloc(sizeof(*socket));439 socket = (socket_core_t *) malloc(sizeof(*socket)); 440 440 if (!socket) 441 441 return ENOMEM; … … 486 486 */ 487 487 int 488 socket_destroy(int packet_phone, int socket_id, socket_cores_ reflocal_sockets,489 socket_ports_ refglobal_sockets,490 void (*socket_release)(socket_core_ refsocket))491 { 492 socket_core_ refsocket;488 socket_destroy(int packet_phone, int socket_id, socket_cores_t *local_sockets, 489 socket_ports_t *global_sockets, 490 void (*socket_release)(socket_core_t *socket)) 491 { 492 socket_core_t *socket; 493 493 int accepted_id; 494 494 … … 601 601 * @returns NULL if no socket was found. 602 602 */ 603 socket_core_ ref604 socket_port_find(socket_ports_ refglobal_sockets, int port, const char *key,603 socket_core_t * 604 socket_port_find(socket_ports_t *global_sockets, int port, const char *key, 605 605 size_t key_length) 606 606 { 607 socket_port_ refsocket_port;608 socket_core_ ref*socket_ref;607 socket_port_t *socket_port; 608 socket_core_t **socket_ref; 609 609 610 610 socket_port = socket_ports_find(global_sockets, port); … … 628 628 */ 629 629 void 630 socket_port_release(socket_ports_ ref global_sockets, socket_core_refsocket)631 { 632 socket_port_ refsocket_port;633 socket_core_ ref*socket_ref;630 socket_port_release(socket_ports_t *global_sockets, socket_core_t *socket) 631 { 632 socket_port_t *socket_port; 633 socket_core_t **socket_ref; 634 634 635 635 if (!socket->port) … … 679 679 */ 680 680 int 681 socket_port_add(socket_ports_ refglobal_sockets, int port,682 socket_core_ refsocket, const char *key, size_t key_length)683 { 684 socket_port_ refsocket_port;681 socket_port_add(socket_ports_t *global_sockets, int port, 682 socket_core_t *socket, const char *key, size_t key_length) 683 { 684 socket_port_t *socket_port; 685 685 int rc; 686 686
Note:
See TracChangeset
for help on using the changeset viewer.