Changeset c0e74b1 in mainline for uspace/lib/c/include/net/inet.h


Ignore:
Timestamp:
2010-10-06T22:58:18Z (14 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.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.