Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4e5c7ba in mainline


Ignore:
Timestamp:
2010-11-18T22:36:12Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
f772bc55
Parents:
cb569e6
Message:

Remove xxx_ref typedefs (part 1).

Location:
uspace/srv/net
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp.c

    rcb569e6 r4e5c7ba  
    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);
     
    128128    services_t protocol, measured_string_ref address)
    129129{
    130         arp_device_ref device;
    131         arp_proto_ref proto;
     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,
     176static int arp_proto_create(arp_proto_t **proto, services_t service,
    177177    measured_string_ref 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;
     
    215215    services_t protocol, measured_string_ref address)
    216216{
    217         arp_device_ref device;
    218         arp_proto_ref proto;
     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;
     420        arp_header_t *header;
     421        arp_device_t *device;
     422        arp_proto_t *proto;
    423423        measured_string_ref hw_source;
    424424        uint8_t *src_hw;
     
    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 +
     
    527527    measured_string_ref target)
    528528{
    529         arp_device_ref device;
    530         arp_proto_ref proto;
     529        arp_device_t *device;
     530        arp_proto_t *proto;
    531531        measured_string_ref 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));
  • uspace/srv/net/il/arp/arp.h

    rcb569e6 r4e5c7ba  
    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.
  • uspace/srv/net/il/arp/arp_header.h

    rcb569e6 r4e5c7ba  
    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

    rcb569e6 r4e5c7ba  
    144144static int ip_get_icmp_phone(void)
    145145{
    146         ip_proto_ref proto;
     146        ip_proto_t *proto;
    147147        int phone;
    148148
     
    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[] = {
     
    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);
     
    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{
     
    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
     1068*ip_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
     
    14541454    services_t error)
    14551455{
    1456         ip_proto_ref proto;
     1456        ip_proto_t *proto;
    14571457        int phone;
    14581458        services_t service;
     
    15571557        ip_header_ref header;
    15581558        in_addr_t dest;
    1559         ip_route_ref route;
     1559        ip_route_t *route;
    15601560        int phone;
    15611561        struct sockaddr *addr;
     
    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;
     1725        ip_route_t *route;
    17261726        ip_header_ref header;
    17271727
     
    17821782        in_addr_t *dest;
    17831783        in_addr_t *src;
    1784         ip_route_ref route;
     1784        ip_route_t *route;
    17851785        ipv4_pseudo_header_ref header_in;
    17861786
  • uspace/srv/net/il/ip/ip.h

    rcb569e6 r4e5c7ba  
    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.
     
    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/nil/eth/eth.c

    rcb569e6 r4e5c7ba  
    178178{
    179179        int index;
    180         eth_proto_ref proto;
     180        eth_proto_t *proto;
    181181
    182182        fibril_rwlock_read_lock(&eth_globals.protos_lock);
     
    286286    size_t mtu)
    287287{
    288         eth_device_ref device;
     288        eth_device_t *device;
    289289        int index;
    290290        measured_string_t names[2] = {
     
    301301        size_t count = sizeof(names) / sizeof(measured_string_t);
    302302        char *data;
    303         eth_proto_ref proto;
     303        eth_proto_t *proto;
    304304        int rc;
    305305
     
    342342       
    343343        /* Create a new device */
    344         device = (eth_device_ref) malloc(sizeof(eth_device_t));
     344        device = (eth_device_t *) malloc(sizeof(eth_device_t));
    345345        if (!device)
    346346                return ENOMEM;
     
    434434 * @returns             NULL if the packet address length is not big enough.
    435435 */
    436 static eth_proto_ref eth_process_packet(int flags, packet_t packet)
    437 {
    438         eth_header_snap_ref header;
     436static eth_proto_t *eth_process_packet(int flags, packet_t packet)
     437{
     438        eth_header_snap_t *header;
    439439        size_t length;
    440440        eth_type_t type;
    441441        size_t prefix;
    442442        size_t suffix;
    443         eth_fcs_ref fcs;
     443        eth_fcs_t *fcs;
    444444        uint8_t *data;
    445445        int rc;
     
    454454       
    455455        data = packet_get_data(packet);
    456         header = (eth_header_snap_ref) data;
     456        header = (eth_header_snap_t *) data;
    457457        type = ntohs(header->header.ethertype);
    458458       
     
    461461                prefix = sizeof(eth_header_t);
    462462                suffix = 0;
    463                 fcs = (eth_fcs_ref) data + length - sizeof(eth_fcs_t);
     463                fcs = (eth_fcs_t *) data + length - sizeof(eth_fcs_t);
    464464                length -= sizeof(eth_fcs_t);
    465465        } else if(type <= ETH_MAX_CONTENT) {
     
    487487
    488488                suffix = (type < ETH_MIN_CONTENT) ? ETH_MIN_CONTENT - type : 0U;
    489                 fcs = (eth_fcs_ref) data + prefix + type + suffix;
     489                fcs = (eth_fcs_t *) data + prefix + type + suffix;
    490490                suffix += length - prefix - type;
    491491                length = prefix + type + suffix;
     
    516516    packet_t packet, services_t target)
    517517{
    518         eth_proto_ref proto;
     518        eth_proto_t *proto;
    519519        packet_t next;
    520         eth_device_ref device;
     520        eth_device_t *device;
    521521        int flags;
    522522
     
    564564    size_t *prefix, size_t *content, size_t *suffix)
    565565{
    566         eth_device_ref device;
     566        eth_device_t *device;
    567567
    568568        if (!addr_len || !prefix || !content || !suffix)
     
    598598    measured_string_ref *address)
    599599{
    600         eth_device_ref device;
     600        eth_device_t *device;
    601601
    602602        if (!address)
     
    631631static int eth_register_message(services_t service, int phone)
    632632{
    633         eth_proto_ref proto;
     633        eth_proto_t *proto;
    634634        int protocol;
    635635        int index;
     
    646646                return EOK;
    647647        } else {
    648                 proto = (eth_proto_ref) malloc(sizeof(eth_proto_t));
     648                proto = (eth_proto_t *) malloc(sizeof(eth_proto_t));
    649649                if (!proto) {
    650650                        fibril_rwlock_write_unlock(&eth_globals.protos_lock);
     
    688688    size_t mtu)
    689689{
    690         eth_header_snap_ref header;
    691         eth_header_lsap_ref header_lsap;
    692         eth_header_ref header_dix;
    693         eth_fcs_ref fcs;
     690        eth_header_snap_t *header;
     691        eth_header_lsap_t *header_lsap;
     692        eth_header_t *header_dix;
     693        eth_fcs_t *fcs;
    694694        uint8_t *src;
    695695        uint8_t *dest;
     
    697697        int i;
    698698        void *padding;
    699         eth_preamble_ref preamble;
     699        eth_preamble_t *preamble;
    700700
    701701        i = packet_get_addr(packet, &src, &dest);
     
    795795    services_t sender)
    796796{
    797         eth_device_ref device;
     797        eth_device_t *device;
    798798        packet_t next;
    799799        packet_t tmp;
  • uspace/srv/net/nil/eth/eth.h

    rcb569e6 r4e5c7ba  
    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.
  • uspace/srv/net/nil/eth/eth_header.h

    rcb569e6 r4e5c7ba  
    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

    rcb569e6 r4e5c7ba  
    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;
     
    250250    measured_string_ref *address)
    251251{
    252         nildummy_device_ref device;
     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);
  • uspace/srv/net/nil/nildummy/nildummy.h

    rcb569e6 r4e5c7ba  
    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.
  • uspace/srv/net/tl/icmp/icmp.c

    rcb569e6 r4e5c7ba  
    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;
     
    483483{
    484484        int reply_key;
    485         icmp_reply_ref reply;
     485        icmp_reply_t *reply;
    486486
    487487        /* Compute the reply key */
  • uspace/srv/net/tl/icmp/icmp.h

    rcb569e6 r4e5c7ba  
    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

    rcb569e6 r4e5c7ba  
    166166
    167167static 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);
     168static void tcp_prepare_operation_header(socket_core_ref, tcp_socket_data_t *,
     169    tcp_header_t *, int synchronize, int);
    170170static int tcp_prepare_timeout(int (*)(void *), socket_core_ref,
    171     tcp_socket_data_ref, size_t, tcp_socket_state_t, suseconds_t, int);
     171    tcp_socket_data_t *, size_t, tcp_socket_state_t, suseconds_t, int);
    172172static void tcp_free_socket_data(socket_core_ref);
    173173
     
    179179static int tcp_connect_core(socket_core_ref, socket_cores_ref,
    180180    struct sockaddr *, socklen_t);
    181 static int tcp_queue_prepare_packet(socket_core_ref, tcp_socket_data_ref,
     181static int tcp_queue_prepare_packet(socket_core_ref, tcp_socket_data_t *,
    182182    packet_t, size_t);
    183 static int tcp_queue_packet(socket_core_ref, tcp_socket_data_ref, packet_t,
     183static int tcp_queue_packet(socket_core_ref, tcp_socket_data_t *, packet_t,
    184184    size_t);
    185 static packet_t tcp_get_packets_to_send(socket_core_ref, tcp_socket_data_ref);
     185static packet_t tcp_get_packets_to_send(socket_core_ref, tcp_socket_data_t *);
    186186static void tcp_send_packets(device_id_t, packet_t);
    187187
    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,
     188static void tcp_process_acknowledgement(socket_core_ref, tcp_socket_data_t *,
     189    tcp_header_t *);
     190static packet_t tcp_send_prepare_packet(socket_core_ref, tcp_socket_data_t *,
    191191    packet_t, size_t, size_t);
    192 static packet_t tcp_prepare_copy(socket_core_ref, tcp_socket_data_ref, packet_t,
     192static packet_t tcp_prepare_copy(socket_core_ref, tcp_socket_data_t *, packet_t,
    193193    size_t, size_t);
    194 /* static */ void tcp_retransmit_packet(socket_core_ref, tcp_socket_data_ref,
     194/* static */ void tcp_retransmit_packet(socket_core_ref, tcp_socket_data_t *,
    195195    size_t);
    196196static 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,
     197    tcp_socket_data_t *, int, int);
     198static void tcp_refresh_socket_data(tcp_socket_data_t *);
     199
     200static void tcp_initialize_socket_data(tcp_socket_data_t *);
     201
     202static int tcp_process_listen(socket_core_ref, tcp_socket_data_t *,
     203    tcp_header_t *, packet_t, struct sockaddr *, struct sockaddr *, size_t);
     204static int tcp_process_syn_sent(socket_core_ref, tcp_socket_data_t *,
     205    tcp_header_t *, packet_t);
     206static int tcp_process_syn_received(socket_core_ref, tcp_socket_data_t *,
     207    tcp_header_t *, packet_t);
     208static int tcp_process_established(socket_core_ref, tcp_socket_data_t *,
     209    tcp_header_t *, packet_t, int, size_t);
     210static int tcp_queue_received_packet(socket_core_ref, tcp_socket_data_t *,
    211211    packet_t, int, size_t);
    212212
     
    290290        size_t offset;
    291291        int result;
    292         tcp_header_ref header;
     292        tcp_header_t *header;
    293293        socket_core_ref socket;
    294         tcp_socket_data_ref socket_data;
     294        tcp_socket_data_t *socket_data;
    295295        packet_t next_packet;
    296296        size_t total_length;
     
    343343
    344344        /* Get tcp header */
    345         header = (tcp_header_ref) packet_get_data(packet);
     345        header = (tcp_header_t *) packet_get_data(packet);
    346346        if (!header)
    347347                return tcp_release_and_return(packet, NO_DATA);
     
    380380
    381381        printf("socket id %d\n", socket->socket_id);
    382         socket_data = (tcp_socket_data_ref) socket->specific_data;
     382        socket_data = (tcp_socket_data_t *) socket->specific_data;
    383383        assert(socket_data);
    384384
     
    497497}
    498498
    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,
     499int tcp_process_established(socket_core_ref socket, tcp_socket_data_t *
     500    socket_data, tcp_header_t *header, packet_t packet, int fragments,
    501501    size_t total_length)
    502502{
     
    806806
    807807int tcp_queue_received_packet(socket_core_ref socket,
    808     tcp_socket_data_ref socket_data, packet_t packet, int fragments,
     808    tcp_socket_data_t *socket_data, packet_t packet, int fragments,
    809809    size_t total_length)
    810810{
     
    842842}
    843843
    844 int tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_ref
    845     socket_data, tcp_header_ref header, packet_t packet)
     844int tcp_process_syn_sent(socket_core_ref socket, tcp_socket_data_t *
     845    socket_data, tcp_header_t *header, packet_t packet)
    846846{
    847847        packet_t next_packet;
     
    901901
    902902int tcp_process_listen(socket_core_ref listening_socket,
    903     tcp_socket_data_ref listening_socket_data, tcp_header_ref header,
     903    tcp_socket_data_t *listening_socket_data, tcp_header_t *header,
    904904    packet_t packet, struct sockaddr *src, struct sockaddr *dest,
    905905    size_t addrlen)
     
    907907        packet_t next_packet;
    908908        socket_core_ref socket;
    909         tcp_socket_data_ref socket_data;
     909        tcp_socket_data_t *socket_data;
    910910        int socket_id;
    911911        int listening_socket_id = listening_socket->socket_id;
     
    922922                return tcp_release_and_return(packet, EINVAL);
    923923
    924         socket_data = (tcp_socket_data_ref) malloc(sizeof(*socket_data));
     924        socket_data = (tcp_socket_data_t *) malloc(sizeof(*socket_data));
    925925        if (!socket_data)
    926926                return tcp_release_and_return(packet, ENOMEM);
     
    979979        }
    980980        listening_socket_data =
    981             (tcp_socket_data_ref) listening_socket->specific_data;
     981            (tcp_socket_data_t *) listening_socket->specific_data;
    982982        assert(listening_socket_data);
    983983
     
    991991                return ENOTSOCK;
    992992        }
    993         socket_data = (tcp_socket_data_ref) socket->specific_data;
     993        socket_data = (tcp_socket_data_t *) socket->specific_data;
    994994        assert(socket_data);
    995995
     
    10611061
    10621062int tcp_process_syn_received(socket_core_ref socket,
    1063     tcp_socket_data_ref socket_data, tcp_header_ref header, packet_t packet)
     1063    tcp_socket_data_t *socket_data, tcp_header_t *header, packet_t packet)
    10641064{
    10651065        socket_core_ref listening_socket;
    1066         tcp_socket_data_ref listening_socket_data;
     1066        tcp_socket_data_t *listening_socket_data;
    10671067        int rc;
    10681068
     
    10861086        if (listening_socket) {
    10871087                listening_socket_data =
    1088                     (tcp_socket_data_ref) listening_socket->specific_data;
     1088                    (tcp_socket_data_t *) listening_socket->specific_data;
    10891089                assert(listening_socket_data);
    10901090
     
    11281128
    11291129void tcp_process_acknowledgement(socket_core_ref socket,
    1130     tcp_socket_data_ref socket_data, tcp_header_ref header)
     1130    tcp_socket_data_t *socket_data, tcp_header_t *header)
    11311131{
    11321132        size_t number;
     
    12651265}
    12661266
    1267 void tcp_refresh_socket_data(tcp_socket_data_ref socket_data)
     1267void tcp_refresh_socket_data(tcp_socket_data_t *socket_data)
    12681268{
    12691269        assert(socket_data);
     
    12811281}
    12821282
    1283 void tcp_initialize_socket_data(tcp_socket_data_ref socket_data)
     1283void tcp_initialize_socket_data(tcp_socket_data_t *socket_data)
    12841284{
    12851285        assert(socket_data);
     
    13041304        ipc_call_t answer;
    13051305        int answer_count;
    1306         tcp_socket_data_ref socket_data;
     1306        tcp_socket_data_t *socket_data;
    13071307        socket_core_ref socket;
    13081308        packet_dimension_ref packet_dimension;
     
    13361336                case NET_SOCKET:
    13371337                        socket_data =
    1338                             (tcp_socket_data_ref) malloc(sizeof(*socket_data));
     1338                            (tcp_socket_data_t *) malloc(sizeof(*socket_data));
    13391339                        if (!socket_data) {
    13401340                                res = ENOMEM;
     
    13831383                                    SOCKET_GET_SOCKET_ID(call));
    13841384                                if (socket) {
    1385                                         socket_data = (tcp_socket_data_ref)
     1385                                        socket_data = (tcp_socket_data_t *)
    13861386                                            socket->specific_data;
    13871387                                        assert(socket_data);
     
    15431543        int keep_write_lock = false;
    15441544        socket_core_ref socket;
    1545         tcp_socket_data_ref socket_data;
     1545        tcp_socket_data_t *socket_data;
    15461546
    15471547        assert(timeout);
     
    15611561                goto out;
    15621562       
    1563         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1563        socket_data = (tcp_socket_data_t *) socket->specific_data;
    15641564        assert(socket_data);
    15651565        if (socket_data->local_sockets != timeout->local_sockets)
     
    16191619        tcp_timeout_ref timeout = data;
    16201620        socket_core_ref socket;
    1621         tcp_socket_data_ref socket_data;
     1621        tcp_socket_data_t *socket_data;
    16221622        fibril_rwlock_t *local_lock;
    16231623
     
    16351635
    16361636        if (socket && (socket->socket_id == timeout->socket_id)) {
    1637                 socket_data = (tcp_socket_data_ref) socket->specific_data;
     1637                socket_data = (tcp_socket_data_t *) socket->specific_data;
    16381638                assert(socket_data);
    16391639                if (socket_data->local_sockets == timeout->local_sockets) {
     
    16561656}
    16571657
    1658 void tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_ref
     1658void tcp_retransmit_packet(socket_core_ref socket, tcp_socket_data_t *
    16591659    socket_data, size_t sequence_number)
    16601660{
     
    16871687{
    16881688        socket_core_ref socket;
    1689         tcp_socket_data_ref socket_data;
     1689        tcp_socket_data_t *socket_data;
    16901690
    16911691        assert(local_sockets);
     
    17001700       
    17011701        /* Get the socket specific data */
    1702         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1702        socket_data = (tcp_socket_data_t *) socket->specific_data;
    17031703        assert(socket_data);
    17041704
     
    17401740    struct sockaddr *addr, socklen_t addrlen)
    17411741{
    1742         tcp_socket_data_ref socket_data;
     1742        tcp_socket_data_t *socket_data;
    17431743        packet_t packet;
    17441744        int rc;
     
    17491749
    17501750        /* Get the socket specific data */
    1751         socket_data = (tcp_socket_data_ref) socket->specific_data;
     1751        socket_data = (tcp_socket_data_t *) socket->specific_data;
    17521752        assert(socket_data);
    17531753        assert(socket->specific_data == socket_data);
     
    18291829
    18301830int 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;
     1831    tcp_socket_data_t *socket_data, packet_t packet, size_t data_length)
     1832{
     1833        tcp_header_t *header;
    18341834        int rc;
    18351835
     
    18391839
    18401840        /* Get TCP header */
    1841         header = (tcp_header_ref) packet_get_data(packet);
     1841        header = (tcp_header_t *) packet_get_data(packet);
    18421842        if (!header)
    18431843                return NO_DATA;
     
    18591859}
    18601860
    1861 int tcp_queue_packet(socket_core_ref socket, tcp_socket_data_ref socket_data,
     1861int tcp_queue_packet(socket_core_ref socket, tcp_socket_data_t *socket_data,
    18621862    packet_t packet, size_t data_length)
    18631863{
     
    18811881}
    18821882
    1883 packet_t tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_ref
     1883packet_t tcp_get_packets_to_send(socket_core_ref socket, tcp_socket_data_t *
    18841884    socket_data)
    18851885{
     
    19411941}
    19421942
    1943 packet_t tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_ref
     1943packet_t tcp_send_prepare_packet(socket_core_ref socket, tcp_socket_data_t *
    19441944    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
    19451945{
    1946         tcp_header_ref header;
     1946        tcp_header_t *header;
    19471947        uint32_t checksum;
    19481948        int rc;
     
    19611961
    19621962        /* Get the header */
    1963         header = (tcp_header_ref) packet_get_data(packet);
     1963        header = (tcp_header_t *) packet_get_data(packet);
    19641964        if (!header) {
    19651965                pq_release_remote(tcp_globals.net_phone, packet_get_id(packet));
     
    20022002}
    20032003
    2004 packet_t tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_ref
     2004packet_t tcp_prepare_copy(socket_core_ref socket, tcp_socket_data_t *
    20052005    socket_data, packet_t packet, size_t data_length, size_t sequence_number)
    20062006{
     
    20332033
    20342034void tcp_prepare_operation_header(socket_core_ref socket,
    2035     tcp_socket_data_ref socket_data, tcp_header_ref header, int synchronize,
     2035    tcp_socket_data_t *socket_data, tcp_header_t *header, int synchronize,
    20362036    int finalize)
    20372037{
     
    20502050
    20512051int tcp_prepare_timeout(int (*timeout_function)(void *tcp_timeout_t),
    2052     socket_core_ref socket, tcp_socket_data_ref socket_data,
     2052    socket_core_ref socket, tcp_socket_data_t *socket_data,
    20532053    size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout,
    20542054    int globals_read_only)
     
    21002100{
    21012101        socket_core_ref socket;
    2102         tcp_socket_data_ref socket_data;
     2102        tcp_socket_data_t *socket_data;
    21032103        int packet_id;
    21042104        packet_t packet;
     
    21172117                return NO_DATA;
    21182118
    2119         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2119        socket_data = (tcp_socket_data_t *) socket->specific_data;
    21202120
    21212121        /* Check state */
     
    21582158{
    21592159        socket_core_ref socket;
    2160         tcp_socket_data_ref socket_data;
     2160        tcp_socket_data_t *socket_data;
    21612161        packet_dimension_ref packet_dimension;
    21622162        packet_t packet;
    21632163        size_t total_length;
    2164         tcp_header_ref header;
     2164        tcp_header_t *header;
    21652165        int index;
    21662166        int result;
     
    21792179                return NO_DATA;
    21802180
    2181         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2181        socket_data = (tcp_socket_data_t *) socket->specific_data;
    21822182
    21832183        /* Check state */
     
    22332233{
    22342234        socket_core_ref socket;
    2235         tcp_socket_data_ref socket_data;
     2235        tcp_socket_data_t *socket_data;
    22362236        packet_t packet;
    22372237        int rc;
     
    22432243
    22442244        /* Get the socket specific data */
    2245         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2245        socket_data = (tcp_socket_data_t *) socket->specific_data;
    22462246        assert(socket_data);
    22472247
     
    22992299
    23002300int tcp_create_notification_packet(packet_t *packet, socket_core_ref socket,
    2301     tcp_socket_data_ref socket_data, int synchronize, int finalize)
     2301    tcp_socket_data_t *socket_data, int synchronize, int finalize)
    23022302{
    23032303        packet_dimension_ref packet_dimension;
    2304         tcp_header_ref header;
     2304        tcp_header_t *header;
    23052305        int rc;
    23062306
     
    23372337        socket_core_ref accepted;
    23382338        socket_core_ref socket;
    2339         tcp_socket_data_ref socket_data;
     2339        tcp_socket_data_t *socket_data;
    23402340        packet_dimension_ref packet_dimension;
    23412341        int rc;
     
    23512351
    23522352        /* Get the socket specific data */
    2353         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2353        socket_data = (tcp_socket_data_t *) socket->specific_data;
    23542354        assert(socket_data);
    23552355
     
    23692369
    23702370                /* Get the socket specific data */
    2371                 socket_data = (tcp_socket_data_ref) accepted->specific_data;
     2371                socket_data = (tcp_socket_data_t *) accepted->specific_data;
    23722372                assert(socket_data);
    23732373                /* TODO can it be in another state? */
     
    24072407void tcp_free_socket_data(socket_core_ref socket)
    24082408{
    2409         tcp_socket_data_ref socket_data;
     2409        tcp_socket_data_t *socket_data;
    24102410
    24112411        assert(socket);
     
    24142414
    24152415        /* Get the socket specific data */
    2416         socket_data = (tcp_socket_data_ref) socket->specific_data;
     2416        socket_data = (tcp_socket_data_t *) socket->specific_data;
    24172417        assert(socket_data);
    24182418
  • uspace/srv/net/tl/tcp/tcp.h

    rcb569e6 r4e5c7ba  
    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.
  • uspace/srv/net/tl/tcp/tcp_header.h

    rcb569e6 r4e5c7ba  
    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

    rcb569e6 r4e5c7ba  
    223223        size_t offset;
    224224        int result;
    225         udp_header_ref header;
     225        udp_header_t *header;
    226226        socket_core_ref socket;
    227227        packet_t next_packet;
     
    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);
     
    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;
     
    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 */
  • uspace/srv/net/tl/udp/udp_header.h

    rcb569e6 r4e5c7ba  
    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.