Changeset 4e5c7ba in mainline for uspace/srv/net/il


Ignore:
Timestamp:
2010-11-18T22:36:12Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f772bc55
Parents:
cb569e6
Message:

Remove xxx_ref typedefs (part 1).

Location:
uspace/srv/net/il
Files:
5 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;
Note: See TracChangeset for help on using the changeset viewer.