Changeset 88a1bb9 in mainline
- Timestamp:
- 2010-11-18T23:20:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4eca056
- Parents:
- f772bc55
- Location:
- uspace
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/packet.c
rf772bc55 r88a1bb9 64 64 typedef packet_t packet_map_t[PACKET_MAP_SIZE]; 65 65 66 /** Type definition of the packet map page pointer. */67 typedef packet_map_t * packet_map_ref;68 69 66 /** Packet map. 70 67 * Maps packet identifiers to the packet references. … … 109 106 packet_t pm_find(packet_id_t packet_id) 110 107 { 111 packet_map_ refmap;108 packet_map_t *map; 112 109 packet_t packet; 113 110 … … 140 137 int pm_add(packet_t packet) 141 138 { 142 packet_map_ refmap;139 packet_map_t *map; 143 140 int rc; 144 141 … … 154 151 } else { 155 152 do { 156 map = (packet_map_ ref) malloc(sizeof(packet_map_t));153 map = (packet_map_t *) malloc(sizeof(packet_map_t)); 157 154 if (!map) { 158 155 fibril_rwlock_write_unlock(&pm_globals.lock); … … 180 177 int count; 181 178 int index; 182 packet_map_ refmap;179 packet_map_t *map; 183 180 packet_t packet; 184 181 -
uspace/lib/c/generic/net/socket_client.c
rf772bc55 r88a1bb9 78 78 */ 79 79 typedef struct socket socket_t; 80 81 /** Type definition of the socket specific data pointer.82 * @see socket83 */84 typedef socket_t *socket_ref;85 80 86 81 /** Socket specific data. … … 213 208 ipc_callid_t callid; 214 209 ipc_call_t call; 215 socket_ refsocket;210 socket_t *socket; 216 211 int rc; 217 212 … … 372 367 */ 373 368 static void 374 socket_initialize(socket_ refsocket, int socket_id, int phone,369 socket_initialize(socket_t *socket, int socket_id, int phone, 375 370 services_t service) 376 371 { … … 405 400 int socket(int domain, int type, int protocol) 406 401 { 407 socket_ refsocket;402 socket_t *socket; 408 403 int phone; 409 404 int socket_id; … … 463 458 464 459 // create a new socket structure 465 socket = (socket_ ref) malloc(sizeof(socket_t));460 socket = (socket_t *) malloc(sizeof(socket_t)); 466 461 if (!socket) 467 462 return ENOMEM; … … 524 519 const void *data, size_t datalength) 525 520 { 526 socket_ refsocket;521 socket_t *socket; 527 522 aid_t message_id; 528 523 ipcarg_t result; … … 588 583 int listen(int socket_id, int backlog) 589 584 { 590 socket_ refsocket;585 socket_t *socket; 591 586 int result; 592 587 … … 627 622 int accept(int socket_id, struct sockaddr * cliaddr, socklen_t * addrlen) 628 623 { 629 socket_ refsocket;630 socket_ refnew_socket;624 socket_t *socket; 625 socket_t *new_socket; 631 626 aid_t message_id; 632 627 ipcarg_t ipc_result; … … 661 656 662 657 // create a new scoket 663 new_socket = (socket_ ref) malloc(sizeof(socket_t));658 new_socket = (socket_t *) malloc(sizeof(socket_t)); 664 659 if (!new_socket) { 665 660 fibril_mutex_unlock(&socket->accept_lock); … … 745 740 * @param[in] socket The socket to be destroyed. 746 741 */ 747 static void socket_destroy(socket_ refsocket)742 static void socket_destroy(socket_t *socket) 748 743 { 749 744 int accepted_id; … … 770 765 int closesocket(int socket_id) 771 766 { 772 socket_ refsocket;767 socket_t *socket; 773 768 int rc; 774 769 … … 824 819 socklen_t addrlen) 825 820 { 826 socket_ refsocket;821 socket_t *socket; 827 822 aid_t message_id; 828 823 ipcarg_t result; … … 981 976 int flags, struct sockaddr *fromaddr, socklen_t *addrlen) 982 977 { 983 socket_ refsocket;978 socket_t *socket; 984 979 aid_t message_id; 985 980 ipcarg_t ipc_result; … … 1163 1158 getsockopt(int socket_id, int level, int optname, void *value, size_t *optlen) 1164 1159 { 1165 socket_ refsocket;1160 socket_t *socket; 1166 1161 aid_t message_id; 1167 1162 ipcarg_t result; -
uspace/lib/net/adt/module_map.c
rf772bc55 r88a1bb9 63 63 */ 64 64 int 65 add_module(module_ ref*module, modules_ref modules, const char *name,65 add_module(module_t **module, modules_ref modules, const char *name, 66 66 const char *filename, services_t service, task_id_t task_id, 67 67 connect_module_t connect_module) 68 68 { 69 module_ reftmp_module;69 module_t *tmp_module; 70 70 int rc; 71 71 72 tmp_module = (module_ ref) malloc(sizeof(module_t));72 tmp_module = (module_t *) malloc(sizeof(module_t)); 73 73 if (!tmp_module) 74 74 return ENOMEM; … … 104 104 * @returns NULL if there is no such module. 105 105 */ 106 module_ refget_running_module(modules_ref modules, char *name)106 module_t *get_running_module(modules_ref modules, char *name) 107 107 { 108 module_ refmodule;108 module_t *module; 109 109 110 110 module = modules_find(modules, name, 0); -
uspace/lib/net/il/ip_client.c
rf772bc55 r88a1bb9 53 53 size_t ip_client_header_length(packet_t packet) 54 54 { 55 ip_header_ refheader;56 57 header = (ip_header_ ref) packet_get_data(packet);55 ip_header_t *header; 56 57 header = (ip_header_t *) packet_get_data(packet); 58 58 if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t))) 59 59 return 0; … … 91 91 size_t data_length, void **header, size_t *headerlen) 92 92 { 93 ipv4_pseudo_header_ refheader_in;93 ipv4_pseudo_header_t *header_in; 94 94 struct sockaddr_in *address_in; 95 95 … … 109 109 110 110 *headerlen = sizeof(*header_in); 111 header_in = (ipv4_pseudo_header_ ref) malloc(*headerlen);111 header_in = (ipv4_pseudo_header_t *) malloc(*headerlen); 112 112 if (!header_in) 113 113 return ENOMEM; … … 155 155 ip_tos_t tos, int dont_fragment, size_t ipopt_length) 156 156 { 157 ip_header_ refheader;157 ip_header_t *header; 158 158 uint8_t *data; 159 159 size_t padding; … … 177 177 178 178 // set the header 179 header = (ip_header_ ref) data;179 header = (ip_header_t *) data; 180 180 header->header_length = IP_COMPUTE_HEADER_LENGTH(sizeof(ip_header_t) + 181 181 ipopt_length); … … 211 211 ip_ttl_t *ttl, ip_tos_t *tos, int *dont_fragment, size_t *ipopt_length) 212 212 { 213 ip_header_ refheader;214 215 header = (ip_header_ ref) packet_get_data(packet);213 ip_header_t *header; 214 215 header = (ip_header_t *) packet_get_data(packet); 216 216 if (!header || (packet_get_data_length(packet) < sizeof(ip_header_t))) 217 217 return ENOMEM; … … 247 247 size_t data_length) 248 248 { 249 ipv4_pseudo_header_ refheader_in;249 ipv4_pseudo_header_t *header_in; 250 250 251 251 if (!header) … … 253 253 254 254 if (headerlen == sizeof(ipv4_pseudo_header_t)) { 255 header_in = (ipv4_pseudo_header_ ref) header;255 header_in = (ipv4_pseudo_header_t *) header; 256 256 header_in->data_length = htons(data_length); 257 257 return EOK; -
uspace/lib/net/include/adt/module_map.h
rf772bc55 r88a1bb9 48 48 typedef struct module_struct module_t; 49 49 50 /** Type definition of the module structure pointer.51 * @see module_struct52 */53 typedef module_t *module_ref;54 55 50 /** Module map. 56 51 * Sorted by module names. … … 77 72 }; 78 73 79 extern int add_module(module_ ref*, modules_ref, const char *, const char *,74 extern int add_module(module_t **, modules_ref, const char *, const char *, 80 75 services_t, task_id_t, connect_module_t *); 81 extern module_ refget_running_module(modules_ref, char *);76 extern module_t *get_running_module(modules_ref, char *); 82 77 extern task_id_t spawn(const char *); 83 78 -
uspace/lib/net/include/icmp_header.h
rf772bc55 r88a1bb9 52 52 typedef struct icmp_echo icmp_echo_t; 53 53 54 /** Type definition of the echo specific data pointer.55 * @see icmp_echo56 */57 typedef icmp_echo_t *icmp_echo_ref;58 59 54 /** Echo specific data. */ 60 55 struct icmp_echo { … … 69 64 */ 70 65 typedef struct icmp_header icmp_header_t; 71 72 /** Type definition of the internet control message header pointer.73 * @see icmp_header74 */75 typedef icmp_header_t *icmp_header_ref;76 66 77 67 /** Internet control message header. */ -
uspace/lib/net/include/ip_header.h
rf772bc55 r88a1bb9 127 127 typedef struct ip_header ip_header_t; 128 128 129 /** Type definition of the internet header pointer.130 * @see ip_header131 */132 typedef ip_header_t *ip_header_ref;133 134 129 /** Type definition of the internet option header. 135 130 * @see ip_header … … 137 132 typedef struct ip_option ip_option_t; 138 133 139 /** Type definition of the internet option header pointer.140 * @see ip_header141 */142 typedef ip_option_t *ip_option_ref;143 144 134 /** Type definition of the internet version 4 pseudo header. 145 135 * @see ipv4_pseudo_header 146 136 */ 147 137 typedef struct ipv4_pseudo_header ipv4_pseudo_header_t; 148 149 /** Type definition of the internet version 4 pseudo header pointer.150 * @see ipv4_pseudo_header151 */152 typedef ipv4_pseudo_header_t *ipv4_pseudo_header_ref;153 138 154 139 /** Internet header. -
uspace/lib/net/include/socket_core.h
rf772bc55 r88a1bb9 66 66 typedef struct socket_core socket_core_t; 67 67 68 /** Type definition of the socket core pointer.69 * @see socket_core70 */71 typedef socket_core_t *socket_core_ref;72 73 68 /** Type definition of the socket port. 74 69 * @see socket_port 75 70 */ 76 71 typedef struct socket_port socket_port_t; 77 78 /** Type definition of the socket port pointer.79 * @see socket_port80 */81 typedef socket_port_t *socket_port_ref;82 72 83 73 /** Socket core. */ … … 111 101 * the other use the remote addresses. 112 102 */ 113 GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_ ref);103 GENERIC_CHAR_MAP_DECLARE(socket_port_map, socket_core_t *); 114 104 115 105 /** Ports map. … … 119 109 120 110 extern void socket_cores_release(int, socket_cores_ref, socket_ports_ref, 121 void (*)(socket_core_ ref));111 void (*)(socket_core_t *)); 122 112 extern int socket_bind(socket_cores_ref, socket_ports_ref, int, void *, size_t, 123 113 int, int, int); 124 extern int socket_bind_free_port(socket_ports_ref, socket_core_ ref, int, int,114 extern int socket_bind_free_port(socket_ports_ref, socket_core_t *, int, int, 125 115 int); 126 116 extern int socket_create(socket_cores_ref, int, void *, int *); 127 117 extern int socket_destroy(int, int, socket_cores_ref, socket_ports_ref, 128 void (*)(socket_core_ ref));118 void (*)(socket_core_t *)); 129 119 extern int socket_reply_packets(packet_t, size_t *); 130 extern socket_core_ refsocket_port_find(socket_ports_ref, int, const char *,120 extern socket_core_t *socket_port_find(socket_ports_ref, int, const char *, 131 121 size_t); 132 extern void socket_port_release(socket_ports_ref, socket_core_ ref);133 extern int socket_port_add(socket_ports_ref, int, socket_core_ ref,122 extern void socket_port_release(socket_ports_ref, socket_core_t *); 123 extern int socket_port_add(socket_ports_ref, int, socket_core_t *, 134 124 const char *, size_t); 135 125 -
uspace/lib/net/tl/icmp_client.c
rf772bc55 r88a1bb9 64 64 icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu) 65 65 { 66 icmp_header_ refheader;66 icmp_header_t *header; 67 67 68 header = (icmp_header_ ref) packet_get_data(packet);68 header = (icmp_header_t *) packet_get_data(packet); 69 69 if (!header || 70 70 (packet_get_data_length(packet) < sizeof(icmp_header_t))) { -
uspace/lib/net/tl/socket_core.c
rf772bc55 r88a1bb9 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,87 socket_destroy_core(int packet_phone, socket_core_t *socket, 88 88 socket_cores_ref local_sockets, socket_ports_ref global_sockets, 89 void (* socket_release)(socket_core_ refsocket))89 void (* socket_release)(socket_core_t *socket)) 90 90 { 91 91 int packet_id; … … 123 123 socket_cores_release(int packet_phone, socket_cores_ref local_sockets, 124 124 socket_ports_ref global_sockets, 125 void (* socket_release)(socket_core_ refsocket))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_ref 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 … … 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_ref global_sockets, socket_core_t *socket, 331 331 int free_ports_start, int free_ports_end, int last_used_port) 332 332 { … … 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; … … 488 488 socket_destroy(int packet_phone, int socket_id, socket_cores_ref local_sockets, 489 489 socket_ports_ref global_sockets, 490 void (*socket_release)(socket_core_ refsocket))491 { 492 socket_core_ refsocket;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_ ref603 socket_core_t * 604 604 socket_port_find(socket_ports_ref 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_ref 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) … … 680 680 int 681 681 socket_port_add(socket_ports_ref global_sockets, int port, 682 socket_core_ refsocket, const char *key, size_t key_length)683 { 684 socket_port_ refsocket_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 -
uspace/srv/net/il/ip/ip.c
rf772bc55 r88a1bb9 170 170 * @returns Other error codes as defined for the packet_set_addr(). 171 171 */ 172 static int ip_prepare_icmp(packet_t packet, ip_header_ refheader)172 static int ip_prepare_icmp(packet_t packet, ip_header_t *header) 173 173 { 174 174 packet_t next; … … 187 187 188 188 // get header 189 header = (ip_header_ ref) packet_get_data(packet);189 header = (ip_header_t *) packet_get_data(packet); 190 190 if (!header) 191 191 return EINVAL; … … 234 234 static int 235 235 ip_prepare_icmp_and_get_phone(services_t error, packet_t packet, 236 ip_header_ refheader)236 ip_header_t *header) 237 237 { 238 238 int phone; … … 542 542 * @returns NULL on error. 543 543 */ 544 static ip_header_ ref545 ip_create_middle_header(packet_t packet, ip_header_ reflast)546 { 547 ip_header_ refmiddle;548 549 middle = (ip_header_ ref) packet_suffix(packet, IP_HEADER_LENGTH(last));544 static ip_header_t * 545 ip_create_middle_header(packet_t packet, ip_header_t *last) 546 { 547 ip_header_t *middle; 548 549 middle = (ip_header_t *) packet_suffix(packet, IP_HEADER_LENGTH(last)); 550 550 if (!middle) 551 551 return NULL; … … 562 562 * @param[in] first The original header to be copied. 563 563 */ 564 static void ip_create_last_header(ip_header_ ref last, ip_header_reffirst)565 { 566 ip_option_ refoption;564 static void ip_create_last_header(ip_header_t *last, ip_header_t *first) 565 { 566 ip_option_t *option; 567 567 size_t next; 568 568 size_t length; … … 575 575 // process all ip options 576 576 while (next < first->header_length) { 577 option = (ip_option_ ref) (((uint8_t *) first) + next);577 option = (ip_option_t *) (((uint8_t *) first) + next); 578 578 // skip end or noop 579 579 if ((option->type == IPOPT_END) || … … 626 626 { 627 627 size_t length; 628 ip_header_ refheader;629 ip_header_ reflast_header;630 ip_header_ refmiddle_header;628 ip_header_t *header; 629 ip_header_t *last_header; 630 ip_header_t *middle_header; 631 631 packet_t next; 632 632 int rc; … … 636 636 return EINVAL; 637 637 638 header = (ip_header_ ref) packet_get_data(packet);638 header = (ip_header_t *) packet_get_data(packet); 639 639 if (destination) { 640 640 rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value, … … 660 660 661 661 if (pq_next(packet)) { 662 last_header = (ip_header_ ref) malloc(IP_HEADER_LENGTH(header));662 last_header = (ip_header_t *) malloc(IP_HEADER_LENGTH(header)); 663 663 if (!last_header) 664 664 return ENOMEM; … … 666 666 next = pq_next(packet); 667 667 while (pq_next(next)) { 668 middle_header = (ip_header_ ref) packet_prefix(next,668 middle_header = (ip_header_t *) packet_prefix(next, 669 669 IP_HEADER_LENGTH(last_header)); 670 670 if (!middle_header) { … … 698 698 } 699 699 700 middle_header = (ip_header_ ref) packet_prefix(next,700 middle_header = (ip_header_t *) packet_prefix(next, 701 701 IP_HEADER_LENGTH(last_header)); 702 702 if (!middle_header) { … … 755 755 static int 756 756 ip_fragment_packet_data(packet_t packet, packet_t new_packet, 757 ip_header_ ref header, ip_header_refnew_header, size_t length,757 ip_header_t *header, ip_header_t *new_header, size_t length, 758 758 const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen) 759 759 { … … 820 820 { 821 821 packet_t new_packet; 822 ip_header_ refheader;823 ip_header_ refmiddle_header;824 ip_header_ reflast_header;822 ip_header_t *header; 823 ip_header_t *middle_header; 824 ip_header_t *last_header; 825 825 struct sockaddr *src; 826 826 struct sockaddr *dest; … … 838 838 839 839 // get header 840 header = (ip_header_ ref) packet_get_data(packet);840 header = (ip_header_t *) packet_get_data(packet); 841 841 if (!header) 842 842 return EINVAL; … … 853 853 854 854 // allocate as much as originally 855 last_header = (ip_header_ ref) packet_suffix(new_packet,855 last_header = (ip_header_t *) packet_suffix(new_packet, 856 856 IP_HEADER_LENGTH(header)); 857 857 if (!last_header) … … 1065 1065 * @returns NULL if no route was found. 1066 1066 */ 1067 static ip_route_t 1068 *ip_netif_find_route(ip_netif_t *netif, in_addr_t destination)1067 static ip_route_t * 1068 ip_netif_find_route(ip_netif_t *netif, in_addr_t destination) 1069 1069 { 1070 1070 int index; … … 1420 1420 * @returns The packet destination address. 1421 1421 */ 1422 static in_addr_t ip_get_destination(ip_header_ refheader)1422 static in_addr_t ip_get_destination(ip_header_t *header) 1423 1423 { 1424 1424 in_addr_t destination; … … 1451 1451 */ 1452 1452 static int 1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_ refheader,1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header, 1454 1454 services_t error) 1455 1455 { … … 1555 1555 ip_process_packet(device_id_t device_id, packet_t packet) 1556 1556 { 1557 ip_header_ refheader;1557 ip_header_t *header; 1558 1558 in_addr_t dest; 1559 1559 ip_route_t *route; … … 1564 1564 int rc; 1565 1565 1566 header = (ip_header_ ref) packet_get_data(packet);1566 header = (ip_header_t *) packet_get_data(packet); 1567 1567 if (!header) 1568 1568 return ip_release_and_return(packet, ENOMEM); … … 1724 1724 measured_string_t address; 1725 1725 ip_route_t *route; 1726 ip_header_ refheader;1726 ip_header_t *header; 1727 1727 1728 1728 switch (error) { … … 1734 1734 1735 1735 data = packet_get_data(packet); 1736 header = (ip_header_ ref)(data + offset);1736 header = (ip_header_t *)(data + offset); 1737 1737 1738 1738 // destination host unreachable? … … 1783 1783 in_addr_t *src; 1784 1784 ip_route_t *route; 1785 ipv4_pseudo_header_ refheader_in;1785 ipv4_pseudo_header_t *header_in; 1786 1786 1787 1787 if (!destination || (addrlen <= 0)) … … 1829 1829 1830 1830 *headerlen = sizeof(*header_in); 1831 header_in = (ipv4_pseudo_header_ ref) malloc(*headerlen);1831 header_in = (ipv4_pseudo_header_t *) malloc(*headerlen); 1832 1832 if (!header_in) 1833 1833 return ENOMEM; -
uspace/srv/net/il/ip/ip.h
rf772bc55 r88a1bb9 89 89 struct ip_netif { 90 90 /** ARP module. Assigned if using ARP. */ 91 module_ refarp;91 module_t *arp; 92 92 /** Broadcast address. */ 93 93 in_addr_t broadcast; -
uspace/srv/net/net/net.h
rf772bc55 r88a1bb9 103 103 104 104 /** Serving network interface driver module index. */ 105 module_ refdriver;105 module_t *driver; 106 106 107 device_id_t id; 108 module_ ref il;/**< Serving internet layer module index. */109 char *name; 110 module_ ref nil;/**< Serving link layer module index. */107 device_id_t id; /**< System-unique network interface identifier. */ 108 module_t *il; /**< Serving internet layer module index. */ 109 char *name; /**< System-unique network interface name. */ 110 module_t *nil; /**< Serving link layer module index. */ 111 111 } netif_t; 112 112 -
uspace/srv/net/nil/eth/eth.c
rf772bc55 r88a1bb9 155 155 */ 156 156 typedef enum eth_addr_type eth_addr_type_t; 157 158 /** Type definition of the ethernet address type pointer.159 * @see eth_addr_type160 */161 typedef eth_addr_type_t *eth_addr_type_ref;162 157 163 158 /** Ethernet address type. */ -
uspace/srv/net/tl/icmp/icmp.c
rf772bc55 r88a1bb9 156 156 */ 157 157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet, 158 icmp_header_ refheader, services_t error, ip_ttl_t ttl, ip_tos_t tos,158 icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos, 159 159 int dont_fragment) 160 160 { … … 189 189 * @returns NULL on errors. 190 190 */ 191 static icmp_header_ reficmp_prepare_packet(packet_t packet)192 { 193 icmp_header_ refheader;191 static icmp_header_t *icmp_prepare_packet(packet_t packet) 192 { 193 icmp_header_t *header; 194 194 size_t header_length; 195 195 size_t total_length; … … 247 247 const struct sockaddr * addr, socklen_t addrlen) 248 248 { 249 icmp_header_ refheader;249 icmp_header_t *header; 250 250 packet_t packet; 251 251 size_t length; … … 342 342 icmp_code_t code, icmp_param_t mtu, packet_t packet) 343 343 { 344 icmp_header_ refheader;344 icmp_header_t *header; 345 345 346 346 header = icmp_prepare_packet(packet); … … 357 357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet) 358 358 { 359 icmp_header_ refheader;359 icmp_header_t *header; 360 360 361 361 header = icmp_prepare_packet(packet); … … 370 370 packet_t packet) 371 371 { 372 icmp_header_ refheader;372 icmp_header_t *header; 373 373 374 374 header = icmp_prepare_packet(packet); … … 383 383 icmp_param_t pointer, packet_t packet) 384 384 { 385 icmp_header_ refheader;385 icmp_header_t *header; 386 386 387 387 header = icmp_prepare_packet(packet); … … 479 479 * @param[in] code The received reply message code. 480 480 */ 481 static void icmp_process_echo_reply(packet_t packet, icmp_header_ refheader,481 static void icmp_process_echo_reply(packet_t packet, icmp_header_t *header, 482 482 icmp_type_t type, icmp_code_t code) 483 483 { … … 525 525 int result; 526 526 void *data; 527 icmp_header_ refheader;527 icmp_header_t *header; 528 528 icmp_type_t type; 529 529 icmp_code_t code; … … 567 567 568 568 /* Get ICMP header */ 569 header = (icmp_header_ ref) data;569 header = (icmp_header_t *) data; 570 570 571 571 if (header->checksum) { … … 735 735 * @returns ENOTCONN if no free identifier have been found. 736 736 */ 737 static int icmp_bind_free_id(icmp_echo_ refecho_data)737 static int icmp_bind_free_id(icmp_echo_t *echo_data) 738 738 { 739 739 icmp_param_t index; … … 791 791 struct sockaddr *addr; 792 792 ipc_callid_t data_callid; 793 icmp_echo_ refecho_data;793 icmp_echo_t *echo_data; 794 794 int rc = EOK; 795 795 … … 800 800 answer_count = 0; 801 801 802 echo_data = (icmp_echo_ ref) malloc(sizeof(*echo_data));802 echo_data = (icmp_echo_t *) malloc(sizeof(*echo_data)); 803 803 if (!echo_data) 804 804 return ENOMEM; -
uspace/srv/net/tl/tcp/tcp.c
rf772bc55 r88a1bb9 161 161 162 162 static int tcp_release_and_return(packet_t, int); 163 static void tcp_prepare_operation_header(socket_core_ ref, tcp_socket_data_t *,163 static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *, 164 164 tcp_header_t *, int synchronize, int); 165 static int tcp_prepare_timeout(int (*)(void *), socket_core_ ref,165 static int tcp_prepare_timeout(int (*)(void *), socket_core_t *, 166 166 tcp_socket_data_t *, size_t, tcp_socket_state_t, suseconds_t, int); 167 static void tcp_free_socket_data(socket_core_ ref);167 static void tcp_free_socket_data(socket_core_t *); 168 168 169 169 static int tcp_timeout(void *); … … 172 172 173 173 static int tcp_process_packet(device_id_t, packet_t, services_t); 174 static int tcp_connect_core(socket_core_ ref, socket_cores_ref,174 static int tcp_connect_core(socket_core_t *, socket_cores_ref, 175 175 struct sockaddr *, socklen_t); 176 static int tcp_queue_prepare_packet(socket_core_ ref, tcp_socket_data_t *,176 static int tcp_queue_prepare_packet(socket_core_t *, tcp_socket_data_t *, 177 177 packet_t, size_t); 178 static int tcp_queue_packet(socket_core_ ref, tcp_socket_data_t *, packet_t,178 static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t, 179 179 size_t); 180 static packet_t tcp_get_packets_to_send(socket_core_ ref, tcp_socket_data_t *);180 static packet_t tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *); 181 181 static void tcp_send_packets(device_id_t, packet_t); 182 182 183 static void tcp_process_acknowledgement(socket_core_ ref, tcp_socket_data_t *,183 static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *, 184 184 tcp_header_t *); 185 static packet_t tcp_send_prepare_packet(socket_core_ ref, tcp_socket_data_t *,185 static packet_t tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *, 186 186 packet_t, size_t, size_t); 187 static packet_t tcp_prepare_copy(socket_core_ ref, tcp_socket_data_t *, packet_t,187 static packet_t tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, packet_t, 188 188 size_t, size_t); 189 /* static */ void tcp_retransmit_packet(socket_core_ ref, tcp_socket_data_t *,189 /* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *, 190 190 size_t); 191 static int tcp_create_notification_packet(packet_t *, socket_core_ ref,191 static int tcp_create_notification_packet(packet_t *, socket_core_t *, 192 192 tcp_socket_data_t *, int, int); 193 193 static void tcp_refresh_socket_data(tcp_socket_data_t *); … … 195 195 static void tcp_initialize_socket_data(tcp_socket_data_t *); 196 196 197 static int tcp_process_listen(socket_core_ ref, tcp_socket_data_t *,197 static int tcp_process_listen(socket_core_t *, tcp_socket_data_t *, 198 198 tcp_header_t *, packet_t, struct sockaddr *, struct sockaddr *, size_t); 199 static int tcp_process_syn_sent(socket_core_ ref, tcp_socket_data_t *,199 static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *, 200 200 tcp_header_t *, packet_t); 201 static int tcp_process_syn_received(socket_core_ ref, tcp_socket_data_t *,201 static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *, 202 202 tcp_header_t *, packet_t); 203 static int tcp_process_established(socket_core_ ref, tcp_socket_data_t *,203 static int tcp_process_established(socket_core_t *, tcp_socket_data_t *, 204 204 tcp_header_t *, packet_t, int, size_t); 205 static int tcp_queue_received_packet(socket_core_ ref, tcp_socket_data_t *,205 static int tcp_queue_received_packet(socket_core_t *, tcp_socket_data_t *, 206 206 packet_t, int, size_t); 207 207 … … 286 286 int result; 287 287 tcp_header_t *header; 288 socket_core_ refsocket;288 socket_core_t *socket; 289 289 tcp_socket_data_t *socket_data; 290 290 packet_t next_packet; … … 492 492 } 493 493 494 int tcp_process_established(socket_core_ refsocket, tcp_socket_data_t *494 int tcp_process_established(socket_core_t *socket, tcp_socket_data_t * 495 495 socket_data, tcp_header_t *header, packet_t packet, int fragments, 496 496 size_t total_length) … … 800 800 } 801 801 802 int tcp_queue_received_packet(socket_core_ refsocket,802 int tcp_queue_received_packet(socket_core_t *socket, 803 803 tcp_socket_data_t *socket_data, packet_t packet, int fragments, 804 804 size_t total_length) … … 837 837 } 838 838 839 int tcp_process_syn_sent(socket_core_ refsocket, tcp_socket_data_t *839 int tcp_process_syn_sent(socket_core_t *socket, tcp_socket_data_t * 840 840 socket_data, tcp_header_t *header, packet_t packet) 841 841 { … … 895 895 } 896 896 897 int tcp_process_listen(socket_core_ reflistening_socket,897 int tcp_process_listen(socket_core_t *listening_socket, 898 898 tcp_socket_data_t *listening_socket_data, tcp_header_t *header, 899 899 packet_t packet, struct sockaddr *src, struct sockaddr *dest, … … 901 901 { 902 902 packet_t next_packet; 903 socket_core_ refsocket;903 socket_core_t *socket; 904 904 tcp_socket_data_t *socket_data; 905 905 int socket_id; … … 1055 1055 } 1056 1056 1057 int tcp_process_syn_received(socket_core_ refsocket,1057 int tcp_process_syn_received(socket_core_t *socket, 1058 1058 tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t packet) 1059 1059 { 1060 socket_core_ reflistening_socket;1060 socket_core_t *listening_socket; 1061 1061 tcp_socket_data_t *listening_socket_data; 1062 1062 int rc; … … 1122 1122 } 1123 1123 1124 void tcp_process_acknowledgement(socket_core_ refsocket,1124 void tcp_process_acknowledgement(socket_core_t *socket, 1125 1125 tcp_socket_data_t *socket_data, tcp_header_t *header) 1126 1126 { … … 1300 1300 int answer_count; 1301 1301 tcp_socket_data_t *socket_data; 1302 socket_core_ refsocket;1302 socket_core_t *socket; 1303 1303 packet_dimension_t *packet_dimension; 1304 1304 … … 1537 1537 tcp_timeout_t *timeout = data; 1538 1538 int keep_write_lock = false; 1539 socket_core_ refsocket;1539 socket_core_t *socket; 1540 1540 tcp_socket_data_t *socket_data; 1541 1541 … … 1613 1613 { 1614 1614 tcp_timeout_t *timeout = data; 1615 socket_core_ refsocket;1615 socket_core_t *socket; 1616 1616 tcp_socket_data_t *socket_data; 1617 1617 fibril_rwlock_t *local_lock; … … 1651 1651 } 1652 1652 1653 void tcp_retransmit_packet(socket_core_ refsocket, tcp_socket_data_t *1653 void tcp_retransmit_packet(socket_core_t *socket, tcp_socket_data_t * 1654 1654 socket_data, size_t sequence_number) 1655 1655 { … … 1681 1681 int backlog) 1682 1682 { 1683 socket_core_ refsocket;1683 socket_core_t *socket; 1684 1684 tcp_socket_data_t *socket_data; 1685 1685 … … 1707 1707 struct sockaddr *addr, socklen_t addrlen) 1708 1708 { 1709 socket_core_ refsocket;1709 socket_core_t *socket; 1710 1710 int rc; 1711 1711 … … 1732 1732 } 1733 1733 1734 int tcp_connect_core(socket_core_ refsocket, socket_cores_ref local_sockets,1734 int tcp_connect_core(socket_core_t *socket, socket_cores_ref local_sockets, 1735 1735 struct sockaddr *addr, socklen_t addrlen) 1736 1736 { … … 1823 1823 } 1824 1824 1825 int tcp_queue_prepare_packet(socket_core_ refsocket,1825 int tcp_queue_prepare_packet(socket_core_t *socket, 1826 1826 tcp_socket_data_t *socket_data, packet_t packet, size_t data_length) 1827 1827 { … … 1854 1854 } 1855 1855 1856 int tcp_queue_packet(socket_core_ refsocket, tcp_socket_data_t *socket_data,1856 int tcp_queue_packet(socket_core_t *socket, tcp_socket_data_t *socket_data, 1857 1857 packet_t packet, size_t data_length) 1858 1858 { … … 1876 1876 } 1877 1877 1878 packet_t tcp_get_packets_to_send(socket_core_ refsocket, tcp_socket_data_t *1878 packet_t tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t * 1879 1879 socket_data) 1880 1880 { … … 1936 1936 } 1937 1937 1938 packet_t tcp_send_prepare_packet(socket_core_ refsocket, tcp_socket_data_t *1938 packet_t tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t * 1939 1939 socket_data, packet_t packet, size_t data_length, size_t sequence_number) 1940 1940 { … … 1997 1997 } 1998 1998 1999 packet_t tcp_prepare_copy(socket_core_ refsocket, tcp_socket_data_t *1999 packet_t tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t * 2000 2000 socket_data, packet_t packet, size_t data_length, size_t sequence_number) 2001 2001 { … … 2027 2027 } 2028 2028 2029 void tcp_prepare_operation_header(socket_core_ refsocket,2029 void tcp_prepare_operation_header(socket_core_t *socket, 2030 2030 tcp_socket_data_t *socket_data, tcp_header_t *header, int synchronize, 2031 2031 int finalize) … … 2045 2045 2046 2046 int tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t), 2047 socket_core_ refsocket, tcp_socket_data_t *socket_data,2047 socket_core_t *socket, tcp_socket_data_t *socket_data, 2048 2048 size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout, 2049 2049 int globals_read_only) … … 2094 2094 int flags, size_t *addrlen) 2095 2095 { 2096 socket_core_ refsocket;2096 socket_core_t *socket; 2097 2097 tcp_socket_data_t *socket_data; 2098 2098 int packet_id; … … 2152 2152 int fragments, size_t *data_fragment_size, int flags) 2153 2153 { 2154 socket_core_ refsocket;2154 socket_core_t *socket; 2155 2155 tcp_socket_data_t *socket_data; 2156 2156 packet_dimension_t *packet_dimension; … … 2227 2227 tcp_close_message(socket_cores_ref local_sockets, int socket_id) 2228 2228 { 2229 socket_core_ refsocket;2229 socket_core_t *socket; 2230 2230 tcp_socket_data_t *socket_data; 2231 2231 packet_t packet; … … 2293 2293 } 2294 2294 2295 int tcp_create_notification_packet(packet_t *packet, socket_core_ refsocket,2295 int tcp_create_notification_packet(packet_t *packet, socket_core_t *socket, 2296 2296 tcp_socket_data_t *socket_data, int synchronize, int finalize) 2297 2297 { … … 2330 2330 int new_socket_id, size_t *data_fragment_size, size_t *addrlen) 2331 2331 { 2332 socket_core_ refaccepted;2333 socket_core_ refsocket;2332 socket_core_t *accepted; 2333 socket_core_t *socket; 2334 2334 tcp_socket_data_t *socket_data; 2335 2335 packet_dimension_t *packet_dimension; … … 2400 2400 } 2401 2401 2402 void tcp_free_socket_data(socket_core_ refsocket)2402 void tcp_free_socket_data(socket_core_t *socket) 2403 2403 { 2404 2404 tcp_socket_data_t *socket_data; -
uspace/srv/net/tl/udp/udp.c
rf772bc55 r88a1bb9 224 224 int result; 225 225 udp_header_t *header; 226 socket_core_ refsocket;226 socket_core_t *socket; 227 227 packet_t next_packet; 228 228 size_t total_length; … … 457 457 size_t *data_fragment_size, int flags) 458 458 { 459 socket_core_ refsocket;459 socket_core_t *socket; 460 460 packet_t packet; 461 461 packet_t next_packet; … … 612 612 int flags, size_t *addrlen) 613 613 { 614 socket_core_ refsocket;614 socket_core_t *socket; 615 615 int packet_id; 616 616 packet_t packet;
Note:
See TracChangeset
for help on using the changeset viewer.