Changes in / [40e29f5:63f8966] in mainline


Ignore:
Location:
uspace/srv/net
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/arp/arp_messages.h

    r40e29f5 r63f8966  
    7575 *  @param[in] call The message call structure.
    7676 */
    77 #define ARP_GET_NETIF(call) \
    78         ({services_t service = (services_t) IPC_GET_ARG2(*call); service;})
     77#define ARP_GET_NETIF(call)             (services_t) IPC_GET_ARG2(*call)
    7978
    8079/*@}*/
  • uspace/srv/net/il/ip/ip.c

    r40e29f5 r63f8966  
    893893        struct sockaddr * addr;
    894894        size_t addrlen;
    895         size_t prefix;
    896         size_t suffix;
    897         size_t content;
    898895        ip_pseudo_header_ref header;
    899896        size_t headerlen;
     
    927924                        ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen,
    928925                            &device_id, &header, &headerlen));
    929                         IPC_SET_DEVICE(answer, device_id);
    930                         IP_SET_HEADERLEN(answer, headerlen);
     926                        *IPC_SET_DEVICE(answer) = device_id;
     927                        *IP_SET_HEADERLEN(answer) = headerlen;
    931928                        *answer_count = 2;
    932929                        if(! ERROR_OCCURRED(data_reply(&headerlen, sizeof(headerlen)))){
     
    936933                        return ERROR_CODE;
    937934                case NET_IL_PACKET_SPACE:
    938                         ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call), &addrlen, &prefix, &content, &suffix));
    939                         IPC_SET_ADDR(answer, addrlen);
    940                         IPC_SET_PREFIX(answer, prefix);
    941                         IPC_SET_CONTENT(answer, content);
    942                         IPC_SET_SUFFIX(answer, suffix);
    943                         *answer_count = 4;
     935                        ERROR_PROPAGATE(ip_packet_size_message(IPC_GET_DEVICE(call), IPC_SET_ADDR(answer), IPC_SET_PREFIX(answer), IPC_SET_CONTENT(answer), IPC_SET_SUFFIX(answer)));
     936                        *answer_count = 3;
    944937                        return EOK;
    945938                case NET_IL_MTU_CHANGED:
  • uspace/srv/net/il/ip/ip_messages.h

    r40e29f5 r63f8966  
    7272 *  @param[in] call The message call structure.
    7373 */
    74 #define IP_GET_ADDRESS(call) \
    75         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
     74#define IP_GET_ADDRESS(call)            ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
    7675
    7776/** Returns the gateway message parameter.
    7877 *  @param[in] call The message call structure.
    7978 */
    80 #define IP_GET_GATEWAY(call) \
    81         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;})
     79#define IP_GET_GATEWAY(call)            ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;})
    8280
    8381/** Sets the header length in the message answer.
    8482 *  @param[out] answer The message answer structure.
    8583 */
    86 #define IP_SET_HEADERLEN(answer, value) \
    87         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);}
     84#define IP_SET_HEADERLEN(answer)        (&IPC_GET_ARG2(*answer))
    8885
    8986/** Returns the network mask message parameter.
    9087 *  @param[in] call The message call structure.
    9188 */
    92 #define IP_GET_NETMASK(call) \
    93         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;})
     89#define IP_GET_NETMASK(call)            ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;})
    9490
    9591/** Returns the protocol message parameter.
    9692 *  @param[in] call The message call structure.
    9793 */
    98 #define IP_GET_PROTOCOL(call) \
    99         ({ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); protocol;})
     94#define IP_GET_PROTOCOL(call)           ((ip_protocol_t) IPC_GET_ARG1(*call))
    10095
    10196/*@}*/
  • uspace/srv/net/messages.h

    r40e29f5 r63f8966  
    236236 *  @param[in] call The IPC call to be checked.
    237237 */
    238 #define IS_NET_MESSAGE(call) \
    239         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
     238#define IS_NET_MESSAGE(call)                    IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
    240239
    241240/** Returns a value indicating whether the IPC call is an ARP message.
    242241 *  @param[in] call The IPC call to be checked.
    243242 */
    244 #define IS_NET_ARP_MESSAGE(call) \
    245         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
     243#define IS_NET_ARP_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
    246244
    247245/** Returns a value indicating whether the IPC call is an Ethernet message.
    248246 *  @param[in] call The IPC call to be checked.
    249247 */
    250 #define IS_NET_ETH_MESSAGE(call) \
    251         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
     248#define IS_NET_ETH_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
    252249
    253250/** Returns a value indicating whether the IPC call is an ICMP message.
    254251 *  @param[in] call The IPC call to be checked.
    255252 */
    256 #define IS_NET_ICMP_MESSAGE(call) \
    257         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
     253#define IS_NET_ICMP_MESSAGE(call)               IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
    258254
    259255/** Returns a value indicating whether the IPC call is an inter-network layer message.
    260256 *  @param[in] call The IPC call to be checked.
    261257 */
    262 #define IS_NET_IL_MESSAGE(call) \
    263         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
     258#define IS_NET_IL_MESSAGE(call)         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
    264259
    265260/** Returns a value indicating whether the IPC call is an IP message.
    266261 *  @param[in] call The IPC call to be checked.
    267262 */
    268 #define IS_NET_IP_MESSAGE(call) \
    269         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
     263#define IS_NET_IP_MESSAGE(call)         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
    270264
    271265/** Returns a value indicating whether the IPC call is a generic networking message.
    272266 *  @param[in] call The IPC call to be checked.
    273267 */
    274 #define IS_NET_NET_MESSAGE(call) \
    275         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST)
     268#define IS_NET_NET_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST)
    276269
    277270/** Returns a value indicating whether the IPC call is a network interface layer message.
    278271 *  @param[in] call The IPC call to be checked.
    279272 */
    280 #define IS_NET_NIL_MESSAGE(call) \
    281         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
     273#define IS_NET_NIL_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
    282274
    283275/** Returns a value indicating whether the IPC call is a packet manaagement system message.
    284276 *  @param[in] call The IPC call to be checked.
    285277 */
    286 #define IS_NET_PACKET_MESSAGE(call) \
    287         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
     278#define IS_NET_PACKET_MESSAGE(call)     IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
    288279
    289280/** Returns a value indicating whether the IPC call is a socket message.
    290281 *  @param[in] call The IPC call to be checked.
    291282 */
    292 #define IS_NET_SOCKET_MESSAGE(call) \
    293         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
     283#define IS_NET_SOCKET_MESSAGE(call)     IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
    294284
    295285/** Returns a value indicating whether the IPC call is a TCP message.
    296286 *  @param[in] call The IPC call to be checked.
    297287 */
    298 #define IS_NET_TCP_MESSAGE(call) \
    299         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
     288#define IS_NET_TCP_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
    300289
    301290/** Returns a value indicating whether the IPC call is a transport layer message.
    302291 *  @param[in] call The IPC call to be checked.
    303292 */
    304 #define IS_NET_TL_MESSAGE(call) \
    305         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST)
     293#define IS_NET_TL_MESSAGE(call)         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST)
    306294
    307295/** Returns a value indicating whether the IPC call is a UDP message.
    308296 *  @param[in] call The IPC call to be checked.
    309297 */
    310 #define IS_NET_UDP_MESSAGE(call) \
    311         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
     298#define IS_NET_UDP_MESSAGE(call)                IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
    312299
    313300/*@}*/
     
    324311 *  @param[in] call The message call structure.
    325312 */
    326 #define IPC_GET_DEVICE(call) \
    327         ({device_id_t device_id = (device_id_t) IPC_GET_ARG1(*call); device_id;})
    328 
    329 /*@;})*/
     313#define IPC_GET_DEVICE(call)            (device_id_t) IPC_GET_ARG1(*call)
     314
     315/*@}*/
    330316
    331317/** @name Second arguments
    332318 */
    333 /*@({*/
     319/*@{*/
    334320
    335321/** Returns the packet identifier message argument.
    336322 *  @param[in] call The message call structure.
    337323 */
    338 #define IPC_GET_PACKET(call) \
    339         ({packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); packet_id;})
     324#define IPC_GET_PACKET(call)            (packet_id_t) IPC_GET_ARG2(*call)
    340325
    341326/** Returns the count message argument.
    342327 *  @param[in] call The message call structure.
    343328 */
    344 #define IPC_GET_COUNT(call) \
    345         ({size_t size = (size_t) IPC_GET_ARG2(*call); size;})
     329#define IPC_GET_COUNT(call)             (size_t) IPC_GET_ARG2(*call)
    346330
    347331/** Returns the device state message argument.
    348332 *  @param[in] call The message call structure.
    349333 */
    350 #define IPC_GET_STATE(call) \
    351         ({device_state_t device_state = (device_state_t) IPC_GET_ARG2(*call); device_state;})
     334#define IPC_GET_STATE(call)             (device_state_t) IPC_GET_ARG2(*call)
    352335
    353336/** Returns the maximum transmission unit message argument.
    354337 *  @param[in] call The message call structure.
    355338 */
    356 #define IPC_GET_MTU(call) \
    357         ({size_t size = (size_t) IPC_GET_ARG2(*call); size;})
    358 
    359 /*@;})*/
     339#define IPC_GET_MTU(call)                       (size_t) IPC_GET_ARG2(*call)
     340
     341/*@}*/
    360342
    361343/** @name Third arguments
    362344 */
    363 /*@({*/
     345/*@{*/
    364346
    365347/** Returns the device driver service message argument.
    366348 *  @param[in] call The message call structure.
    367349 */
    368  #define IPC_GET_SERVICE(call) \
    369         ({services_t service = (services_t) IPC_GET_ARG3(*call); service;})
     350#define IPC_GET_SERVICE(call)           (services_t) IPC_GET_ARG3(*call)
    370351
    371352/** Returns the target service message argument.
    372353 *  @param[in] call The message call structure.
    373354 */
    374 #define IPC_GET_TARGET(call) \
    375         ({services_t service = (services_t) IPC_GET_ARG3(*call); service;})
     355#define IPC_GET_TARGET(call)            (services_t) IPC_GET_ARG3(*call)
    376356
    377357/** Returns the sender service message argument.
    378358 *  @param[in] call The message call structure.
    379359 */
    380 #define IPC_GET_SENDER(call) \
    381         ({services_t service = (services_t) IPC_GET_ARG3(*call); service;})
    382 
    383 /*@;})*/
     360#define IPC_GET_SENDER(call)            (services_t) IPC_GET_ARG3(*call)
     361
     362/*@}*/
    384363
    385364/** @name Fourth arguments
    386365 */
    387 /*@({*/
     366/*@{*/
    388367
    389368/** Returns the error service message argument.
    390369 *  @param[in] call The message call structure.
    391370 */
    392 #define IPC_GET_ERROR(call) \
    393         ({services_t service = (services_t) IPC_GET_ARG4(*call); service;})
    394 
    395 /*@;})*/
     371#define IPC_GET_ERROR(call)             (services_t) IPC_GET_ARG4(*call)
     372
     373/*@}*/
    396374
    397375/** @name Fifth arguments
    398376 */
    399 /*@({*/
     377/*@{*/
    400378
    401379/** Returns the phone message argument.
    402380 *  @param[in] call The message call structure.
    403381 */
    404 #define IPC_GET_PHONE(call) \
    405         ({int phone = (int) IPC_GET_ARG5(*call); phone;})
     382#define IPC_GET_PHONE(call)             (int) IPC_GET_ARG5(*call)
    406383
    407384/*@}*/
     
    414391 *  @param[out] answer The message answer structure.
    415392 */
    416 #define IPC_SET_DEVICE(answer, value) \
    417         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(*answer, argument);}
     393#define IPC_SET_DEVICE(answer)  (&IPC_GET_ARG1(*answer))
    418394
    419395/** Sets the minimum address length in the message answer.
    420396 *  @param[out] answer The message answer structure.
    421397 */
    422 #define IPC_SET_ADDR(answer, value) \
    423         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(*answer, argument);}
     398#define IPC_SET_ADDR(answer)            (&IPC_GET_ARG1(*answer))
    424399
    425400/*@}*/
     
    432407 *  @param[out] answer The message answer structure.
    433408 */
    434 #define IPC_SET_PREFIX(answer, value) \
    435         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);}
     409#define IPC_SET_PREFIX(answer)  (&IPC_GET_ARG2(*answer))
    436410
    437411/*@}*/
     
    444418 *  @param[out] answer The message answer structure.
    445419 */
    446 #define IPC_SET_CONTENT(answer, value) \
    447         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(*answer, argument);}
     420#define IPC_SET_CONTENT(answer) (&IPC_GET_ARG3(*answer))
    448421
    449422/*@}*/
     
    456429 *  @param[out] answer The message answer structure.
    457430 */
    458 #define IPC_SET_SUFFIX(answer, value) \
    459         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG4(*answer, argument);}
     431#define IPC_SET_SUFFIX(answer)  (&IPC_GET_ARG4(*answer))
    460432
    461433/*@}*/
  • uspace/srv/net/netif/netif_messages.h

    r40e29f5 r63f8966  
    7979 *  @param[in] call The message call structure.
    8080 */
    81 #define NETIF_GET_IRQ(call) \
    82         ({int irq = (int) IPC_GET_ARG2(*call); irq;})
     81#define NETIF_GET_IRQ(call)             (int)   IPC_GET_ARG2(*call)
    8382
    8483/** Returns the input/output address message parameter.
    8584 *  @param[in] call The message call structure.
    8685 */
    87 #define NETIF_GET_IO(call) \
    88         ({int io = (int) IPC_GET_ARG3(*call); io;})
     86#define NETIF_GET_IO(call)              (int)   IPC_GET_ARG3(*call)
    8987
    9088/*@}*/
  • uspace/srv/net/nil/eth/eth.c

    r40e29f5 r63f8966  
    709709        measured_string_ref address;
    710710        packet_t packet;
    711         size_t addrlen;
    712         size_t prefix;
    713         size_t suffix;
    714         size_t content;
    715711
    716712//      printf("message %d - %d\n", IPC_GET_METHOD(*call), NET_NIL_FIRST);
     
    725721                        return eth_send_message(IPC_GET_DEVICE(call), packet, IPC_GET_SERVICE(call));
    726722                case NET_NIL_PACKET_SPACE:
    727                         ERROR_PROPAGATE(eth_packet_space_message(IPC_GET_DEVICE(call), &addrlen, &prefix, &content, &suffix));
    728                         IPC_SET_ADDR(answer, addrlen);
    729                         IPC_SET_PREFIX(answer, prefix);
    730                         IPC_SET_CONTENT(answer, content);
    731                         IPC_SET_SUFFIX(answer, suffix);
     723                        ERROR_PROPAGATE(eth_packet_space_message(IPC_GET_DEVICE(call), IPC_SET_ADDR(answer), IPC_SET_PREFIX(answer), IPC_SET_CONTENT(answer), IPC_SET_SUFFIX(answer)));
    732724                        *answer_count = 4;
    733725                        return EOK;
  • uspace/srv/net/nil/nil_messages.h

    r40e29f5 r63f8966  
    8282/** Returns the protocol service message parameter.
    8383 */
    84 #define NIL_GET_PROTO(call) \
    85         ({services_t service = (services_t) IPC_GET_ARG2(*call); service;})
     84#define NIL_GET_PROTO(call)             (services_t) IPC_GET_ARG2(*call)
    8685
    8786/*@}*/
  • uspace/srv/net/nil/nildummy/nildummy.c

    r40e29f5 r63f8966  
    316316        measured_string_ref address;
    317317        packet_t packet;
    318         size_t addrlen;
    319         size_t prefix;
    320         size_t suffix;
    321         size_t content;
    322318
    323319//      printf("message %d - %d\n", IPC_GET_METHOD(*call), NET_NIL_FIRST);
     
    332328                        return nildummy_send_message(IPC_GET_DEVICE(call), packet, IPC_GET_SERVICE(call));
    333329                case NET_NIL_PACKET_SPACE:
    334                         ERROR_PROPAGATE(nildummy_packet_space_message(IPC_GET_DEVICE(call), &addrlen, &prefix, &content, &suffix));
    335                         IPC_SET_ADDR(answer, addrlen);
    336                         IPC_SET_PREFIX(answer, prefix);
    337                         IPC_SET_CONTENT(answer, content);
    338                         IPC_SET_SUFFIX(answer, suffix);
     330                        ERROR_PROPAGATE(nildummy_packet_space_message(IPC_GET_DEVICE(call), IPC_SET_ADDR(answer), IPC_SET_PREFIX(answer), IPC_SET_CONTENT(answer), IPC_SET_SUFFIX(answer)));
    339331                        *answer_count = 4;
    340332                        return EOK;
  • uspace/srv/net/socket/socket_client.c

    r40e29f5 r63f8966  
    421421        int socket_id;
    422422        services_t service;
    423         ipcarg_t fragment_size;
    424         ipcarg_t header_size;
    425423
    426424        // find the appropriate service
     
    480478                return socket_id;
    481479        }
    482         if(ERROR_OCCURRED((int) async_req_3_3(phone, NET_SOCKET, socket_id, 0, service, NULL, &fragment_size, &header_size))){
     480        if(ERROR_OCCURRED((int) async_req_3_3(phone, NET_SOCKET, socket_id, 0, service, NULL, (ipcarg_t *) &socket->data_fragment_size, (ipcarg_t *) &socket->header_size))){
    483481                fibril_rwlock_write_unlock(&socket_globals.lock);
    484482                free(socket);
    485483                return ERROR_CODE;
    486484        }
    487         socket->data_fragment_size = (size_t) fragment_size;
    488         socket->header_size = (size_t) header_size;
    489485        // finish the new socket initialization
    490486        socket_initialize(socket, socket_id, phone, service);
  • uspace/srv/net/socket/socket_messages.h

    r40e29f5 r63f8966  
    115115 *  @param[out] answer The message answer structure.
    116116 */
    117 #define SOCKET_SET_SOCKET_ID(answer, value) \
    118         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);}
     117#define SOCKET_SET_SOCKET_ID(answer)            &IPC_GET_ARG1(answer)
    119118
    120119/** Returns the socket identifier message parameter.
    121120 *  @param[in] call The message call structure.
    122121 */
    123 #define SOCKET_GET_SOCKET_ID(call) \
    124         ({int socket_id = (int) IPC_GET_ARG1(call); socket_id;})
     122#define SOCKET_GET_SOCKET_ID(call)              (int) IPC_GET_ARG1(call)
    125123
    126124/** Sets the read data length in the message answer.
    127125 *  @param[out] answer The message answer structure.
    128126 */
    129 #define SOCKET_SET_READ_DATA_LENGTH(answer, value) \
    130         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);}
     127#define SOCKET_SET_READ_DATA_LENGTH(answer)     &IPC_GET_ARG1(answer)
    131128
    132129/** Returns the read data length message parameter.
    133130 *  @param[in] call The message call structure.
    134131 */
    135 #define SOCKET_GET_READ_DATA_LENGTH(call) \
    136         ({int data_length = (int) IPC_GET_ARG1(call); data_length;})
     132#define SOCKET_GET_READ_DATA_LENGTH(call)       (int) IPC_GET_ARG1(call)
    137133
    138134/** Returns the backlog message parameter.
    139135 *  @param[in] call The message call structure.
    140136 */
    141 #define SOCKET_GET_BACKLOG(call) \
    142         ({int backlog = (int) IPC_GET_ARG2(call); backlog;})
     137#define SOCKET_GET_BACKLOG(call)                (int) IPC_GET_ARG2(call)
    143138
    144139/** Returns the option level message parameter.
    145140 *  @param[in] call The message call structure.
    146141 */
    147 #define SOCKET_GET_OPT_LEVEL(call) \
    148         ({int opt_level = (int) IPC_GET_ARG2(call); opt_level;})
     142#define SOCKET_GET_OPT_LEVEL(call)              (int) IPC_GET_ARG2(call)
    149143
    150144/** Returns the data fragment size message parameter.
    151145 *  @param[in] call The message call structure.
    152146 */
    153 #define SOCKET_GET_DATA_FRAGMENT_SIZE(call) \
    154         ({size_t size = (size_t) IPC_GET_ARG2(call); size;})
     147#define SOCKET_GET_DATA_FRAGMENT_SIZE(call)     (size_t) IPC_GET_ARG2(call)
    155148
    156149/** Sets the data fragment size in the message answer.
    157150 *  @param[out] answer The message answer structure.
    158151 */
    159 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) \
    160         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(answer, argument);}
     152#define SOCKET_SET_DATA_FRAGMENT_SIZE(answer)   &IPC_GET_ARG2(answer)
    161153
    162154/** Sets the address length in the message answer.
    163155 *  @param[out] answer The message answer structure.
    164156 */
    165 #define SOCKET_SET_ADDRESS_LENGTH(answer, value) \
    166         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);}
     157#define SOCKET_SET_ADDRESS_LENGTH(answer)       &IPC_GET_ARG3(answer)
    167158
    168159/** Returns the address length message parameter.
    169160 *  @param[in] call The message call structure.
    170161 */
    171 #define SOCKET_GET_ADDRESS_LENGTH(call) \
    172         ({socklen_t address_length = (socklen_t) IPC_GET_ARG3(call); address_length;})
     162#define SOCKET_GET_ADDRESS_LENGTH(call)         (socklen_t) IPC_GET_ARG3(call)
    173163
    174164/** Sets the header size in the message answer.
    175165 *  @param[out] answer The message answer structure.
    176166 */
    177 #define SOCKET_SET_HEADER_SIZE(answer, value) \
    178         \
    179         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);}
     167#define SOCKET_SET_HEADER_SIZE(answer)          &IPC_GET_ARG3(answer)
    180168
    181169/** Returns the header size message parameter.
    182170 *  @param[in] call The message call structure.
    183171 */
    184 #define SOCKET_GET_HEADER_SIZE(call) \
    185         ({size_t size = (size_t) IPC_GET_ARG3(call); size;})
     172#define SOCKET_GET_HEADER_SIZE(call)            (size_t) IPC_GET_ARG3(call)
    186173
    187174/** Returns the flags message parameter.
    188175 *  @param[in] call The message call structure.
    189176 */
    190 #define SOCKET_GET_FLAGS(call) \
    191         ({int flags = (int) IPC_GET_ARG4(call); flags;})
     177#define SOCKET_GET_FLAGS(call)                  (int) IPC_GET_ARG4(call)
    192178
    193179/** Returns the option name message parameter.
    194180 *  @param[in] call The message call structure.
    195181 */
    196 #define SOCKET_GET_OPT_NAME(call) \
    197         ({int opt_name = (int) IPC_GET_ARG4(call); opt_name;})
     182#define SOCKET_GET_OPT_NAME(call)               (int) IPC_GET_ARG4(call)
    198183
    199184/** Returns the data fragments message parameter.
    200185 *  @param[in] call The message call structure.
    201186 */
    202 #define SOCKET_GET_DATA_FRAGMENTS(call) \
    203         ({int fragments = (int) IPC_GET_ARG5(call); fragments;})
     187#define SOCKET_GET_DATA_FRAGMENTS(call)         (int) IPC_GET_ARG5(call)
    204188
    205189/** Returns the new socket identifier message parameter.
    206190 *  @param[in] call The message call structure.
    207191 */
    208 #define SOCKET_GET_NEW_SOCKET_ID(call) \
    209         ({int socket_id = (int) IPC_GET_ARG5(call); socket_id;})
     192#define SOCKET_GET_NEW_SOCKET_ID(call)          (int) IPC_GET_ARG5(call)
    210193
    211194/*@}*/
  • uspace/srv/net/structures/packet/packet_server.c

    r40e29f5 r63f8966  
    194194                        }
    195195                        *answer_count = 2;
    196                         IPC_SET_ARG1(*answer, (ipcarg_t) packet->packet_id);
    197                         IPC_SET_ARG2(*answer, (ipcarg_t) packet->length);
     196                        IPC_SET_ARG1(*answer, packet->packet_id);
     197                        IPC_SET_ARG2(*answer, packet->length);
    198198                        return EOK;
    199199                case NET_PACKET_CREATE_4:
     
    203203                        }
    204204                        *answer_count = 2;
    205                         IPC_SET_ARG1(*answer, (ipcarg_t) packet->packet_id);
    206                         IPC_SET_ARG2(*answer, (ipcarg_t) packet->length);
     205                        IPC_SET_ARG1(*answer, packet->packet_id);
     206                        IPC_SET_ARG2(*answer, packet->length);
    207207                        return EOK;
    208208                case NET_PACKET_GET:
     
    217217                                return ENOENT;
    218218                        }
    219                         IPC_SET_ARG1(*answer, (ipcarg_t) packet->length);
     219                        IPC_SET_ARG1(*answer, packet->length);
    220220                        *answer_count = 1;
    221221                        return EOK;
  • uspace/srv/net/tl/icmp/icmp_messages.h

    r40e29f5 r63f8966  
    8282 *  @param[in] call The message call structure.
    8383 */
    84 #define ICMP_GET_CODE(call) \
    85         ({icmp_code_t code = (icmp_code_t) IPC_GET_ARG1(*call); code;})
     84#define ICMP_GET_CODE(call)             (icmp_code_t) IPC_GET_ARG1(*call)
    8685
    8786/** Returns the ICMP link MTU message parameter.
    8887 *  @param[in] call The message call structure.
    8988 */
    90 #define ICMP_GET_MTU(call) \
    91         ({icmp_param_t mtu = (icmp_param_t) IPC_GET_ARG3(*call); mtu;})
     89#define ICMP_GET_MTU(call)              (icmp_param_t) IPC_GET_ARG3(*call)
    9290
    9391/** Returns the pointer message parameter.
    9492 *  @param[in] call The message call structure.
    9593 */
    96 #define ICMP_GET_POINTER(call) \
    97         ({icmp_param_t pointer = (icmp_param_t) IPC_GET_ARG3(*call); pointer;})
     94#define ICMP_GET_POINTER(call)          (icmp_param_t) IPC_GET_ARG3(*call)
    9895
    9996/** Returns the size message parameter.
    10097 *  @param[in] call The message call structure.
    10198 */
    102 #define ICMP_GET_SIZE(call) \
    103         ({size_t size = (size_t) IPC_GET_ARG1(call); size;})
     99#define ICMP_GET_SIZE(call)     (size_t) IPC_GET_ARG1(call)
    104100
    105101/** Returns the timeout message parameter.
    106102 *  @param[in] call The message call structure.
    107103 */
    108 #define ICMP_GET_TIMEOUT(call) \
    109         (({suseconds_t timeout = (suseconds_t) IPC_GET_ARG2(call); timeout;}))
     104#define ICMP_GET_TIMEOUT(call)  ((suseconds_t) IPC_GET_ARG2(call))
    110105
    111106/** Returns the time to live message parameter.
    112107 *  @param[in] call The message call structure.
    113108 */
    114 #define ICMP_GET_TTL(call) \
    115         ({ip_ttl_t ttl = (ip_ttl_t) IPC_GET_ARG3(call); ttl;})
     109#define ICMP_GET_TTL(call)      (ip_ttl_t) IPC_GET_ARG3(call)
    116110
    117111/** Returns the type of service message parameter.
    118112 *  @param[in] call The message call structure.
    119113 */
    120 #define ICMP_GET_TOS(call) \
    121         ({ip_tos_t tos = (ip_tos_t) IPC_GET_ARG4(call); tos;})
     114#define ICMP_GET_TOS(call)      (ip_tos_t) IPC_GET_ARG4(call)
    122115
    123116/** Returns the dont fragment message parameter.
    124117 *  @param[in] call The message call structure.
    125118 */
    126 #define ICMP_GET_DONT_FRAGMENT(call) \
    127         ({int dont_fragment = (int) IPC_GET_ARG5(call); dont_fragment;})
     119#define ICMP_GET_DONT_FRAGMENT(call)            (int) IPC_GET_ARG5(call)
    128120
    129121/*@}*/
  • uspace/srv/net/tl/tcp/tcp.c

    r40e29f5 r63f8966  
    10621062        int socket_id;
    10631063        size_t addrlen;
    1064         size_t size;
    10651064        fibril_rwlock_t lock;
    10661065        ipc_call_t answer;
     
    11081107                                        socket_id = SOCKET_GET_SOCKET_ID(call);
    11091108                                        res = socket_create(&local_sockets, app_phone, socket_data, &socket_id);
    1110                                         SOCKET_SET_SOCKET_ID(answer, socket_id);
     1109                                        *SOCKET_SET_SOCKET_ID(answer) = socket_id;
    11111110                                        fibril_rwlock_write_unlock(&lock);
    11121111                                        if(res == EOK){
    11131112                                                if(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
    1114                                                         SOCKET_SET_DATA_FRAGMENT_SIZE(answer, ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size));
     1113                                                        *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size);
    11151114                                                }
    1116 //                                              SOCKET_SET_DATA_FRAGMENT_SIZE(answer, MAX_TCP_FRAGMENT_SIZE);
    1117                                                 SOCKET_SET_HEADER_SIZE(answer, TCP_HEADER_SIZE);
     1115//                                              *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = MAX_TCP_FRAGMENT_SIZE;
     1116                                                *SOCKET_SET_HEADER_SIZE(answer) = TCP_HEADER_SIZE;
    11181117                                                answer_count = 3;
    11191118                                        }else{
     
    11671166                                fibril_rwlock_read_lock(&tcp_globals.lock);
    11681167                                fibril_rwlock_write_lock(&lock);
    1169                                 res = tcp_accept_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_NEW_SOCKET_ID(call), &size, &addrlen);
    1170                                 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
     1168                                res = tcp_accept_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_NEW_SOCKET_ID(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), &addrlen);
    11711169                                fibril_rwlock_write_unlock(&lock);
    11721170                                fibril_rwlock_read_unlock(&tcp_globals.lock);
    11731171                                if(res > 0){
    1174                                         SOCKET_SET_SOCKET_ID(answer, res);
    1175                                         SOCKET_SET_ADDRESS_LENGTH(answer, addrlen);
     1172                                        *SOCKET_SET_SOCKET_ID(answer) = res;
     1173                                        *SOCKET_SET_ADDRESS_LENGTH(answer) = addrlen;
    11761174                                        answer_count = 3;
    11771175                                }
     
    11801178                                fibril_rwlock_read_lock(&tcp_globals.lock);
    11811179                                fibril_rwlock_write_lock(&lock);
    1182                                 res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), &size, SOCKET_GET_FLAGS(call));
    1183                                 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
     1180                                res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), SOCKET_GET_FLAGS(call));
    11841181                                if(res != EOK){
    11851182                                        fibril_rwlock_write_unlock(&lock);
     
    11941191                                        fibril_rwlock_read_lock(&tcp_globals.lock);
    11951192                                        fibril_rwlock_write_lock(&lock);
    1196                                         res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), &size, SOCKET_GET_FLAGS(call));
    1197                                         SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
     1193                                        res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), SOCKET_GET_FLAGS(call));
    11981194                                        if(res != EOK){
    11991195                                                fibril_rwlock_write_unlock(&lock);
     
    12121208                                fibril_rwlock_read_unlock(&tcp_globals.lock);
    12131209                                if(res > 0){
    1214                                         SOCKET_SET_READ_DATA_LENGTH(answer, res);
     1210                                        *SOCKET_SET_READ_DATA_LENGTH(answer) = res;
    12151211                                        answer_count = 1;
    12161212                                        res = EOK;
     
    12241220                                fibril_rwlock_read_unlock(&tcp_globals.lock);
    12251221                                if(res > 0){
    1226                                         SOCKET_SET_READ_DATA_LENGTH(answer, res);
    1227                                         SOCKET_SET_ADDRESS_LENGTH(answer, addrlen);
     1222                                        *SOCKET_SET_READ_DATA_LENGTH(answer) = res;
     1223                                        *SOCKET_SET_ADDRESS_LENGTH(answer) = addrlen;
    12281224                                        answer_count = 3;
    12291225                                        res = EOK;
  • uspace/srv/net/tl/udp/udp.c

    r40e29f5 r63f8966  
    419419        int socket_id;
    420420        size_t addrlen;
    421         size_t size;
    422421        ipc_call_t answer;
    423422        int answer_count;
     
    455454                                socket_id = SOCKET_GET_SOCKET_ID(call);
    456455                                res = socket_create(&local_sockets, app_phone, NULL, &socket_id);
    457                                 SOCKET_SET_SOCKET_ID(answer, socket_id);
    458 
     456                                *SOCKET_SET_SOCKET_ID(answer) = socket_id;
     457                               
    459458                                if(res == EOK){
    460459                                        if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
    461                                                 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, packet_dimension->content);
     460                                                *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = packet_dimension->content;
    462461                                        }
    463 //                                      SOCKET_SET_DATA_FRAGMENT_SIZE(answer, MAX_UDP_FRAGMENT_SIZE);
    464                                         SOCKET_SET_HEADER_SIZE(answer, UDP_HEADER_SIZE);
     462//                                      *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = MAX_UDP_FRAGMENT_SIZE;
     463                                        *SOCKET_SET_HEADER_SIZE(answer) = UDP_HEADER_SIZE;
    465464                                        answer_count = 3;
    466465                                }
     
    479478                                if(res == EOK){
    480479                                        fibril_rwlock_write_lock(&udp_globals.lock);
    481                                         res = udp_sendto_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), addr, addrlen, SOCKET_GET_DATA_FRAGMENTS(call), &size, SOCKET_GET_FLAGS(call));
    482                                         SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size);
     480                                        res = udp_sendto_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), addr, addrlen, SOCKET_GET_DATA_FRAGMENTS(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), SOCKET_GET_FLAGS(call));
    483481                                        if(res != EOK){
    484482                                                fibril_rwlock_write_unlock(&udp_globals.lock);
     
    494492                                fibril_rwlock_write_unlock(&udp_globals.lock);
    495493                                if(res > 0){
    496                                         SOCKET_SET_READ_DATA_LENGTH(answer, res);
    497                                         SOCKET_SET_ADDRESS_LENGTH(answer, addrlen);
     494                                        *SOCKET_SET_READ_DATA_LENGTH(answer) = res;
     495                                        *SOCKET_SET_ADDRESS_LENGTH(answer) = addrlen;
    498496                                        answer_count = 3;
    499497                                        res = EOK;
Note: See TracChangeset for help on using the changeset viewer.