Changeset a7811f17 in mainline for uspace/srv


Ignore:
Timestamp:
2010-11-19T21:28:02Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a9c6b966
Parents:
45f04f8 (diff), aaa3f33a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge xxx_ref typedefs removal.

Location:
uspace/srv
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r45f04f8 ra7811f17  
    157157}
    158158
    159 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats){
     159int netif_get_device_stats(device_id_t device_id, device_stats_t *stats)
     160{
    160161        netif_device_t * device;
    161162        eth_stat_t * de_stat;
     
    185186}
    186187
    187 int netif_get_addr_message(device_id_t device_id, measured_string_ref address){
     188int netif_get_addr_message(device_id_t device_id, measured_string_t *address){
    188189        netif_device_t * device;
    189190        int rc;
  • uspace/srv/net/il/arp/arp.c

    r45f04f8 ra7811f17  
    8383 * @param[in] device    The device specific data.
    8484 */
    85 static void arp_clear_device(arp_device_ref device)
     85static void arp_clear_device(arp_device_t *device)
    8686{
    8787        int count;
    88         arp_proto_ref proto;
     88        arp_proto_t *proto;
    8989
    9090        for (count = arp_protos_count(&device->protos) - 1; count >= 0;
     
    105105{
    106106        int count;
    107         arp_device_ref device;
     107        arp_device_t *device;
    108108
    109109        fibril_rwlock_write_lock(&arp_globals.lock);
     
    126126
    127127static int arp_clear_address_req(int arp_phone, device_id_t device_id,
    128     services_t protocol, measured_string_ref address)
    129 {
    130         arp_device_ref device;
    131         arp_proto_ref proto;
     128    services_t protocol, measured_string_t *address)
     129{
     130        arp_device_t *device;
     131        arp_proto_t *proto;
    132132
    133133        fibril_rwlock_write_lock(&arp_globals.lock);
     
    150150static int arp_clear_device_req(int arp_phone, device_id_t device_id)
    151151{
    152         arp_device_ref device;
     152        arp_device_t *device;
    153153
    154154        fibril_rwlock_write_lock(&arp_globals.lock);
     
    174174 * @returns             ENOMEM if there is not enough memory left.
    175175 */
    176 static int arp_proto_create(arp_proto_ref *proto, services_t service,
    177     measured_string_ref address)
     176static int arp_proto_create(arp_proto_t **proto, services_t service,
     177    measured_string_t *address)
    178178{
    179179        int rc;
    180180
    181         *proto = (arp_proto_ref) malloc(sizeof(arp_proto_t));
     181        *proto = (arp_proto_t *) malloc(sizeof(arp_proto_t));
    182182        if (!*proto)
    183183                return ENOMEM;
     
    213213 */
    214214static int arp_device_message(device_id_t device_id, services_t service,
    215     services_t protocol, measured_string_ref address)
    216 {
    217         arp_device_ref device;
    218         arp_proto_ref proto;
     215    services_t protocol, measured_string_t *address)
     216{
     217        arp_device_t *device;
     218        arp_proto_t *proto;
    219219        hw_type_t hardware;
    220220        int index;
     
    260260               
    261261                /* Create a new device */
    262                 device = (arp_device_ref) malloc(sizeof(arp_device_t));
     262                device = (arp_device_t *) malloc(sizeof(arp_device_t));
    263263                if (!device) {
    264264                        fibril_rwlock_write_unlock(&arp_globals.lock);
     
    381381static int arp_mtu_changed_message(device_id_t device_id, size_t mtu)
    382382{
    383         arp_device_ref device;
     383        arp_device_t *device;
    384384
    385385        fibril_rwlock_write_lock(&arp_globals.lock);
     
    418418{
    419419        size_t length;
    420         arp_header_ref header;
    421         arp_device_ref device;
    422         arp_proto_ref proto;
    423         measured_string_ref hw_source;
     420        arp_header_t *header;
     421        arp_device_t *device;
     422        arp_proto_t *proto;
     423        measured_string_t *hw_source;
    424424        uint8_t *src_hw;
    425425        uint8_t *src_proto;
     
    436436                return ENOENT;
    437437
    438         header = (arp_header_ref) packet_get_data(packet);
     438        header = (arp_header_t *) packet_get_data(packet);
    439439        if ((ntohs(header->hardware) != device->hardware) ||
    440440            (length < sizeof(arp_header_t) + header->hardware_length * 2U +
     
    523523 * @returns             NULL if the hardware address is not found in the cache.
    524524 */
    525 static measured_string_ref
     525static measured_string_t *
    526526arp_translate_message(device_id_t device_id, services_t protocol,
    527     measured_string_ref target)
    528 {
    529         arp_device_ref device;
    530         arp_proto_ref proto;
    531         measured_string_ref addr;
     527    measured_string_t *target)
     528{
     529        arp_device_t *device;
     530        arp_proto_t *proto;
     531        measured_string_t *addr;
    532532        size_t length;
    533533        packet_t packet;
    534         arp_header_ref header;
     534        arp_header_t *header;
    535535
    536536        if (!target)
     
    561561                return NULL;
    562562
    563         header = (arp_header_ref) packet_suffix(packet, length);
     563        header = (arp_header_t *) packet_suffix(packet, length);
    564564        if (!header) {
    565565                pq_release_remote(arp_globals.net_phone, packet_get_id(packet));
     
    612612    ipc_call_t *answer, int *answer_count)
    613613{
    614         measured_string_ref address;
    615         measured_string_ref translation;
     614        measured_string_t *address;
     615        measured_string_t *translation;
    616616        char *data;
    617617        packet_t packet;
  • uspace/srv/net/il/arp/arp.h

    r45f04f8 ra7811f17  
    5555typedef struct arp_device arp_device_t;
    5656
    57 /** Type definition of the ARP device specific data pointer.
    58  * @see arp_device
    59  */
    60 typedef arp_device_t *arp_device_ref;
    61 
    6257/** Type definition of the ARP global data.
    6358 * @see arp_globals
     
    6964 */
    7065typedef struct arp_proto arp_proto_t;
    71 
    72 /** Type definition of the ARP protocol specific data pointer.
    73  * @see arp_proto
    74  */
    75 typedef arp_proto_t *arp_proto_ref;
    7666
    7767/** ARP address map.
     
    9989struct arp_device {
    10090        /** Actual device hardware address. */
    101         measured_string_ref addr;
     91        measured_string_t * addr;
    10292        /** Actual device hardware address data. */
    10393        char *addr_data;
    10494        /** Broadcast device hardware address. */
    105         measured_string_ref broadcast_addr;
     95        measured_string_t * broadcast_addr;
    10696        /** Broadcast device hardware address data. */
    10797        char *broadcast_data;
     
    145135struct arp_proto {
    146136        /** Actual device protocol address. */
    147         measured_string_ref addr;
     137        measured_string_t *addr;
    148138        /** Actual device protocol address data. */
    149139        char *addr_data;
  • uspace/srv/net/il/arp/arp_header.h

    r45f04f8 ra7811f17  
    4646typedef struct arp_header arp_header_t;
    4747
    48 /** Type definition of an ARP protocol header pointer.
    49  * @see arp_header
    50  */
    51 typedef arp_header_t *arp_header_ref;
    52 
    5348/** ARP protocol header. */
    5449struct arp_header {
  • uspace/srv/net/il/ip/ip.c

    r45f04f8 ra7811f17  
    144144static int ip_get_icmp_phone(void)
    145145{
    146         ip_proto_ref proto;
     146        ip_proto_t *proto;
    147147        int phone;
    148148
     
    170170 * @returns             Other error codes as defined for the packet_set_addr().
    171171 */
    172 static int ip_prepare_icmp(packet_t packet, ip_header_ref header)
     172static int ip_prepare_icmp(packet_t packet, ip_header_t *header)
    173173{
    174174        packet_t next;
     
    187187
    188188                // get header
    189                 header = (ip_header_ref) packet_get_data(packet);
     189                header = (ip_header_t *) packet_get_data(packet);
    190190                if (!header)
    191191                        return EINVAL;
     
    234234static int
    235235ip_prepare_icmp_and_get_phone(services_t error, packet_t packet,
    236     ip_header_ref header)
     236    ip_header_t *header)
    237237{
    238238        int phone;
     
    308308 *                      nil_packet_size_req() function.
    309309 */
    310 static int ip_netif_initialize(ip_netif_ref ip_netif)
     310static int ip_netif_initialize(ip_netif_t *ip_netif)
    311311{
    312312        measured_string_t names[] = {
     
    344344                }
    345345        };
    346         measured_string_ref configuration;
     346        measured_string_t *configuration;
    347347        size_t count = sizeof(names) / sizeof(measured_string_t);
    348348        char *data;
    349349        measured_string_t address;
    350         ip_route_ref route;
     350        ip_route_t *route;
    351351        in_addr_t gateway;
    352352        int index;
     
    378378                        return ENOTSUP;
    379379                } else if (ip_netif->ipv == IPV4) {
    380                         route = (ip_route_ref) malloc(sizeof(ip_route_t));
     380                        route = (ip_route_t *) malloc(sizeof(ip_route_t));
    381381                        if (!route) {
    382382                                net_free_settings(configuration, data);
     
    491491static int ip_mtu_changed_message(device_id_t device_id, size_t mtu)
    492492{
    493         ip_netif_ref netif;
     493        ip_netif_t *netif;
    494494
    495495        fibril_rwlock_write_lock(&ip_globals.netifs_lock);
     
    516516static int ip_device_state_message(device_id_t device_id, device_state_t state)
    517517{
    518         ip_netif_ref netif;
     518        ip_netif_t *netif;
    519519
    520520        fibril_rwlock_write_lock(&ip_globals.netifs_lock);
     
    542542 * @returns             NULL on error.
    543543 */
    544 static ip_header_ref
    545 ip_create_middle_header(packet_t packet, ip_header_ref last)
    546 {
    547         ip_header_ref middle;
    548 
    549         middle = (ip_header_ref) packet_suffix(packet, IP_HEADER_LENGTH(last));
     544static ip_header_t *
     545ip_create_middle_header(packet_t packet, ip_header_t *last)
     546{
     547        ip_header_t *middle;
     548
     549        middle = (ip_header_t *) packet_suffix(packet, IP_HEADER_LENGTH(last));
    550550        if (!middle)
    551551                return NULL;
     
    562562 * @param[in] first     The original header to be copied.
    563563 */
    564 static void ip_create_last_header(ip_header_ref last, ip_header_ref first)
    565 {
    566         ip_option_ref option;
     564static void ip_create_last_header(ip_header_t *last, ip_header_t *first)
     565{
     566        ip_option_t *option;
    567567        size_t next;
    568568        size_t length;
     
    575575        // process all ip options
    576576        while (next < first->header_length) {
    577                 option = (ip_option_ref) (((uint8_t *) first) + next);
     577                option = (ip_option_t *) (((uint8_t *) first) + next);
    578578                // skip end or noop
    579579                if ((option->type == IPOPT_END) ||
     
    623623static int
    624624ip_prepare_packet(in_addr_t *source, in_addr_t dest, packet_t packet,
    625     measured_string_ref destination)
     625    measured_string_t *destination)
    626626{
    627627        size_t length;
    628         ip_header_ref header;
    629         ip_header_ref last_header;
    630         ip_header_ref middle_header;
     628        ip_header_t *header;
     629        ip_header_t *last_header;
     630        ip_header_t *middle_header;
    631631        packet_t next;
    632632        int rc;
     
    636636                return EINVAL;
    637637
    638         header = (ip_header_ref) packet_get_data(packet);
     638        header = (ip_header_t *) packet_get_data(packet);
    639639        if (destination) {
    640640                rc = packet_set_addr(packet, NULL, (uint8_t *) destination->value,
     
    660660
    661661        if (pq_next(packet)) {
    662                 last_header = (ip_header_ref) malloc(IP_HEADER_LENGTH(header));
     662                last_header = (ip_header_t *) malloc(IP_HEADER_LENGTH(header));
    663663                if (!last_header)
    664664                        return ENOMEM;
     
    666666                next = pq_next(packet);
    667667                while (pq_next(next)) {
    668                         middle_header = (ip_header_ref) packet_prefix(next,
     668                        middle_header = (ip_header_t *) packet_prefix(next,
    669669                            IP_HEADER_LENGTH(last_header));
    670670                        if (!middle_header) {
     
    698698                }
    699699
    700                 middle_header = (ip_header_ref) packet_prefix(next,
     700                middle_header = (ip_header_t *) packet_prefix(next,
    701701                    IP_HEADER_LENGTH(last_header));
    702702                if (!middle_header) {
     
    755755static int
    756756ip_fragment_packet_data(packet_t packet, packet_t new_packet,
    757     ip_header_ref header, ip_header_ref new_header, size_t length,
     757    ip_header_t *header, ip_header_t *new_header, size_t length,
    758758    const struct sockaddr *src, const struct sockaddr *dest, socklen_t addrlen)
    759759{
     
    820820{
    821821        packet_t new_packet;
    822         ip_header_ref header;
    823         ip_header_ref middle_header;
    824         ip_header_ref last_header;
     822        ip_header_t *header;
     823        ip_header_t *middle_header;
     824        ip_header_t *last_header;
    825825        struct sockaddr *src;
    826826        struct sockaddr *dest;
     
    838838
    839839        // get header
    840         header = (ip_header_ref) packet_get_data(packet);
     840        header = (ip_header_t *) packet_get_data(packet);
    841841        if (!header)
    842842                return EINVAL;
     
    853853
    854854        // allocate as much as originally
    855         last_header = (ip_header_ref) packet_suffix(new_packet,
     855        last_header = (ip_header_t *) packet_suffix(new_packet,
    856856            IP_HEADER_LENGTH(header));
    857857        if (!last_header)
     
    993993 */
    994994static int
    995 ip_send_route(packet_t packet, ip_netif_ref netif, ip_route_ref 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{
    998998        measured_string_t destination;
    999         measured_string_ref translation;
     999        measured_string_t *translation;
    10001000        char *data;
    10011001        int phone;
     
    10651065 * @returns             NULL if no route was found.
    10661066 */
    1067 static ip_route_ref
    1068 ip_netif_find_route(ip_netif_ref netif, in_addr_t destination)
     1067static ip_route_t *
     1068ip_netif_find_route(ip_netif_t *netif, in_addr_t destination)
    10691069{
    10701070        int index;
    1071         ip_route_ref route;
     1071        ip_route_t *route;
    10721072
    10731073        if (!netif)
     
    10931093 * @returns             NULL if no route was found.
    10941094 */
    1095 static ip_route_ref ip_find_route(in_addr_t destination) {
     1095static ip_route_t *ip_find_route(in_addr_t destination) {
    10961096        int index;
    1097         ip_route_ref route;
    1098         ip_netif_ref netif;
     1097        ip_route_t *route;
     1098        ip_netif_t *netif;
    10991099
    11001100        // start with the last netif - the newest one
     
    11191119 * @returns             NULL if no IP address was found.
    11201120 */
    1121 static in_addr_t *ip_netif_address(ip_netif_ref netif)
    1122 {
    1123         ip_route_ref route;
     1121static in_addr_t *ip_netif_address(ip_netif_t *netif)
     1122{
     1123        ip_route_t *route;
    11241124
    11251125        route = ip_routes_get_index(&netif->routes, 0);
     
    11471147    tl_received_msg_t received_msg)
    11481148{
    1149         ip_proto_ref proto;
     1149        ip_proto_t *proto;
    11501150        int index;
    11511151
     
    11531153                return EINVAL;
    11541154
    1155         proto = (ip_proto_ref) malloc(sizeof(ip_protos_t));
     1155        proto = (ip_proto_t *) malloc(sizeof(ip_protos_t));
    11561156        if (!proto)
    11571157                return ENOMEM;
     
    11801180ip_device_req_local(int il_phone, device_id_t device_id, services_t netif)
    11811181{
    1182         ip_netif_ref ip_netif;
    1183         ip_route_ref route;
     1182        ip_netif_t *ip_netif;
     1183        ip_route_t *route;
    11841184        int index;
    11851185        int rc;
    11861186
    1187         ip_netif = (ip_netif_ref) malloc(sizeof(ip_netif_t));
     1187        ip_netif = (ip_netif_t *) malloc(sizeof(ip_netif_t));
    11881188        if (!ip_netif)
    11891189                return ENOMEM;
     
    12511251{
    12521252        int addrlen;
    1253         ip_netif_ref netif;
    1254         ip_route_ref route;
     1253        ip_netif_t *netif;
     1254        ip_route_t *route;
    12551255        struct sockaddr *addr;
    12561256        struct sockaddr_in *address_in;
     
    13671367    size_t *content, size_t *suffix)
    13681368{
    1369         ip_netif_ref netif;
     1369        ip_netif_t *netif;
    13701370        int index;
    13711371
     
    14201420 * @returns             The packet destination address.
    14211421 */
    1422 static in_addr_t ip_get_destination(ip_header_ref header)
     1422static in_addr_t ip_get_destination(ip_header_t *header)
    14231423{
    14241424        in_addr_t destination;
     
    14511451 */
    14521452static int
    1453 ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_ref header,
     1453ip_deliver_local(device_id_t device_id, packet_t packet, ip_header_t *header,
    14541454    services_t error)
    14551455{
    1456         ip_proto_ref proto;
     1456        ip_proto_t *proto;
    14571457        int phone;
    14581458        services_t service;
     
    15551555ip_process_packet(device_id_t device_id, packet_t packet)
    15561556{
    1557         ip_header_ref header;
     1557        ip_header_t *header;
    15581558        in_addr_t dest;
    1559         ip_route_ref route;
     1559        ip_route_t *route;
    15601560        int phone;
    15611561        struct sockaddr *addr;
     
    15641564        int rc;
    15651565
    1566         header = (ip_header_ref) packet_get_data(packet);
     1566        header = (ip_header_t *) packet_get_data(packet);
    15671567        if (!header)
    15681568                return ip_release_and_return(packet, ENOMEM);
     
    16471647    in_addr_t netmask, in_addr_t gateway)
    16481648{
    1649         ip_route_ref route;
    1650         ip_netif_ref netif;
     1649        ip_route_t *route;
     1650        ip_netif_t *netif;
    16511651        int index;
    16521652
     
    16591659        }
    16601660
    1661         route = (ip_route_ref) malloc(sizeof(ip_route_t));
     1661        route = (ip_route_t *) malloc(sizeof(ip_route_t));
    16621662        if (!route) {
    16631663                fibril_rwlock_write_unlock(&ip_globals.netifs_lock);
     
    16811681ip_set_gateway_req_local(int ip_phone, device_id_t device_id, in_addr_t gateway)
    16821682{
    1683         ip_netif_ref netif;
     1683        ip_netif_t *netif;
    16841684
    16851685        fibril_rwlock_write_lock(&ip_globals.netifs_lock);
     
    17211721        icmp_type_t type;
    17221722        icmp_code_t code;
    1723         ip_netif_ref netif;
     1723        ip_netif_t *netif;
    17241724        measured_string_t address;
    1725         ip_route_ref route;
    1726         ip_header_ref header;
     1725        ip_route_t *route;
     1726        ip_header_t *header;
    17271727
    17281728        switch (error) {
     
    17341734
    17351735                data = packet_get_data(packet);
    1736                 header = (ip_header_ref)(data + offset);
     1736                header = (ip_header_t *)(data + offset);
    17371737
    17381738                // destination host unreachable?
     
    17821782        in_addr_t *dest;
    17831783        in_addr_t *src;
    1784         ip_route_ref route;
    1785         ipv4_pseudo_header_ref header_in;
     1784        ip_route_t *route;
     1785        ipv4_pseudo_header_t *header_in;
    17861786
    17871787        if (!destination || (addrlen <= 0))
     
    18291829
    18301830        *headerlen = sizeof(*header_in);
    1831         header_in = (ipv4_pseudo_header_ref) malloc(*headerlen);
     1831        header_in = (ipv4_pseudo_header_t *) malloc(*headerlen);
    18321832        if (!header_in)
    18331833                return ENOMEM;
  • uspace/srv/net/il/ip/ip.h

    r45f04f8 ra7811f17  
    5959typedef struct ip_netif ip_netif_t;
    6060
    61 /** Type definition of the IP network interface specific data pointer.
    62  * @see ip_netif
    63  */
    64 typedef ip_netif_t *ip_netif_ref;
    65 
    6661/** Type definition of the IP protocol specific data.
    6762 * @see ip_proto
     
    6964typedef struct ip_proto ip_proto_t;
    7065
    71 /** Type definition of the IP protocol specific data pointer.
    72  * @see ip_proto
    73  */
    74 typedef ip_proto_t *ip_proto_ref;
    75 
    7666/** Type definition of the IP route specific data.
    7767 *  @see ip_route
    7868 */
    7969typedef struct ip_route ip_route_t;
    80 
    81 /** Type definition of the IP route specific data pointer.
    82  *  @see ip_route
    83  */
    84 typedef ip_route_t *ip_route_ref;
    8570
    8671/** IP network interfaces.
     
    10489struct ip_netif {
    10590        /** ARP module. Assigned if using ARP. */
    106         module_ref arp;
     91        module_t *arp;
    10792        /** Broadcast address. */
    10893        in_addr_t broadcast;
     
    146131        in_addr_t gateway;
    147132        /** Parent netif. */
    148         ip_netif_ref netif;
     133        ip_netif_t *netif;
    149134        /** Target network mask. */
    150135        in_addr_t netmask;
  • uspace/srv/net/net/net.c

    r45f04f8 ra7811f17  
    8888 *
    8989 */
    90 int add_configuration(measured_strings_ref configuration, const char *name,
     90int add_configuration(measured_strings_t *configuration, const char *name,
    9191    const char *value)
    9292{
    9393        int rc;
    9494       
    95         measured_string_ref setting =
     95        measured_string_t *setting =
    9696            measured_string_create_bulk(value, 0);
    9797        if (!setting)
     
    117117}
    118118
    119 static int parse_line(measured_strings_ref configuration, char *line)
     119static int parse_line(measured_strings_t *configuration, char *line)
    120120{
    121121        int rc;
     
    163163       
    164164        /* Create a bulk measured string till the end */
    165         measured_string_ref setting =
     165        measured_string_t *setting =
    166166            measured_string_create_bulk(value, 0);
    167167        if (!setting)
     
    179179
    180180static int read_configuration_file(const char *directory, const char *filename,
    181     measured_strings_ref configuration)
     181    measured_strings_t *configuration)
    182182{
    183183        printf("%s: Reading configuration file %s/%s\n", NAME, directory, filename);
     
    356356 *
    357357 */
    358 static int net_get_conf(measured_strings_ref netif_conf,
    359     measured_string_ref configuration, size_t count, char **data)
     358static int net_get_conf(measured_strings_t *netif_conf,
     359    measured_string_t *configuration, size_t count, char **data)
    360360{
    361361        if (data)
     
    364364        size_t index;
    365365        for (index = 0; index < count; index++) {
    366                 measured_string_ref setting =
     366                measured_string_t *setting =
    367367                    measured_strings_find(netif_conf, configuration[index].value, 0);
    368368                if (!setting)
     
    382382}
    383383
    384 int net_get_conf_req(int net_phone, measured_string_ref *configuration,
     384int net_get_conf_req(int net_phone, measured_string_t **configuration,
    385385    size_t count, char **data)
    386386{
     
    392392
    393393int net_get_device_conf_req(int net_phone, device_id_t device_id,
    394     measured_string_ref *configuration, size_t count, char **data)
     394    measured_string_t **configuration, size_t count, char **data)
    395395{
    396396        if ((!configuration) || (count == 0))
     
    404404}
    405405
    406 void net_free_settings(measured_string_ref settings, char *data)
     406void net_free_settings(measured_string_t *settings, char *data)
    407407{
    408408}
     
    429429       
    430430        /* Mandatory netif */
    431         measured_string_ref setting =
     431        measured_string_t *setting =
    432432            measured_strings_find(&netif->configuration, CONF_NETIF, 0);
    433433       
     
    550550               
    551551                /* Mandatory name */
    552                 measured_string_ref setting =
     552                measured_string_t *setting =
    553553                    measured_strings_find(&netif->configuration, CONF_NAME, 0);
    554554                if (!setting) {
     
    620620    int *answer_count)
    621621{
    622         measured_string_ref strings;
     622        measured_string_t *strings;
    623623        char *data;
    624624        int rc;
  • uspace/srv/net/net/net.h

    r45f04f8 ra7811f17  
    103103       
    104104        /** Serving network interface driver module index. */
    105         module_ref driver;
     105        module_t *driver;
    106106       
    107         device_id_t id;  /**< System-unique network interface identifier. */
    108         module_ref il;   /**< Serving internet layer module index. */
    109         char *name;      /**< System-unique network interface name. */
    110         module_ref nil;  /**< Serving link layer module index. */
     107        device_id_t id; /**< System-unique network interface identifier. */
     108        module_t *il;   /**< Serving internet layer module index. */
     109        char *name;     /**< System-unique network interface name. */
     110        module_t *nil;  /**< Serving link layer module index. */
    111111} netif_t;
    112112
     
    133133} net_globals_t;
    134134
    135 extern int add_configuration(measured_strings_ref, const char *, const char *);
     135extern int add_configuration(measured_strings_t *, const char *, const char *);
    136136extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, int *);
    137137extern int net_initialize_build(async_client_conn_t);
  • uspace/srv/net/netif/lo/lo.c

    r45f04f8 ra7811f17  
    7070}
    7171
    72 int netif_get_addr_message(device_id_t device_id, measured_string_ref address)
     72int netif_get_addr_message(device_id_t device_id, measured_string_t *address)
    7373{
    7474        if (!address)
     
    8181}
    8282
    83 int netif_get_device_stats(device_id_t device_id, device_stats_ref stats)
     83int netif_get_device_stats(device_id_t device_id, device_stats_t *stats)
    8484{
    8585        netif_device_t *device;
     
    9393                return rc;
    9494
    95         memcpy(stats, (device_stats_ref) device->specific,
     95        memcpy(stats, (device_stats_t *) device->specific,
    9696            sizeof(device_stats_t));
    9797
     
    145145        }
    146146
    147         null_device_stats((device_stats_ref) (*device)->specific);
     147        null_device_stats((device_stats_t *) (*device)->specific);
    148148        (*device)->device_id = device_id;
    149149        (*device)->nil_phone = -1;
     
    204204        next = packet;
    205205        do {
    206                 ((device_stats_ref) device->specific)->send_packets++;
    207                 ((device_stats_ref) device->specific)->receive_packets++;
     206                ((device_stats_t *) device->specific)->send_packets++;
     207                ((device_stats_t *) device->specific)->receive_packets++;
    208208                length = packet_get_data_length(next);
    209                 ((device_stats_ref) device->specific)->send_bytes += length;
    210                 ((device_stats_ref) device->specific)->receive_bytes += length;
     209                ((device_stats_t *) device->specific)->send_bytes += length;
     210                ((device_stats_t *) device->specific)->receive_bytes += length;
    211211                next = pq_next(next);
    212212        } while(next);
  • uspace/srv/net/nil/eth/eth.c

    r45f04f8 ra7811f17  
    156156typedef enum eth_addr_type eth_addr_type_t;
    157157
    158 /** Type definition of the ethernet address type pointer.
    159  * @see eth_addr_type
    160  */
    161 typedef eth_addr_type_t *eth_addr_type_ref;
    162 
    163158/** Ethernet address type. */
    164159enum eth_addr_type {
     
    178173{
    179174        int index;
    180         eth_proto_ref proto;
     175        eth_proto_t *proto;
    181176
    182177        fibril_rwlock_read_lock(&eth_globals.protos_lock);
     
    286281    size_t mtu)
    287282{
    288         eth_device_ref device;
     283        eth_device_t *device;
    289284        int index;
    290285        measured_string_t names[2] = {
     
    298293                }
    299294        };
    300         measured_string_ref configuration;
     295        measured_string_t *configuration;
    301296        size_t count = sizeof(names) / sizeof(measured_string_t);
    302297        char *data;
    303         eth_proto_ref proto;
     298        eth_proto_t *proto;
    304299        int rc;
    305300
     
    342337       
    343338        /* Create a new device */
    344         device = (eth_device_ref) malloc(sizeof(eth_device_t));
     339        device = (eth_device_t *) malloc(sizeof(eth_device_t));
    345340        if (!device)
    346341                return ENOMEM;
     
    434429 * @returns             NULL if the packet address length is not big enough.
    435430 */
    436 static eth_proto_ref eth_process_packet(int flags, packet_t packet)
    437 {
    438         eth_header_snap_ref header;
     431static eth_proto_t *eth_process_packet(int flags, packet_t packet)
     432{
     433        eth_header_snap_t *header;
    439434        size_t length;
    440435        eth_type_t type;
    441436        size_t prefix;
    442437        size_t suffix;
    443         eth_fcs_ref fcs;
     438        eth_fcs_t *fcs;
    444439        uint8_t *data;
    445440        int rc;
     
    454449       
    455450        data = packet_get_data(packet);
    456         header = (eth_header_snap_ref) data;
     451        header = (eth_header_snap_t *) data;
    457452        type = ntohs(header->header.ethertype);
    458453       
     
    461456                prefix = sizeof(eth_header_t);
    462457                suffix = 0;
    463                 fcs = (eth_fcs_ref) data + length - sizeof(eth_fcs_t);
     458                fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t);
    464459                length -= sizeof(eth_fcs_t);
    465460        } else if(type <= ETH_MAX_CONTENT) {
     
    487482
    488483                suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U;
    489                 fcs = (eth_fcs_ref) data + prefix + type + suffix;
     484                fcs = (eth_fcs_t *) data + prefix + type + suffix;
    490485                suffix += length - prefix - type;
    491486                length = prefix + type + suffix;
     
    516511    packet_t packet, services_t target)
    517512{
    518         eth_proto_ref proto;
     513        eth_proto_t *proto;
    519514        packet_t next;
    520         eth_device_ref device;
     515        eth_device_t *device;
    521516        int flags;
    522517
     
    564559    size_t *prefix, size_t *content, size_t *suffix)
    565560{
    566         eth_device_ref device;
     561        eth_device_t *device;
    567562
    568563        if (!addr_len || !prefix || !content || !suffix)
     
    596591 */
    597592static int eth_addr_message(device_id_t device_id, eth_addr_type_t type,
    598     measured_string_ref *address)
    599 {
    600         eth_device_ref device;
     593    measured_string_t **address)
     594{
     595        eth_device_t *device;
    601596
    602597        if (!address)
     
    631626static int eth_register_message(services_t service, int phone)
    632627{
    633         eth_proto_ref proto;
     628        eth_proto_t *proto;
    634629        int protocol;
    635630        int index;
     
    646641                return EOK;
    647642        } else {
    648                 proto = (eth_proto_ref) malloc(sizeof(eth_proto_t));
     643                proto = (eth_proto_t *) malloc(sizeof(eth_proto_t));
    649644                if (!proto) {
    650645                        fibril_rwlock_write_unlock(&eth_globals.protos_lock);
     
    688683    size_t mtu)
    689684{
    690         eth_header_snap_ref header;
    691         eth_header_lsap_ref header_lsap;
    692         eth_header_ref header_dix;
    693         eth_fcs_ref fcs;
     685        eth_header_snap_t *header;
     686        eth_header_lsap_t *header_lsap;
     687        eth_header_t *header_dix;
     688        eth_fcs_t *fcs;
    694689        uint8_t *src;
    695690        uint8_t *dest;
     
    697692        int i;
    698693        void *padding;
    699         eth_preamble_ref preamble;
     694        eth_preamble_t *preamble;
    700695
    701696        i = packet_get_addr(packet, &src, &dest);
     
    795790    services_t sender)
    796791{
    797         eth_device_ref device;
     792        eth_device_t *device;
    798793        packet_t next;
    799794        packet_t tmp;
     
    845840    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
    846841{
    847         measured_string_ref address;
     842        measured_string_t *address;
    848843        packet_t packet;
    849844        size_t addrlen;
  • uspace/srv/net/nil/eth/eth.h

    r45f04f8 ra7811f17  
    5454typedef struct eth_device eth_device_t;
    5555
    56 /** Type definition of the Ethernet device specific data pointer.
    57  * @see eth_device
    58  */
    59 typedef eth_device_t *eth_device_ref;
    60 
    6156/** Type definition of the Ethernet protocol specific data.
    6257 * @see eth_proto
    6358 */
    6459typedef struct eth_proto eth_proto_t;
    65 
    66 /** Type definition of the Ethernet protocol specific data pointer.
    67  * @see eth_proto
    68  */
    69 typedef eth_proto_t *eth_proto_ref;
    7060
    7161/** Ethernet device map.
     
    10090       
    10191        /** Actual device hardware address. */
    102         measured_string_ref addr;
     92        measured_string_t *addr;
    10393        /** Actual device hardware address data. */
    10494        char *addr_data;
     
    133123       
    134124        /** Broadcast device hardware address. */
    135         measured_string_ref broadcast_addr;
     125        measured_string_t *broadcast_addr;
    136126};
    137127
  • uspace/srv/net/nil/eth/eth_header.h

    r45f04f8 ra7811f17  
    5858typedef struct eth_header_snap eth_header_snap_t;
    5959
    60 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions
    61  * pointer.
    62  *
    63  * @see eth_header_snap
    64  */
    65 typedef eth_header_snap_t *eth_header_snap_ref;
    66 
    6760/** Type definition of the Ethernet header IEEE 802.3 + 802.2 + SNAP extensions.
    6861 * @see eth_header_lsap
    6962 */
    7063typedef struct eth_header_lsap eth_header_lsap_t;
    71 
    72 /** Type definition of the Ethernet header IEEE 802.3 + 802.2 extension pointer.
    73  * @see eth_header_lsap
    74  */
    75 typedef eth_header_lsap_t *eth_header_lsap_ref;
    7664
    7765/** Type definition of the Ethernet header LSAP extension.
     
    8068typedef struct eth_ieee_lsap eth_ieee_lsap_t;
    8169
    82 /** Type definition of the Ethernet header LSAP extension pointer.
    83  * @see eth_ieee_lsap
    84  */
    85 typedef eth_ieee_lsap_t *eth_ieee_lsap_ref;
    86 
    8770/** Type definition of the Ethernet header SNAP extension.
    8871 * @see eth_snap
    8972 */
    9073typedef struct eth_snap eth_snap_t;
    91 
    92 /** Type definition of the Ethernet header SNAP extension pointer.
    93  * @see eth_snap
    94  */
    95 typedef eth_snap_t *eth_snap_ref;
    9674
    9775/** Type definition of the Ethernet header preamble.
     
    10078typedef struct eth_preamble eth_preamble_t;
    10179
    102 /** Type definition of the Ethernet header preamble pointer.
    103  * @see eth_preamble
    104  */
    105 typedef eth_preamble_t *eth_preamble_ref;
    106 
    10780/** Type definition of the Ethernet header.
    10881 * @see eth_header
    10982 */
    11083typedef struct eth_header eth_header_t;
    111 
    112 /** Type definition of the Ethernet header pointer.
    113  * @see eth_header
    114  */
    115 typedef eth_header_t *eth_header_ref;
    11684
    11785/** Ethernet header Link Service Access Point extension. */
     
    219187typedef uint32_t eth_fcs_t;
    220188
    221 /** Ethernet Frame Check Sequence pointer. */
    222 typedef eth_fcs_t *eth_fcs_ref;
    223 
    224189#endif
    225190
  • uspace/srv/net/nil/nildummy/nildummy.c

    r45f04f8 ra7811f17  
    153153    size_t mtu)
    154154{
    155         nildummy_device_ref device;
     155        nildummy_device_t *device;
    156156        int index;
    157157        int rc;
     
    192192       
    193193        /* Create a new device */
    194         device = (nildummy_device_ref) malloc(sizeof(nildummy_device_t));
     194        device = (nildummy_device_t *) malloc(sizeof(nildummy_device_t));
    195195        if (!device)
    196196                return ENOMEM;
     
    248248 */
    249249static int nildummy_addr_message(device_id_t device_id,
    250     measured_string_ref *address)
    251 {
    252         nildummy_device_ref device;
     250    measured_string_t **address)
     251{
     252        nildummy_device_t *device;
    253253
    254254        if (!address)
     
    282282    size_t *prefix, size_t *content, size_t *suffix)
    283283{
    284         nildummy_device_ref device;
     284        nildummy_device_t *device;
    285285
    286286        if (!addr_len || !prefix || !content || !suffix)
     
    357357    services_t sender)
    358358{
    359         nildummy_device_ref device;
     359        nildummy_device_t *device;
    360360
    361361        fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
     
    377377    ipc_call_t *call, ipc_call_t *answer, int *answer_count)
    378378{
    379         measured_string_ref address;
     379        measured_string_t *address;
    380380        packet_t packet;
    381381        size_t addrlen;
  • uspace/srv/net/nil/nildummy/nildummy.h

    r45f04f8 ra7811f17  
    5454typedef struct nildummy_device nildummy_device_t;
    5555
    56 /** Type definition of the dummy nil device specific data pointer.
    57  * @see nildummy_device
    58  */
    59 typedef nildummy_device_t *nildummy_device_ref;
    60 
    6156/** Type definition of the dummy nil protocol specific data.
    6257 * @see nildummy_proto
    6358 */
    6459typedef struct nildummy_proto nildummy_proto_t;
    65 
    66 /** Type definition of the dummy nil protocol specific data pointer.
    67  * @see nildummy_proto
    68  */
    69 typedef nildummy_proto_t *nildummy_proto_ref;
    7060
    7161/** Dummy nil device map.
     
    8676        size_t mtu;
    8777        /** Actual device hardware address. */
    88         measured_string_ref addr;
     78        measured_string_t *addr;
    8979        /** Actual device hardware address data. */
    9080        char *addr_data;
  • uspace/srv/net/tl/icmp/icmp.c

    r45f04f8 ra7811f17  
    156156 */
    157157static int icmp_send_packet(icmp_type_t type, icmp_code_t code, packet_t packet,
    158     icmp_header_ref header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
     158    icmp_header_t *header, services_t error, ip_ttl_t ttl, ip_tos_t tos,
    159159    int dont_fragment)
    160160{
     
    189189 * @returns NULL on errors.
    190190 */
    191 static icmp_header_ref icmp_prepare_packet(packet_t packet)
    192 {
    193         icmp_header_ref header;
     191static icmp_header_t *icmp_prepare_packet(packet_t packet)
     192{
     193        icmp_header_t *header;
    194194        size_t header_length;
    195195        size_t total_length;
     
    247247    const struct sockaddr * addr, socklen_t addrlen)
    248248{
    249         icmp_header_ref header;
     249        icmp_header_t *header;
    250250        packet_t packet;
    251251        size_t length;
    252252        uint8_t *data;
    253         icmp_reply_ref reply;
     253        icmp_reply_t *reply;
    254254        int reply_key;
    255255        int index;
     
    342342    icmp_code_t code, icmp_param_t mtu, packet_t packet)
    343343{
    344         icmp_header_ref header;
     344        icmp_header_t *header;
    345345
    346346        header = icmp_prepare_packet(packet);
     
    357357static int icmp_source_quench_msg_local(int icmp_phone, packet_t packet)
    358358{
    359         icmp_header_ref header;
     359        icmp_header_t *header;
    360360
    361361        header = icmp_prepare_packet(packet);
     
    370370    packet_t packet)
    371371{
    372         icmp_header_ref header;
     372        icmp_header_t *header;
    373373
    374374        header = icmp_prepare_packet(packet);
     
    383383    icmp_param_t pointer, packet_t packet)
    384384{
    385         icmp_header_ref header;
     385        icmp_header_t *header;
    386386
    387387        header = icmp_prepare_packet(packet);
     
    413413                }
    414414        };
    415         measured_string_ref configuration;
     415        measured_string_t *configuration;
    416416        size_t count = sizeof(names) / sizeof(measured_string_t);
    417417        char *data;
     
    479479 * @param[in] code      The received reply message code.
    480480 */
    481 static void  icmp_process_echo_reply(packet_t packet, icmp_header_ref header,
     481static void  icmp_process_echo_reply(packet_t packet, icmp_header_t *header,
    482482    icmp_type_t type, icmp_code_t code)
    483483{
    484484        int reply_key;
    485         icmp_reply_ref reply;
     485        icmp_reply_t *reply;
    486486
    487487        /* Compute the reply key */
     
    525525        int result;
    526526        void *data;
    527         icmp_header_ref header;
     527        icmp_header_t *header;
    528528        icmp_type_t type;
    529529        icmp_code_t code;
     
    567567
    568568        /* Get ICMP header */
    569         header = (icmp_header_ref) data;
     569        header = (icmp_header_t *) data;
    570570
    571571        if (header->checksum) {
     
    735735 * @returns             ENOTCONN if no free identifier have been found.
    736736 */
    737 static int icmp_bind_free_id(icmp_echo_ref echo_data)
     737static int icmp_bind_free_id(icmp_echo_t *echo_data)
    738738{
    739739        icmp_param_t index;
     
    791791        struct sockaddr *addr;
    792792        ipc_callid_t data_callid;
    793         icmp_echo_ref echo_data;
     793        icmp_echo_t *echo_data;
    794794        int rc = EOK;
    795795
     
    800800        answer_count = 0;
    801801
    802         echo_data = (icmp_echo_ref) malloc(sizeof(*echo_data));
     802        echo_data = (icmp_echo_t *) malloc(sizeof(*echo_data));
    803803        if (!echo_data)
    804804                return ENOMEM;
  • uspace/srv/net/tl/icmp/icmp.h

    r45f04f8 ra7811f17  
    4949 */
    5050typedef struct icmp_reply icmp_reply_t;
    51 
    52 /** Type definition of the ICMP reply data pointer.
    53  * @see icmp_reply
    54  */
    55 typedef icmp_reply_t *icmp_reply_ref;
    5651
    5752/** Type definition of the ICMP global data.
  • uspace/srv/net/tl/tcp/tcp.c

    r45f04f8 ra7811f17  
    127127typedef struct tcp_timeout tcp_timeout_t;
    128128
    129 /** Type definition of the TCP timeout pointer.
    130  *  @see tcp_timeout
    131  */
    132 typedef tcp_timeout_t *tcp_timeout_ref;
    133 
    134129/** TCP reply timeout data.
    135130 *  Used as a timeouting fibril argument.
     
    144139
    145140        /** Local sockets. */
    146         socket_cores_ref local_sockets;
     141        socket_cores_t *local_sockets;
    147142
    148143        /** Socket identifier. */
     
    166161
    167162static int tcp_release_and_return(packet_t, int);
    168 static void tcp_prepare_operation_header(socket_core_ref, tcp_socket_data_ref,
    169     tcp_header_ref, int synchronize, int);
    170 static int tcp_prepare_timeout(int (*)(void *), socket_core_ref,
    171     tcp_socket_data_ref, size_t, tcp_socket_state_t, suseconds_t, int);
    172 static void tcp_free_socket_data(socket_core_ref);
     163static void tcp_prepare_operation_header(socket_core_t *, tcp_socket_data_t *,
     164    tcp_header_t *, int synchronize, int);
     165static int tcp_prepare_timeout(int (*)(void *), socket_core_t *,
     166    tcp_socket_data_t *, size_t, tcp_socket_state_t, suseconds_t, int);
     167static void tcp_free_socket_data(socket_core_t *);
    173168
    174169static int tcp_timeout(void *);
     
    177172
    178173static int tcp_process_packet(device_id_t, packet_t, services_t);
    179 static int tcp_connect_core(socket_core_ref, socket_cores_ref,
     174static int tcp_connect_core(socket_core_t *, socket_cores_t *,
    180175    struct sockaddr *, socklen_t);
    181 static int tcp_queue_prepare_packet(socket_core_ref, tcp_socket_data_ref,
     176static int tcp_queue_prepare_packet(socket_core_t *, tcp_socket_data_t *,
    182177    packet_t, size_t);
    183 static int tcp_queue_packet(socket_core_ref, tcp_socket_data_ref, packet_t,
     178static int tcp_queue_packet(socket_core_t *, tcp_socket_data_t *, packet_t,
    184179    size_t);
    185 static packet_t tcp_get_packets_to_send(socket_core_ref, tcp_socket_data_ref);
     180static packet_t tcp_get_packets_to_send(socket_core_t *, tcp_socket_data_t *);
    186181static void tcp_send_packets(device_id_t, packet_t);
    187182
    188 static void tcp_process_acknowledgement(socket_core_ref, tcp_socket_data_ref,
    189     tcp_header_ref);
    190 static packet_t tcp_send_prepare_packet(socket_core_ref, tcp_socket_data_ref,
     183static void tcp_process_acknowledgement(socket_core_t *, tcp_socket_data_t *,
     184    tcp_header_t *);
     185static packet_t tcp_send_prepare_packet(socket_core_t *, tcp_socket_data_t *,
    191186    packet_t, size_t, size_t);
    192 static packet_t tcp_prepare_copy(socket_core_ref, tcp_socket_data_ref, packet_t,
     187static packet_t tcp_prepare_copy(socket_core_t *, tcp_socket_data_t *, packet_t,
    193188    size_t, size_t);
    194 /* static */ void tcp_retransmit_packet(socket_core_ref, tcp_socket_data_ref,
     189/* static */ void tcp_retransmit_packet(socket_core_t *, tcp_socket_data_t *,
    195190    size_t);
    196 static int tcp_create_notification_packet(packet_t *, socket_core_ref,
    197     tcp_socket_data_ref, int, int);
    198 static void tcp_refresh_socket_data(tcp_socket_data_ref);
    199 
    200 static void tcp_initialize_socket_data(tcp_socket_data_ref);
    201 
    202 static int tcp_process_listen(socket_core_ref, tcp_socket_data_ref,
    203     tcp_header_ref, packet_t, struct sockaddr *, struct sockaddr *, size_t);
    204 static int tcp_process_syn_sent(socket_core_ref, tcp_socket_data_ref,
    205     tcp_header_ref, packet_t);
    206 static int tcp_process_syn_received(socket_core_ref, tcp_socket_data_ref,
    207     tcp_header_ref, packet_t);
    208 static int tcp_process_established(socket_core_ref, tcp_socket_data_ref,
    209     tcp_header_ref, packet_t, int, size_t);
    210 static int tcp_queue_received_packet(socket_core_ref, tcp_socket_data_ref,
     191static int tcp_create_notification_packet(packet_t *, socket_core_t *,
     192    tcp_socket_data_t *, int, int);
     193static void tcp_refresh_socket_data(tcp_socket_data_t *);
     194
     195static void tcp_initialize_socket_data(tcp_socket_data_t *);
     196
     197static int tcp_process_listen(socket_core_t *, tcp_socket_data_t *,
     198    tcp_header_t *, packet_t, struct sockaddr *, struct sockaddr *, size_t);
     199static int tcp_process_syn_sent(socket_core_t *, tcp_socket_data_t *,
     200    tcp_header_t *, packet_t);
     201static int tcp_process_syn_received(socket_core_t *, tcp_socket_data_t *,
     202    tcp_header_t *, packet_t);
     203static int tcp_process_established(socket_core_t *, tcp_socket_data_t *,
     204    tcp_header_t *, packet_t, int, size_t);
     205static int tcp_queue_received_packet(socket_core_t *, tcp_socket_data_t *,
    211206    packet_t, int, size_t);
    212207
     
    214209static int tcp_process_client_messages(ipc_callid_t, ipc_call_t);
    215210
    216 static int tcp_listen_message(socket_cores_ref, int, int);
    217 static int tcp_connect_message(socket_cores_ref, int, struct sockaddr *,
     211static int tcp_listen_message(socket_cores_t *, int, int);
     212static int tcp_connect_message(socket_cores_t *, int, struct sockaddr *,
    218213    socklen_t);
    219 static int tcp_recvfrom_message(socket_cores_ref, int, int, size_t *);
    220 static int tcp_send_message(socket_cores_ref, int, int, size_t *, int);
    221 static int tcp_accept_message(socket_cores_ref, int, int, size_t *, size_t *);
    222 static int tcp_close_message(socket_cores_ref, int);
     214static int tcp_recvfrom_message(socket_cores_t *, int, int, size_t *);
     215static int tcp_send_message(socket_cores_t *, int, int, size_t *, int);
     216static int tcp_accept_message(socket_cores_t *, int, int, size_t *, size_t *);
     217static int tcp_close_message(socket_cores_t *, int);
    223218
    224219/** TCP global data. */
     
    290285        size_t offset;
    291286        int result;
    292         tcp_header_ref header;
    293         socket_core_ref socket;
    294         tcp_socket_data_ref socket_data;
     287        tcp_header_t *header;
     288        socket_core_t *socket;
     289        tcp_socket_data_t *socket_data;
    295290        packet_t next_packet;
    296291        size_t total_length;
     
    343338
    344339        /* Get tcp header */
    345         header = (tcp_header_ref) packet_get_data(packet);
     340        header = (tcp_header_t *) packet_get_data(packet);
    346341        if (!header)
    347342                return tcp_release_and_return(packet, NO_DATA);
     
    380375
    381376        printf("socket id %d\n", socket->socket_id);
    382         socket_data = (tcp_socket_data_ref) socket->specific_data;
     377        socket_data = (tcp_socket_data_t *) socket->specific_data;
    383378        assert(socket_data);
    384379
     
    497492}
    498493
    499 int tcp_process_established(socket_core_ref socket, tcp_socket_data_ref
    500     socket_data, tcp_header_ref header, packet_t packet, int fragments,
     494int tcp_process_established(socket_core_t *socket, tcp_socket_data_t *
     495    socket_data, tcp_header_t *header, packet_t packet, int fragments,
    501496    size_t total_length)
    502497{
     
    805800}
    806801
    807 int tcp_queue_received_packet(socket_core_ref socket,
    808     tcp_socket_data_ref socket_data, packet_t packet, int fragments,
     802int tcp_queue_received_packet(socket_core_t *socket,
     803    tcp_socket_data_t *socket_data, packet_t packet, int fragments,
    809804    size_t total_length)
    810805{
    811         packet_dimension_ref packet_dimension;
     806        packet_dimension_t *packet_dimension;
    812807        int rc;
    813808
     
    842837}
    843838
    844 int tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_ref
    845     socket_data, tcp_header_ref header, packet_t packet)
     839int tcp_process_syn_sent(socket_core_t *socket, tcp_socket_data_t *
     840    socket_data, tcp_header_t *header, packet_t packet)
    846841{
    847842        packet_t next_packet;
     
    900895}
    901896
    902 int tcp_process_listen(socket_core_ref listening_socket,
    903     tcp_socket_data_ref listening_socket_data, tcp_header_ref header,
     897int tcp_process_listen(socket_core_t *listening_socket,
     898    tcp_socket_data_t *listening_socket_data, tcp_header_t *header,
    904899    packet_t packet, struct sockaddr *src, struct sockaddr *dest,
    905900    size_t addrlen)
    906901{
    907902        packet_t next_packet;
    908         socket_core_ref socket;
    909         tcp_socket_data_ref socket_data;
     903        socket_core_t *socket;
     904        tcp_socket_data_t *socket_data;
    910905        int socket_id;
    911906        int listening_socket_id = listening_socket->socket_id;
     
    922917                return tcp_release_and_return(packet, EINVAL);
    923918
    924         socket_data = (tcp_socket_data_ref) malloc(sizeof(*socket_data));
     919        socket_data = (tcp_socket_data_t *) malloc(sizeof(*socket_data));
    925920        if (!socket_data)
    926921                return tcp_release_and_return(packet, ENOMEM);
     
    979974        }
    980975        listening_socket_data =
    981             (tcp_socket_data_ref) listening_socket->specific_data;
     976            (tcp_socket_data_t *) listening_socket->specific_data;
    982977        assert(listening_socket_data);
    983978
     
    991986                return ENOTSOCK;
    992987        }
    993         socket_data = (tcp_socket_data_ref) socket->specific_data;
     988        socket_data = (tcp_socket_data_t *) socket->specific_data;
    994989        assert(socket_data);
    995990
     
    10601055}
    10611056
    1062 int tcp_process_syn_received(socket_core_ref socket,
    1063     tcp_socket_data_ref socket_data, tcp_header_ref header, packet_t packet)
    1064 {
    1065         socket_core_ref listening_socket;
    1066         tcp_socket_data_ref listening_socket_data;
     1057int tcp_process_syn_received(socket_core_t *socket,
     1058    tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t packet)
     1059{
     1060        socket_core_t *listening_socket;
     1061        tcp_socket_data_t *listening_socket_data;
    10671062        int rc;
    10681063
     
    10861081        if (listening_socket) {
    10871082                listening_socket_data =
    1088                     (tcp_socket_data_ref) listening_socket->specific_data;
     1083                    (tcp_socket_data_t *) listening_socket->specific_data;
    10891084                assert(listening_socket_data);
    10901085
     
    11271122}
    11281123
    1129 void tcp_process_acknowledgement(socket_core_ref socket,
    1130     tcp_socket_data_ref socket_data, tcp_header_ref header)
     1124void tcp_process_acknowledgement(socket_core_t *socket,
     1125    tcp_socket_data_t *socket_data, tcp_header_t *header)
    11311126{
    11321127        size_t number;
     
    12651260}
    12661261
    1267 void tcp_refresh_socket_data(tcp_socket_data_ref socket_data)
     1262void tcp_refresh_socket_data(tcp_socket_data_t *socket_data)
    12681263{
    12691264        assert(socket_data);
     
    12811276}
    12821277
    1283 void tcp_initialize_socket_data(tcp_socket_data_ref socket_data)
     1278void tcp_initialize_socket_data(tcp_socket_data_t *socket_data)
    12841279{
    12851280        assert(socket_data);
     
    13041299        ipc_call_t answer;
    13051300        int answer_count;
    1306         tcp_socket_data_ref socket_data;
    1307         socket_core_ref socket;
    1308         packet_dimension_ref packet_dimension;
     1301        tcp_socket_data_t *socket_data;
     1302        socket_core_t *socket;
     1303        packet_dimension_t *packet_dimension;
    13091304
    13101305        /*
     
    13361331                case NET_SOCKET:
    13371332                        socket_data =
    1338                             (tcp_socket_data_ref) malloc(sizeof(*socket_data));
     1333                            (tcp_socket_data_t *) malloc(sizeof(*socket_data));
    13391334                        if (!socket_data) {
    13401335                                res = ENOMEM;
     
    13831378                                    SOCKET_GET_SOCKET_ID(call));
    13841379                                if (socket) {
    1385                                         socket_data = (tcp_socket_data_ref)
     1380                                        socket_data = (tcp_socket_data_t *)
    13861381                                            socket->specific_data;
    13871382                                        assert(socket_data);
     
    15401535int tcp_timeout(void *data)
    15411536{
    1542         tcp_timeout_ref timeout = data;
     1537        tcp_timeout_t *timeout = data;
    15431538        int keep_write_lock = false;
    1544         socket_core_ref socket;
    1545         tcp_socket_data_ref socket_data;
     1539        socket_core_t *socket;
     1540        tcp_socket_data_t *socket_data;
    15461541
    15471542        assert(timeout);
     
    15611556                goto out;
    15621557       
    1563         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1558        socket_data = (tcp_socket_data_t *) socket->specific_data;
    15641559        assert(socket_data);
    15651560        if (socket_data->local_sockets != timeout->local_sockets)
     
    16171612int tcp_release_after_timeout(void *data)
    16181613{
    1619         tcp_timeout_ref timeout = data;
    1620         socket_core_ref socket;
    1621         tcp_socket_data_ref socket_data;
     1614        tcp_timeout_t *timeout = data;
     1615        socket_core_t *socket;
     1616        tcp_socket_data_t *socket_data;
    16221617        fibril_rwlock_t *local_lock;
    16231618
     
    16351630
    16361631        if (socket && (socket->socket_id == timeout->socket_id)) {
    1637                 socket_data = (tcp_socket_data_ref) socket->specific_data;
     1632                socket_data = (tcp_socket_data_t *) socket->specific_data;
    16381633                assert(socket_data);
    16391634                if (socket_data->local_sockets == timeout->local_sockets) {
     
    16561651}
    16571652
    1658 void tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_ref
     1653void tcp_retransmit_packet(socket_core_t *socket, tcp_socket_data_t *
    16591654    socket_data, size_t sequence_number)
    16601655{
     
    16831678}
    16841679
    1685 int tcp_listen_message(socket_cores_ref local_sockets, int socket_id,
     1680int tcp_listen_message(socket_cores_t *local_sockets, int socket_id,
    16861681    int backlog)
    16871682{
    1688         socket_core_ref socket;
    1689         tcp_socket_data_ref socket_data;
     1683        socket_core_t *socket;
     1684        tcp_socket_data_t *socket_data;
    16901685
    16911686        assert(local_sockets);
     
    17001695       
    17011696        /* Get the socket specific data */
    1702         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1697        socket_data = (tcp_socket_data_t *) socket->specific_data;
    17031698        assert(socket_data);
    17041699
     
    17091704}
    17101705
    1711 int tcp_connect_message(socket_cores_ref local_sockets, int socket_id,
     1706int tcp_connect_message(socket_cores_t *local_sockets, int socket_id,
    17121707    struct sockaddr *addr, socklen_t addrlen)
    17131708{
    1714         socket_core_ref socket;
     1709        socket_core_t *socket;
    17151710        int rc;
    17161711
     
    17371732}
    17381733
    1739 int tcp_connect_core(socket_core_ref socket, socket_cores_ref local_sockets,
     1734int tcp_connect_core(socket_core_t *socket, socket_cores_t *local_sockets,
    17401735    struct sockaddr *addr, socklen_t addrlen)
    17411736{
    1742         tcp_socket_data_ref socket_data;
     1737        tcp_socket_data_t *socket_data;
    17431738        packet_t packet;
    17441739        int rc;
     
    17491744
    17501745        /* Get the socket specific data */
    1751         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1746        socket_data = (tcp_socket_data_t *) socket->specific_data;
    17521747        assert(socket_data);
    17531748        assert(socket->specific_data == socket_data);
     
    18281823}
    18291824
    1830 int tcp_queue_prepare_packet(socket_core_ref socket,
    1831     tcp_socket_data_ref socket_data, packet_t packet, size_t data_length)
    1832 {
    1833         tcp_header_ref header;
     1825int tcp_queue_prepare_packet(socket_core_t *socket,
     1826    tcp_socket_data_t *socket_data, packet_t packet, size_t data_length)
     1827{
     1828        tcp_header_t *header;
    18341829        int rc;
    18351830
     
    18391834
    18401835        /* Get TCP header */
    1841         header = (tcp_header_ref) packet_get_data(packet);
     1836        header = (tcp_header_t *) packet_get_data(packet);
    18421837        if (!header)
    18431838                return NO_DATA;
     
    18591854}
    18601855
    1861 int tcp_queue_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
     1856int tcp_queue_packet(socket_core_t *socket, tcp_socket_data_t *socket_data,
    18621857    packet_t packet, size_t data_length)
    18631858{
     
    18811876}
    18821877
    1883 packet_t tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_ref
     1878packet_t tcp_get_packets_to_send(socket_core_t *socket, tcp_socket_data_t *
    18841879    socket_data)
    18851880{
     
    19411936}
    19421937
    1943 packet_t tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_ref
     1938packet_t tcp_send_prepare_packet(socket_core_t *socket, tcp_socket_data_t *
    19441939    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
    19451940{
    1946         tcp_header_ref header;
     1941        tcp_header_t *header;
    19471942        uint32_t checksum;
    19481943        int rc;
     
    19611956
    19621957        /* Get the header */
    1963         header = (tcp_header_ref) packet_get_data(packet);
     1958        header = (tcp_header_t *) packet_get_data(packet);
    19641959        if (!header) {
    19651960                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
     
    20021997}
    20031998
    2004 packet_t tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_ref
     1999packet_t tcp_prepare_copy(socket_core_t *socket, tcp_socket_data_t *
    20052000    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
    20062001{
     
    20322027}
    20332028
    2034 void tcp_prepare_operation_header(socket_core_ref socket,
    2035     tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize,
     2029void tcp_prepare_operation_header(socket_core_t *socket,
     2030    tcp_socket_data_t *socket_data, tcp_header_t *header, int synchronize,
    20362031    int finalize)
    20372032{
     
    20502045
    20512046int tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t),
    2052     socket_core_ref socket, tcp_socket_data_ref socket_data,
     2047    socket_core_t *socket, tcp_socket_data_t *socket_data,
    20532048    size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout,
    20542049    int globals_read_only)
    20552050{
    2056         tcp_timeout_ref operation_timeout;
     2051        tcp_timeout_t *operation_timeout;
    20572052        fid_t fibril;
    20582053
     
    20962091}
    20972092
    2098 int tcp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
     2093int tcp_recvfrom_message(socket_cores_t *local_sockets, int socket_id,
    20992094    int flags, size_t *addrlen)
    21002095{
    2101         socket_core_ref socket;
    2102         tcp_socket_data_ref socket_data;
     2096        socket_core_t *socket;
     2097        tcp_socket_data_t *socket_data;
    21032098        int packet_id;
    21042099        packet_t packet;
     
    21172112                return NO_DATA;
    21182113
    2119         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2114        socket_data = (tcp_socket_data_t *) socket->specific_data;
    21202115
    21212116        /* Check state */
     
    21542149}
    21552150
    2156 int tcp_send_message(socket_cores_ref local_sockets, int socket_id,
     2151int tcp_send_message(socket_cores_t *local_sockets, int socket_id,
    21572152    int fragments, size_t *data_fragment_size, int flags)
    21582153{
    2159         socket_core_ref socket;
    2160         tcp_socket_data_ref socket_data;
    2161         packet_dimension_ref packet_dimension;
     2154        socket_core_t *socket;
     2155        tcp_socket_data_t *socket_data;
     2156        packet_dimension_t *packet_dimension;
    21622157        packet_t packet;
    21632158        size_t total_length;
    2164         tcp_header_ref header;
     2159        tcp_header_t *header;
    21652160        int index;
    21662161        int result;
     
    21792174                return NO_DATA;
    21802175
    2181         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2176        socket_data = (tcp_socket_data_t *) socket->specific_data;
    21822177
    21832178        /* Check state */
     
    22302225
    22312226int
    2232 tcp_close_message(socket_cores_ref local_sockets, int socket_id)
    2233 {
    2234         socket_core_ref socket;
    2235         tcp_socket_data_ref socket_data;
     2227tcp_close_message(socket_cores_t *local_sockets, int socket_id)
     2228{
     2229        socket_core_t *socket;
     2230        tcp_socket_data_t *socket_data;
    22362231        packet_t packet;
    22372232        int rc;
     
    22432238
    22442239        /* Get the socket specific data */
    2245         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2240        socket_data = (tcp_socket_data_t *) socket->specific_data;
    22462241        assert(socket_data);
    22472242
     
    22982293}
    22992294
    2300 int tcp_create_notification_packet(packet_t *packet, socket_core_ref socket,
    2301     tcp_socket_data_ref socket_data, int synchronize, int finalize)
    2302 {
    2303         packet_dimension_ref packet_dimension;
    2304         tcp_header_ref header;
     2295int tcp_create_notification_packet(packet_t *packet, socket_core_t *socket,
     2296    tcp_socket_data_t *socket_data, int synchronize, int finalize)
     2297{
     2298        packet_dimension_t *packet_dimension;
     2299        tcp_header_t *header;
    23052300        int rc;
    23062301
     
    23322327}
    23332328
    2334 int tcp_accept_message(socket_cores_ref local_sockets, int socket_id,
     2329int tcp_accept_message(socket_cores_t *local_sockets, int socket_id,
    23352330    int new_socket_id, size_t *data_fragment_size, size_t *addrlen)
    23362331{
    2337         socket_core_ref accepted;
    2338         socket_core_ref socket;
    2339         tcp_socket_data_ref socket_data;
    2340         packet_dimension_ref packet_dimension;
     2332        socket_core_t *accepted;
     2333        socket_core_t *socket;
     2334        tcp_socket_data_t *socket_data;
     2335        packet_dimension_t *packet_dimension;
    23412336        int rc;
    23422337
     
    23512346
    23522347        /* Get the socket specific data */
    2353         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2348        socket_data = (tcp_socket_data_t *) socket->specific_data;
    23542349        assert(socket_data);
    23552350
     
    23692364
    23702365                /* Get the socket specific data */
    2371                 socket_data = (tcp_socket_data_ref) accepted->specific_data;
     2366                socket_data = (tcp_socket_data_t *) accepted->specific_data;
    23722367                assert(socket_data);
    23732368                /* TODO can it be in another state? */
     
    24052400}
    24062401
    2407 void tcp_free_socket_data(socket_core_ref socket)
    2408 {
    2409         tcp_socket_data_ref socket_data;
     2402void tcp_free_socket_data(socket_core_t *socket)
     2403{
     2404        tcp_socket_data_t *socket_data;
    24102405
    24112406        assert(socket);
     
    24142409
    24152410        /* Get the socket specific data */
    2416         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2411        socket_data = (tcp_socket_data_t *) socket->specific_data;
    24172412        assert(socket_data);
    24182413
  • uspace/srv/net/tl/tcp/tcp.h

    r45f04f8 ra7811f17  
    5555typedef struct tcp_socket_data tcp_socket_data_t;
    5656
    57 /** Type definition of the TCP socket specific data pointer.
    58  * @see tcp_socket_data
    59  */
    60 typedef tcp_socket_data_t *tcp_socket_data_ref;
    61 
    6257/** Type definition of the TCP operation data.
    6358 * @see tcp_operation
    6459 */
    6560typedef struct tcp_operation tcp_operation_t;
    66 
    67 /** Type definition of the TCP operation data pointer.
    68  * @see tcp_operation
    69  */
    70 typedef tcp_operation_t *tcp_operation_ref;
    7161
    7262/** TCP socket state type definition.
     
    272262        uint16_t dest_port;
    273263        /** Parent local sockets. */
    274         socket_cores_ref local_sockets;
     264        socket_cores_t *local_sockets;
    275265       
    276266        /** Local sockets safety lock.
  • uspace/srv/net/tl/tcp/tcp_header.h

    r45f04f8 ra7811f17  
    5959typedef struct tcp_header tcp_header_t;
    6060
    61 /** Type definition of the transmission datagram header pointer.
    62  * @see tcp_header
    63  */
    64 typedef tcp_header_t *tcp_header_ref;
    65 
    6661/** Type definition of the transmission datagram header option.
    6762 * @see tcp_option
     
    6964typedef struct tcp_option tcp_option_t;
    7065
    71 /** Type definition of the transmission datagram header option pointer.
    72  * @see tcp_option
    73  */
    74 typedef tcp_option_t *tcp_option_ref;
    75 
    7666/** Type definition of the Maximum segment size TCP option. */
    7767typedef struct tcp_max_segment_size_option tcp_max_segment_size_option_t;
    78 
    79 /** Type definition of the Maximum segment size TCP option pointer.
    80  * @see tcp_max_segment_size_option
    81  */
    82 typedef tcp_max_segment_size_option_t *tcp_max_segment_size_option_ref;
    8368
    8469/** Transmission datagram header. */
  • uspace/srv/net/tl/udp/udp.c

    r45f04f8 ra7811f17  
    112112                }
    113113        };
    114         measured_string_ref configuration;
     114        measured_string_t *configuration;
    115115        size_t count = sizeof(names) / sizeof(measured_string_t);
    116116        char *data;
     
    223223        size_t offset;
    224224        int result;
    225         udp_header_ref header;
    226         socket_core_ref socket;
     225        udp_header_t *header;
     226        socket_core_t *socket;
    227227        packet_t next_packet;
    228228        size_t total_length;
     
    235235        struct sockaddr *src;
    236236        struct sockaddr *dest;
    237         packet_dimension_ref packet_dimension;
     237        packet_dimension_t *packet_dimension;
    238238        int rc;
    239239
     
    277277
    278278        /* Get UDP header */
    279         header = (udp_header_ref) packet_get_data(packet);
     279        header = (udp_header_t *) packet_get_data(packet);
    280280        if (!header)
    281281                return udp_release_and_return(packet, NO_DATA);
     
    453453 *                      function.
    454454 */
    455 static int udp_sendto_message(socket_cores_ref local_sockets, int socket_id,
     455static int udp_sendto_message(socket_cores_t *local_sockets, int socket_id,
    456456    const struct sockaddr *addr, socklen_t addrlen, int fragments,
    457457    size_t *data_fragment_size, int flags)
    458458{
    459         socket_core_ref socket;
     459        socket_core_t *socket;
    460460        packet_t packet;
    461461        packet_t next_packet;
    462         udp_header_ref header;
     462        udp_header_t *header;
    463463        int index;
    464464        size_t total_length;
     
    469469        size_t headerlen;
    470470        device_id_t device_id;
    471         packet_dimension_ref packet_dimension;
     471        packet_dimension_t *packet_dimension;
    472472        int rc;
    473473       
     
    609609 *                      function.
    610610 */
    611 static int udp_recvfrom_message(socket_cores_ref local_sockets, int socket_id,
     611static int udp_recvfrom_message(socket_cores_t *local_sockets, int socket_id,
    612612    int flags, size_t *addrlen)
    613613{
    614         socket_core_ref socket;
     614        socket_core_t *socket;
    615615        int packet_id;
    616616        packet_t packet;
    617         udp_header_ref header;
     617        udp_header_t *header;
    618618        struct sockaddr *addr;
    619619        size_t length;
     
    644644                return udp_release_and_return(packet, NO_DATA);
    645645        }
    646         header = (udp_header_ref) data;
     646        header = (udp_header_t *) data;
    647647
    648648        /* Set the source address port */
     
    714714        ipc_call_t answer;
    715715        int answer_count;
    716         packet_dimension_ref packet_dimension;
     716        packet_dimension_t *packet_dimension;
    717717
    718718        /*
  • uspace/srv/net/tl/udp/udp_header.h

    r45f04f8 ra7811f17  
    4949typedef struct udp_header udp_header_t;
    5050
    51 /** Type definition of the user datagram header pointer.
    52  * @see udp_header
    53  */
    54 typedef udp_header_t *udp_header_ref;
    55 
    5651/** User datagram header. */
    5752struct udp_header {
Note: See TracChangeset for help on using the changeset viewer.