Changeset 89c57b6 in mainline for uspace/lib/c/include/ipc/ip.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/ip.h

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup ip
    30  *  @{
     29/** @addtogroup libc
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  IP module messages.
    35  *  @see ip_interface.h
     34 * IP module messages.
     35 * @see ip_interface.h
    3636 */
    3737
    38 #ifndef __NET_IP_MESSAGES_H__
    39 #define __NET_IP_MESSAGES_H__
     38#ifndef LIBC_IP_MESSAGES_H_
     39#define LIBC_IP_MESSAGES_H_
    4040
    41 #include <ipc/ipc.h>
     41#include <ipc/net.h>
     42#include <net/in.h>
     43#include <net/ip_codes.h>
    4244
    43 #include <in.h>
    44 #include <ip_codes.h>
    45 
    46 /** IP module messages.
    47  */
    48 typedef enum{
     45/** IP module messages. */
     46typedef enum {
     47        /** New device message.
     48         * @see ip_device_req()
     49         */
     50        NET_IP_DEVICE = NET_IP_FIRST,
     51       
    4952        /** Adds the routing entry.
    50          *  @see ip_add_route()
     53         * @see ip_add_route()
    5154         */
    52         NET_IP_ADD_ROUTE = NET_IP_FIRST,
     55        NET_IP_ADD_ROUTE,
     56       
    5357        /** Gets the actual route information.
    54          *  @see ip_get_route()
     58         * @see ip_get_route()
    5559         */
    5660        NET_IP_GET_ROUTE,
     61       
    5762        /** Processes the received error notification.
    58          *  @see ip_received_error_msg()
     63         * @see ip_received_error_msg()
    5964         */
    6065        NET_IP_RECEIVED_ERROR,
     66       
    6167        /** Sets the default gateway.
    62          *  @see ip_set_default_gateway()
     68         * @see ip_set_default_gateway()
    6369         */
    64         NET_IP_SET_GATEWAY
     70        NET_IP_SET_GATEWAY,
     71       
     72        /** Packet size message.
     73         * @see ip_packet_size_req()
     74         */
     75        NET_IP_PACKET_SPACE,
     76       
     77        /** Packet send message.
     78         * @see ip_send_msg()
     79         */
     80        NET_IP_SEND
    6581} ip_messages;
    6682
    67 /** @name IP specific message parameters definitions
    68  */
     83/** @name IP specific message parameters definitions */
    6984/*@{*/
    7085
    71 /** Returns the address message parameter.
    72  *  @param[in] call The message call structure.
     86/** Return the address message parameter.
     87 *
     88 * @param[in] call Message call structure.
     89 *
    7390 */
    7491#define IP_GET_ADDRESS(call) \
    75         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
     92        ({ \
     93                in_addr_t addr; \
     94                addr.s_addr = IPC_GET_ARG3(call); \
     95                addr; \
     96        })
    7697
    77 /** Returns the gateway message parameter.
    78  *  @param[in] call The message call structure.
     98/** Return the gateway message parameter.
     99 *
     100 * @param[in] call Message call structure.
     101 *
    79102 */
    80103#define IP_GET_GATEWAY(call) \
    81         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;})
     104        ({ \
     105                in_addr_t addr; \
     106                addr.s_addr = IPC_GET_ARG2(call); \
     107                addr; \
     108        })
    82109
    83 /** Sets the header length in the message answer.
    84  *  @param[out] answer The message answer structure.
     110/** Set the header length in the message answer.
     111 *
     112 * @param[out] answer Message answer structure.
     113 *
    85114 */
    86 #define IP_SET_HEADERLEN(answer, value) \
    87         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);}
     115#define IP_SET_HEADERLEN(answer, value)  IPC_SET_ARG2(answer, (sysarg_t) (value))
    88116
    89 /** Returns the network mask message parameter.
    90  *  @param[in] call The message call structure.
     117/** Return the network mask message parameter.
     118 *
     119 * @param[in] call Message call structure.
     120 *
    91121 */
    92122#define IP_GET_NETMASK(call) \
    93         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;})
     123        ({ \
     124                in_addr_t addr; \
     125                addr.s_addr = IPC_GET_ARG4(call); \
     126                addr; \
     127        })
    94128
    95 /** Returns the protocol message parameter.
    96  *  @param[in] call The message call structure.
     129/** Return the protocol message parameter.
     130 *
     131 * @param[in] call Message call structure.
     132 *
    97133 */
    98 #define IP_GET_PROTOCOL(call) \
    99         ({ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); protocol;})
     134#define IP_GET_PROTOCOL(call)  ((ip_protocol_t) IPC_GET_ARG1(call))
    100135
    101136/*@}*/
Note: See TracChangeset for help on using the changeset viewer.