Changeset 854151c in mainline


Ignore:
Timestamp:
2011-01-07T12:32:23Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b404a98
Parents:
3d5e190
Message:

store addresses as uint8_t values (char can be both signed or unsigned depending on platform)
improve MAC address printouts

Location:
uspace
Files:
12 edited

Legend:

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

    r3d5e190 r854151c  
    100100int
    101101generic_get_addr_req(int phone, int message, device_id_t device_id,
    102     measured_string_t **address, char ** data)
     102    measured_string_t **address, uint8_t **data)
    103103{
    104104        aid_t message_id;
     
    112112        message_id = async_send_1(phone, (sysarg_t) message,
    113113            (sysarg_t) device_id, NULL);
    114         string = measured_strings_return(phone, address, data, 1);
     114        string = measured_strings_return(phone, address, (char **) data, 1);
    115115        async_wait_for(message_id, &result);
    116116
  • uspace/lib/net/include/generic.h

    r3d5e190 r854151c  
    5050extern int generic_device_req_remote(int, int, device_id_t, int, services_t);
    5151extern int generic_get_addr_req(int, int, device_id_t, measured_string_t **,
    52     char **);
     52    uint8_t **);
    5353extern int generic_packet_size_req_remote(int, int, device_id_t,
    5454    packet_dimension_t *);
  • uspace/lib/net/include/netif_local.h

    r3d5e190 r854151c  
    196196
    197197extern int netif_get_addr_req_local(int, device_id_t, measured_string_t **,
    198     char **);
     198    uint8_t **);
    199199extern int netif_probe_req_local(int, device_id_t, int, int);
    200200extern int netif_send_msg_local(int, device_id_t, packet_t *, services_t);
  • uspace/lib/net/include/netif_remote.h

    r3d5e190 r854151c  
    4242
    4343extern int netif_get_addr_req_remote(int, device_id_t, measured_string_t **,
    44     char **);
     44    uint8_t **);
    4545extern int netif_probe_req_remote(int, device_id_t, int, int);
    4646extern int netif_send_msg_remote(int, device_id_t, packet_t *, services_t);
  • uspace/lib/net/netif/netif_local.c

    r3d5e190 r854151c  
    203203 */
    204204int netif_get_addr_req_local(int netif_phone, device_id_t device_id,
    205     measured_string_t **address, char **data)
     205    measured_string_t **address, uint8_t **data)
    206206{
    207207        int rc;
     
    221221        fibril_rwlock_read_unlock(&netif_globals.lock);
    222222       
    223         *data = (**address).value;
     223        *data = (uint8_t *) (**address).value;
    224224       
    225225        return rc;
  • uspace/lib/net/netif/netif_remote.c

    r3d5e190 r854151c  
    6060 */
    6161int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
    62     measured_string_t **address, char **data)
     62    measured_string_t **address, uint8_t **data)
    6363{
    6464        return generic_get_addr_req(netif_phone, NET_NETIF_GET_ADDR, device_id,
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r3d5e190 r854151c  
    263263        printf("Ethernet address ");
    264264        for (i = 0; i < 6; i++)
    265                 printf("%x%c", dep->de_address.ea_addr[i], i < 5 ? ':' : '\n');
     265                printf("%02x%c", dep->de_address.ea_addr[i], i < 5 ? ':' : '\n');
    266266       
    267267        /*
  • uspace/srv/net/il/arp/arp.c

    r3d5e190 r854151c  
    215215        (*proto)->service = service;
    216216        (*proto)->addr = address;
    217         (*proto)->addr_data = address->value;
     217        (*proto)->addr_data = (uint8_t *) address->value;
    218218       
    219219        rc = arp_addr_initialize(&(*proto)->addresses);
     
    267267                        free(proto->addr_data);
    268268                        proto->addr = address;
    269                         proto->addr_data = address->value;
     269                        proto->addr_data = (uint8_t *) address->value;
    270270                } else {
    271271                        rc = arp_proto_create(&proto, protocol, address);
  • uspace/srv/net/il/arp/arp.h

    r3d5e190 r854151c  
    9696        measured_string_t *addr;
    9797        /** Actual device hardware address data. */
    98         char *addr_data;
     98        uint8_t *addr_data;
    9999        /** Broadcast device hardware address. */
    100100        measured_string_t *broadcast_addr;
    101101        /** Broadcast device hardware address data. */
    102         char *broadcast_data;
     102        uint8_t *broadcast_data;
    103103        /** Device identifier. */
    104104        device_id_t device_id;
     
    142142        measured_string_t *addr;
    143143        /** Actual device protocol address data. */
    144         char *addr_data;
     144        uint8_t *addr_data;
    145145        /** Address map. */
    146146        arp_addr_t addresses;
     
    154154         * Hardware address for the translation. NULL denotes an incomplete
    155155         * record with possible waiters.
    156          */ 
     156         */
    157157        measured_string_t *hw_addr;
    158158        /** Condition variable used for waiting for completion of the record. */
  • uspace/srv/net/nil/eth/eth.c

    r3d5e190 r854151c  
    407407       
    408408        printf("%s: Device registered (id: %d, service: %d: mtu: %zu, "
    409             "mac: %x:%x:%x:%x:%x:%x, flags: 0x%x)\n",
     409            "mac: %02x:%02x:%02x:%02x:%02x:%02x, flags: 0x%x)\n",
    410410            NAME, device->device_id, device->service, device->mtu,
    411411            device->addr_data[0], device->addr_data[1],
  • uspace/srv/net/nil/eth/eth.h

    r3d5e190 r854151c  
    9191        /** Actual device hardware address. */
    9292        measured_string_t *addr;
     93       
    9394        /** Actual device hardware address data. */
    94         char *addr_data;
     95        uint8_t *addr_data;
    9596};
    9697
  • uspace/srv/net/nil/nildummy/nildummy.h

    r3d5e190 r854151c  
    7878        measured_string_t *addr;
    7979        /** Actual device hardware address data. */
    80         char *addr_data;
     80        uint8_t *addr_data;
    8181};
    8282
Note: See TracChangeset for help on using the changeset viewer.