Changeset 0a866eeb in mainline


Ignore:
Timestamp:
2010-10-08T19:45:11Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c69d327
Parents:
d52fbaf
Message:

Fix packet_get_copy() and socket_destroy_core() to use the remote packet
interfaces.

Fix packet_client.h to declare the remote packet interfaces and create
packet_local.h for the use by the packet server (or later possibly also by the
bundle build).

Location:
uspace
Files:
1 added
24 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/Makefile

    rd52fbaf r0a866eeb  
    3535        generic/net_remote.c \
    3636        generic/net_checksum.c \
     37        generic/packet_client.c \
    3738        generic/packet_remote.c \
     39        generic/socket_core.c \
    3840        adt/module_map.c \
    3941        netif/netif_local.c \
  • uspace/lib/net/generic/packet_client.c

    rd52fbaf r0a866eeb  
    4141#include <sys/mman.h>
    4242
     43#include <packet_client.h>
     44
    4345#include <net_messages.h>
    4446#include <packet/packet.h>
    4547#include <packet/packet_header.h>
    46 #include <packet/packet_client.h>
    4748
    4849int packet_copy_data(packet_t packet, const void * data, size_t length)
     
    181182
    182183        // get a new packet
    183         copy = packet_get_4_local(phone, PACKET_DATA_LENGTH(packet),
     184        copy = packet_get_4_remote(phone, PACKET_DATA_LENGTH(packet),
    184185            PACKET_MAX_ADDRESS_LENGTH(packet), packet->max_prefix,
    185186            PACKET_MIN_SUFFIX(packet));
     
    199200                return copy;
    200201        } else {
    201                 pq_release_local(phone, copy->packet_id);
     202                pq_release_remote(phone, copy->packet_id);
    202203                return NULL;
    203204        }
  • uspace/lib/net/generic/packet_remote.c

    rd52fbaf r0a866eeb  
    4444
    4545#include <net_messages.h>
     46#include <packet_client.h>
     47#include <packet_remote.h>
     48
    4649#include <packet/packet.h>
    47 #include <packet/packet_client.h>
    4850#include <packet/packet_header.h>
    49 #include <packet_remote.h>
    5051
    5152/** Obtain the packet from the packet server as the shared memory block.
  • uspace/lib/net/generic/socket_core.c

    rd52fbaf r0a866eeb  
    4747#include <adt/int_map.h>
    4848#include <packet/packet.h>
    49 #include <packet/packet_client.h>
     49#include <packet_client.h>
     50#include <packet_remote.h>
    5051#include <net/modules.h>
    5152#include <socket_core.h>
     
    9192        // release all received packets
    9293        while((packet_id = dyn_fifo_pop(&socket->received)) >= 0){
    93                 pq_release_local(packet_phone, packet_id);
     94                pq_release_remote(packet_phone, packet_id);
    9495        }
    9596        dyn_fifo_destroy(&socket->received);
  • uspace/lib/net/il/ip_client.c

    rd52fbaf r0a866eeb  
    4040
    4141#include <ip_client.h>
     42#include <packet_client.h>
     43#include <ip_header.h>
     44
    4245#include <packet/packet.h>
    43 #include <packet/packet_client.h>
    44 #include <ip_header.h>
    4546
    4647size_t ip_client_header_length(packet_t packet){
  • uspace/lib/net/il/ip_remote.c

    rd52fbaf r0a866eeb  
    4747#include <net/inet.h>
    4848#include <ip_interface.h>
    49 #include <packet/packet_client.h>
     49#include <packet_client.h>
    5050#include <il_messages.h>
    5151#include <ip_messages.h>
  • uspace/lib/net/include/il_interface.h

    rd52fbaf r0a866eeb  
    4646#include <net_device.h>
    4747#include <packet/packet.h>
    48 #include <packet/packet_client.h>
     48#include <packet_client.h>
    4949#include <il_messages.h>
    5050
  • uspace/lib/net/include/netif_interface.h

    rd52fbaf r0a866eeb  
    5353
    5454#include <netif_remote.h>
    55 #include <packet/packet_client.h>
     55#include <packet_client.h>
    5656
    5757#define netif_module_message    netif_module_message_standalone
  • uspace/lib/net/include/packet_client.h

    rd52fbaf r0a866eeb  
    172172 *  @returns Other error codes as defined for the packet_return() function.
    173173 */
    174 extern int packet_translate_local(int phone, packet_ref packet, packet_id_t packet_id);
     174extern int packet_translate_remote(int phone, packet_ref packet, packet_id_t packet_id);
    175175
    176176/** Obtains the packet of the given dimensions.
     
    184184 *  @returns NULL on error.
    185185 */
    186 extern packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
     186extern packet_t packet_get_4_remote(int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix);
    187187
    188188/** Obtains the packet of the given content size.
     
    193193 *  @returns NULL on error.
    194194 */
    195 extern packet_t packet_get_1_local(int phone, size_t content);
     195extern packet_t packet_get_1_remote(int phone, size_t content);
    196196
    197197/** Releases the packet queue.
     
    202202 *  @param[in] packet_id The packet identifier.
    203203 */
    204 extern void pq_release_local(int phone, packet_id_t packet_id);
     204extern void pq_release_remote(int phone, packet_id_t packet_id);
    205205
    206206/** Returns the packet copy.
  • uspace/lib/net/include/tl_interface.h

    rd52fbaf r0a866eeb  
    4444#include <net_device.h>
    4545#include <packet/packet.h>
    46 #include <packet/packet_client.h>
     46#include <packet_client.h>
    4747#include <tl_messages.h>
    4848
  • uspace/lib/net/netif/netif_local.c

    rd52fbaf r0a866eeb  
    4747#include <net/modules.h>
    4848#include <packet/packet.h>
    49 #include <packet/packet_client.h>
     49#include <packet_client.h>
    5050#include <packet/packet_server.h>
    5151#include <packet_remote.h>
  • uspace/lib/net/netif/netif_remote.c

    rd52fbaf r0a866eeb  
    4040#include <adt/measured_strings.h>
    4141#include <packet/packet.h>
    42 #include <packet/packet_client.h>
     42#include <packet_client.h>
    4343#include <net_device.h>
    4444#include <netif_remote.h>
  • uspace/lib/net/nil/nil_remote.c

    rd52fbaf r0a866eeb  
    4040#include <nil_interface.h>
    4141#include <packet/packet.h>
    42 #include <packet/packet_client.h>
     42#include <packet_client.h>
    4343#include <nil_messages.h>
    4444#include <nil_remote.h>
  • uspace/lib/net/tl/icmp_client.c

    rd52fbaf r0a866eeb  
    4646#include <icmp_client.h>
    4747#include <packet/packet.h>
    48 #include <packet/packet_client.h>
     48#include <packet_client.h>
    4949#include <icmp_header.h>
    5050
  • uspace/lib/net/tl/icmp_remote.c

    rd52fbaf r0a866eeb  
    4545#include <net/modules.h>
    4646#include <icmp_interface.h>
    47 #include <packet/packet_client.h>
     47#include <packet_client.h>
    4848#include <icmp_messages.h>
    4949
  • uspace/lib/net/tl/tl_common.c

    rd52fbaf r0a866eeb  
    4646
    4747#include <packet/packet.h>
    48 #include <packet/packet_client.h>
     48#include <packet_client.h>
    4949#include <packet_remote.h>
    5050#include <net_device.h>
  • uspace/lib/socket/Makefile

    rd52fbaf r0a866eeb  
    3333
    3434SOURCES = \
    35         generic/socket_core.c \
    3635        generic/icmp_common.c \
    3736        generic/icmp_api.c \
    3837        packet/packet.c \
    39         packet/packet_client.c \
    4038        packet/packet_server.c
    4139
  • uspace/lib/socket/packet/packet_server.c

    rd52fbaf r0a866eeb  
    4949#include <net_messages.h>
    5050#include <packet/packet.h>
    51 #include <packet/packet_client.h>
     51#include <packet/packet_local.h>
    5252#include <packet/packet_header.h>
    5353#include <packet/packet_server.h>
  • uspace/srv/hw/netif/dp8390/dp8390.c

    rd52fbaf r0a866eeb  
    3939#include <netif_local.h>
    4040#include <packet/packet.h>
    41 #include <packet/packet_client.h>
     41#include <packet_client.h>
    4242
    4343#include "dp8390_drv.h"
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    rd52fbaf r0a866eeb  
    4646#include <net_messages.h>
    4747#include <net/modules.h>
    48 #include <packet/packet_client.h>
     48#include <packet_client.h>
    4949#include <adt/measured_strings.h>
    5050#include <net_device.h>
  • uspace/srv/net/il/arp/arp.c

    rd52fbaf r0a866eeb  
    5656#include <adt/measured_strings.h>
    5757#include <packet/packet.h>
    58 #include <packet/packet_client.h>
     58#include <packet_client.h>
    5959#include <packet_remote.h>
    6060#include <il_messages.h>
  • uspace/srv/net/il/ip/ip.c

    rd52fbaf r0a866eeb  
    6868#include <adt/measured_strings.h>
    6969#include <adt/module_map.h>
    70 #include <packet/packet_client.h>
     70#include <packet_client.h>
    7171#include <packet_remote.h>
    7272#include <nil_messages.h>
  • uspace/srv/net/netif/lo/lo.c

    rd52fbaf r0a866eeb  
    4747#include <net/modules.h>
    4848#include <adt/measured_strings.h>
    49 #include <packet/packet_client.h>
     49#include <packet_client.h>
    5050#include <net_device.h>
    5151#include <nil_interface.h>
  • uspace/srv/net/nil/eth/eth.c

    rd52fbaf r0a866eeb  
    5959#include <il_interface.h>
    6060#include <adt/measured_strings.h>
    61 #include <packet/packet_client.h>
     61#include <packet_client.h>
    6262#include <packet_remote.h>
    6363#include <nil_local.h>
  • uspace/srv/net/tl/icmp/icmp.c

    rd52fbaf r0a866eeb  
    5656#include <net_messages.h>
    5757#include <net/modules.h>
    58 #include <packet/packet_client.h>
     58#include <packet_client.h>
    5959#include <packet_remote.h>
    6060#include <net_checksum.h>
  • uspace/srv/net/tl/tcp/tcp.c

    rd52fbaf r0a866eeb  
    5858#include <net_messages.h>
    5959#include <adt/dynamic_fifo.h>
    60 #include <packet/packet_client.h>
     60#include <packet_client.h>
    6161#include <packet_remote.h>
    6262#include <net_checksum.h>
  • uspace/srv/net/tl/udp/udp.c

    rd52fbaf r0a866eeb  
    5555#include <net_messages.h>
    5656#include <adt/dynamic_fifo.h>
    57 #include <packet/packet_client.h>
     57#include <packet_client.h>
    5858#include <packet_remote.h>
    5959#include <net_checksum.h>
Note: See TracChangeset for help on using the changeset viewer.