Changes in / [0b4a67a:7e1f9b7] in mainline
- Location:
- uspace
- Files:
-
- 1 deleted
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/net/packet.c
r0b4a67a r7e1f9b7 62 62 63 63 /** Type definition of the packet map page. */ 64 typedef packet_t packet_map_t[PACKET_MAP_SIZE];64 typedef packet_t *packet_map_t[PACKET_MAP_SIZE]; 65 65 66 66 /** Packet map. … … 104 104 * @return NULL if the mapping does not exist. 105 105 */ 106 packet_t pm_find(packet_id_t packet_id)106 packet_t *pm_find(packet_id_t packet_id) 107 107 { 108 108 packet_map_t *map; 109 packet_t packet;109 packet_t *packet; 110 110 111 111 if (!packet_id) … … 135 135 * @return ENOMEM if there is not enough memory left. 136 136 */ 137 int pm_add(packet_t packet)137 int pm_add(packet_t *packet) 138 138 { 139 139 packet_map_t *map; … … 178 178 int index; 179 179 packet_map_t *map; 180 packet_t packet;180 packet_t *packet; 181 181 182 182 fibril_rwlock_write_lock(&pm_globals.lock); … … 209 209 * @return EINVAL if the packet is not valid. 210 210 */ 211 int pq_add(packet_t * first, packet_tpacket, size_t order, size_t metric)212 { 213 packet_t item;211 int pq_add(packet_t **first, packet_t *packet, size_t order, size_t metric) 212 { 213 packet_t *item; 214 214 215 215 if (!first || !packet_is_valid(packet)) … … 253 253 * @return NULL if the packet is not found. 254 254 */ 255 packet_t pq_find(packet_tpacket, size_t order)256 { 257 packet_t item;255 packet_t *pq_find(packet_t *packet, size_t order) 256 { 257 packet_t *item; 258 258 259 259 if (!packet_is_valid(packet)) … … 278 278 * @return EINVAL if etiher of the packets is invalid. 279 279 */ 280 int pq_insert_after(packet_t packet, packet_tnew_packet)281 { 282 packet_t item;280 int pq_insert_after(packet_t *packet, packet_t *new_packet) 281 { 282 packet_t *item; 283 283 284 284 if (!packet_is_valid(packet) || !packet_is_valid(new_packet)) … … 303 303 * @return NULL if the packet is not valid. 304 304 */ 305 packet_t pq_detach(packet_tpacket)306 { 307 packet_t next;308 packet_t previous;305 packet_t *pq_detach(packet_t *packet) 306 { 307 packet_t *next; 308 packet_t *previous; 309 309 310 310 if (!packet_is_valid(packet)) … … 331 331 * @return EINVAL if the packet is invalid. 332 332 */ 333 int pq_set_order(packet_t packet, size_t order, size_t metric)333 int pq_set_order(packet_t *packet, size_t order, size_t metric) 334 334 { 335 335 if (!packet_is_valid(packet)) … … 349 349 * @return EINVAL if the packet is invalid. 350 350 */ 351 int pq_get_order(packet_t packet, size_t *order, size_t *metric)351 int pq_get_order(packet_t *packet, size_t *order, size_t *metric) 352 352 { 353 353 if (!packet_is_valid(packet)) … … 372 372 * packets after its detachment. 373 373 */ 374 void pq_destroy(packet_t first, void (*packet_release)(packet_tpacket))375 { 376 packet_t actual;377 packet_t next;374 void pq_destroy(packet_t *first, void (*packet_release)(packet_t *packet)) 375 { 376 packet_t *actual; 377 packet_t *next; 378 378 379 379 actual = first; … … 395 395 * @return NULL if the packet is not valid. 396 396 */ 397 packet_t pq_next(packet_tpacket)397 packet_t *pq_next(packet_t *packet) 398 398 { 399 399 if (!packet_is_valid(packet)) … … 410 410 * @return NULL if the packet is not valid. 411 411 */ 412 packet_t pq_previous(packet_tpacket)412 packet_t *pq_previous(packet_t *packet) 413 413 { 414 414 if (!packet_is_valid(packet)) -
uspace/lib/c/include/net/packet.h
r0b4a67a r7e1f9b7 46 46 * @see packet 47 47 */ 48 typedef struct packet *packet_t;48 typedef struct packet packet_t; 49 49 50 50 /** Type definition of the packet dimension. … … 69 69 /*@{*/ 70 70 71 extern packet_t pm_find(packet_id_t);72 extern int pm_add(packet_t );71 extern packet_t *pm_find(packet_id_t); 72 extern int pm_add(packet_t *); 73 73 extern int pm_init(void); 74 74 extern void pm_destroy(void); 75 75 76 extern int pq_add(packet_t * , packet_t, size_t, size_t);77 extern packet_t pq_find(packet_t, size_t);78 extern int pq_insert_after(packet_t , packet_t);79 extern packet_t pq_detach(packet_t);80 extern int pq_set_order(packet_t , size_t, size_t);81 extern int pq_get_order(packet_t , size_t *, size_t *);82 extern void pq_destroy(packet_t , void (*)(packet_t));83 extern packet_t pq_next(packet_t);84 extern packet_t pq_previous(packet_t);76 extern int pq_add(packet_t **, packet_t *, size_t, size_t); 77 extern packet_t *pq_find(packet_t *, size_t); 78 extern int pq_insert_after(packet_t *, packet_t *); 79 extern packet_t *pq_detach(packet_t *); 80 extern int pq_set_order(packet_t *, size_t, size_t); 81 extern int pq_get_order(packet_t *, size_t *, size_t *); 82 extern void pq_destroy(packet_t *, void (*)(packet_t *)); 83 extern packet_t *pq_next(packet_t *); 84 extern packet_t *pq_previous(packet_t *); 85 85 86 86 /*@}*/ -
uspace/lib/c/include/net/packet_header.h
r0b4a67a r7e1f9b7 128 128 * @return False otherwise. 129 129 */ 130 static inline int packet_is_valid(const packet_t packet)130 static inline int packet_is_valid(const packet_t *packet) 131 131 { 132 132 return packet && (packet->magic_value == PACKET_MAGIC_VALUE); -
uspace/lib/net/generic/packet_client.c
r0b4a67a r7e1f9b7 57 57 * @return ENOMEM if there is not enough memory left. 58 58 */ 59 int packet_copy_data(packet_t packet, const void *data, size_t length)59 int packet_copy_data(packet_t *packet, const void *data, size_t length) 60 60 { 61 61 if (!packet_is_valid(packet)) … … 81 81 * @return NULL if there is not enough memory left. 82 82 */ 83 void *packet_prefix(packet_t packet, size_t length)83 void *packet_prefix(packet_t *packet, size_t length) 84 84 { 85 85 if ((!packet_is_valid(packet)) || 86 (packet->data_start - sizeof( struct packet) -86 (packet->data_start - sizeof(packet_t) - 87 87 2 * (packet->dest_addr - packet->src_addr) < length)) { 88 88 return NULL; … … 102 102 * @return NULL if there is not enough memory left. 103 103 */ 104 void *packet_suffix(packet_t packet, size_t length)104 void *packet_suffix(packet_t *packet, size_t length) 105 105 { 106 106 if ((!packet_is_valid(packet)) || … … 124 124 * @return ENOMEM if there is not enough memory left. 125 125 */ 126 int packet_trim(packet_t packet, size_t prefix, size_t suffix)126 int packet_trim(packet_t *packet, size_t prefix, size_t suffix) 127 127 { 128 128 if (!packet_is_valid(packet)) … … 143 143 * @return Zero if the packet is not valid. 144 144 */ 145 packet_id_t packet_get_id(const packet_t packet)145 packet_id_t packet_get_id(const packet_t *packet) 146 146 { 147 147 return packet_is_valid(packet) ? packet->packet_id : 0; … … 157 157 * @return EINVAL if the packet is not valid. 158 158 */ 159 int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)159 int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest) 160 160 { 161 161 if (!packet_is_valid(packet)) … … 177 177 * @return Zero if the packet is not valid. 178 178 */ 179 size_t packet_get_data_length(const packet_t packet)179 size_t packet_get_data_length(const packet_t *packet) 180 180 { 181 181 if (!packet_is_valid(packet)) … … 191 191 * @return NULL if the packet is not valid. 192 192 */ 193 void *packet_get_data(const packet_t packet)193 void *packet_get_data(const packet_t *packet) 194 194 { 195 195 if (!packet_is_valid(packet)) … … 210 210 */ 211 211 int 212 packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,212 packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest, 213 213 size_t addr_len) 214 214 { … … 257 257 * @return NULL on error. 258 258 */ 259 packet_t packet_get_copy(int phone, packet_tpacket)260 { 261 packet_t copy;259 packet_t *packet_get_copy(int phone, packet_t *packet) 260 { 261 packet_t *copy; 262 262 uint8_t * src = NULL; 263 263 uint8_t * dest = NULL; -
uspace/lib/net/generic/packet_remote.c
r0b4a67a r7e1f9b7 64 64 */ 65 65 static int 66 packet_return(int phone, packet_t * packet, packet_id_t packet_id, size_t size)66 packet_return(int phone, packet_t **packet, packet_id_t packet_id, size_t size) 67 67 { 68 68 ipc_call_t answer; … … 72 72 message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer); 73 73 74 *packet = (packet_t ) as_get_mappable_page(size);74 *packet = (packet_t *) as_get_mappable_page(size); 75 75 rc = async_share_in_start_0_0(phone, *packet, size); 76 76 if (rc != EOK) { … … 107 107 * function. 108 108 */ 109 int packet_translate_remote(int phone, packet_t * packet, packet_id_t packet_id)109 int packet_translate_remote(int phone, packet_t **packet, packet_id_t packet_id) 110 110 { 111 111 int rc; … … 127 127 } 128 128 if ((*packet)->next) { 129 packet_t next;129 packet_t *next; 130 130 131 131 return packet_translate_remote(phone, &next, (*packet)->next); … … 148 148 * @return NULL on error. 149 149 */ 150 packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,150 packet_t *packet_get_4_remote(int phone, size_t max_content, size_t addr_len, 151 151 size_t max_prefix, size_t max_suffix) 152 152 { … … 161 161 162 162 163 packet_t packet = pm_find(packet_id);163 packet_t *packet = pm_find(packet_id); 164 164 if (!packet) { 165 165 rc = packet_return(phone, &packet, packet_id, size); … … 180 180 * @return NULL on error. 181 181 */ 182 packet_t packet_get_1_remote(int phone, size_t content)182 packet_t *packet_get_1_remote(int phone, size_t content) 183 183 { 184 184 ipcarg_t packet_id; … … 191 191 return NULL; 192 192 193 packet_t packet = pm_find(packet_id);193 packet_t *packet = pm_find(packet_id); 194 194 if (!packet) { 195 195 rc = packet_return(phone, &packet, packet_id, size); -
uspace/lib/net/il/il_interface.c
r0b4a67a r7e1f9b7 77 77 * 78 78 */ 79 int il_received_msg(int il_phone, device_id_t device_id, packet_t packet,79 int il_received_msg(int il_phone, device_id_t device_id, packet_t *packet, 80 80 services_t target) 81 81 { -
uspace/lib/net/il/ip_client.c
r0b4a67a r7e1f9b7 51 51 * @return Zero if there is no IP header. 52 52 */ 53 size_t ip_client_header_length(packet_t packet)53 size_t ip_client_header_length(packet_t *packet) 54 54 { 55 55 ip_header_t *header; … … 152 152 */ 153 153 int 154 ip_client_prepare_packet(packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl,154 ip_client_prepare_packet(packet_t *packet, ip_protocol_t protocol, ip_ttl_t ttl, 155 155 ip_tos_t tos, int dont_fragment, size_t ipopt_length) 156 156 { … … 208 208 */ 209 209 int 210 ip_client_process_packet(packet_t packet, ip_protocol_t *protocol,210 ip_client_process_packet(packet_t *packet, ip_protocol_t *protocol, 211 211 ip_ttl_t *ttl, ip_tos_t *tos, int *dont_fragment, size_t *ipopt_length) 212 212 { -
uspace/lib/net/il/ip_remote.c
r0b4a67a r7e1f9b7 204 204 */ 205 205 int ip_received_error_msg_remote(int ip_phone, device_id_t device_id, 206 packet_t packet, services_t target, services_t error)206 packet_t *packet, services_t target, services_t error) 207 207 { 208 208 return generic_received_msg_remote(ip_phone, NET_IP_RECEIVED_ERROR, … … 225 225 * function. 226 226 */ 227 int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t packet,227 int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t *packet, 228 228 services_t sender, services_t error) 229 229 { -
uspace/lib/net/include/icmp_client.h
r0b4a67a r7e1f9b7 41 41 #include <net/packet.h> 42 42 43 extern int icmp_client_process_packet(packet_t , icmp_type_t *, icmp_code_t *,43 extern int icmp_client_process_packet(packet_t *, icmp_type_t *, icmp_code_t *, 44 44 icmp_param_t *, icmp_param_t *); 45 extern size_t icmp_client_header_length(packet_t );45 extern size_t icmp_client_header_length(packet_t *); 46 46 47 47 #endif -
uspace/lib/net/include/icmp_interface.h
r0b4a67a r7e1f9b7 51 51 52 52 extern int icmp_destination_unreachable_msg(int, icmp_code_t, icmp_param_t, 53 packet_t );54 extern int icmp_source_quench_msg(int, packet_t );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 );53 packet_t *); 54 extern int icmp_source_quench_msg(int, packet_t *); 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 *); 57 57 58 58 /*@}*/ -
uspace/lib/net/include/il_interface.h
r0b4a67a r7e1f9b7 51 51 52 52 extern int il_device_state_msg(int, device_id_t, device_state_t, services_t); 53 extern int il_received_msg(int, device_id_t, packet_t , services_t);53 extern int il_received_msg(int, device_id_t, packet_t *, services_t); 54 54 extern int il_mtu_changed_msg(int, device_id_t, size_t, services_t); 55 55 -
uspace/lib/net/include/ip_client.h
r0b4a67a r7e1f9b7 45 45 #include <ip_interface.h> 46 46 47 extern int ip_client_prepare_packet(packet_t , ip_protocol_t, ip_ttl_t, ip_tos_t,48 i nt, size_t);49 extern int ip_client_process_packet(packet_t , ip_protocol_t *, ip_ttl_t *,47 extern int ip_client_prepare_packet(packet_t *, ip_protocol_t, ip_ttl_t, 48 ip_tos_t, int, size_t); 49 extern int ip_client_process_packet(packet_t *, ip_protocol_t *, ip_ttl_t *, 50 50 ip_tos_t *, int *, size_t *); 51 extern size_t ip_client_header_length(packet_t );51 extern size_t ip_client_header_length(packet_t *); 52 52 extern int ip_client_set_pseudo_header_data_length(void *, size_t, size_t); 53 53 extern int ip_client_get_pseudo_header(ip_protocol_t, struct sockaddr *, -
uspace/lib/net/include/ip_interface.h
r0b4a67a r7e1f9b7 70 70 * @return EOK on success. 71 71 */ 72 typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t packet,72 typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t *packet, 73 73 services_t receiver, services_t error); 74 74 -
uspace/lib/net/include/ip_remote.h
r0b4a67a r7e1f9b7 45 45 extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t); 46 46 extern int ip_packet_size_req_remote(int, device_id_t, packet_dimension_t *); 47 extern int ip_received_error_msg_remote(int, device_id_t, packet_t , services_t,47 extern int ip_received_error_msg_remote(int, device_id_t, packet_t *, services_t, 48 48 services_t); 49 49 extern int ip_device_req_remote(int, device_id_t, services_t); 50 50 extern int ip_add_route_req_remote(int, device_id_t, in_addr_t, in_addr_t, 51 51 in_addr_t); 52 extern int ip_send_msg_remote(int, device_id_t, packet_t , services_t,52 extern int ip_send_msg_remote(int, device_id_t, packet_t *, services_t, 53 53 services_t); 54 54 extern int ip_get_route_req_remote(int, ip_protocol_t, const struct sockaddr *, -
uspace/lib/net/include/netif_local.h
r0b4a67a r7e1f9b7 111 111 * message implementation. 112 112 */ 113 extern int netif_send_message(device_id_t device_id, packet_t packet,113 extern int netif_send_message(device_id_t device_id, packet_t *packet, 114 114 services_t sender); 115 115 … … 198 198 char **); 199 199 extern int netif_probe_req_local(int, device_id_t, int, int); 200 extern int netif_send_msg_local(int, device_id_t, packet_t , services_t);200 extern int netif_send_msg_local(int, device_id_t, packet_t *, services_t); 201 201 extern int netif_start_req_local(int, device_id_t); 202 202 extern int netif_stop_req_local(int, device_id_t); … … 208 208 extern void null_device_stats(device_stats_t *); 209 209 extern void netif_pq_release(packet_id_t); 210 extern packet_t netif_packet_get_1(size_t);210 extern packet_t *netif_packet_get_1(size_t); 211 211 extern int netif_init_module(async_client_conn_t); 212 212 -
uspace/lib/net/include/netif_remote.h
r0b4a67a r7e1f9b7 44 44 char **); 45 45 extern int netif_probe_req_remote(int, device_id_t, int, int); 46 extern int netif_send_msg_remote(int, device_id_t, packet_t , services_t);46 extern int netif_send_msg_remote(int, device_id_t, packet_t *, services_t); 47 47 extern int netif_start_req_remote(int, device_id_t); 48 48 extern int netif_stop_req_remote(int, device_id_t); -
uspace/lib/net/include/nil_local.h
r0b4a67a r7e1f9b7 77 77 * received function. 78 78 */ 79 extern int nil_received_msg_local(int, device_id_t, packet_t , services_t);79 extern int nil_received_msg_local(int, device_id_t, packet_t *, services_t); 80 80 81 81 /** Message processing function. -
uspace/lib/net/include/nil_remote.h
r0b4a67a r7e1f9b7 39 39 40 40 extern int nil_device_state_msg_remote(int, device_id_t, int); 41 extern int nil_received_msg_remote(int, device_id_t, packet_t , services_t);41 extern int nil_received_msg_remote(int, device_id_t, packet_t *, services_t); 42 42 43 43 #endif -
uspace/lib/net/include/packet_client.h
r0b4a67a r7e1f9b7 99 99 packet_trim((packet), sizeof(prefix), sizeof(suffix)) 100 100 101 extern void *packet_prefix(packet_t , size_t);102 extern void *packet_suffix(packet_t , size_t);103 extern int packet_trim(packet_t , size_t, size_t);104 extern int packet_copy_data(packet_t , const void *, size_t);105 extern packet_id_t packet_get_id(const packet_t );106 extern size_t packet_get_data_length(const packet_t );107 extern void *packet_get_data(const packet_t );108 extern int packet_get_addr(const packet_t , uint8_t **, uint8_t **);109 extern int packet_set_addr(packet_t , const uint8_t *, const uint8_t *, size_t);110 extern packet_t packet_get_copy(int phone, packet_t packet);101 extern void *packet_prefix(packet_t *, size_t); 102 extern void *packet_suffix(packet_t *, size_t); 103 extern int packet_trim(packet_t *, size_t, size_t); 104 extern int packet_copy_data(packet_t *, const void *, size_t); 105 extern packet_id_t packet_get_id(const packet_t *); 106 extern size_t packet_get_data_length(const packet_t *); 107 extern void *packet_get_data(const packet_t *); 108 extern int packet_get_addr(const packet_t *, uint8_t **, uint8_t **); 109 extern int packet_set_addr(packet_t *, const uint8_t *, const uint8_t *, size_t); 110 extern packet_t *packet_get_copy(int, packet_t *); 111 111 112 112 /*@}*/ -
uspace/lib/net/include/packet_remote.h
r0b4a67a r7e1f9b7 37 37 #include <sys/types.h> 38 38 39 extern int packet_translate_remote(int, packet_t * , packet_id_t);40 extern packet_t packet_get_4_remote(int, size_t, size_t, size_t, size_t);41 extern packet_t packet_get_1_remote(int, size_t);39 extern int packet_translate_remote(int, packet_t **, packet_id_t); 40 extern packet_t *packet_get_4_remote(int, size_t, size_t, size_t, size_t); 41 extern packet_t *packet_get_1_remote(int, size_t); 42 42 extern void pq_release_remote(int, packet_id_t); 43 43 -
uspace/lib/net/include/socket_core.h
r0b4a67a r7e1f9b7 117 117 extern int socket_destroy(int, int, socket_cores_t *, socket_ports_t *, 118 118 void (*)(socket_core_t *)); 119 extern int socket_reply_packets(packet_t , size_t *);119 extern int socket_reply_packets(packet_t *, size_t *); 120 120 extern socket_core_t *socket_port_find(socket_ports_t *, int, const char *, 121 121 size_t); -
uspace/lib/net/include/tl_common.h
r0b4a67a r7e1f9b7 57 57 size_t); 58 58 extern int tl_set_address_port(struct sockaddr *, int, uint16_t); 59 extern int tl_prepare_icmp_packet(int, int, packet_t , services_t);60 extern int tl_socket_read_packet_data(int, packet_t * , size_t,59 extern int tl_prepare_icmp_packet(int, int, packet_t *, services_t); 60 extern int tl_socket_read_packet_data(int, packet_t **, size_t, 61 61 const packet_dimension_t *, const struct sockaddr *, socklen_t); 62 62 -
uspace/lib/net/include/tl_interface.h
r0b4a67a r7e1f9b7 52 52 /*@{*/ 53 53 54 extern int tl_received_msg(int, device_id_t, packet_t , services_t, services_t);54 extern int tl_received_msg(int, device_id_t, packet_t *, services_t, services_t); 55 55 56 56 /*@}*/ -
uspace/lib/net/netif/netif_local.c
r0b4a67a r7e1f9b7 92 92 */ 93 93 int netif_send_msg_local(int netif_phone, device_id_t device_id, 94 packet_t packet, services_t sender)94 packet_t *packet, services_t sender) 95 95 { 96 96 fibril_rwlock_write_lock(&netif_globals.lock); … … 307 307 * 308 308 */ 309 packet_t netif_packet_get_1(size_t content)309 packet_t *netif_packet_get_1(size_t content) 310 310 { 311 311 return packet_get_1_remote(netif_globals.net_phone, content); … … 361 361 size_t length; 362 362 device_stats_t stats; 363 packet_t packet;363 packet_t *packet; 364 364 measured_string_t address; 365 365 int rc; -
uspace/lib/net/netif/netif_remote.c
r0b4a67a r7e1f9b7 93 93 */ 94 94 int 95 netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t packet,95 netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t *packet, 96 96 services_t sender) 97 97 { -
uspace/lib/net/nil/nil_remote.c
r0b4a67a r7e1f9b7 74 74 */ 75 75 int nil_received_msg_remote(int nil_phone, device_id_t device_id, 76 packet_t packet, services_t target)76 packet_t *packet, services_t target) 77 77 { 78 78 return generic_received_msg_remote(nil_phone, NET_NIL_RECEIVED, -
uspace/lib/net/tl/icmp_client.c
r0b4a67a r7e1f9b7 61 61 */ 62 62 int 63 icmp_client_process_packet(packet_t packet, icmp_type_t *type,63 icmp_client_process_packet(packet_t *packet, icmp_type_t *type, 64 64 icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu) 65 65 { … … 94 94 * @return The ICMP header length in bytes. 95 95 */ 96 size_t icmp_client_header_length(packet_t packet)96 size_t icmp_client_header_length(packet_t *packet) 97 97 { 98 98 if (packet_get_data_length(packet) < sizeof(icmp_header_t)) -
uspace/lib/net/tl/icmp_remote.c
r0b4a67a r7e1f9b7 63 63 int 64 64 icmp_destination_unreachable_msg(int icmp_phone, icmp_code_t code, 65 icmp_param_t mtu, packet_t packet)65 icmp_param_t mtu, packet_t *packet) 66 66 { 67 67 async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code, … … 82 82 * @return ENOMEM if there is not enough memory left. 83 83 */ 84 int icmp_source_quench_msg(int icmp_phone, packet_t packet)84 int icmp_source_quench_msg(int icmp_phone, packet_t *packet) 85 85 { 86 86 async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0, … … 102 102 * @return ENOMEM if there is not enough memory left. 103 103 */ 104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet)104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet) 105 105 { 106 106 async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code, … … 124 124 */ 125 125 int icmp_parameter_problem_msg(int icmp_phone, icmp_code_t code, 126 icmp_param_t pointer, packet_t packet)126 icmp_param_t pointer, packet_t *packet) 127 127 { 128 128 async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code, -
uspace/lib/net/tl/socket_core.c
r0b4a67a r7e1f9b7 522 522 * function. 523 523 */ 524 int socket_reply_packets(packet_t packet, size_t *length)525 { 526 packet_t next_packet;524 int socket_reply_packets(packet_t *packet, size_t *length) 525 { 526 packet_t *next_packet; 527 527 size_t fragments; 528 528 size_t *lengths; -
uspace/lib/net/tl/tl_common.c
r0b4a67a r7e1f9b7 248 248 */ 249 249 int 250 tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t packet,250 tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t *packet, 251 251 services_t error) 252 252 { 253 packet_t next;253 packet_t *next; 254 254 uint8_t *src; 255 255 int length; … … 287 287 */ 288 288 int 289 tl_socket_read_packet_data(int packet_phone, packet_t * packet, size_t prefix,289 tl_socket_read_packet_data(int packet_phone, packet_t **packet, size_t prefix, 290 290 const packet_dimension_t *dimension, const struct sockaddr *addr, 291 291 socklen_t addrlen) -
uspace/lib/net/tl/tl_interface.c
r0b4a67a r7e1f9b7 58 58 */ 59 59 int 60 tl_received_msg(int tl_phone, device_id_t device_id, packet_t packet,60 tl_received_msg(int tl_phone, device_id_t device_id, packet_t *packet, 61 61 services_t target, services_t error) 62 62 { -
uspace/lib/packet/generic/packet_server.c
r0b4a67a r7e1f9b7 36 36 37 37 #include <packet_server.h> 38 #include <packet_local.h>39 38 40 39 #include <align.h> … … 69 68 fibril_mutex_t lock; 70 69 /** Free packet queues. */ 71 packet_t free[FREE_QUEUES_COUNT];70 packet_t *free[FREE_QUEUES_COUNT]; 72 71 73 72 /** … … 103 102 }; 104 103 105 int packet_translate_local(int phone, packet_t *packet, packet_id_t packet_id)106 {107 if (!packet)108 return EINVAL;109 110 *packet = pm_find(packet_id);111 return (*packet) ? EOK : ENOENT;112 }113 114 104 /** Clears and initializes the packet according to the given dimensions. 115 105 * … … 122 112 */ 123 113 static void 124 packet_init(packet_t packet, size_t addr_len, size_t max_prefix,114 packet_init(packet_t *packet, size_t addr_len, size_t max_prefix, 125 115 size_t max_content, size_t max_suffix) 126 116 { 127 117 // clear the packet content 128 bzero(((void *) packet) + sizeof( struct packet),129 packet->length - sizeof( struct packet));118 bzero(((void *) packet) + sizeof(packet_t), 119 packet->length - sizeof(packet_t)); 130 120 131 121 // clear the packet header … … 135 125 packet->next = 0; 136 126 packet->addr_len = 0; 137 packet->src_addr = sizeof( struct packet);127 packet->src_addr = sizeof(packet_t); 138 128 packet->dest_addr = packet->src_addr + addr_len; 139 129 packet->max_prefix = max_prefix; … … 157 147 * @return NULL if there is not enough memory left. 158 148 */ 159 static packet_t 149 static packet_t * 160 150 packet_create(size_t length, size_t addr_len, size_t max_prefix, 161 151 size_t max_content, size_t max_suffix) 162 152 { 163 packet_t packet;153 packet_t *packet; 164 154 int rc; 165 155 166 156 // already locked 167 packet = (packet_t ) mmap(NULL, length, PROTO_READ | PROTO_WRITE,157 packet = (packet_t *) mmap(NULL, length, PROTO_READ | PROTO_WRITE, 168 158 MAP_SHARED | MAP_ANONYMOUS, 0, 0); 169 159 if (packet == MAP_FAILED) … … 198 188 * @return NULL if there is not enough memory left. 199 189 */ 200 static packet_t 190 static packet_t * 201 191 packet_get_local(size_t addr_len, size_t max_prefix, size_t max_content, 202 192 size_t max_suffix) 203 193 { 204 size_t length = ALIGN_UP(sizeof( struct packet) + 2 * addr_len +194 size_t length = ALIGN_UP(sizeof(packet_t) + 2 * addr_len + 205 195 max_prefix + max_content + max_suffix, PAGE_SIZE); 206 196 207 197 fibril_mutex_lock(&ps_globals.lock); 208 198 209 packet_t packet;199 packet_t *packet; 210 200 unsigned int index; 211 201 … … 241 231 } 242 232 243 packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len,244 size_t max_prefix, size_t max_suffix)245 {246 return packet_get_local(addr_len, max_prefix, max_content, max_suffix);247 }248 249 packet_t packet_get_1_local(int phone, size_t content)250 {251 return packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, content,252 DEFAULT_SUFFIX);253 }254 255 233 /** Release the packet and returns it to the appropriate free packet queue. 256 234 * … … 260 238 * 261 239 */ 262 static void packet_release(packet_t packet)240 static void packet_release(packet_t *packet) 263 241 { 264 242 int index; … … 283 261 static int packet_release_wrapper(packet_id_t packet_id) 284 262 { 285 packet_t packet;263 packet_t *packet; 286 264 287 265 packet = pm_find(packet_id); … … 294 272 295 273 return EOK; 296 }297 298 void pq_release_local(int phone, packet_id_t packet_id)299 {300 (void) packet_release_wrapper(packet_id);301 274 } 302 275 … … 310 283 * async_share_in_finalize() function. 311 284 */ 312 static int packet_reply( const packet_tpacket)285 static int packet_reply(packet_t *packet) 313 286 { 314 287 ipc_callid_t callid; … … 351 324 int *answer_count) 352 325 { 353 packet_t packet;326 packet_t *packet; 354 327 355 328 *answer_count = 0; -
uspace/srv/hw/netif/dp8390/dp8390.c
r0b4a67a r7e1f9b7 65 65 * @return EINVAL 66 66 */ 67 int queue_packet(dpeth_t * dep, packet_t packet);67 int queue_packet(dpeth_t * dep, packet_t *packet); 68 68 69 69 /** Reads a memory block byte by byte. … … 336 336 } 337 337 338 int queue_packet(dpeth_t * dep, packet_t packet){339 packet_t tmp;338 int queue_packet(dpeth_t * dep, packet_t *packet){ 339 packet_t *tmp; 340 340 341 341 if(dep->packet_count >= MAX_PACKETS){ … … 361 361 * based on do_vwrite * 362 362 *===========================================================================*/ 363 int do_pwrite(dpeth_t * dep, packet_t packet, int from_int)363 int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int) 364 364 { 365 365 // int port, count, size; … … 910 910 dpeth_t *dep; 911 911 { 912 packet_t packet;912 packet_t *packet; 913 913 914 914 // if (!(dep->de_flags &DEF_SEND_AVAIL)) … … 1003 1003 { 1004 1004 int last, count; 1005 packet_t packet;1005 packet_t *packet; 1006 1006 1007 1007 // if (!(dep->de_flags &DEF_READING)) -
uspace/srv/hw/netif/dp8390/dp8390.h
r0b4a67a r7e1f9b7 313 313 /** Outgoing packets queue. 314 314 */ 315 packet_t packet_queue;315 packet_t *packet_queue; 316 316 /** Outgoing packets count. 317 317 */ … … 320 320 /** Received packets queue. 321 321 */ 322 packet_t received_queue;322 packet_t *received_queue; 323 323 /** Received packets count. 324 324 */ -
uspace/srv/hw/netif/dp8390/dp8390_drv.h
r0b4a67a r7e1f9b7 72 72 * @returns 73 73 */ 74 int do_pwrite(dpeth_t * dep, packet_t packet, int from_int);74 int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int); 75 75 76 76 /** Prints out network interface information. -
uspace/srv/hw/netif/dp8390/dp8390_module.c
r0b4a67a r7e1f9b7 103 103 netif_device_t * device; 104 104 dpeth_t * dep; 105 packet_t received;105 packet_t *received; 106 106 device_id_t device_id; 107 107 int phone; … … 247 247 } 248 248 249 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender){250 netif_device_t * device; 251 dpeth_t * dep; 252 packet_t next;249 int netif_send_message(device_id_t device_id, packet_t *packet, services_t sender){ 250 netif_device_t * device; 251 dpeth_t * dep; 252 packet_t *next; 253 253 int rc; 254 254 -
uspace/srv/net/il/arp/arp.c
r0b4a67a r7e1f9b7 415 415 * @return ENOMEM if there is not enough memory left. 416 416 */ 417 static int arp_receive_message(device_id_t device_id, packet_t packet)417 static int arp_receive_message(device_id_t device_id, packet_t *packet) 418 418 { 419 419 size_t length; … … 531 531 measured_string_t *addr; 532 532 size_t length; 533 packet_t packet;533 packet_t *packet; 534 534 arp_header_t *header; 535 535 … … 615 615 measured_string_t *translation; 616 616 char *data; 617 packet_t packet;618 packet_t next;617 packet_t *packet; 618 packet_t *next; 619 619 int rc; 620 620 -
uspace/srv/net/il/ip/ip.c
r0b4a67a r7e1f9b7 129 129 * @return The result parameter. 130 130 */ 131 static int ip_release_and_return(packet_t packet, int result)131 static int ip_release_and_return(packet_t *packet, int result) 132 132 { 133 133 pq_release_remote(ip_globals.net_phone, packet_get_id(packet)); … … 170 170 * @return Other error codes as defined for the packet_set_addr(). 171 171 */ 172 static int ip_prepare_icmp(packet_t packet, ip_header_t *header)173 { 174 packet_t next;172 static int ip_prepare_icmp(packet_t *packet, ip_header_t *header) 173 { 174 packet_t *next; 175 175 struct sockaddr *dest; 176 176 struct sockaddr_in dest_in; … … 233 233 */ 234 234 static int 235 ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,235 ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet, 236 236 ip_header_t *header) 237 237 { … … 543 543 */ 544 544 static ip_header_t * 545 ip_create_middle_header(packet_t packet, ip_header_t *last)545 ip_create_middle_header(packet_t *packet, ip_header_t *last) 546 546 { 547 547 ip_header_t *middle; … … 622 622 */ 623 623 static int 624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t *packet, 625 625 measured_string_t *destination) 626 626 { … … 629 629 ip_header_t *last_header; 630 630 ip_header_t *middle_header; 631 packet_t next;631 packet_t *next; 632 632 int rc; 633 633 … … 754 754 */ 755 755 static int 756 ip_fragment_packet_data(packet_t packet, packet_tnew_packet,756 ip_fragment_packet_data(packet_t *packet, packet_t *new_packet, 757 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) … … 816 816 */ 817 817 static int 818 ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,818 ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix, 819 819 socklen_t addr_len) 820 820 { 821 packet_t new_packet;821 packet_t *new_packet; 822 822 ip_header_t *header; 823 823 ip_header_t *middle_header; … … 922 922 * @return NULL if there are no packets left. 923 923 */ 924 static packet_t 925 ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,924 static packet_t * 925 ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix, 926 926 socklen_t addr_len, services_t error) 927 927 { 928 928 size_t length; 929 packet_t next;930 packet_t new_packet;929 packet_t *next; 930 packet_t *new_packet; 931 931 int result; 932 932 int phone; … … 993 993 */ 994 994 static int 995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route,995 ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route, 996 996 in_addr_t *src, in_addr_t dest, services_t error) 997 997 { … … 1247 1247 1248 1248 static int 1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet, 1250 1250 services_t sender, services_t error) 1251 1251 { … … 1451 1451 */ 1452 1452 static int 1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,1453 ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header, 1454 1454 services_t error) 1455 1455 { … … 1553 1553 */ 1554 1554 static int 1555 ip_process_packet(device_id_t device_id, packet_t packet)1555 ip_process_packet(device_id_t device_id, packet_t *packet) 1556 1556 { 1557 1557 ip_header_t *header; … … 1715 1715 static int 1716 1716 ip_received_error_msg_local(int ip_phone, device_id_t device_id, 1717 packet_t packet, services_t target, services_t error)1717 packet_t *packet, services_t target, services_t error) 1718 1718 { 1719 1719 uint8_t *data; … … 1859 1859 * @return ENOMEM if there is not enough memory left. 1860 1860 */ 1861 static int ip_receive_message(device_id_t device_id, packet_t packet)1862 { 1863 packet_t next;1861 static int ip_receive_message(device_id_t device_id, packet_t *packet) 1862 { 1863 packet_t *next; 1864 1864 1865 1865 do { … … 1890 1890 int *answer_count) 1891 1891 { 1892 packet_t packet;1892 packet_t *packet; 1893 1893 struct sockaddr *addr; 1894 1894 size_t addrlen; -
uspace/srv/net/netif/lo/lo.c
r0b4a67a r7e1f9b7 185 185 } 186 186 187 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender)187 int netif_send_message(device_id_t device_id, packet_t *packet, services_t sender) 188 188 { 189 189 netif_device_t *device; 190 190 size_t length; 191 packet_t next;191 packet_t *next; 192 192 int phone; 193 193 int rc; -
uspace/srv/net/nil/eth/eth.c
r0b4a67a r7e1f9b7 234 234 static void eth_receiver(ipc_callid_t iid, ipc_call_t *icall) 235 235 { 236 packet_t packet;236 packet_t *packet; 237 237 int rc; 238 238 … … 429 429 * @return NULL if the packet address length is not big enough. 430 430 */ 431 static eth_proto_t *eth_process_packet(int flags, packet_t packet)431 static eth_proto_t *eth_process_packet(int flags, packet_t *packet) 432 432 { 433 433 eth_header_snap_t *header; … … 509 509 510 510 int nil_received_msg_local(int nil_phone, device_id_t device_id, 511 packet_t packet, services_t target)511 packet_t *packet, services_t target) 512 512 { 513 513 eth_proto_t *proto; 514 packet_t next;514 packet_t *next; 515 515 eth_device_t *device; 516 516 int flags; … … 680 680 */ 681 681 static int 682 eth_prepare_packet(int flags, packet_t packet, uint8_t *src_addr, int ethertype,682 eth_prepare_packet(int flags, packet_t *packet, uint8_t *src_addr, int ethertype, 683 683 size_t mtu) 684 684 { … … 787 787 * @return EINVAL if the service parameter is not known. 788 788 */ 789 static int eth_send_message(device_id_t device_id, packet_t packet,789 static int eth_send_message(device_id_t device_id, packet_t *packet, 790 790 services_t sender) 791 791 { 792 792 eth_device_t *device; 793 packet_t next;794 packet_t tmp;793 packet_t *next; 794 packet_t *tmp; 795 795 int ethertype; 796 796 int rc; … … 841 841 { 842 842 measured_string_t *address; 843 packet_t packet;843 packet_t *packet; 844 844 size_t addrlen; 845 845 size_t prefix; -
uspace/srv/net/nil/nildummy/nildummy.c
r0b4a67a r7e1f9b7 106 106 static void nildummy_receiver(ipc_callid_t iid, ipc_call_t *icall) 107 107 { 108 packet_t packet;108 packet_t *packet; 109 109 int rc; 110 110 … … 304 304 305 305 int nil_received_msg_local(int nil_phone, device_id_t device_id, 306 packet_t packet, services_t target)307 { 308 packet_t next;306 packet_t *packet, services_t target) 307 { 308 packet_t *next; 309 309 310 310 fibril_rwlock_read_lock(&nildummy_globals.protos_lock); … … 354 354 * @return EINVAL if the service parameter is not known. 355 355 */ 356 static int nildummy_send_message(device_id_t device_id, packet_t packet,356 static int nildummy_send_message(device_id_t device_id, packet_t *packet, 357 357 services_t sender) 358 358 { … … 378 378 { 379 379 measured_string_t *address; 380 packet_t packet;380 packet_t *packet; 381 381 size_t addrlen; 382 382 size_t prefix; -
uspace/srv/net/tl/icmp/icmp.c
r0b4a67a r7e1f9b7 130 130 * @return The result parameter. 131 131 */ 132 static int icmp_release_and_return(packet_t packet, int result)132 static int icmp_release_and_return(packet_t *packet, int result) 133 133 { 134 134 pq_release_remote(icmp_globals.net_phone, packet_get_id(packet)); … … 155 155 * @return EPERM if the error message is not allowed. 156 156 */ 157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t *packet, 158 158 icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos, 159 159 int dont_fragment) … … 189 189 * @return NULL on errors. 190 190 */ 191 static icmp_header_t *icmp_prepare_packet(packet_t packet)191 static icmp_header_t *icmp_prepare_packet(packet_t *packet) 192 192 { 193 193 icmp_header_t *header; … … 248 248 { 249 249 icmp_header_t *header; 250 packet_t packet;250 packet_t *packet; 251 251 size_t length; 252 252 uint8_t *data; … … 340 340 341 341 static int icmp_destination_unreachable_msg_local(int icmp_phone, 342 icmp_code_t code, icmp_param_t mtu, packet_t packet)342 icmp_code_t code, icmp_param_t mtu, packet_t *packet) 343 343 { 344 344 icmp_header_t *header; … … 355 355 } 356 356 357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet)357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t *packet) 358 358 { 359 359 icmp_header_t *header; … … 368 368 369 369 static int icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code, 370 packet_t packet)370 packet_t *packet) 371 371 { 372 372 icmp_header_t *header; … … 381 381 382 382 static int icmp_parameter_problem_msg_local(int icmp_phone, icmp_code_t code, 383 icmp_param_t pointer, packet_t packet)383 icmp_param_t pointer, packet_t *packet) 384 384 { 385 385 icmp_header_t *header; … … 479 479 * @param[in] code The received reply message code. 480 480 */ 481 static void icmp_process_echo_reply(packet_t packet, icmp_header_t *header,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 { … … 518 518 * ip_client_process_packet() function. 519 519 */ 520 static int icmp_process_packet(packet_t packet, services_t error)520 static int icmp_process_packet(packet_t *packet, services_t error) 521 521 { 522 522 size_t length; … … 658 658 * icmp_process_packet() function. 659 659 */ 660 static int icmp_received_msg_local(device_id_t device_id, packet_t packet,660 static int icmp_received_msg_local(device_id_t device_id, packet_t *packet, 661 661 services_t receiver, services_t error) 662 662 { … … 690 690 static int icmp_process_message(ipc_call_t *call) 691 691 { 692 packet_t packet;692 packet_t *packet; 693 693 int rc; 694 694 … … 896 896 ipc_call_t *answer, int *answer_count) 897 897 { 898 packet_t packet;898 packet_t *packet; 899 899 int rc; 900 900 -
uspace/srv/net/tl/tcp/tcp.c
r0b4a67a r7e1f9b7 160 160 }; 161 161 162 static int tcp_release_and_return(packet_t , int);162 static int tcp_release_and_return(packet_t *, int); 163 163 static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *, 164 164 tcp_header_t *, int synchronize, int); … … 171 171 static int tcp_release_after_timeout(void *); 172 172 173 static int tcp_process_packet(device_id_t, packet_t , services_t);173 static int tcp_process_packet(device_id_t, packet_t *, services_t); 174 174 static int tcp_connect_core(socket_core_t *, socket_cores_t *, 175 175 struct sockaddr *, socklen_t); 176 176 static int tcp_queue_prepare_packet(socket_core_t *, tcp_socket_data_t *, 177 packet_t , size_t);178 static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t ,177 packet_t *, size_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_t *, tcp_socket_data_t *);181 static void tcp_send_packets(device_id_t, packet_t );180 static packet_t *tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *); 181 static void tcp_send_packets(device_id_t, packet_t *); 182 182 183 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_t *, tcp_socket_data_t *,186 packet_t , size_t, size_t);187 static packet_t tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, packet_t,188 size_t, size_t);185 static packet_t *tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *, 186 packet_t *, size_t, size_t); 187 static packet_t *tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, 188 packet_t *, size_t, size_t); 189 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_t *,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 *); … … 196 196 197 197 static int tcp_process_listen(socket_core_t *, tcp_socket_data_t *, 198 tcp_header_t *, packet_t , struct sockaddr *, struct sockaddr *, size_t);198 tcp_header_t *, packet_t *, struct sockaddr *, struct sockaddr *, size_t); 199 199 static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *, 200 tcp_header_t *, packet_t );200 tcp_header_t *, packet_t *); 201 201 static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *, 202 tcp_header_t *, packet_t );202 tcp_header_t *, packet_t *); 203 203 static int tcp_process_established(socket_core_t *, tcp_socket_data_t *, 204 tcp_header_t *, packet_t , int, size_t);204 tcp_header_t *, packet_t *, int, size_t); 205 205 static int tcp_queue_received_packet(socket_core_t *, tcp_socket_data_t *, 206 packet_t , int, size_t);207 208 static int tcp_received_msg(device_id_t, packet_t , services_t, services_t);206 packet_t *, int, size_t); 207 208 static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t); 209 209 static int tcp_process_client_messages(ipc_callid_t, ipc_call_t); 210 210 … … 262 262 } 263 263 264 int tcp_received_msg(device_id_t device_id, packet_t packet,264 int tcp_received_msg(device_id_t device_id, packet_t *packet, 265 265 services_t receiver, services_t error) 266 266 { … … 280 280 } 281 281 282 int tcp_process_packet(device_id_t device_id, packet_t packet, services_t error)282 int tcp_process_packet(device_id_t device_id, packet_t *packet, services_t error) 283 283 { 284 284 size_t length; … … 288 288 socket_core_t *socket; 289 289 tcp_socket_data_t *socket_data; 290 packet_t next_packet;290 packet_t *next_packet; 291 291 size_t total_length; 292 292 uint32_t checksum; … … 493 493 494 494 int tcp_process_established(socket_core_t *socket, tcp_socket_data_t * 495 socket_data, tcp_header_t *header, packet_t packet, int fragments,495 socket_data, tcp_header_t *header, packet_t *packet, int fragments, 496 496 size_t total_length) 497 497 { 498 packet_t next_packet;499 packet_t tmp_packet;498 packet_t *next_packet; 499 packet_t *tmp_packet; 500 500 uint32_t old_incoming; 501 501 size_t order; … … 801 801 802 802 int tcp_queue_received_packet(socket_core_t *socket, 803 tcp_socket_data_t *socket_data, packet_t packet, int fragments,803 tcp_socket_data_t *socket_data, packet_t *packet, int fragments, 804 804 size_t total_length) 805 805 { … … 838 838 839 839 int tcp_process_syn_sent(socket_core_t *socket, tcp_socket_data_t * 840 socket_data, tcp_header_t *header, packet_t packet)841 { 842 packet_t next_packet;840 socket_data, tcp_header_t *header, packet_t *packet) 841 { 842 packet_t *next_packet; 843 843 int rc; 844 844 … … 897 897 int tcp_process_listen(socket_core_t *listening_socket, 898 898 tcp_socket_data_t *listening_socket_data, tcp_header_t *header, 899 packet_t packet, struct sockaddr *src, struct sockaddr *dest,899 packet_t *packet, struct sockaddr *src, struct sockaddr *dest, 900 900 size_t addrlen) 901 901 { 902 packet_t next_packet;902 packet_t *next_packet; 903 903 socket_core_t *socket; 904 904 tcp_socket_data_t *socket_data; … … 1056 1056 1057 1057 int tcp_process_syn_received(socket_core_t *socket, 1058 tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t packet)1058 tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t *packet) 1059 1059 { 1060 1060 socket_core_t *listening_socket; … … 1127 1127 size_t number; 1128 1128 size_t length; 1129 packet_t packet;1130 packet_t next;1131 packet_t acknowledged = NULL;1129 packet_t *packet; 1130 packet_t *next; 1131 packet_t *acknowledged = NULL; 1132 1132 uint32_t old; 1133 1133 … … 1232 1232 ipc_call_t *answer, int *answer_count) 1233 1233 { 1234 packet_t packet;1234 packet_t *packet; 1235 1235 int rc; 1236 1236 … … 1654 1654 socket_data, size_t sequence_number) 1655 1655 { 1656 packet_t packet;1657 packet_t copy;1656 packet_t *packet; 1657 packet_t *copy; 1658 1658 size_t data_length; 1659 1659 … … 1736 1736 { 1737 1737 tcp_socket_data_t *socket_data; 1738 packet_t packet;1738 packet_t *packet; 1739 1739 int rc; 1740 1740 … … 1824 1824 1825 1825 int tcp_queue_prepare_packet(socket_core_t *socket, 1826 tcp_socket_data_t *socket_data, packet_t packet, size_t data_length)1826 tcp_socket_data_t *socket_data, packet_t *packet, size_t data_length) 1827 1827 { 1828 1828 tcp_header_t *header; … … 1855 1855 1856 1856 int tcp_queue_packet(socket_core_t *socket, tcp_socket_data_t *socket_data, 1857 packet_t packet, size_t data_length)1857 packet_t *packet, size_t data_length) 1858 1858 { 1859 1859 int rc; … … 1876 1876 } 1877 1877 1878 packet_t tcp_get_packets_to_send(socket_core_t *socket, 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 { 1881 packet_t packet;1882 packet_t copy;1883 packet_t sending = NULL;1884 packet_t previous = NULL;1881 packet_t *packet; 1882 packet_t *copy; 1883 packet_t *sending = NULL; 1884 packet_t *previous = NULL; 1885 1885 size_t data_length; 1886 1886 int rc; … … 1936 1936 } 1937 1937 1938 packet_t tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t *1939 socket_data, packet_t packet, size_t data_length, size_t sequence_number)1938 packet_t *tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t * 1939 socket_data, packet_t *packet, size_t data_length, size_t sequence_number) 1940 1940 { 1941 1941 tcp_header_t *header; … … 1997 1997 } 1998 1998 1999 packet_t tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t *2000 socket_data, packet_t packet, size_t data_length, size_t sequence_number)2001 { 2002 packet_t copy;1999 packet_t *tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t * 2000 socket_data, packet_t *packet, size_t data_length, size_t sequence_number) 2001 { 2002 packet_t *copy; 2003 2003 2004 2004 assert(socket); … … 2015 2015 } 2016 2016 2017 void tcp_send_packets(device_id_t device_id, packet_t packet)2018 { 2019 packet_t next;2017 void tcp_send_packets(device_id_t device_id, packet_t *packet) 2018 { 2019 packet_t *next; 2020 2020 2021 2021 while (packet) { … … 2097 2097 tcp_socket_data_t *socket_data; 2098 2098 int packet_id; 2099 packet_t packet;2099 packet_t *packet; 2100 2100 size_t length; 2101 2101 int rc; … … 2155 2155 tcp_socket_data_t *socket_data; 2156 2156 packet_dimension_t *packet_dimension; 2157 packet_t packet;2157 packet_t *packet; 2158 2158 size_t total_length; 2159 2159 tcp_header_t *header; … … 2229 2229 socket_core_t *socket; 2230 2230 tcp_socket_data_t *socket_data; 2231 packet_t packet;2231 packet_t *packet; 2232 2232 int rc; 2233 2233 … … 2293 2293 } 2294 2294 2295 int tcp_create_notification_packet(packet_t * packet, socket_core_t *socket,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 { … … 2442 2442 * @return The result parameter. 2443 2443 */ 2444 int tcp_release_and_return(packet_t packet, int result)2444 int tcp_release_and_return(packet_t *packet, int result) 2445 2445 { 2446 2446 pq_release_remote(tcp_globals.net_phone, packet_get_id(packet)); -
uspace/srv/net/tl/tcp/tcp.h
r0b4a67a r7e1f9b7 239 239 * Packets metric is set as their data length. 240 240 */ 241 packet_t incoming;241 packet_t *incoming; 242 242 243 243 /** Outgoing packet queue. … … 249 249 * Packets metric is set as their data length. 250 250 */ 251 packet_t outgoing;251 packet_t *outgoing; 252 252 253 253 /** IP pseudo header. */ -
uspace/srv/net/tl/udp/udp.c
r0b4a67a r7e1f9b7 190 190 * @return The result parameter. 191 191 */ 192 static int udp_release_and_return(packet_t packet, int result)192 static int udp_release_and_return(packet_t *packet, int result) 193 193 { 194 194 pq_release_remote(udp_globals.net_phone, packet_get_id(packet)); … … 217 217 * ip_client_process_packet() function. 218 218 */ 219 static int udp_process_packet(device_id_t device_id, packet_t packet,219 static int udp_process_packet(device_id_t device_id, packet_t *packet, 220 220 services_t error) 221 221 { … … 225 225 udp_header_t *header; 226 226 socket_core_t *socket; 227 packet_t next_packet;227 packet_t *next_packet; 228 228 size_t total_length; 229 229 uint32_t checksum; 230 230 int fragments; 231 packet_t tmp_packet;231 packet_t *tmp_packet; 232 232 icmp_type_t type; 233 233 icmp_code_t code; … … 413 413 * udp_process_packet() function. 414 414 */ 415 static int udp_received_msg(device_id_t device_id, packet_t packet,415 static int udp_received_msg(device_id_t device_id, packet_t *packet, 416 416 services_t receiver, services_t error) 417 417 { … … 458 458 { 459 459 socket_core_t *socket; 460 packet_t packet;461 packet_t next_packet;460 packet_t *packet; 461 packet_t *next_packet; 462 462 udp_header_t *header; 463 463 int index; … … 614 614 socket_core_t *socket; 615 615 int packet_id; 616 packet_t packet;616 packet_t *packet; 617 617 udp_header_t *header; 618 618 struct sockaddr *addr; … … 861 861 ipc_call_t *answer, int *answer_count) 862 862 { 863 packet_t packet;863 packet_t *packet; 864 864 int rc; 865 865
Note:
See TracChangeset
for help on using the changeset viewer.