Changeset 61bfc370 in mainline for uspace/srv


Ignore:
Timestamp:
2011-01-07T18:57:55Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e08a733
Parents:
7c34b28f
Message:
  • make measured_string and other network-related data types binary-safe
  • fix several network-related routines binary-safe (replace clearly suspicious use of str_lcmp() with bcmp())
  • rename spawn() to net_spawn()
Location:
uspace/srv
Files:
14 edited

Legend:

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

    r7c34b28f r61bfc370  
    550550                if ((length < ETH_MIN_PACK_SIZE) || (length > ETH_MAX_PACK_SIZE_TAGGED)) {
    551551                        printf("Packet with strange length arrived: %zu\n", length);
    552                         next= curr;
     552                        next = curr;
    553553                } else if ((next < dep->de_startpage) || (next >= dep->de_stoppage)) {
    554554                        printf("Strange next page\n");
    555                         next= curr;
     555                        next = curr;
    556556                } else if (header.dr_status & RSR_FO) {
    557557                        /*
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r7c34b28f r61bfc370  
    213213                return rc;
    214214       
    215         address->value = (char *) (&((dpeth_t *) device->specific)->de_address);
     215        address->value = (uint8_t *) &((dpeth_t *) device->specific)->de_address;
    216216        address->length = sizeof(ether_addr_t);
    217217        return EOK;
  • uspace/srv/hw/netif/dp8390/dp8390_port.h

    r7c34b28f r61bfc370  
    4343#include <libarch/ddi.h>
    4444#include <sys/types.h>
    45 
    46 /** Compares two memory blocks.
    47  *  @param[in] first The first memory block.
    48  *  @param[in] second The second memory block.
    49  *  @param[in] size The blocks size in bytes.
    50  *  @returns 0 if equeal.
    51  *  @returns -1 if the first is greater than the second.
    52  *  @returns 1 if the second is greater than the first.
    53  */
    54 #define memcmp(first, second, size)  bcmp((char *) (first), (char *) (second), (size))
    5545
    5646/** Reads 1 byte.
  • uspace/srv/hw/netif/dp8390/ne2000.c

    r7c34b28f r61bfc370  
    241241                buf[i] = inb_ne(dep, NE_DATA);
    242242       
    243         return (memcmp(buf, pat, 4) == 0);
     243        return (bcmp(buf, pat, 4) == 0);
    244244}
    245245
     
    280280                *(uint16_t *)(buf + i) = inw_ne(dep, NE_DATA);
    281281       
    282         return (memcmp(buf, pat, 4) == 0);
     282        return (bcmp(buf, pat, 4) == 0);
    283283}
    284284
  • uspace/srv/net/il/arp/arp.c

    r7c34b28f r61bfc370  
    215215        (*proto)->service = service;
    216216        (*proto)->addr = address;
    217         (*proto)->addr_data = (uint8_t *) address->value;
     217        (*proto)->addr_data = address->value;
    218218       
    219219        rc = arp_addr_initialize(&(*proto)->addresses);
     
    267267                        free(proto->addr_data);
    268268                        proto->addr = address;
    269                         proto->addr_data = (uint8_t *) address->value;
     269                        proto->addr_data = address->value;
    270270                } else {
    271271                        rc = arp_proto_create(&proto, protocol, address);
     
    482482        des_hw = src_proto + header->protocol_length;
    483483        des_proto = des_hw + header->hardware_length;
    484         trans = arp_addr_find(&proto->addresses, (char *) src_proto,
     484        trans = arp_addr_find(&proto->addresses, src_proto,
    485485            header->protocol_length);
    486486        /* Exists? */
     
    493493        if (proto->addr->length != header->protocol_length)
    494494                return EINVAL;
    495         if (!str_lcmp(proto->addr->value, (char *) des_proto,
    496             proto->addr->length)) {
     495       
     496        if (!bcmp(proto->addr->value, des_proto, proto->addr->length)) {
    497497                /* Not already updated? */
    498498                if (!trans) {
     
    502502                        trans->hw_addr = NULL;
    503503                        fibril_condvar_initialize(&trans->cv);
    504                         rc = arp_addr_add(&proto->addresses, (char *) src_proto,
     504                        rc = arp_addr_add(&proto->addresses, src_proto,
    505505                            header->protocol_length, trans);
    506506                        if (rc != EOK) {
     
    510510                }
    511511                if (!trans->hw_addr) {
    512                         trans->hw_addr = measured_string_create_bulk(
    513                             (char *) src_hw, header->hardware_length);
     512                        trans->hw_addr = measured_string_create_bulk(src_hw,
     513                            header->hardware_length);
    514514                        if (!trans->hw_addr)
    515515                                return ENOMEM;
    516 
     516                       
    517517                        /* Notify the fibrils that wait for the translation. */
    518518                        fibril_condvar_broadcast(&trans->cv);
     
    681681        measured_string_t *address;
    682682        measured_string_t *translation;
    683         char *data;
     683        uint8_t *data;
    684684        packet_t *packet;
    685685        packet_t *next;
     
    748748       
    749749        case NET_IL_RECEIVED:
     750               
    750751                rc = packet_translate_remote(arp_globals.net_phone, &packet,
    751752                    IPC_GET_PACKET(call));
  • uspace/srv/net/il/ip/ip.c

    r7c34b28f r61bfc370  
    275275        if (rc != EOK)
    276276                goto out;
    277         rc = add_module(NULL, &ip_globals.modules, ARP_NAME, ARP_FILENAME,
    278             SERVICE_ARP, 0, arp_connect_module);
     277        rc = add_module(NULL, &ip_globals.modules, (uint8_t *) ARP_NAME,
     278            (uint8_t *) ARP_FILENAME, SERVICE_ARP, 0, arp_connect_module);
    279279
    280280out:
     
    312312        measured_string_t names[] = {
    313313                {
    314                         (char *) "IPV",
     314                        (uint8_t *) "IPV",
    315315                        3
    316316                },
    317317                {
    318                         (char *) "IP_CONFIG",
     318                        (uint8_t *) "IP_CONFIG",
    319319                        9
    320320                },
    321321                {
    322                         (char *) "IP_ADDR",
     322                        (uint8_t *) "IP_ADDR",
    323323                        7
    324324                },
    325325                {
    326                         (char *) "IP_NETMASK",
     326                        (uint8_t *) "IP_NETMASK",
    327327                        10
    328328                },
    329329                {
    330                         (char *) "IP_GATEWAY",
     330                        (uint8_t *) "IP_GATEWAY",
    331331                        10
    332332                },
    333333                {
    334                         (char *) "IP_BROADCAST",
     334                        (uint8_t *) "IP_BROADCAST",
    335335                        12
    336336                },
    337337                {
    338                         (char *) "ARP",
     338                        (uint8_t *) "ARP",
    339339                        3
    340340                },
    341341                {
    342                         (char *) "IP_ROUTING",
     342                        (uint8_t *) "IP_ROUTING",
    343343                        10
    344344                }
     
    346346        measured_string_t *configuration;
    347347        size_t count = sizeof(names) / sizeof(measured_string_t);
    348         char *data;
     348        uint8_t *data;
    349349        measured_string_t address;
    350350        ip_route_t *route;
     
    368368        if (configuration) {
    369369                if (configuration[0].value)
    370                         ip_netif->ipv = strtol(configuration[0].value, NULL, 0);
    371 
    372                 ip_netif->dhcp = !str_lcmp(configuration[1].value, "dhcp",
     370                        ip_netif->ipv = strtol((char *) configuration[0].value, NULL, 0);
     371               
     372                ip_netif->dhcp = !str_lcmp((char *) configuration[1].value, "dhcp",
    373373                    configuration[1].length);
    374374               
     
    394394                        }
    395395                       
    396                         if ((inet_pton(AF_INET, configuration[2].value,
     396                        if ((inet_pton(AF_INET, (char *) configuration[2].value,
    397397                            (uint8_t *) &route->address.s_addr) != EOK) ||
    398                             (inet_pton(AF_INET, configuration[3].value,
     398                            (inet_pton(AF_INET, (char *) configuration[3].value,
    399399                            (uint8_t *) &route->netmask.s_addr) != EOK) ||
    400                             (inet_pton(AF_INET, configuration[4].value,
     400                            (inet_pton(AF_INET, (char *) configuration[4].value,
    401401                            (uint8_t *) &gateway.s_addr) == EINVAL) ||
    402                             (inet_pton(AF_INET, configuration[5].value,
     402                            (inet_pton(AF_INET, (char *) configuration[5].value,
    403403                            (uint8_t *) &ip_netif->broadcast.s_addr) == EINVAL))
    404404                            {
     
    441441        if (ip_netif->arp) {
    442442                if (route) {
    443                         address.value = (char *) &route->address.s_addr;
     443                        address.value = (uint8_t *) &route->address.s_addr;
    444444                        address.length = sizeof(in_addr_t);
    445445                       
     
    997997        measured_string_t destination;
    998998        measured_string_t *translation;
    999         char *data;
     999        uint8_t *data;
    10001000        int phone;
    10011001        int rc;
     
    10041004        if (netif->arp && (route->address.s_addr != dest.s_addr)) {
    10051005                destination.value = route->gateway.s_addr ?
    1006                     (char *) &route->gateway.s_addr : (char *) &dest.s_addr;
     1006                    (uint8_t *) &route->gateway.s_addr : (uint8_t *) &dest.s_addr;
    10071007                destination.length = sizeof(dest.s_addr);
    10081008
     
    17561756                    (header->destination_address & route->netmask.s_addr))) {
    17571757                        // clear the ARP mapping if any
    1758                         address.value = (char *) &header->destination_address;
     1758                        address.value = (uint8_t *) &header->destination_address;
    17591759                        address.length = sizeof(header->destination_address);
    17601760                        arp_clear_address_req(netif->arp->phone,
  • uspace/srv/net/net/net.c

    r7c34b28f r61bfc370  
    9090 *
    9191 */
    92 int add_configuration(measured_strings_t *configuration, const char *name,
    93     const char *value)
     92int add_configuration(measured_strings_t *configuration, const uint8_t *name,
     93    const uint8_t *value)
    9494{
    9595        int rc;
     
    119119}
    120120
    121 static int parse_line(measured_strings_t *configuration, char *line)
     121static int parse_line(measured_strings_t *configuration, uint8_t *line)
    122122{
    123123        int rc;
    124124       
    125125        /* From the beginning */
    126         char *name = line;
     126        uint8_t *name = line;
    127127       
    128128        /* Skip comments and blank lines */
     
    135135       
    136136        /* Remember the name start */
    137         char *value = name;
     137        uint8_t *value = name;
    138138       
    139139        /* Skip the name */
     
    186186       
    187187        /* Construct the full filename */
    188         char line[BUFFER_SIZE];
    189         if (snprintf(line, BUFFER_SIZE, "%s/%s", directory, filename) > BUFFER_SIZE)
     188        char fname[BUFFER_SIZE];
     189        if (snprintf(fname, BUFFER_SIZE, "%s/%s", directory, filename) > BUFFER_SIZE)
    190190                return EOVERFLOW;
    191191       
    192192        /* Open the file */
    193         FILE *cfg = fopen(line, "r");
     193        FILE *cfg = fopen(fname, "r");
    194194        if (!cfg)
    195195                return ENOENT;
     
    201201        unsigned int line_number = 0;
    202202        size_t index = 0;
     203        uint8_t line[BUFFER_SIZE];
     204       
    203205        while (!ferror(cfg) && !feof(cfg)) {
    204206                int read = fgetc(cfg);
     
    207209                                line[BUFFER_SIZE - 1] = '\0';
    208210                                fprintf(stderr, "%s: Configuration line %u too "
    209                                     "long: %s\n", NAME, line_number, line);
     211                                    "long: %s\n", NAME, line_number, (char *) line);
    210212                               
    211213                                /* No space left in the line buffer */
     
    213215                        }
    214216                        /* Append the character */
    215                         line[index] = (char) read;
     217                        line[index] = (uint8_t) read;
    216218                        index++;
    217219                } else {
     
    221223                        if (parse_line(configuration, line) != EOK) {
    222224                                fprintf(stderr, "%s: Configuration error on "
    223                                     "line %u: %s\n", NAME, line_number, line);
     225                                    "line %u: %s\n", NAME, line_number, (char *) line);
    224226                        }
    225227                       
     
    282284                return rc;
    283285       
    284         rc = add_module(NULL, &net_globals.modules, LO_NAME, LO_FILENAME,
    285             SERVICE_LO, 0, connect_to_service);
    286         if (rc != EOK)
    287                 return rc;
    288         rc = add_module(NULL, &net_globals.modules, DP8390_NAME,
    289             DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);
    290         if (rc != EOK)
    291                 return rc;
    292         rc = add_module(NULL, &net_globals.modules, ETHERNET_NAME,
    293             ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
    294         if (rc != EOK)
    295                 return rc;
    296         rc = add_module(NULL, &net_globals.modules, NILDUMMY_NAME,
    297             NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
     286        rc = add_module(NULL, &net_globals.modules, (uint8_t *) LO_NAME,
     287            (uint8_t *) LO_FILENAME, SERVICE_LO, 0, connect_to_service);
     288        if (rc != EOK)
     289                return rc;
     290        rc = add_module(NULL, &net_globals.modules, (uint8_t *) DP8390_NAME,
     291            (uint8_t *) DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);
     292        if (rc != EOK)
     293                return rc;
     294        rc = add_module(NULL, &net_globals.modules, (uint8_t *) ETHERNET_NAME,
     295            (uint8_t *) ETHERNET_FILENAME, SERVICE_ETHERNET, 0, connect_to_service);
     296        if (rc != EOK)
     297                return rc;
     298        rc = add_module(NULL, &net_globals.modules, (uint8_t *) NILDUMMY_NAME,
     299            (uint8_t *) NILDUMMY_FILENAME, SERVICE_NILDUMMY, 0, connect_to_service);
    298300        if (rc != EOK)
    299301                return rc;
     
    364366 */
    365367static int net_get_conf(measured_strings_t *netif_conf,
    366     measured_string_t *configuration, size_t count, char **data)
     368    measured_string_t *configuration, size_t count, uint8_t **data)
    367369{
    368370        if (data)
     
    390392
    391393int net_get_conf_req(int net_phone, measured_string_t **configuration,
    392     size_t count, char **data)
     394    size_t count, uint8_t **data)
    393395{
    394396        if (!configuration || (count <= 0))
     
    399401
    400402int net_get_device_conf_req(int net_phone, device_id_t device_id,
    401     measured_string_t **configuration, size_t count, char **data)
     403    measured_string_t **configuration, size_t count, uint8_t **data)
    402404{
    403405        if ((!configuration) || (count == 0))
     
    411413}
    412414
    413 void net_free_settings(measured_string_t *settings, char *data)
     415void net_free_settings(measured_string_t *settings, uint8_t *data)
    414416{
    415417}
     
    437439        /* Mandatory netif */
    438440        measured_string_t *setting =
    439             measured_strings_find(&netif->configuration, CONF_NETIF, 0);
     441            measured_strings_find(&netif->configuration, (uint8_t *) CONF_NETIF, 0);
    440442       
    441443        netif->driver = get_running_module(&net_globals.modules, setting->value);
     
    447449       
    448450        /* Optional network interface layer */
    449         setting = measured_strings_find(&netif->configuration, CONF_NIL, 0);
     451        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_NIL, 0);
    450452        if (setting) {
    451453                netif->nil = get_running_module(&net_globals.modules, setting->value);
     
    459461       
    460462        /* Mandatory internet layer */
    461         setting = measured_strings_find(&netif->configuration, CONF_IL, 0);
     463        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IL, 0);
    462464        netif->il = get_running_module(&net_globals.modules, setting->value);
    463465        if (!netif->il) {
     
    468470       
    469471        /* Hardware configuration */
    470         setting = measured_strings_find(&netif->configuration, CONF_IRQ, 0);
    471         int irq = setting ? strtol(setting->value, NULL, 10) : 0;
    472        
    473         setting = measured_strings_find(&netif->configuration, CONF_IO, 0);
    474         int io = setting ? strtol(setting->value, NULL, 16) : 0;
     472        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IRQ, 0);
     473        int irq = setting ? strtol((char *) setting->value, NULL, 10) : 0;
     474       
     475        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0);
     476        int io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
    475477       
    476478        rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io);
     
    481483        services_t internet_service;
    482484        if (netif->nil) {
    483                 setting = measured_strings_find(&netif->configuration, CONF_MTU, 0);
     485                setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_MTU, 0);
    484486                if (!setting)
    485487                        setting = measured_strings_find(&net_globals.configuration,
    486                             CONF_MTU, 0);
    487                
    488                 int mtu = setting ? strtol(setting->value, NULL, 10) : 0;
     488                            (uint8_t *) CONF_MTU, 0);
     489               
     490                int mtu = setting ? strtol((char *) setting->value, NULL, 10) : 0;
    489491               
    490492                rc = nil_device_req(netif->nil->phone, netif->id, mtu,
     
    558560                /* Mandatory name */
    559561                measured_string_t *setting =
    560                     measured_strings_find(&netif->configuration, CONF_NAME, 0);
     562                    measured_strings_find(&netif->configuration, (uint8_t *) CONF_NAME, 0);
    561563                if (!setting) {
    562564                        fprintf(stderr, "%s: Network interface name is missing\n", NAME);
     
    602604                printf("%s: Network interface started (name: %s, id: %d, driver: %s, "
    603605                    "nil: %s, il: %s)\n", NAME, netif->name, netif->id,
    604                     netif->driver->name,  netif->nil ? netif->nil->name : "[none]",
     606                    netif->driver->name, netif->nil ? (char *) netif->nil->name : "[none]",
    605607                    netif->il->name);
    606608        }
     
    628630{
    629631        measured_string_t *strings;
    630         char *data;
     632        uint8_t *data;
    631633        int rc;
    632634       
  • uspace/srv/net/net/net.h

    r7c34b28f r61bfc370  
    105105        module_t *driver;
    106106       
    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. */
     107        device_id_t id;  /**< System-unique network interface identifier. */
     108        module_t *il;    /**< Serving internet layer module index. */
     109        uint8_t *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_t *, const char *, const char *);
     135extern int add_configuration(measured_strings_t *, const uint8_t *,
     136    const uint8_t *);
    136137extern int net_module_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, int *);
    137138extern int net_initialize_build(async_client_conn_t);
  • uspace/srv/net/net/net_standalone.c

    r7c34b28f r61bfc370  
    6363        int rc;
    6464       
    65         task_id_t task_id = spawn("/srv/ip");
     65        task_id_t task_id = net_spawn((uint8_t *) "/srv/ip");
    6666        if (!task_id)
    6767                return EINVAL;
    6868       
    69         rc = add_module(NULL, &net_globals.modules, IP_NAME,
    70             IP_FILENAME, SERVICE_IP, task_id, ip_connect_module);
     69        rc = add_module(NULL, &net_globals.modules, (uint8_t *) IP_NAME,
     70            (uint8_t *) IP_FILENAME, SERVICE_IP, task_id, ip_connect_module);
    7171        if (rc != EOK)
    7272                return rc;
    7373       
    74         if (!spawn("/srv/icmp"))
     74        if (!net_spawn((uint8_t *) "/srv/icmp"))
    7575                return EINVAL;
    7676       
    77         if (!spawn("/srv/udp"))
     77        if (!net_spawn((uint8_t *) "/srv/udp"))
    7878                return EINVAL;
    7979       
    80         if (!spawn("/srv/tcp"))
     80        if (!net_spawn((uint8_t *) "/srv/tcp"))
    8181                return EINVAL;
    8282       
  • uspace/srv/net/netif/lo/lo.c

    r7c34b28f r61bfc370  
    5353
    5454/** Default hardware address. */
    55 #define DEFAULT_ADDR            "\0\0\0\0\0\0"
     55#define DEFAULT_ADDR  0
    5656
    5757/** Default address length. */
    58 #define DEFAULT_ADDR_LEN        (sizeof(DEFAULT_ADDR) / sizeof(char))
     58#define DEFAULT_ADDR_LEN  6
    5959
    6060/** Loopback module name. */
     
    6262
    6363/** Network interface global data. */
    64 netif_globals_t netif_globals;
     64netif_globals_t netif_globals;
    6565
    6666int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
     
    7474        if (!address)
    7575                return EBADMEM;
    76 
    77         address->value = str_dup(DEFAULT_ADDR);
     76       
     77        uint8_t *addr = (uint8_t *) malloc(DEFAULT_ADDR_LEN);
     78        memset(addr, DEFAULT_ADDR, DEFAULT_ADDR_LEN);
     79       
     80        address->value = addr;
    7881        address->length = DEFAULT_ADDR_LEN;
    79 
     82       
    8083        return EOK;
    8184}
  • uspace/srv/net/nil/eth/eth.c

    r7c34b28f r61bfc370  
    201201
    202202        eth_globals.broadcast_addr =
    203             measured_string_create_bulk("\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR);
     203            measured_string_create_bulk((uint8_t *) "\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR);
    204204        if (!eth_globals.broadcast_addr) {
    205205                rc = ENOMEM;
     
    284284        measured_string_t names[2] = {
    285285                {
    286                         (char *) "ETH_MODE",
     286                        (uint8_t *) "ETH_MODE",
    287287                        8
    288288                },
    289289                {
    290                         (char *) "ETH_DUMMY",
     290                        (uint8_t *) "ETH_DUMMY",
    291291                        9
    292292                }
     
    294294        measured_string_t *configuration;
    295295        size_t count = sizeof(names) / sizeof(measured_string_t);
    296         char *data;
     296        uint8_t *data;
    297297        eth_proto_t *proto;
    298298        int rc;
     
    358358
    359359        if (configuration) {
    360                 if (!str_lcmp(configuration[0].value, "DIX",
     360                if (!str_lcmp((char *) configuration[0].value, "DIX",
    361361                    configuration[0].length)) {
    362362                        device->flags |= ETH_DIX;
    363                 } else if(!str_lcmp(configuration[0].value, "8023_2_LSAP",
     363                } else if(!str_lcmp((char *) configuration[0].value, "8023_2_LSAP",
    364364                    configuration[0].length)) {
    365365                        device->flags |= ETH_8023_2_LSAP;
  • uspace/srv/net/tl/icmp/icmp.c

    r7c34b28f r61bfc370  
    405405        measured_string_t names[] = {
    406406                {
    407                         (char *) "ICMP_ERROR_REPORTING",
     407                        (uint8_t *) "ICMP_ERROR_REPORTING",
    408408                        20
    409409                },
    410410                {
    411                         (char *) "ICMP_ECHO_REPLYING",
     411                        (uint8_t *) "ICMP_ECHO_REPLYING",
    412412                        18
    413413                }
     
    415415        measured_string_t *configuration;
    416416        size_t count = sizeof(names) / sizeof(measured_string_t);
    417         char *data;
     417        uint8_t *data;
    418418        int rc;
    419419
  • uspace/srv/net/tl/tcp/tcp.c

    r7c34b28f r61bfc370  
    154154
    155155        /** Port map key. */
    156         char *key;
     156        uint8_t *key;
    157157
    158158        /** Port map key length. */
     
    358358        /* Find the destination socket */
    359359        socket = socket_port_find(&tcp_globals.sockets,
    360             ntohs(header->destination_port), (const char *) src, addrlen);
     360            ntohs(header->destination_port), (uint8_t *) src, addrlen);
    361361        if (!socket) {
    362362                /* Find the listening destination socket */
    363363                socket = socket_port_find(&tcp_globals.sockets,
    364                     ntohs(header->destination_port), SOCKET_MAP_KEY_LISTENING,
    365                     0);
     364                    ntohs(header->destination_port),
     365                    (uint8_t *) SOCKET_MAP_KEY_LISTENING, 0);
    366366        }
    367367
     
    998998        /* Find the destination socket */
    999999        listening_socket = socket_port_find(&tcp_globals.sockets,
    1000             listening_port, SOCKET_MAP_KEY_LISTENING, 0);
     1000            listening_port, (uint8_t *) SOCKET_MAP_KEY_LISTENING, 0);
    10011001        if (!listening_socket ||
    10021002            (listening_socket->socket_id != listening_socket_id)) {
     
    10221022
    10231023        rc = socket_port_add(&tcp_globals.sockets, listening_port, socket,
    1024             (const char *) socket_data->addr, socket_data->addrlen);
     1024            (uint8_t *) socket_data->addr, socket_data->addrlen);
    10251025        assert(socket == socket_port_find(&tcp_globals.sockets, listening_port,
    1026             (const char *) socket_data->addr, socket_data->addrlen));
     1026            (uint8_t *) socket_data->addr, socket_data->addrlen));
    10271027
    10281028//      rc = socket_bind_free_port(&tcp_globals.sockets, socket,
     
    21092109
    21102110        /* Copy the key */
    2111         operation_timeout->key = ((char *) operation_timeout) +
     2111        operation_timeout->key = ((uint8_t *) operation_timeout) +
    21122112            sizeof(*operation_timeout);
    21132113        operation_timeout->key_length = socket->key_length;
  • uspace/srv/net/tl/udp/udp.c

    r7c34b28f r61bfc370  
    104104        measured_string_t names[] = {
    105105                {
    106                         (char *) "UDP_CHECKSUM_COMPUTING",
     106                        (uint8_t *) "UDP_CHECKSUM_COMPUTING",
    107107                        22
    108108                },
    109109                {
    110                         (char *) "UDP_AUTOBINDING",
     110                        (uint8_t *) "UDP_AUTOBINDING",
    111111                        15
    112112                }
     
    114114        measured_string_t *configuration;
    115115        size_t count = sizeof(names) / sizeof(measured_string_t);
    116         char *data;
     116        uint8_t *data;
    117117        int rc;
    118118
     
    283283        /* Find the destination socket */
    284284        socket = socket_port_find(&udp_globals.sockets,
    285         ntohs(header->destination_port), SOCKET_MAP_KEY_LISTENING, 0);
     285            ntohs(header->destination_port), (uint8_t *) SOCKET_MAP_KEY_LISTENING, 0);
    286286        if (!socket) {
    287287                if (tl_prepare_icmp_packet(udp_globals.net_phone,
Note: See TracChangeset for help on using the changeset viewer.