Changeset 779a47d in mainline


Ignore:
Timestamp:
2010-10-15T19:04:29Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a5d892f
Parents:
522253c1
Message:

Move IP module messages definitions to standard library.

Location:
uspace
Files:
2 edited
1 moved

Legend:

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

    r522253c1 r779a47d  
    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
    4141#include <ipc/ipc.h>
     
    4545#include <net/ip_codes.h>
    4646
    47 /** IP module messages.
    48  */
    49 typedef enum{
     47/** IP module messages. */
     48typedef enum {
    5049        /** Adds the routing entry.
    51          *  @see ip_add_route()
     50         * @see ip_add_route()
    5251         */
    5352        NET_IP_ADD_ROUTE = NET_IP_FIRST,
    5453        /** Gets the actual route information.
    55          *  @see ip_get_route()
     54         * @see ip_get_route()
    5655         */
    5756        NET_IP_GET_ROUTE,
    5857        /** Processes the received error notification.
    59          *  @see ip_received_error_msg()
     58         * @see ip_received_error_msg()
    6059         */
    6160        NET_IP_RECEIVED_ERROR,
    6261        /** Sets the default gateway.
    63          *  @see ip_set_default_gateway()
     62         * @see ip_set_default_gateway()
    6463         */
    6564        NET_IP_SET_GATEWAY
    6665} ip_messages;
    6766
    68 /** @name IP specific message parameters definitions
    69  */
     67/** @name IP specific message parameters definitions */
    7068/*@{*/
    7169
    7270/** Returns the address message parameter.
    73  *  @param[in] call The message call structure.
     71 * @param[in] call The message call structure.
    7472 */
    7573#define IP_GET_ADDRESS(call) \
    76         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG3(*call); addr;})
     74        ({ \
     75                in_addr_t addr; \
     76                addr.s_addr = IPC_GET_ARG3(*call); \
     77                addr; \
     78        })
    7779
    7880/** Returns the gateway message parameter.
    79  *  @param[in] call The message call structure.
     81 * @param[in] call The message call structure.
    8082 */
    8183#define IP_GET_GATEWAY(call) \
    82         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG2(*call); addr;})
     84        ({ \
     85                in_addr_t addr; \
     86                addr.s_addr = IPC_GET_ARG2(*call); \
     87                addr; \
     88        })
    8389
    8490/** Sets the header length in the message answer.
    85  *  @param[out] answer The message answer structure.
     91 * @param[out] answer The message answer structure.
    8692 */
    8793#define IP_SET_HEADERLEN(answer, value) \
    88         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(*answer, argument);}
     94        do { \
     95                ipcarg_t argument = (ipcarg_t) (value); \
     96                IPC_SET_ARG2(*answer, argument); \
     97        } while (0)
    8998
    9099/** Returns the network mask message parameter.
    91  *  @param[in] call The message call structure.
     100 * @param[in] call The message call structure.
    92101 */
    93102#define IP_GET_NETMASK(call) \
    94         ({in_addr_t addr; addr.s_addr = IPC_GET_ARG4(*call); addr;})
     103        ({ \
     104                in_addr_t addr; \
     105                addr.s_addr = IPC_GET_ARG4(*call); \
     106                addr; \
     107        })
    95108
    96109/** Returns the protocol message parameter.
    97  *  @param[in] call The message call structure.
     110 * @param[in] call The message call structure.
    98111 */
    99112#define IP_GET_PROTOCOL(call) \
    100         ({ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); protocol;})
     113        ({ \
     114                ip_protocol_t protocol = (ip_protocol_t) IPC_GET_ARG1(*call); \
     115                protocol; \
     116        })
    101117
    102118/*@}*/
  • uspace/lib/net/il/ip_remote.c

    r522253c1 r779a47d  
    4242#include <ip_remote.h>
    4343#include <ip_interface.h>
    44 #include <ip_messages.h>
    4544#include <packet_client.h>
    4645#include <generic.h>
     
    4847#include <ipc/services.h>
    4948#include <ipc/il.h>
     49#include <ipc/ip.h>
    5050
    5151#include <net/modules.h>
  • uspace/srv/net/il/ip/ip.c

    r522253c1 r779a47d  
    4646#include <ipc/net.h>
    4747#include <ipc/il.h>
     48#include <ipc/ip.h>
    4849#include <sys/types.h>
    4950#include <byteorder.h>
     
    7879#include "ip.h"
    7980#include "ip_header.h"
    80 #include "ip_messages.h"
    8181#include "ip_module.h"
    8282
Note: See TracChangeset for help on using the changeset viewer.