Changes in / [0b4a67a:7e1f9b7] in mainline


Ignore:
Location:
uspace
Files:
1 deleted
45 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/packet.c

    r0b4a67a r7e1f9b7  
    6262
    6363/** Type definition of the packet map page. */
    64 typedef packet_t packet_map_t[PACKET_MAP_SIZE];
     64typedef packet_t *packet_map_t[PACKET_MAP_SIZE];
    6565
    6666/** Packet map.
     
    104104 * @return              NULL if the mapping does not exist.
    105105 */
    106 packet_t pm_find(packet_id_t packet_id)
     106packet_t *pm_find(packet_id_t packet_id)
    107107{
    108108        packet_map_t *map;
    109         packet_t packet;
     109        packet_t *packet;
    110110
    111111        if (!packet_id)
     
    135135 * @return              ENOMEM if there is not enough memory left.
    136136 */
    137 int pm_add(packet_t packet)
     137int pm_add(packet_t *packet)
    138138{
    139139        packet_map_t *map;
     
    178178        int index;
    179179        packet_map_t *map;
    180         packet_t packet;
     180        packet_t *packet;
    181181
    182182        fibril_rwlock_write_lock(&pm_globals.lock);
     
    209209 * @return              EINVAL if the packet is not valid.
    210210 */
    211 int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric)
    212 {
    213         packet_t item;
     211int pq_add(packet_t **first, packet_t *packet, size_t order, size_t metric)
     212{
     213        packet_t *item;
    214214
    215215        if (!first || !packet_is_valid(packet))
     
    253253 * @return              NULL if the packet is not found.
    254254 */
    255 packet_t pq_find(packet_t packet, size_t order)
    256 {
    257         packet_t item;
     255packet_t *pq_find(packet_t *packet, size_t order)
     256{
     257        packet_t *item;
    258258
    259259        if (!packet_is_valid(packet))
     
    278278 * @return              EINVAL if etiher of the packets is invalid.
    279279 */
    280 int pq_insert_after(packet_t packet, packet_t new_packet)
    281 {
    282         packet_t item;
     280int pq_insert_after(packet_t *packet, packet_t *new_packet)
     281{
     282        packet_t *item;
    283283
    284284        if (!packet_is_valid(packet) || !packet_is_valid(new_packet))
     
    303303 * @return              NULL if the packet is not valid.
    304304 */
    305 packet_t pq_detach(packet_t packet)
    306 {
    307         packet_t next;
    308         packet_t previous;
     305packet_t *pq_detach(packet_t *packet)
     306{
     307        packet_t *next;
     308        packet_t *previous;
    309309
    310310        if (!packet_is_valid(packet))
     
    331331 * @return              EINVAL if the packet is invalid.
    332332 */
    333 int pq_set_order(packet_t packet, size_t order, size_t metric)
     333int pq_set_order(packet_t *packet, size_t order, size_t metric)
    334334{
    335335        if (!packet_is_valid(packet))
     
    349349 * @return              EINVAL if the packet is invalid.
    350350 */
    351 int pq_get_order(packet_t packet, size_t *order, size_t *metric)
     351int pq_get_order(packet_t *packet, size_t *order, size_t *metric)
    352352{
    353353        if (!packet_is_valid(packet))
     
    372372 *                      packets after its detachment.
    373373 */
    374 void pq_destroy(packet_t first, void (*packet_release)(packet_t packet))
    375 {
    376         packet_t actual;
    377         packet_t next;
     374void pq_destroy(packet_t *first, void (*packet_release)(packet_t *packet))
     375{
     376        packet_t *actual;
     377        packet_t *next;
    378378
    379379        actual = first;
     
    395395 * @return              NULL if the packet is not valid.
    396396 */
    397 packet_t pq_next(packet_t packet)
     397packet_t *pq_next(packet_t *packet)
    398398{
    399399        if (!packet_is_valid(packet))
     
    410410 * @return              NULL if the packet is not valid.
    411411 */
    412 packet_t pq_previous(packet_t packet)
     412packet_t *pq_previous(packet_t *packet)
    413413{
    414414        if (!packet_is_valid(packet))
  • uspace/lib/c/include/net/packet.h

    r0b4a67a r7e1f9b7  
    4646 * @see packet
    4747 */
    48 typedef struct packet * packet_t;
     48typedef struct packet packet_t;
    4949
    5050/** Type definition of the packet dimension.
     
    6969/*@{*/
    7070
    71 extern packet_t pm_find(packet_id_t);
    72 extern int pm_add(packet_t);
     71extern packet_t *pm_find(packet_id_t);
     72extern int pm_add(packet_t *);
    7373extern int pm_init(void);
    7474extern void pm_destroy(void);
    7575
    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);
     76extern int pq_add(packet_t **, packet_t *, size_t, size_t);
     77extern packet_t *pq_find(packet_t *, size_t);
     78extern int pq_insert_after(packet_t *, packet_t *);
     79extern packet_t *pq_detach(packet_t *);
     80extern int pq_set_order(packet_t *, size_t, size_t);
     81extern int pq_get_order(packet_t *, size_t *, size_t *);
     82extern void pq_destroy(packet_t *, void (*)(packet_t *));
     83extern packet_t *pq_next(packet_t *);
     84extern packet_t *pq_previous(packet_t *);
    8585
    8686/*@}*/
  • uspace/lib/c/include/net/packet_header.h

    r0b4a67a r7e1f9b7  
    128128 * @return              False otherwise.
    129129 */
    130 static inline int packet_is_valid(const packet_t packet)
     130static inline int packet_is_valid(const packet_t *packet)
    131131{
    132132        return packet && (packet->magic_value == PACKET_MAGIC_VALUE);
  • uspace/lib/net/generic/packet_client.c

    r0b4a67a r7e1f9b7  
    5757 * @return              ENOMEM if there is not enough memory left.
    5858 */
    59 int packet_copy_data(packet_t packet, const void *data, size_t length)
     59int packet_copy_data(packet_t *packet, const void *data, size_t length)
    6060{
    6161        if (!packet_is_valid(packet))
     
    8181 * @return              NULL if there is not enough memory left.
    8282 */
    83 void *packet_prefix(packet_t packet, size_t length)
     83void *packet_prefix(packet_t *packet, size_t length)
    8484{
    8585        if ((!packet_is_valid(packet)) ||
    86             (packet->data_start - sizeof(struct packet) -
     86            (packet->data_start - sizeof(packet_t) -
    8787            2 * (packet->dest_addr - packet->src_addr) < length)) {
    8888                return NULL;
     
    102102 * @return              NULL if there is not enough memory left.
    103103 */
    104 void *packet_suffix(packet_t packet, size_t length)
     104void *packet_suffix(packet_t *packet, size_t length)
    105105{
    106106        if ((!packet_is_valid(packet)) ||
     
    124124 * @return              ENOMEM if there is not enough memory left.
    125125 */
    126 int packet_trim(packet_t packet, size_t prefix, size_t suffix)
     126int packet_trim(packet_t *packet, size_t prefix, size_t suffix)
    127127{
    128128        if (!packet_is_valid(packet))
     
    143143 * @return              Zero if the packet is not valid.
    144144 */
    145 packet_id_t packet_get_id(const packet_t packet)
     145packet_id_t packet_get_id(const packet_t *packet)
    146146{
    147147        return packet_is_valid(packet) ? packet->packet_id : 0;
     
    157157 * @return              EINVAL if the packet is not valid.
    158158 */
    159 int packet_get_addr(const packet_t packet, uint8_t **src, uint8_t **dest)
     159int packet_get_addr(const packet_t *packet, uint8_t **src, uint8_t **dest)
    160160{
    161161        if (!packet_is_valid(packet))
     
    177177 * @return              Zero if the packet is not valid.
    178178 */
    179 size_t packet_get_data_length(const packet_t packet)
     179size_t packet_get_data_length(const packet_t *packet)
    180180{
    181181        if (!packet_is_valid(packet))
     
    191191 * @return              NULL if the packet is not valid.
    192192 */
    193 void *packet_get_data(const packet_t packet)
     193void *packet_get_data(const packet_t *packet)
    194194{
    195195        if (!packet_is_valid(packet))
     
    210210 */
    211211int
    212 packet_set_addr(packet_t packet, const uint8_t *src, const uint8_t *dest,
     212packet_set_addr(packet_t *packet, const uint8_t *src, const uint8_t *dest,
    213213    size_t addr_len)
    214214{
     
    257257 * @return              NULL on error.
    258258 */
    259 packet_t packet_get_copy(int phone, packet_t packet)
    260 {
    261         packet_t copy;
     259packet_t *packet_get_copy(int phone, packet_t *packet)
     260{
     261        packet_t *copy;
    262262        uint8_t * src = NULL;
    263263        uint8_t * dest = NULL;
  • uspace/lib/net/generic/packet_remote.c

    r0b4a67a r7e1f9b7  
    6464 */
    6565static int
    66 packet_return(int phone, packet_t *packet, packet_id_t packet_id, size_t size)
     66packet_return(int phone, packet_t **packet, packet_id_t packet_id, size_t size)
    6767{
    6868        ipc_call_t answer;
     
    7272        message = async_send_1(phone, NET_PACKET_GET, packet_id, &answer);
    7373
    74         *packet = (packet_t) as_get_mappable_page(size);
     74        *packet = (packet_t *) as_get_mappable_page(size);
    7575        rc = async_share_in_start_0_0(phone, *packet, size);
    7676        if (rc != EOK) {
     
    107107 *                      function.
    108108 */
    109 int packet_translate_remote(int phone, packet_t *packet, packet_id_t packet_id)
     109int packet_translate_remote(int phone, packet_t **packet, packet_id_t packet_id)
    110110{
    111111        int rc;
     
    127127        }
    128128        if ((*packet)->next) {
    129                 packet_t next;
     129                packet_t *next;
    130130               
    131131                return packet_translate_remote(phone, &next, (*packet)->next);
     
    148148 * @return              NULL on error.
    149149 */
    150 packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
     150packet_t *packet_get_4_remote(int phone, size_t max_content, size_t addr_len,
    151151    size_t max_prefix, size_t max_suffix)
    152152{
     
    161161       
    162162       
    163         packet_t packet = pm_find(packet_id);
     163        packet_t *packet = pm_find(packet_id);
    164164        if (!packet) {
    165165                rc = packet_return(phone, &packet, packet_id, size);
     
    180180 * @return              NULL on error.
    181181 */
    182 packet_t packet_get_1_remote(int phone, size_t content)
     182packet_t *packet_get_1_remote(int phone, size_t content)
    183183{
    184184        ipcarg_t packet_id;
     
    191191                return NULL;
    192192       
    193         packet_t packet = pm_find(packet_id);
     193        packet_t *packet = pm_find(packet_id);
    194194        if (!packet) {
    195195                rc = packet_return(phone, &packet, packet_id, size);
  • uspace/lib/net/il/il_interface.c

    r0b4a67a r7e1f9b7  
    7777 *
    7878 */
    79 int il_received_msg(int il_phone, device_id_t device_id, packet_t packet,
     79int il_received_msg(int il_phone, device_id_t device_id, packet_t *packet,
    8080    services_t target)
    8181{
  • uspace/lib/net/il/ip_client.c

    r0b4a67a r7e1f9b7  
    5151 * @return              Zero if there is no IP header.
    5252 */
    53 size_t ip_client_header_length(packet_t packet)
     53size_t ip_client_header_length(packet_t *packet)
    5454{
    5555        ip_header_t *header;
     
    152152 */
    153153int
    154 ip_client_prepare_packet(packet_t packet, ip_protocol_t protocol, ip_ttl_t ttl,
     154ip_client_prepare_packet(packet_t *packet, ip_protocol_t protocol, ip_ttl_t ttl,
    155155    ip_tos_t tos, int dont_fragment, size_t ipopt_length)
    156156{
     
    208208 */
    209209int
    210 ip_client_process_packet(packet_t packet, ip_protocol_t *protocol,
     210ip_client_process_packet(packet_t *packet, ip_protocol_t *protocol,
    211211    ip_ttl_t *ttl, ip_tos_t *tos, int *dont_fragment, size_t *ipopt_length)
    212212{
  • uspace/lib/net/il/ip_remote.c

    r0b4a67a r7e1f9b7  
    204204 */
    205205int 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)
    207207{
    208208        return generic_received_msg_remote(ip_phone, NET_IP_RECEIVED_ERROR,
     
    225225 *                      function.
    226226 */
    227 int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t packet,
     227int ip_send_msg_remote(int ip_phone, device_id_t device_id, packet_t *packet,
    228228    services_t sender, services_t error)
    229229{
  • uspace/lib/net/include/icmp_client.h

    r0b4a67a r7e1f9b7  
    4141#include <net/packet.h>
    4242
    43 extern int icmp_client_process_packet(packet_t, icmp_type_t *, icmp_code_t *,
     43extern int icmp_client_process_packet(packet_t *, icmp_type_t *, icmp_code_t *,
    4444    icmp_param_t *, icmp_param_t *);
    45 extern size_t icmp_client_header_length(packet_t);
     45extern size_t icmp_client_header_length(packet_t *);
    4646
    4747#endif
  • uspace/lib/net/include/icmp_interface.h

    r0b4a67a r7e1f9b7  
    5151
    5252extern 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 *);
     54extern int icmp_source_quench_msg(int, packet_t *);
     55extern int icmp_time_exceeded_msg(int, icmp_code_t, packet_t *);
     56extern int icmp_parameter_problem_msg(int, icmp_code_t, icmp_param_t, packet_t *);
    5757
    5858/*@}*/
  • uspace/lib/net/include/il_interface.h

    r0b4a67a r7e1f9b7  
    5151
    5252extern 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);
     53extern int il_received_msg(int, device_id_t, packet_t *, services_t);
    5454extern int il_mtu_changed_msg(int, device_id_t, size_t, services_t);
    5555
  • uspace/lib/net/include/ip_client.h

    r0b4a67a r7e1f9b7  
    4545#include <ip_interface.h>
    4646
    47 extern int ip_client_prepare_packet(packet_t, ip_protocol_t, ip_ttl_t, ip_tos_t,
    48     int, size_t);
    49 extern int ip_client_process_packet(packet_t, ip_protocol_t *, ip_ttl_t *,
     47extern int ip_client_prepare_packet(packet_t *, ip_protocol_t, ip_ttl_t,
     48    ip_tos_t, int, size_t);
     49extern int ip_client_process_packet(packet_t *, ip_protocol_t *, ip_ttl_t *,
    5050    ip_tos_t *, int *, size_t *);
    51 extern size_t ip_client_header_length(packet_t);
     51extern size_t ip_client_header_length(packet_t *);
    5252extern int ip_client_set_pseudo_header_data_length(void *, size_t, size_t);
    5353extern int ip_client_get_pseudo_header(ip_protocol_t, struct sockaddr *,
  • uspace/lib/net/include/ip_interface.h

    r0b4a67a r7e1f9b7  
    7070 * @return              EOK on success.
    7171 */
    72 typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t packet,
     72typedef int (*tl_received_msg_t)(device_id_t device_id, packet_t *packet,
    7373    services_t receiver, services_t error);
    7474
  • uspace/lib/net/include/ip_remote.h

    r0b4a67a r7e1f9b7  
    4545extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t);
    4646extern 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,
     47extern int ip_received_error_msg_remote(int, device_id_t, packet_t *, services_t,
    4848    services_t);
    4949extern int ip_device_req_remote(int, device_id_t, services_t);
    5050extern int ip_add_route_req_remote(int, device_id_t, in_addr_t, in_addr_t,
    5151    in_addr_t);
    52 extern int ip_send_msg_remote(int, device_id_t, packet_t, services_t,
     52extern int ip_send_msg_remote(int, device_id_t, packet_t *, services_t,
    5353    services_t);
    5454extern int ip_get_route_req_remote(int, ip_protocol_t, const struct sockaddr *,
  • uspace/lib/net/include/netif_local.h

    r0b4a67a r7e1f9b7  
    111111 *                      message implementation.
    112112 */
    113 extern int netif_send_message(device_id_t device_id, packet_t packet,
     113extern int netif_send_message(device_id_t device_id, packet_t *packet,
    114114    services_t sender);
    115115
     
    198198    char **);
    199199extern 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);
     200extern int netif_send_msg_local(int, device_id_t, packet_t *, services_t);
    201201extern int netif_start_req_local(int, device_id_t);
    202202extern int netif_stop_req_local(int, device_id_t);
     
    208208extern void null_device_stats(device_stats_t *);
    209209extern void netif_pq_release(packet_id_t);
    210 extern packet_t netif_packet_get_1(size_t);
     210extern packet_t *netif_packet_get_1(size_t);
    211211extern int netif_init_module(async_client_conn_t);
    212212
  • uspace/lib/net/include/netif_remote.h

    r0b4a67a r7e1f9b7  
    4444    char **);
    4545extern 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);
     46extern int netif_send_msg_remote(int, device_id_t, packet_t *, services_t);
    4747extern int netif_start_req_remote(int, device_id_t);
    4848extern int netif_stop_req_remote(int, device_id_t);
  • uspace/lib/net/include/nil_local.h

    r0b4a67a r7e1f9b7  
    7777 *                      received function.
    7878 */
    79 extern int nil_received_msg_local(int, device_id_t, packet_t, services_t);
     79extern int nil_received_msg_local(int, device_id_t, packet_t *, services_t);
    8080
    8181/** Message processing function.
  • uspace/lib/net/include/nil_remote.h

    r0b4a67a r7e1f9b7  
    3939
    4040extern 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);
     41extern int nil_received_msg_remote(int, device_id_t, packet_t *, services_t);
    4242
    4343#endif
  • uspace/lib/net/include/packet_client.h

    r0b4a67a r7e1f9b7  
    9999        packet_trim((packet), sizeof(prefix), sizeof(suffix))
    100100
    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);
     101extern void *packet_prefix(packet_t *, size_t);
     102extern void *packet_suffix(packet_t *, size_t);
     103extern int packet_trim(packet_t *, size_t, size_t);
     104extern int packet_copy_data(packet_t *, const void *, size_t);
     105extern packet_id_t packet_get_id(const packet_t *);
     106extern size_t packet_get_data_length(const packet_t *);
     107extern void *packet_get_data(const packet_t *);
     108extern int packet_get_addr(const packet_t *, uint8_t **, uint8_t **);
     109extern int packet_set_addr(packet_t *, const uint8_t *, const uint8_t *, size_t);
     110extern packet_t *packet_get_copy(int, packet_t *);
    111111
    112112/*@}*/
  • uspace/lib/net/include/packet_remote.h

    r0b4a67a r7e1f9b7  
    3737#include <sys/types.h>
    3838
    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);
     39extern int packet_translate_remote(int, packet_t **, packet_id_t);
     40extern packet_t *packet_get_4_remote(int, size_t, size_t, size_t, size_t);
     41extern packet_t *packet_get_1_remote(int, size_t);
    4242extern void pq_release_remote(int, packet_id_t);
    4343
  • uspace/lib/net/include/socket_core.h

    r0b4a67a r7e1f9b7  
    117117extern int socket_destroy(int, int, socket_cores_t *, socket_ports_t *,
    118118    void (*)(socket_core_t *));
    119 extern int socket_reply_packets(packet_t, size_t *);
     119extern int socket_reply_packets(packet_t *, size_t *);
    120120extern socket_core_t *socket_port_find(socket_ports_t *, int, const char *,
    121121    size_t);
  • uspace/lib/net/include/tl_common.h

    r0b4a67a r7e1f9b7  
    5757    size_t);
    5858extern 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,
     59extern int tl_prepare_icmp_packet(int, int, packet_t *, services_t);
     60extern int tl_socket_read_packet_data(int, packet_t **, size_t,
    6161    const packet_dimension_t *, const struct sockaddr *, socklen_t);
    6262
  • uspace/lib/net/include/tl_interface.h

    r0b4a67a r7e1f9b7  
    5252/*@{*/
    5353
    54 extern int tl_received_msg(int, device_id_t, packet_t, services_t, services_t);
     54extern int tl_received_msg(int, device_id_t, packet_t *, services_t, services_t);
    5555
    5656/*@}*/
  • uspace/lib/net/netif/netif_local.c

    r0b4a67a r7e1f9b7  
    9292 */
    9393int 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)
    9595{
    9696        fibril_rwlock_write_lock(&netif_globals.lock);
     
    307307 *
    308308 */
    309 packet_t netif_packet_get_1(size_t content)
     309packet_t *netif_packet_get_1(size_t content)
    310310{
    311311        return packet_get_1_remote(netif_globals.net_phone, content);
     
    361361        size_t length;
    362362        device_stats_t stats;
    363         packet_t packet;
     363        packet_t *packet;
    364364        measured_string_t address;
    365365        int rc;
  • uspace/lib/net/netif/netif_remote.c

    r0b4a67a r7e1f9b7  
    9393 */
    9494int
    95 netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t packet,
     95netif_send_msg_remote(int netif_phone, device_id_t device_id, packet_t *packet,
    9696    services_t sender)
    9797{
  • uspace/lib/net/nil/nil_remote.c

    r0b4a67a r7e1f9b7  
    7474 */
    7575int 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)
    7777{
    7878        return generic_received_msg_remote(nil_phone, NET_NIL_RECEIVED,
  • uspace/lib/net/tl/icmp_client.c

    r0b4a67a r7e1f9b7  
    6161 */
    6262int
    63 icmp_client_process_packet(packet_t packet, icmp_type_t *type,
     63icmp_client_process_packet(packet_t *packet, icmp_type_t *type,
    6464    icmp_code_t *code, icmp_param_t *pointer, icmp_param_t *mtu)
    6565{
     
    9494 * @return              The ICMP header length in bytes.
    9595 */
    96 size_t icmp_client_header_length(packet_t packet)
     96size_t icmp_client_header_length(packet_t *packet)
    9797{
    9898        if (packet_get_data_length(packet) < sizeof(icmp_header_t))
  • uspace/lib/net/tl/icmp_remote.c

    r0b4a67a r7e1f9b7  
    6363int
    6464icmp_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)
    6666{
    6767        async_msg_3(icmp_phone, NET_ICMP_DEST_UNREACH, (ipcarg_t) code,
     
    8282 * @return              ENOMEM if there is not enough memory left.
    8383 */
    84 int icmp_source_quench_msg(int icmp_phone, packet_t packet)
     84int icmp_source_quench_msg(int icmp_phone, packet_t *packet)
    8585{
    8686        async_msg_2(icmp_phone, NET_ICMP_SOURCE_QUENCH, 0,
     
    102102 * @return              ENOMEM if there is not enough memory left.
    103103 */
    104 int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t packet)
     104int icmp_time_exceeded_msg(int icmp_phone, icmp_code_t code, packet_t *packet)
    105105{
    106106        async_msg_2(icmp_phone, NET_ICMP_TIME_EXCEEDED, (ipcarg_t) code,
     
    124124 */
    125125int 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)
    127127{
    128128        async_msg_3(icmp_phone, NET_ICMP_PARAMETERPROB, (ipcarg_t) code,
  • uspace/lib/net/tl/socket_core.c

    r0b4a67a r7e1f9b7  
    522522 *                      function.
    523523 */
    524 int socket_reply_packets(packet_t packet, size_t *length)
    525 {
    526         packet_t next_packet;
     524int socket_reply_packets(packet_t *packet, size_t *length)
     525{
     526        packet_t *next_packet;
    527527        size_t fragments;
    528528        size_t *lengths;
  • uspace/lib/net/tl/tl_common.c

    r0b4a67a r7e1f9b7  
    248248 */
    249249int
    250 tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t packet,
     250tl_prepare_icmp_packet(int packet_phone, int icmp_phone, packet_t *packet,
    251251    services_t error)
    252252{
    253         packet_t next;
     253        packet_t *next;
    254254        uint8_t *src;
    255255        int length;
     
    287287 */
    288288int
    289 tl_socket_read_packet_data(int packet_phone, packet_t *packet, size_t prefix,
     289tl_socket_read_packet_data(int packet_phone, packet_t **packet, size_t prefix,
    290290    const packet_dimension_t *dimension, const struct sockaddr *addr,
    291291    socklen_t addrlen)
  • uspace/lib/net/tl/tl_interface.c

    r0b4a67a r7e1f9b7  
    5858 */
    5959int
    60 tl_received_msg(int tl_phone, device_id_t device_id, packet_t packet,
     60tl_received_msg(int tl_phone, device_id_t device_id, packet_t *packet,
    6161    services_t target, services_t error)
    6262{
  • uspace/lib/packet/generic/packet_server.c

    r0b4a67a r7e1f9b7  
    3636
    3737#include <packet_server.h>
    38 #include <packet_local.h>
    3938
    4039#include <align.h>
     
    6968        fibril_mutex_t lock;
    7069        /** Free packet queues. */
    71         packet_t free[FREE_QUEUES_COUNT];
     70        packet_t *free[FREE_QUEUES_COUNT];
    7271       
    7372        /**
     
    103102};
    104103
    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 
    114104/** Clears and initializes the packet according to the given dimensions.
    115105 *
     
    122112 */
    123113static void
    124 packet_init(packet_t packet, size_t addr_len, size_t max_prefix,
     114packet_init(packet_t *packet, size_t addr_len, size_t max_prefix,
    125115    size_t max_content, size_t max_suffix)
    126116{
    127117        // 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));
    130120       
    131121        // clear the packet header
     
    135125        packet->next = 0;
    136126        packet->addr_len = 0;
    137         packet->src_addr = sizeof(struct packet);
     127        packet->src_addr = sizeof(packet_t);
    138128        packet->dest_addr = packet->src_addr + addr_len;
    139129        packet->max_prefix = max_prefix;
     
    157147 * @return              NULL if there is not enough memory left.
    158148 */
    159 static packet_t
     149static packet_t *
    160150packet_create(size_t length, size_t addr_len, size_t max_prefix,
    161151    size_t max_content, size_t max_suffix)
    162152{
    163         packet_t packet;
     153        packet_t *packet;
    164154        int rc;
    165155
    166156        // already locked
    167         packet = (packet_t) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
     157        packet = (packet_t *) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
    168158            MAP_SHARED | MAP_ANONYMOUS, 0, 0);
    169159        if (packet == MAP_FAILED)
     
    198188 * @return              NULL if there is not enough memory left.
    199189 */
    200 static packet_t
     190static packet_t *
    201191packet_get_local(size_t addr_len, size_t max_prefix, size_t max_content,
    202192    size_t max_suffix)
    203193{
    204         size_t length = ALIGN_UP(sizeof(struct packet) + 2 * addr_len +
     194        size_t length = ALIGN_UP(sizeof(packet_t) + 2 * addr_len +
    205195            max_prefix + max_content + max_suffix, PAGE_SIZE);
    206196       
    207197        fibril_mutex_lock(&ps_globals.lock);
    208198       
    209         packet_t packet;
     199        packet_t *packet;
    210200        unsigned int index;
    211201       
     
    241231}
    242232
    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 
    255233/** Release the packet and returns it to the appropriate free packet queue.
    256234 *
     
    260238 *
    261239 */
    262 static void packet_release(packet_t packet)
     240static void packet_release(packet_t *packet)
    263241{
    264242        int index;
     
    283261static int packet_release_wrapper(packet_id_t packet_id)
    284262{
    285         packet_t packet;
     263        packet_t *packet;
    286264
    287265        packet = pm_find(packet_id);
     
    294272
    295273        return EOK;
    296 }
    297 
    298 void pq_release_local(int phone, packet_id_t packet_id)
    299 {
    300         (void) packet_release_wrapper(packet_id);
    301274}
    302275
     
    310283 *                      async_share_in_finalize() function.
    311284 */
    312 static int packet_reply(const packet_t packet)
     285static int packet_reply(packet_t *packet)
    313286{
    314287        ipc_callid_t callid;
     
    351324    int *answer_count)
    352325{
    353         packet_t packet;
     326        packet_t *packet;
    354327
    355328        *answer_count = 0;
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r0b4a67a r7e1f9b7  
    6565 *  @return EINVAL
    6666 */
    67 int queue_packet(dpeth_t * dep, packet_t packet);
     67int queue_packet(dpeth_t * dep, packet_t *packet);
    6868
    6969/** Reads a memory block byte by byte.
     
    336336}
    337337
    338 int queue_packet(dpeth_t * dep, packet_t packet){
    339         packet_t tmp;
     338int queue_packet(dpeth_t * dep, packet_t *packet){
     339        packet_t *tmp;
    340340
    341341        if(dep->packet_count >= MAX_PACKETS){
     
    361361 *                      based on        do_vwrite                                    *
    362362 *===========================================================================*/
    363 int do_pwrite(dpeth_t * dep, packet_t packet, int from_int)
     363int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int)
    364364{
    365365//      int port, count, size;
     
    910910dpeth_t *dep;
    911911{
    912         packet_t packet;
     912        packet_t *packet;
    913913
    914914//      if (!(dep->de_flags &DEF_SEND_AVAIL))
     
    10031003{
    10041004        int last, count;
    1005         packet_t packet;
     1005        packet_t *packet;
    10061006
    10071007//      if (!(dep->de_flags &DEF_READING))
  • uspace/srv/hw/netif/dp8390/dp8390.h

    r0b4a67a r7e1f9b7  
    313313        /** Outgoing packets queue.
    314314         */
    315         packet_t packet_queue;
     315        packet_t *packet_queue;
    316316        /** Outgoing packets count.
    317317         */
     
    320320        /** Received packets queue.
    321321         */
    322         packet_t received_queue;
     322        packet_t *received_queue;
    323323        /** Received packets count.
    324324         */
  • uspace/srv/hw/netif/dp8390/dp8390_drv.h

    r0b4a67a r7e1f9b7  
    7272 *  @returns
    7373 */
    74 int do_pwrite(dpeth_t * dep, packet_t packet, int from_int);
     74int do_pwrite(dpeth_t * dep, packet_t *packet, int from_int);
    7575
    7676/** Prints out network interface information.
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r0b4a67a r7e1f9b7  
    103103        netif_device_t * device;
    104104        dpeth_t * dep;
    105         packet_t received;
     105        packet_t *received;
    106106        device_id_t device_id;
    107107        int phone;
     
    247247}
    248248
    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;
     249int 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;
    253253        int rc;
    254254
  • uspace/srv/net/il/arp/arp.c

    r0b4a67a r7e1f9b7  
    415415 * @return              ENOMEM if there is not enough memory left.
    416416 */
    417 static int arp_receive_message(device_id_t device_id, packet_t packet)
     417static int arp_receive_message(device_id_t device_id, packet_t *packet)
    418418{
    419419        size_t length;
     
    531531        measured_string_t *addr;
    532532        size_t length;
    533         packet_t packet;
     533        packet_t *packet;
    534534        arp_header_t *header;
    535535
     
    615615        measured_string_t *translation;
    616616        char *data;
    617         packet_t packet;
    618         packet_t next;
     617        packet_t *packet;
     618        packet_t *next;
    619619        int rc;
    620620       
  • uspace/srv/net/il/ip/ip.c

    r0b4a67a r7e1f9b7  
    129129 * @return              The result parameter.
    130130 */
    131 static int ip_release_and_return(packet_t packet, int result)
     131static int ip_release_and_return(packet_t *packet, int result)
    132132{
    133133        pq_release_remote(ip_globals.net_phone, packet_get_id(packet));
     
    170170 * @return              Other error codes as defined for the packet_set_addr().
    171171 */
    172 static int ip_prepare_icmp(packet_t packet, ip_header_t *header)
    173 {
    174         packet_t next;
     172static int ip_prepare_icmp(packet_t *packet, ip_header_t *header)
     173{
     174        packet_t *next;
    175175        struct sockaddr *dest;
    176176        struct sockaddr_in dest_in;
     
    233233 */
    234234static int
    235 ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,
     235ip_prepare_icmp_and_get_phone(services_t error, packet_t *packet,
    236236    ip_header_t *header)
    237237{
     
    543543 */
    544544static ip_header_t *
    545 ip_create_middle_header(packet_t packet, ip_header_t *last)
     545ip_create_middle_header(packet_t *packet, ip_header_t *last)
    546546{
    547547        ip_header_t *middle;
     
    622622 */
    623623static int
    624 ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,
     624ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t *packet,
    625625    measured_string_t *destination)
    626626{
     
    629629        ip_header_t *last_header;
    630630        ip_header_t *middle_header;
    631         packet_t next;
     631        packet_t *next;
    632632        int rc;
    633633
     
    754754 */
    755755static int
    756 ip_fragment_packet_data(packet_t packet, packet_t new_packet,
     756ip_fragment_packet_data(packet_t *packet, packet_t *new_packet,
    757757    ip_header_t *header, ip_header_t *new_header, size_t length,
    758758    const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen)
     
    816816 */
    817817static int
    818 ip_fragment_packet(packet_t packet, size_t length, size_t prefix, size_t suffix,
     818ip_fragment_packet(packet_t *packet, size_t length, size_t prefix, size_t suffix,
    819819    socklen_t addr_len)
    820820{
    821         packet_t new_packet;
     821        packet_t *new_packet;
    822822        ip_header_t *header;
    823823        ip_header_t *middle_header;
     
    922922 * @return              NULL if there are no packets left.
    923923 */
    924 static packet_t
    925 ip_split_packet(packet_t packet, size_t prefix, size_t content, size_t suffix,
     924static packet_t *
     925ip_split_packet(packet_t *packet, size_t prefix, size_t content, size_t suffix,
    926926    socklen_t addr_len, services_t error)
    927927{
    928928        size_t length;
    929         packet_t next;
    930         packet_t new_packet;
     929        packet_t *next;
     930        packet_t *new_packet;
    931931        int result;
    932932        int phone;
     
    993993 */
    994994static int
    995 ip_send_route(packet_t packet, ip_netif_t *netif, ip_route_t *route,
     995ip_send_route(packet_t *packet, ip_netif_t *netif, ip_route_t *route,
    996996    in_addr_t *src, in_addr_t dest, services_t error)
    997997{
     
    12471247
    12481248static int
    1249 ip_send_msg_local(int il_phone, device_id_t device_id, packet_t packet,
     1249ip_send_msg_local(int il_phone, device_id_t device_id, packet_t *packet,
    12501250    services_t sender, services_t error)
    12511251{
     
    14511451 */
    14521452static int
    1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,
     1453ip_deliver_local(device_id_t device_id, packet_t *packet, ip_header_t *header,
    14541454    services_t error)
    14551455{
     
    15531553 */
    15541554static int
    1555 ip_process_packet(device_id_t device_id, packet_t packet)
     1555ip_process_packet(device_id_t device_id, packet_t *packet)
    15561556{
    15571557        ip_header_t *header;
     
    17151715static int
    17161716ip_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)
    17181718{
    17191719        uint8_t *data;
     
    18591859 * @return              ENOMEM if there is not enough memory left.
    18601860 */
    1861 static int ip_receive_message(device_id_t device_id, packet_t packet)
    1862 {
    1863         packet_t next;
     1861static int ip_receive_message(device_id_t device_id, packet_t *packet)
     1862{
     1863        packet_t *next;
    18641864
    18651865        do {
     
    18901890    int *answer_count)
    18911891{
    1892         packet_t packet;
     1892        packet_t *packet;
    18931893        struct sockaddr *addr;
    18941894        size_t addrlen;
  • uspace/srv/net/netif/lo/lo.c

    r0b4a67a r7e1f9b7  
    185185}
    186186
    187 int netif_send_message(device_id_t device_id, packet_t packet, services_t sender)
     187int netif_send_message(device_id_t device_id, packet_t *packet, services_t sender)
    188188{
    189189        netif_device_t *device;
    190190        size_t length;
    191         packet_t next;
     191        packet_t *next;
    192192        int phone;
    193193        int rc;
  • uspace/srv/net/nil/eth/eth.c

    r0b4a67a r7e1f9b7  
    234234static void eth_receiver(ipc_callid_t iid, ipc_call_t *icall)
    235235{
    236         packet_t packet;
     236        packet_t *packet;
    237237        int rc;
    238238
     
    429429 * @return              NULL if the packet address length is not big enough.
    430430 */
    431 static eth_proto_t *eth_process_packet(int flags, packet_t packet)
     431static eth_proto_t *eth_process_packet(int flags, packet_t *packet)
    432432{
    433433        eth_header_snap_t *header;
     
    509509
    510510int 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)
    512512{
    513513        eth_proto_t *proto;
    514         packet_t next;
     514        packet_t *next;
    515515        eth_device_t *device;
    516516        int flags;
     
    680680 */
    681681static int
    682 eth_prepare_packet(int flags, packet_t packet, uint8_t *src_addr, int ethertype,
     682eth_prepare_packet(int flags, packet_t *packet, uint8_t *src_addr, int ethertype,
    683683    size_t mtu)
    684684{
     
    787787 * @return              EINVAL if the service parameter is not known.
    788788 */
    789 static int eth_send_message(device_id_t device_id, packet_t packet,
     789static int eth_send_message(device_id_t device_id, packet_t *packet,
    790790    services_t sender)
    791791{
    792792        eth_device_t *device;
    793         packet_t next;
    794         packet_t tmp;
     793        packet_t *next;
     794        packet_t *tmp;
    795795        int ethertype;
    796796        int rc;
     
    841841{
    842842        measured_string_t *address;
    843         packet_t packet;
     843        packet_t *packet;
    844844        size_t addrlen;
    845845        size_t prefix;
  • uspace/srv/net/nil/nildummy/nildummy.c

    r0b4a67a r7e1f9b7  
    106106static void nildummy_receiver(ipc_callid_t iid, ipc_call_t *icall)
    107107{
    108         packet_t packet;
     108        packet_t *packet;
    109109        int rc;
    110110
     
    304304
    305305int 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;
    309309
    310310        fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
     
    354354 * @return              EINVAL if the service parameter is not known.
    355355 */
    356 static int nildummy_send_message(device_id_t device_id, packet_t packet,
     356static int nildummy_send_message(device_id_t device_id, packet_t *packet,
    357357    services_t sender)
    358358{
     
    378378{
    379379        measured_string_t *address;
    380         packet_t packet;
     380        packet_t *packet;
    381381        size_t addrlen;
    382382        size_t prefix;
  • uspace/srv/net/tl/icmp/icmp.c

    r0b4a67a r7e1f9b7  
    130130 * @return              The result parameter.
    131131 */
    132 static int icmp_release_and_return(packet_t packet, int result)
     132static int icmp_release_and_return(packet_t *packet, int result)
    133133{
    134134        pq_release_remote(icmp_globals.net_phone, packet_get_id(packet));
     
    155155 * @return              EPERM if the error message is not allowed.
    156156 */
    157 static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,
     157static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t *packet,
    158158    icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
    159159    int dont_fragment)
     
    189189 * @return NULL on errors.
    190190 */
    191 static icmp_header_t *icmp_prepare_packet(packet_t packet)
     191static icmp_header_t *icmp_prepare_packet(packet_t *packet)
    192192{
    193193        icmp_header_t *header;
     
    248248{
    249249        icmp_header_t *header;
    250         packet_t packet;
     250        packet_t *packet;
    251251        size_t length;
    252252        uint8_t *data;
     
    340340
    341341static 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)
    343343{
    344344        icmp_header_t *header;
     
    355355}
    356356
    357 static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet)
     357static int icmp_source_quench_msg_local(int icmp_phone, packet_t *packet)
    358358{
    359359        icmp_header_t *header;
     
    368368
    369369static int icmp_time_exceeded_msg_local(int icmp_phone, icmp_code_t code,
    370     packet_t packet)
     370    packet_t *packet)
    371371{
    372372        icmp_header_t *header;
     
    381381
    382382static 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)
    384384{
    385385        icmp_header_t *header;
     
    479479 * @param[in] code      The received reply message code.
    480480 */
    481 static void  icmp_process_echo_reply(packet_t packet, icmp_header_t *header,
     481static void  icmp_process_echo_reply(packet_t *packet, icmp_header_t *header,
    482482    icmp_type_t type, icmp_code_t code)
    483483{
     
    518518 *                      ip_client_process_packet() function.
    519519 */
    520 static int icmp_process_packet(packet_t packet, services_t error)
     520static int icmp_process_packet(packet_t *packet, services_t error)
    521521{
    522522        size_t length;
     
    658658 *                      icmp_process_packet() function.
    659659 */
    660 static int icmp_received_msg_local(device_id_t device_id, packet_t packet,
     660static int icmp_received_msg_local(device_id_t device_id, packet_t *packet,
    661661    services_t receiver, services_t error)
    662662{
     
    690690static int icmp_process_message(ipc_call_t *call)
    691691{
    692         packet_t packet;
     692        packet_t *packet;
    693693        int rc;
    694694
     
    896896    ipc_call_t *answer, int *answer_count)
    897897{
    898         packet_t packet;
     898        packet_t *packet;
    899899        int rc;
    900900
  • uspace/srv/net/tl/tcp/tcp.c

    r0b4a67a r7e1f9b7  
    160160};
    161161
    162 static int tcp_release_and_return(packet_t, int);
     162static int tcp_release_and_return(packet_t *, int);
    163163static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *,
    164164    tcp_header_t *, int synchronize, int);
     
    171171static int tcp_release_after_timeout(void *);
    172172
    173 static int tcp_process_packet(device_id_t, packet_t, services_t);
     173static int tcp_process_packet(device_id_t, packet_t *, services_t);
    174174static int tcp_connect_core(socket_core_t *, socket_cores_t *,
    175175    struct sockaddr *, socklen_t);
    176176static 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);
     178static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t *,
    179179    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);
     180static packet_t *tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *);
     181static void tcp_send_packets(device_id_t, packet_t *);
    182182
    183183static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *,
    184184    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);
     185static packet_t *tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *,
     186    packet_t *, size_t, size_t);
     187static packet_t *tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *,
     188    packet_t *, size_t, size_t);
    189189/* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *,
    190190    size_t);
    191 static int tcp_create_notification_packet(packet_t *, socket_core_t *,
     191static int tcp_create_notification_packet(packet_t **, socket_core_t *,
    192192    tcp_socket_data_t *, int, int);
    193193static void tcp_refresh_socket_data(tcp_socket_data_t *);
     
    196196
    197197static 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);
    199199static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *,
    200     tcp_header_t *, packet_t);
     200    tcp_header_t *, packet_t *);
    201201static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *,
    202     tcp_header_t *, packet_t);
     202    tcp_header_t *, packet_t *);
    203203static 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);
    205205static 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
     208static int tcp_received_msg(device_id_t, packet_t *, services_t, services_t);
    209209static int tcp_process_client_messages(ipc_callid_t, ipc_call_t);
    210210
     
    262262}
    263263
    264 int tcp_received_msg(device_id_t device_id, packet_t packet,
     264int tcp_received_msg(device_id_t device_id, packet_t *packet,
    265265    services_t receiver, services_t error)
    266266{
     
    280280}
    281281
    282 int tcp_process_packet(device_id_t device_id, packet_t packet, services_t error)
     282int tcp_process_packet(device_id_t device_id, packet_t *packet, services_t error)
    283283{
    284284        size_t length;
     
    288288        socket_core_t *socket;
    289289        tcp_socket_data_t *socket_data;
    290         packet_t next_packet;
     290        packet_t *next_packet;
    291291        size_t total_length;
    292292        uint32_t checksum;
     
    493493
    494494int 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,
    496496    size_t total_length)
    497497{
    498         packet_t next_packet;
    499         packet_t tmp_packet;
     498        packet_t *next_packet;
     499        packet_t *tmp_packet;
    500500        uint32_t old_incoming;
    501501        size_t order;
     
    801801
    802802int 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,
    804804    size_t total_length)
    805805{
     
    838838
    839839int 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;
    843843        int rc;
    844844
     
    897897int tcp_process_listen(socket_core_t *listening_socket,
    898898    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,
    900900    size_t addrlen)
    901901{
    902         packet_t next_packet;
     902        packet_t *next_packet;
    903903        socket_core_t *socket;
    904904        tcp_socket_data_t *socket_data;
     
    10561056
    10571057int 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)
    10591059{
    10601060        socket_core_t *listening_socket;
     
    11271127        size_t number;
    11281128        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;
    11321132        uint32_t old;
    11331133
     
    12321232    ipc_call_t *answer, int *answer_count)
    12331233{
    1234         packet_t packet;
     1234        packet_t *packet;
    12351235        int rc;
    12361236
     
    16541654    socket_data, size_t sequence_number)
    16551655{
    1656         packet_t packet;
    1657         packet_t copy;
     1656        packet_t *packet;
     1657        packet_t *copy;
    16581658        size_t data_length;
    16591659
     
    17361736{
    17371737        tcp_socket_data_t *socket_data;
    1738         packet_t packet;
     1738        packet_t *packet;
    17391739        int rc;
    17401740
     
    18241824
    18251825int 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)
    18271827{
    18281828        tcp_header_t *header;
     
    18551855
    18561856int 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)
    18581858{
    18591859        int rc;
     
    18761876}
    18771877
    1878 packet_t tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
     1878packet_t *tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
    18791879    socket_data)
    18801880{
    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;
    18851885        size_t data_length;
    18861886        int rc;
     
    19361936}
    19371937
    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)
     1938packet_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)
    19401940{
    19411941        tcp_header_t *header;
     
    19971997}
    19981998
    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;
     1999packet_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;
    20032003
    20042004        assert(socket);
     
    20152015}
    20162016
    2017 void tcp_send_packets(device_id_t device_id, packet_t packet)
    2018 {
    2019         packet_t next;
     2017void tcp_send_packets(device_id_t device_id, packet_t *packet)
     2018{
     2019        packet_t *next;
    20202020
    20212021        while (packet) {
     
    20972097        tcp_socket_data_t *socket_data;
    20982098        int packet_id;
    2099         packet_t packet;
     2099        packet_t *packet;
    21002100        size_t length;
    21012101        int rc;
     
    21552155        tcp_socket_data_t *socket_data;
    21562156        packet_dimension_t *packet_dimension;
    2157         packet_t packet;
     2157        packet_t *packet;
    21582158        size_t total_length;
    21592159        tcp_header_t *header;
     
    22292229        socket_core_t *socket;
    22302230        tcp_socket_data_t *socket_data;
    2231         packet_t packet;
     2231        packet_t *packet;
    22322232        int rc;
    22332233
     
    22932293}
    22942294
    2295 int tcp_create_notification_packet(packet_t *packet, socket_core_t *socket,
     2295int tcp_create_notification_packet(packet_t **packet, socket_core_t *socket,
    22962296    tcp_socket_data_t *socket_data, int synchronize, int finalize)
    22972297{
     
    24422442 * @return              The result parameter.
    24432443 */
    2444 int tcp_release_and_return(packet_t packet, int result)
     2444int tcp_release_and_return(packet_t *packet, int result)
    24452445{
    24462446        pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
  • uspace/srv/net/tl/tcp/tcp.h

    r0b4a67a r7e1f9b7  
    239239         * Packets metric is set as their data length.
    240240         */
    241         packet_t incoming;
     241        packet_t *incoming;
    242242       
    243243        /** Outgoing packet queue.
     
    249249         * Packets metric is set as their data length.
    250250         */
    251         packet_t outgoing;
     251        packet_t *outgoing;
    252252       
    253253        /** IP pseudo header. */
  • uspace/srv/net/tl/udp/udp.c

    r0b4a67a r7e1f9b7  
    190190 * @return              The result parameter.
    191191 */
    192 static int udp_release_and_return(packet_t packet, int result)
     192static int udp_release_and_return(packet_t *packet, int result)
    193193{
    194194        pq_release_remote(udp_globals.net_phone, packet_get_id(packet));
     
    217217 *                      ip_client_process_packet() function.
    218218 */
    219 static int udp_process_packet(device_id_t device_id, packet_t packet,
     219static int udp_process_packet(device_id_t device_id, packet_t *packet,
    220220    services_t error)
    221221{
     
    225225        udp_header_t *header;
    226226        socket_core_t *socket;
    227         packet_t next_packet;
     227        packet_t *next_packet;
    228228        size_t total_length;
    229229        uint32_t checksum;
    230230        int fragments;
    231         packet_t tmp_packet;
     231        packet_t *tmp_packet;
    232232        icmp_type_t type;
    233233        icmp_code_t code;
     
    413413 *                      udp_process_packet() function.
    414414 */
    415 static int udp_received_msg(device_id_t device_id, packet_t packet,
     415static int udp_received_msg(device_id_t device_id, packet_t *packet,
    416416    services_t receiver, services_t error)
    417417{
     
    458458{
    459459        socket_core_t *socket;
    460         packet_t packet;
    461         packet_t next_packet;
     460        packet_t *packet;
     461        packet_t *next_packet;
    462462        udp_header_t *header;
    463463        int index;
     
    614614        socket_core_t *socket;
    615615        int packet_id;
    616         packet_t packet;
     616        packet_t *packet;
    617617        udp_header_t *header;
    618618        struct sockaddr *addr;
     
    861861    ipc_call_t *answer, int *answer_count)
    862862{
    863         packet_t packet;
     863        packet_t *packet;
    864864        int rc;
    865865
Note: See TracChangeset for help on using the changeset viewer.