Changeset c0e74b1 in mainline for uspace/lib


Ignore:
Timestamp:
2010-10-06T22:58:18Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ae972834
Parents:
49d871ea (diff), d9e2e0e (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 from lp:~jakub/helenos/net.

This merge continues with the overhaul of the networking subsystem and procedes
towards the ultimate goal of getting rid of the current lib socket. The current
lib socket mixes code which should either belong to libc, libnet or directly to
the packet server. By moving generic non-networking and client networking code
out of the current lib socket, I am preparing to merge the rest of it to lib net
and the packet server and fix ticket #257 for the modular builds. When this is
done, we can talk of moving some of the networking client code back to a
dedicated client library, but we can just as well keep it in lib C, similar to
how we have file system client code there.

Location:
uspace/lib
Files:
8 added
8 deleted
35 edited
6 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r49d871ea rc0e74b1  
    9999        generic/vfs/vfs.c \
    100100        generic/vfs/canonify.c \
     101        generic/net/inet.c \
     102        generic/net/modules.c \
     103        generic/net/socket_client.c \
     104        generic/net/socket_parse.c \
    101105        generic/stacktrace.c \
    102106        generic/arg_parse.c \
  • uspace/lib/c/generic/net/socket_parse.c

    r49d871ea rc0e74b1  
    3535 */
    3636
    37 #include <socket_parse.h>
     37#include <net/socket_parse.h>
     38#include <net/socket.h>
    3839#include <arg_parse.h>
    3940#include <errno.h>
    4041#include <str.h>
    41 #include <socket.h>
    4242
    4343/** Translate the character string to the address family number.
  • uspace/lib/c/include/byteorder.h

    r49d871ea rc0e74b1  
    8080#endif
    8181
     82#define htons(n)        host2uint16_t_be((n))
     83#define htonl(n)        host2uint32_t_be((n))
     84#define ntohs(n)        uint16_t_be2host((n))
     85#define ntohl(n)        uint32_t_be2host((n))
     86
    8287static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
    8388{
  • uspace/lib/c/include/ipc/socket.h

    r49d871ea rc0e74b1  
    2727 */
    2828
    29 /** @addtogroup socket
    30  *  @{
     29/** @addtogroup libc
     30 * @{
    3131 */
    3232
    3333/** @file
    34  *  Socket messages.
    35  *  @see socket.h
    36  */
    37 
    38 
    39 #ifndef __NET_SOCKET_MESSAGES_H__
    40 #define __NET_SOCKET_MESSAGES_H__
     34 * Socket messages.
     35 */
     36
     37#ifndef LIBC_SOCKET_MESSAGES_H_
     38#define LIBC_SOCKET_MESSAGES_H_
    4139
    4240#include <ipc/ipc.h>
    43 
    44 #include <net_messages.h>
    45 #include <socket_codes.h>
    46 
    47 /** Socket client messages.
    48  */
    49 typedef enum{
    50         /** Creates a new socket.
    51          *  @see socket()
    52          */
     41#include <ipc/net.h>
     42
     43/** Socket client messages. */
     44typedef enum {
     45        /** Creates a new socket. @see socket() */
    5346        NET_SOCKET = NET_SOCKET_FIRST,
    54         /** Binds the socket.
    55          *  @see bind()
    56          */
     47        /** Binds the socket. @see bind() */
    5748        NET_SOCKET_BIND,
    58         /** Creates a new socket.
    59          *  @see socket()
    60          */
     49        /** Creates a new socket. @see socket() */
    6150        NET_SOCKET_LISTEN,
    62         /** Accepts an incomming connection.
    63          *  @see accept()
    64          */
     51        /** Accepts an incomming connection. @see accept() */
    6552        NET_SOCKET_ACCEPT,
    66         /** Connects the socket.
    67          *  @see connect()
    68          */
     53        /** Connects the socket. @see connect() */
    6954        NET_SOCKET_CONNECT,
    70         /** Closes the socket.
    71          *  @see closesocket()
    72          */
     55        /** Closes the socket. @see closesocket() */
    7356        NET_SOCKET_CLOSE,
    74         /** Sends data via the stream socket.
    75          *  @see send()
    76          */
     57        /** Sends data via the stream socket. @see send() */
    7758        NET_SOCKET_SEND,
    78         /** Sends data via the datagram socket.
    79          *  @see sendto()
    80          */
     59        /** Sends data via the datagram socket. @see sendto() */
    8160        NET_SOCKET_SENDTO,
    82         /** Receives data from the stream socket.
    83          *  @see socket()
    84          */
     61        /** Receives data from the stream socket. @see socket() */
    8562        NET_SOCKET_RECV,
    86         /** Receives data from the datagram socket.
    87          *  @see socket()
    88          */
     63        /** Receives data from the datagram socket. @see socket() */
    8964        NET_SOCKET_RECVFROM,
    90         /** Gets the socket option.
    91          *  @see getsockopt()
    92          */
     65        /** Gets the socket option. @see getsockopt() */
    9366        NET_SOCKET_GETSOCKOPT,
    94         /** Sets the socket option.
    95          *  @see setsockopt()
    96          */
     67        /** Sets the socket option. @see setsockopt() */
    9768        NET_SOCKET_SETSOCKOPT,
    98         /** New socket for acceptence notification message.
    99          */
     69        /** New socket for acceptence notification message. */
    10070        NET_SOCKET_ACCEPTED,
    101         /** New data received notification message.
    102          */
     71        /** New data received notification message. */
    10372        NET_SOCKET_RECEIVED,
    104         /** New socket data fragment size notification message.
    105          */
     73        /** New socket data fragment size notification message. */
    10674        NET_SOCKET_DATA_FRAGMENT_SIZE
    10775} socket_messages;
     
    11280
    11381/** Sets the socket identifier in the message answer.
    114  *  @param[out] answer The message answer structure.
     82 * @param[out] answer   The message answer structure.
    11583 */
    11684#define SOCKET_SET_SOCKET_ID(answer, value) \
    117         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);}
     85        do { \
     86                ipcarg_t argument = (ipcarg_t) (value); \
     87                IPC_SET_ARG1(answer, argument); \
     88        } while (0)
    11889
    11990/** Returns the socket identifier message parameter.
    120  *  @param[in] call The message call structure.
     91 * @param[in] call      The message call structure.
    12192 */
    12293#define SOCKET_GET_SOCKET_ID(call) \
    123         ({int socket_id = (int) IPC_GET_ARG1(call); socket_id;})
     94        ({ \
     95                int socket_id = (int) IPC_GET_ARG1(call); \
     96                socket_id; \
     97        })
    12498
    12599/** Sets the read data length in the message answer.
    126  *  @param[out] answer The message answer structure.
     100 * @param[out] answer   The message answer structure.
    127101 */
    128102#define SOCKET_SET_READ_DATA_LENGTH(answer, value) \
    129         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG1(answer, argument);}
     103        do { \
     104                ipcarg_t argument = (ipcarg_t) (value); \
     105                IPC_SET_ARG1(answer, argument); \
     106        } while (0)
    130107
    131108/** Returns the read data length message parameter.
    132  *  @param[in] call The message call structure.
     109 * @param[in] call      The message call structure.
    133110 */
    134111#define SOCKET_GET_READ_DATA_LENGTH(call) \
    135         ({int data_length = (int) IPC_GET_ARG1(call); data_length;})
     112        ({ \
     113                int data_length = (int) IPC_GET_ARG1(call); \
     114                data_length; \
     115        })
    136116
    137117/** Returns the backlog message parameter.
    138  *  @param[in] call The message call structure.
     118 * @param[in] call      The message call structure.
    139119 */
    140120#define SOCKET_GET_BACKLOG(call) \
    141         ({int backlog = (int) IPC_GET_ARG2(call); backlog;})
     121        ({ \
     122                int backlog = (int) IPC_GET_ARG2(call); \
     123                backlog; \
     124        })
    142125
    143126/** Returns the option level message parameter.
    144  *  @param[in] call The message call structure.
     127 * @param[in] call      The message call structure.
    145128 */
    146129#define SOCKET_GET_OPT_LEVEL(call) \
    147         ({int opt_level = (int) IPC_GET_ARG2(call); opt_level;})
     130        ({ \
     131                int opt_level = (int) IPC_GET_ARG2(call); \
     132                opt_level; \
     133        })
    148134
    149135/** Returns the data fragment size message parameter.
    150  *  @param[in] call The message call structure.
     136 * @param[in] call      The message call structure.
    151137 */
    152138#define SOCKET_GET_DATA_FRAGMENT_SIZE(call) \
    153         ({size_t size = (size_t) IPC_GET_ARG2(call); size;})
     139        ({ \
     140                size_t size = (size_t) IPC_GET_ARG2(call); \
     141                size; \
     142        })
    154143
    155144/** Sets the data fragment size in the message answer.
    156  *  @param[out] answer The message answer structure.
     145 * @param[out] answer   The message answer structure.
    157146 */
    158147#define SOCKET_SET_DATA_FRAGMENT_SIZE(answer, value) \
    159         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG2(answer, argument);}
     148        do { \
     149                ipcarg_t argument = (ipcarg_t) (value); \
     150                IPC_SET_ARG2(answer, argument); \
     151        } while (0)
    160152
    161153/** Sets the address length in the message answer.
    162  *  @param[out] answer The message answer structure.
     154 * @param[out] answer   The message answer structure.
    163155 */
    164156#define SOCKET_SET_ADDRESS_LENGTH(answer, value) \
    165         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);}
     157        do { \
     158                ipcarg_t argument = (ipcarg_t) (value); \
     159                IPC_SET_ARG3(answer, argument);\
     160        } while (0)
    166161
    167162/** Returns the address length message parameter.
    168  *  @param[in] call The message call structure.
     163 * @param[in] call      The message call structure.
    169164 */
    170165#define SOCKET_GET_ADDRESS_LENGTH(call) \
    171         ({socklen_t address_length = (socklen_t) IPC_GET_ARG3(call); address_length;})
     166        ({ \
     167                socklen_t address_length = (socklen_t) IPC_GET_ARG3(call); \
     168                address_length; \
     169        })
    172170
    173171/** Sets the header size in the message answer.
    174  *  @param[out] answer The message answer structure.
     172 * @param[out] answer   The message answer structure.
    175173 */
    176174#define SOCKET_SET_HEADER_SIZE(answer, value) \
    177         \
    178         {ipcarg_t argument = (ipcarg_t) (value); IPC_SET_ARG3(answer, argument);}
     175        do { \
     176                ipcarg_t argument = (ipcarg_t) (value); \
     177                IPC_SET_ARG3(answer, argument); \
     178        } while (0)
    179179
    180180/** Returns the header size message parameter.
    181  *  @param[in] call The message call structure.
     181 *  @param[in] call     The message call structure.
    182182 */
    183183#define SOCKET_GET_HEADER_SIZE(call) \
    184         ({size_t size = (size_t) IPC_GET_ARG3(call); size;})
     184        ({ \
     185                size_t size = (size_t) IPC_GET_ARG3(call); \
     186                size; \
     187        })
    185188
    186189/** Returns the flags message parameter.
    187  *  @param[in] call The message call structure.
     190 *  @param[in] call     The message call structure.
    188191 */
    189192#define SOCKET_GET_FLAGS(call) \
    190         ({int flags = (int) IPC_GET_ARG4(call); flags;})
     193        ({ \
     194                int flags = (int) IPC_GET_ARG4(call); \
     195                flags; \
     196        })
    191197
    192198/** Returns the option name message parameter.
    193  *  @param[in] call The message call structure.
     199 *  @param[in] call     The message call structure.
    194200 */
    195201#define SOCKET_GET_OPT_NAME(call) \
    196         ({int opt_name = (int) IPC_GET_ARG4(call); opt_name;})
     202        ({ \
     203                int opt_name = (int) IPC_GET_ARG4(call); \
     204                opt_name; \
     205        })
    197206
    198207/** Returns the data fragments message parameter.
    199  *  @param[in] call The message call structure.
     208 *  @param[in] call     The message call structure.
    200209 */
    201210#define SOCKET_GET_DATA_FRAGMENTS(call) \
    202         ({int fragments = (int) IPC_GET_ARG5(call); fragments;})
     211        ({ \
     212                int fragments = (int) IPC_GET_ARG5(call); \
     213                fragments; \
     214        })
    203215
    204216/** Returns the new socket identifier message parameter.
    205  *  @param[in] call The message call structure.
     217 *  @param[in] call     The message call structure.
    206218 */
    207219#define SOCKET_GET_NEW_SOCKET_ID(call) \
    208         ({int socket_id = (int) IPC_GET_ARG5(call); socket_id;})
     220        ({ \
     221                int socket_id = (int) IPC_GET_ARG5(call); \
     222                socket_id; \
     223        })
    209224
    210225/*@}*/
  • uspace/lib/c/include/net/in.h

    r49d871ea rc0e74b1  
    2727 */
    2828
    29 /** @addtogroup net
     29/** @addtogroup libc
    3030 *  @{
    3131 */
     
    3535 */
    3636
    37 #ifndef __NET_IN_H__
    38 #define __NET_IN_H__
     37#ifndef LIBC_IN_H_
     38#define LIBC_IN_H_
    3939
     40#include <net/inet.h>
     41#include <net/ip_protocols.h>
    4042#include <sys/types.h>
    4143
    42 #include <ip_protocols.h>
    43 #include <inet.h>
    44 
    45 /** INET string address maximum length.
    46  */
     44/** INET string address maximum length. */
    4745#define INET_ADDRSTRLEN         (4 * 3 + 3 + 1)
    4846
    4947/** Type definition of the INET address.
    50  *  @see in_addr
     48 * @see in_addr
    5149 */
    5250typedef struct in_addr          in_addr_t;
    5351
    5452/** Type definition of the INET socket address.
    55  *  @see sockaddr_in
     53 * @see sockaddr_in
    5654 */
    5755typedef struct sockaddr_in      sockaddr_in_t;
    5856
    59 /** INET address.
    60  */
    61 struct in_addr{
    62         /** 4 byte IP address.
    63          */
     57/** INET address. */
     58struct in_addr {
     59        /** 4 byte IP address. */
    6460        uint32_t s_addr;
    6561};
    6662
    6763/** INET socket address.
    68  *  @see sockaddr
     64 * @see sockaddr
    6965 */
    70 struct sockaddr_in{
    71         /** Address family.
    72          *  Should be AF_INET.
    73          */
     66struct sockaddr_in {
     67        /** Address family. Should be AF_INET. */
    7468        uint16_t sin_family;
    75         /** Port number.
    76          */
     69        /** Port number. */
    7770        uint16_t sin_port;
    78         /** Internet address.
    79          */
     71        /** Internet address. */
    8072        struct in_addr sin_addr;
    81         /** Padding to meet the sockaddr size.
    82          */
     73        /** Padding to meet the sockaddr size. */
    8374        uint8_t sin_zero[8];
    8475};
  • uspace/lib/c/include/net/in6.h

    r49d871ea rc0e74b1  
    2727 */
    2828
    29 /** @addtogroup net
     29/** @addtogroup libc
    3030 *  @{
    3131 */
     
    3535 */
    3636
    37 #ifndef __NET_IN6_H__
    38 #define __NET_IN6_H__
     37#ifndef LIBC_IN6_H_
     38#define LIBC_IN6_H_
    3939
     40#include <net/inet.h>
     41#include <net/ip_protocols.h>
    4042#include <sys/types.h>
    4143
    42 #include <ip_protocols.h>
    43 #include <inet.h>
    44 
    45 /** INET6 string address maximum length.
    46  */
     44/** INET6 string address maximum length. */
    4745#define INET6_ADDRSTRLEN        (8 * 4 + 7 + 1)
    4846
    4947/** Type definition of the INET6 address.
    50  *  @see in6_addr
     48 * @see in6_addr
    5149 */
    5250typedef struct in6_addr in6_addr_t;
    5351
    5452/** Type definition of the INET6 socket address.
    55  *  @see sockaddr_in6
     53 * @see sockaddr_in6
    5654 */
    5755typedef struct sockaddr_in6     sockaddr_in6_t;
    5856
    59 /** INET6 address.
    60  */
    61 struct in6_addr{
    62         /** 16 byte IPv6 address.
    63          */
     57/** INET6 address. */
     58struct in6_addr {
     59        /** 16 byte IPv6 address. */
    6460        unsigned char s6_addr[16];
    6561};
    6662
    6763/** INET6 socket address.
    68  *  @see sockaddr
     64 * @see sockaddr
    6965 */
    70 struct sockaddr_in6{
    71         /** Address family.
    72          *  Should be AF_INET6.
    73          */
     66struct sockaddr_in6 {
     67        /** Address family. Should be AF_INET6. */
    7468        uint16_t sin6_family;
    75         /** Port number.
    76          */
     69        /** Port number. */
    7770        uint16_t sin6_port;
    78         /** IPv6 flow information.
    79          */
     71        /** IPv6 flow information. */
    8072        uint32_t sin6_flowinfo;
    81         /** IPv6 address.
    82          */
     73        /** IPv6 address. */
    8374        struct in6_addr sin6_addr;
    84         /** Scope identifier.
    85          */
     75        /** Scope identifier. */
    8676        uint32_t sin6_scope_id;
    8777};
  • uspace/lib/c/include/net/inet.h

    r49d871ea rc0e74b1  
    2727 */
    2828
    29 /** @addtogroup net
     29/** @addtogroup libc
    3030 *  @{
    3131 */
    3232
    3333/** @file
    34  *  Host - network byte order manipulation functions.
     34 *  Internet common definitions.
    3535 */
    3636
    37 #ifndef __NET_BYTEORDER_H__
    38 #define __NET_BYTEORDER_H__
     37#ifndef LIBC_INET_H_
     38#define LIBC_INET_H_
    3939
     40#include <sys/types.h>
    4041#include <byteorder.h>
    41 #include <sys/types.h>
    4242
     43/** Type definition of the socket address.
     44 * @see sockaddr
     45 */
     46typedef struct sockaddr         sockaddr_t;
    4347
    44 /** Converts the given short number (16 bit) from the host byte order to the network byte order (big endian).
    45  *  @param[in] number The number in the host byte order to be converted.
    46  *  @returns The number in the network byte order.
     48/** Type definition of the address information.
     49 * @see addrinfo
    4750 */
    48 #define htons(number)           host2uint16_t_be(number)
     51typedef struct addrinfo         addrinfo_t;
    4952
    50 /** Converts the given long number (32 bit) from the host byte order to the network byte order (big endian).
    51  *  @param[in] number The number in the host byte order to be converted.
    52  *  @returns The number in the network byte order.
    53  */
    54 #define htonl(number)           host2uint32_t_be(number)
     53/** Socket address. */
     54struct sockaddr {
     55        /** Address family. @see socket.h */
     56        uint16_t sa_family;
     57        /** 14 byte protocol address. */
     58        uint8_t sa_data[14];
     59};
    5560
    56 /** Converts the given short number (16 bit) from the network byte order (big endian) to the host byte order.
    57  *  @param[in] number The number in the network byte order to be converted.
    58  *  @returns The number in the host byte order.
    59  */
    60 #define ntohs(number)   uint16_t_be2host(number)
    61 
    62 /** Converts the given long number (32 bit) from the network byte order (big endian) to the host byte order.
    63  *  @param[in] number The number in the network byte order to be converted.
    64  *  @returns The number in the host byte order.
    65  */
    66 #define ntohl(number)           uint32_t_be2host(number)
     61extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t);
     62extern int inet_pton(uint16_t, const char *, uint8_t *);
    6763
    6864#endif
  • uspace/lib/net/adt/module_map.c

    r49d871ea rc0e74b1  
    4242#include <ipc/services.h>
    4343
    44 #include <net_modules.h>
     44#include <net/modules.h>
    4545
    4646#include <adt/generic_char_map.h>
  • uspace/lib/net/generic/net_remote.c

    r49d871ea rc0e74b1  
    4141
    4242#include <net_messages.h>
    43 #include <net_modules.h>
     43#include <net/modules.h>
    4444#include <net_device.h>
    4545#include <net_interface.h>
  • uspace/lib/net/il/arp_remote.c

    r49d871ea rc0e74b1  
    4242
    4343#include <net_messages.h>
    44 #include <net_modules.h>
     44#include <net/modules.h>
    4545#include <net_device.h>
    4646#include <arp_interface.h>
  • uspace/lib/net/il/ip_remote.c

    r49d871ea rc0e74b1  
    4343
    4444#include <net_messages.h>
    45 #include <net_modules.h>
     45#include <net/modules.h>
    4646#include <net_device.h>
    47 #include <inet.h>
     47#include <net/inet.h>
    4848#include <ip_interface.h>
    4949#include <packet/packet_client.h>
  • uspace/lib/net/include/adt/module_map.h

    r49d871ea rc0e74b1  
    4242#include <ipc/services.h>
    4343
    44 #include <net_modules.h>
     44#include <net/modules.h>
    4545
    4646#include <adt/generic_char_map.h>
  • uspace/lib/net/include/arp_messages.h

    r49d871ea rc0e74b1  
    4040
    4141#include <ipc/ipc.h>
    42 
    43 #include <net_messages.h>
     42#include <ipc/net.h>
    4443
    4544/** ARP module messages.
  • uspace/lib/net/include/icmp_header.h

    r49d871ea rc0e74b1  
    4141#include <sys/types.h>
    4242
    43 #include <in.h>
     43#include <net/in.h>
    4444#include <icmp_codes.h>
    4545
  • uspace/lib/net/include/icmp_interface.h

    r49d871ea rc0e74b1  
    3434#define __NET_ICMP_INTERFACE_H__
    3535
     36#include <net/socket_codes.h>
    3637#include <sys/types.h>
    3738
     
    3940#include <adt/measured_strings.h>
    4041#include <packet/packet.h>
    41 #include <inet.h>
     42#include <net/inet.h>
    4243#include <ip_codes.h>
    43 #include <socket_codes.h>
    4444#include <icmp_codes.h>
    4545#include <icmp_common.h>
  • uspace/lib/net/include/il_messages.h

    r49d871ea rc0e74b1  
    4141
    4242#include <ipc/ipc.h>
     43#include <ipc/net.h>
    4344
    4445/** Internet layer modules messages.
  • uspace/lib/net/include/ip_client.h

    r49d871ea rc0e74b1  
    3838#define __NET_IP_CLIENT_H__
    3939
     40#include <net/socket_codes.h>
    4041#include <sys/types.h>
    4142
     
    4344#include <ip_codes.h>
    4445#include <ip_interface.h>
    45 #include <socket_codes.h>
    4646
    4747/** Prepares the packet to be transfered via IP.
  • uspace/lib/net/include/ip_interface.h

    r49d871ea rc0e74b1  
    3434#define __NET_IP_INTERFACE_H__
    3535
     36#include <net/socket_codes.h>
    3637#include <async.h>
    3738#include <ipc/services.h>
     
    4041#include <packet/packet.h>
    4142
    42 #include <in.h>
     43#include <net/in.h>
    4344#include <ip_codes.h>
    44 #include <socket_codes.h>
    4545
    4646#ifdef CONFIG_IL_TL_BUNDLE
  • uspace/lib/net/include/ip_local.h

    r49d871ea rc0e74b1  
    3838
    3939#include <ip_codes.h>
    40 #include <inet.h>
    41 #include <in.h>
    42 #include <socket.h>
     40#include <net/inet.h>
     41#include <net/in.h>
    4342
    4443extern int ip_received_error_msg_local(int, device_id_t, packet_t, services_t,
  • uspace/lib/net/include/ip_messages.h

    r49d871ea rc0e74b1  
    4040
    4141#include <ipc/ipc.h>
     42#include <ipc/net.h>
    4243
    43 #include <in.h>
     44#include <net/in.h>
    4445#include <ip_codes.h>
    4546
  • uspace/lib/net/include/ip_remote.h

    r49d871ea rc0e74b1  
    3838
    3939#include <ip_codes.h>
    40 #include <inet.h>
    41 #include <in.h>
    42 #include <socket.h>
     40#include <net/inet.h>
     41#include <net/in.h>
    4342
    4443extern int ip_set_gateway_req_remote(int, device_id_t, in_addr_t);
  • uspace/lib/net/include/net_net_messages.h

    r49d871ea rc0e74b1  
    4040
    4141#include <ipc/ipc.h>
    42 
    43 #include <net_messages.h>
     42#include <ipc/net.h>
    4443
    4544/** Networking subsystem central module messages.
  • uspace/lib/net/include/netif_messages.h

    r49d871ea rc0e74b1  
    3939
    4040#include <ipc/ipc.h>
    41 
    42 #include <net_messages.h>
     41#include <ipc/net.h>
    4342
    4443/** Network interface common module messages.
  • uspace/lib/net/include/nil_messages.h

    r49d871ea rc0e74b1  
    3939
    4040#include <ipc/ipc.h>
    41 
    42 #include <net_messages.h>
     41#include <ipc/net.h>
    4342
    4443/** Network interface layer module messages.
  • uspace/lib/net/include/tl_common.h

    r49d871ea rc0e74b1  
    3838#define __NET_TL_COMMON_H__
    3939
     40#include <net/socket_codes.h>
     41
    4042#include <packet/packet.h>
    4143#include <net_device.h>
    42 #include <inet.h>
    43 #include <socket_codes.h>
     44#include <net/inet.h>
    4445
    4546/** Device packet dimensions.
  • uspace/lib/net/include/tl_messages.h

    r49d871ea rc0e74b1  
    4040
    4141#include <ipc/ipc.h>
    42 
    43 #include <net_messages.h>
     42#include <ipc/net.h>
    4443
    4544/** Transport layer modules messages.
  • uspace/lib/net/netif/netif_local.c

    r49d871ea rc0e74b1  
    4545
    4646#include <net_messages.h>
    47 #include <net_modules.h>
     47#include <net/modules.h>
    4848#include <packet/packet.h>
    4949#include <packet/packet_client.h>
  • uspace/lib/net/netif/netif_nil_bundle.c

    r49d871ea rc0e74b1  
    3838#include <async.h>
    3939#include <ipc/ipc.h>
     40#include <ipc/net.h>
    4041
    41 #include <net_messages.h>
    4242#include <packet/packet.h>
    4343#include <netif_nil_bundle.h>
  • uspace/lib/net/netif/netif_remote.c

    r49d871ea rc0e74b1  
    3737#include <ipc/services.h>
    3838
    39 #include <net_modules.h>
     39#include <net/modules.h>
    4040#include <adt/measured_strings.h>
    4141#include <packet/packet.h>
     
    4444#include <netif_remote.h>
    4545#include <netif_messages.h>
     46#include <net_messages.h>
    4647
    4748int netif_get_addr_req_remote(int netif_phone, device_id_t device_id,
  • uspace/lib/net/tl/icmp_remote.c

    r49d871ea rc0e74b1  
    4343
    4444#include <net_messages.h>
    45 #include <net_modules.h>
     45#include <net/modules.h>
    4646#include <icmp_interface.h>
    4747#include <packet/packet_client.h>
  • uspace/lib/net/tl/tl_common.c

    r49d871ea rc0e74b1  
    3636 */
    3737
     38#include <net/socket_codes.h>
     39#include <net/in.h>
     40#include <net/in6.h>
     41#include <net/inet.h>
    3842#include <async.h>
    3943#include <ipc/services.h>
     
    4650#include <net_device.h>
    4751#include <icmp_interface.h>
    48 #include <in.h>
    49 #include <in6.h>
    50 #include <inet.h>
    5152#include <ip_local.h>
    5253#include <ip_remote.h>
    53 #include <socket_codes.h>
    5454#include <ip_interface.h>
    5555#include <tl_interface.h>
  • uspace/lib/socket/Makefile

    r49d871ea rc0e74b1  
    3333
    3434SOURCES = \
    35         generic/socket_client.c \
    3635        generic/socket_core.c \
    37         generic/socket_parse.c \
    38         generic/inet.c \
    39         generic/net_modules.c \
    4036        generic/icmp_common.c \
    4137        generic/icmp_api.c \
  • uspace/lib/socket/generic/icmp_api.c

    r49d871ea rc0e74b1  
    3636 */
    3737
     38#include <net/socket_codes.h>
     39#include <net/inet.h>
    3840#include <async.h>
    3941
     
    4345#include <sys/types.h>
    4446
    45 #include <net_modules.h>
     47#include <net/modules.h>
    4648#include <icmp_api.h>
    47 #include <inet.h>
    4849#include <ip_codes.h>
    49 #include <socket_codes.h>
    5050#include <icmp_messages.h>
    5151
  • uspace/lib/socket/generic/icmp_common.c

    r49d871ea rc0e74b1  
    3939#include <ipc/services.h>
    4040
    41 #include <net_modules.h>
     41#include <net/modules.h>
    4242#include <icmp_common.h>
    4343#include <icmp_messages.h>
  • uspace/lib/socket/generic/socket_core.c

    r49d871ea rc0e74b1  
    3535 */
    3636
     37#include <net/socket_codes.h>
     38#include <net/in.h>
     39#include <net/inet.h>
     40
    3741#include <stdint.h>
    3842#include <stdlib.h>
     
    4044#include <err.h>
    4145
    42 #include <in.h>
    43 #include <inet.h>
    44 #include <socket_codes.h>
    4546#include <adt/dynamic_fifo.h>
    4647#include <adt/int_map.h>
    4748#include <packet/packet.h>
    4849#include <packet/packet_client.h>
    49 #include <net_modules.h>
     50#include <net/modules.h>
    5051#include <socket_core.h>
    5152
  • uspace/lib/socket/include/icmp_api.h

    r49d871ea rc0e74b1  
    3838#define __NET_ICMP_API_H__
    3939
     40#include <net/socket_codes.h>
     41#include <net/inet.h>
    4042#include <sys/types.h>
    4143
     
    4345#include <adt/measured_strings.h>
    4446#include <packet/packet.h>
    45 #include <inet.h>
    4647#include <ip_codes.h>
    47 #include <socket_codes.h>
    4848#include <icmp_codes.h>
    4949#include <icmp_common.h>
  • uspace/lib/socket/include/icmp_messages.h

    r49d871ea rc0e74b1  
    4040
    4141#include <ipc/ipc.h>
     42#include <ipc/net.h>
    4243#include <sys/types.h>
    4344
    4445#include <icmp_codes.h>
    45 #include <net_messages.h>
    4646
    4747/** ICMP module messages.
  • uspace/lib/socket/include/net_messages.h

    r49d871ea rc0e74b1  
    3939
    4040#include <async.h>
    41 
    4241#include <ipc/ipc.h>
    4342#include <ipc/services.h>
     
    4645#include <adt/measured_strings.h>
    4746#include <packet/packet.h>
    48 
    49 /** Returns a value indicating whether the value is in the interval.
    50  *  @param[in] item The value to be checked.
    51  *  @param[in] first_inclusive The first value in the interval inclusive.
    52  *  @param[in] last_exclusive The first value after the interval.
    53  */
    54 #define IS_IN_INTERVAL(item, first_inclusive, last_exclusive)   (((item) >= (first_inclusive)) && ((item) < (last_exclusive)))
    55 
    56 /** @name Networking message counts
    57  */
    58 /*@{*/
    59 
    60 /** The number of ARP messages.
    61  */
    62 #define NET_ARP_COUNT           5
    63 
    64 /** The number of Ethernet messages.
    65  */
    66 #define NET_ETH_COUNT           0
    67 
    68 /** The number of ICMP messages.
    69  */
    70 #define NET_ICMP_COUNT          6
    71 
    72 /** The number of inter-network messages.
    73  */
    74 #define NET_IL_COUNT            6
    75 
    76 /** The number of IP messages.
    77  */
    78 #define NET_IP_COUNT            4
    79 
    80 /** The number of general networking messages.
    81  */
    82 #define NET_NET_COUNT           3
    83 
    84 /** The number of network interface driver messages.
    85  */
    86 #define NET_NETIF_COUNT         6
    87 
    88 /** The number of network interface layer messages.
    89  */
    90 #define NET_NIL_COUNT           7
    91 
    92 /** The number of packet management system messages.
    93  */
    94 #define NET_PACKET_COUNT        5
    95 
    96 /** The number of socket messages.
    97  */
    98 #define NET_SOCKET_COUNT        14
    99 
    100 /** The number of TCP messages.
    101  */
    102 #define NET_TCP_COUNT           0
    103 
    104 /** The number of transport layer messages.
    105  */
    106 #define NET_TL_COUNT            1
    107 
    108 /** The number of UDP messages.
    109  */
    110 #define NET_UDP_COUNT           0
    111 
    112 /*@}*/
    113 
    114 /** @name Networking message intervals
    115  */
    116 /*@{*/
    117 
    118 /** The first networking message.
    119  */
    120 #define NET_FIRST                       2000
    121 
    122 /** The first network interface layer message.
    123  */
    124 #define NET_NETIF_FIRST         NET_FIRST
    125 
    126 /** The last network interface layer message.
    127  */
    128 #define NET_NETIF_LAST          (NET_NETIF_FIRST + NET_NETIF_COUNT)
    129 
    130 /** The first general networking message.
    131  */
    132 #define NET_NET_FIRST           (NET_NETIF_LAST + 0)
    133 
    134 /** The last general networking message.
    135  */
    136 #define NET_NET_LAST            (NET_NET_FIRST + NET_NET_COUNT)
    137 
    138 /** The first network interface layer message.
    139  */
    140 #define NET_NIL_FIRST           (NET_NET_LAST + 0)
    141 
    142 /** The last network interface layer message.
    143  */
    144 #define NET_NIL_LAST            (NET_NIL_FIRST + NET_NIL_COUNT)
    145 
    146 /** The first Ethernet message.
    147  */
    148 #define NET_ETH_FIRST           (NET_NIL_LAST + 0)
    149 
    150 /** The last Ethernet message.
    151  */
    152 #define NET_ETH_LAST            (NET_ETH_FIRST + NET_ETH_COUNT)
    153 
    154 /** The first inter-network message.
    155  */
    156 #define NET_IL_FIRST            (NET_ETH_LAST + 0)
    157 
    158 /** The last inter-network message.
    159  */
    160 #define NET_IL_LAST                     (NET_IL_FIRST + NET_IL_COUNT)
    161 
    162 /** The first IP message.
    163  */
    164 #define NET_IP_FIRST            (NET_IL_LAST + 0)
    165 
    166 /** The last IP message.
    167  */
    168 #define NET_IP_LAST                     (NET_IP_FIRST + NET_IP_COUNT)
    169 
    170 /** The first ARP message.
    171  */
    172 #define NET_ARP_FIRST           (NET_IP_LAST + 0)
    173 
    174 /** The last ARP message.
    175  */
    176 #define NET_ARP_LAST            (NET_ARP_FIRST + NET_ARP_COUNT)
    177 
    178 /** The first ICMP message.
    179  */
    180 #define NET_ICMP_FIRST          (NET_ARP_LAST + 0)
    181 
    182 /** The last ICMP message.
    183  */
    184 #define NET_ICMP_LAST           (NET_ICMP_FIRST + NET_ICMP_COUNT)
    185 
    186 /** The first ICMP message.
    187  */
    188 #define NET_TL_FIRST            (NET_ICMP_LAST + 0)
    189 
    190 /** The last ICMP message.
    191  */
    192 #define NET_TL_LAST                     (NET_TL_FIRST + NET_TL_COUNT)
    193 
    194 /** The first UDP message.
    195  */
    196 #define NET_UDP_FIRST           (NET_TL_LAST + 0)
    197 
    198 /** The last UDP message.
    199  */
    200 #define NET_UDP_LAST            (NET_UDP_FIRST + NET_UDP_COUNT)
    201 
    202 /** The first TCP message.
    203  */
    204 #define NET_TCP_FIRST           (NET_UDP_LAST + 0)
    205 
    206 /** The last TCP message.
    207  */
    208 #define NET_TCP_LAST            (NET_TCP_FIRST + NET_TCP_COUNT)
    209 
    210 /** The first socket message.
    211  */
    212 #define NET_SOCKET_FIRST        (NET_TCP_LAST + 0)
    213 
    214 /** The last socket message.
    215  */
    216 #define NET_SOCKET_LAST         (NET_SOCKET_FIRST + NET_SOCKET_COUNT)
    217 
    218 /** The first packet management system message.
    219  */
    220 #define NET_PACKET_FIRST        (NET_SOCKET_LAST + 0)
    221 
    222 /** The last packet management system message.
    223  */
    224 #define NET_PACKET_LAST         (NET_PACKET_FIRST + NET_PACKET_COUNT)
    225 
    226 /** The last networking message.
    227  */
    228 #define NET_LAST                        NET_PACKET_LAST
    229 
    230 /** The number of networking messages.
    231  */
    232 #define NET_COUNT                       (NET_LAST - NET_FIRST)
    233 
    234 /** Returns a value indicating whether the IPC call is a generic networking message.
    235  *  @param[in] call The IPC call to be checked.
    236  */
    237 #define IS_NET_MESSAGE(call) \
    238         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_FIRST, NET_LAST)
    239 
    240 /** Returns a value indicating whether the IPC call is an ARP message.
    241  *  @param[in] call The IPC call to be checked.
    242  */
    243 #define IS_NET_ARP_MESSAGE(call) \
    244         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ARP_FIRST, NET_ARP_LAST)
    245 
    246 /** Returns a value indicating whether the IPC call is an Ethernet message.
    247  *  @param[in] call The IPC call to be checked.
    248  */
    249 #define IS_NET_ETH_MESSAGE(call) \
    250         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ETH_FIRST, NET_ETH_LAST)
    251 
    252 /** Returns a value indicating whether the IPC call is an ICMP message.
    253  *  @param[in] call The IPC call to be checked.
    254  */
    255 #define IS_NET_ICMP_MESSAGE(call) \
    256         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_ICMP_FIRST, NET_ICMP_LAST)
    257 
    258 /** Returns a value indicating whether the IPC call is an inter-network layer message.
    259  *  @param[in] call The IPC call to be checked.
    260  */
    261 #define IS_NET_IL_MESSAGE(call) \
    262         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IL_FIRST, NET_IL_LAST)
    263 
    264 /** Returns a value indicating whether the IPC call is an IP message.
    265  *  @param[in] call The IPC call to be checked.
    266  */
    267 #define IS_NET_IP_MESSAGE(call) \
    268         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_IP_FIRST, NET_IP_LAST)
    269 
    270 /** Returns a value indicating whether the IPC call is a generic networking message.
    271  *  @param[in] call The IPC call to be checked.
    272  */
    273 #define IS_NET_NET_MESSAGE(call) \
    274         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NET_FIRST, NET_NET_LAST)
    275 
    276 /** Returns a value indicating whether the IPC call is a network interface layer message.
    277  *  @param[in] call The IPC call to be checked.
    278  */
    279 #define IS_NET_NIL_MESSAGE(call) \
    280         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_NIL_FIRST, NET_NIL_LAST)
    281 
    282 /** Returns a value indicating whether the IPC call is a packet manaagement system message.
    283  *  @param[in] call The IPC call to be checked.
    284  */
    285 #define IS_NET_PACKET_MESSAGE(call) \
    286         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_PACKET_FIRST, NET_PACKET_LAST)
    287 
    288 /** Returns a value indicating whether the IPC call is a socket message.
    289  *  @param[in] call The IPC call to be checked.
    290  */
    291 #define IS_NET_SOCKET_MESSAGE(call) \
    292         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_SOCKET_FIRST, NET_SOCKET_LAST)
    293 
    294 /** Returns a value indicating whether the IPC call is a TCP message.
    295  *  @param[in] call The IPC call to be checked.
    296  */
    297 #define IS_NET_TCP_MESSAGE(call) \
    298         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TCP_FIRST, NET_TCP_LAST)
    299 
    300 /** Returns a value indicating whether the IPC call is a transport layer message.
    301  *  @param[in] call The IPC call to be checked.
    302  */
    303 #define IS_NET_TL_MESSAGE(call) \
    304         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_TL_FIRST, NET_TL_LAST)
    305 
    306 /** Returns a value indicating whether the IPC call is a UDP message.
    307  *  @param[in] call The IPC call to be checked.
    308  */
    309 #define IS_NET_UDP_MESSAGE(call) \
    310         IS_IN_INTERVAL(IPC_GET_METHOD(*call), NET_UDP_FIRST, NET_UDP_LAST)
    311 
    312 /*@}*/
    31347
    31448/** @name Networking specific message arguments definitions
  • uspace/lib/socket/include/packet/packet_messages.h

    r49d871ea rc0e74b1  
    3939
    4040#include <ipc/ipc.h>
    41 
    42 #include <net_messages.h>
     41#include <ipc/net.h>
    4342
    4443/** Packet server module messages.
  • uspace/lib/socket/include/socket_core.h

    r49d871ea rc0e74b1  
    4040#include <sys/types.h>
    4141
    42 #include <in.h>
     42#include <net/in.h>
    4343#include <net_device.h>
    4444#include <adt/generic_char_map.h>
Note: See TracChangeset for help on using the changeset viewer.