Skip to content

Commit

Permalink
posix: redo socket API to use conn
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Aug 26, 2015
1 parent c8c4441 commit fefce2b
Show file tree
Hide file tree
Showing 11 changed files with 1,544 additions and 508 deletions.
4 changes: 2 additions & 2 deletions sys/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifneq (,$(filter pnet,$(USEMODULE)))
DIRS += posix/pnet
ifneq (,$(filter posix_sockets,$(USEMODULE)))
DIRS += posix/sockets
endif
ifneq (,$(filter pthread,$(USEMODULE)))
DIRS += posix/pthread
Expand Down
2 changes: 1 addition & 1 deletion sys/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif
ifneq (,$(filter posix,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/include
endif
ifneq (,$(filter pnet,$(USEMODULE)))
ifneq (,$(filter posix_sockets,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/posix/include
endif
ifneq (,$(filter pthread,$(USEMODULE)))
Expand Down
78 changes: 1 addition & 77 deletions sys/posix/include/arpa/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,12 @@
#include "net/af.h"
#include "net/ipv4/addr.h"
#include "net/ipv6/addr.h"
#include "sys/bytes.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef uint16_t in_port_t; /**< Internet port type */
typedef uint32_t in_addr_t; /**< IPv4 address type */

/**
* @brief Alias to @ref IPV4_ADDR_MAX_STR_LEN
*/
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN (IPV4_ADDR_MAX_STR_LEN)
#endif

/**
* @brief Alias to @ref IPV6_ADDR_MAX_STR_LEN
*/
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN (IPV6_ADDR_MAX_STR_LEN)
#endif

/**
* @brief Size in byte of an IPv4 address
*/
Expand All @@ -67,66 +51,6 @@ typedef uint32_t in_addr_t; /**< IPv4 address type */
#define IN6ADDRSZ (sizeof(ipv6_addr_t))
#endif


/**
* @brief IPv4 address structure type.
*/
struct in_addr {
in_addr_t s_addr; ///< an IPv4 address
};

/**
* @brief Convert values between host and network byte order.
*
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/htonl.html">
* The Open Group Base Specification Issue 7, htonl
* </a>
*
* @param[in] hostlong A 32 bit number.
* @return The argument value converted from host to network byte
* order.
*/
#define htonl(hostlong) HTONL(hostlong)

/**
* @brief Convert values between host and network byte order.
*
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/htons.html">
* The Open Group Base Specification Issue 7, htons
* </a>
*
* @param[in] hostshort A 16 bit number.
* @return The argument value converted from host to network byte
* order.
*/
#define htons(hostshort) HTONS(hostshort)

/**
* @brief Convert values between host and network byte order.
*
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohl.html">
* The Open Group Base Specification Issue 7, ntohl
* </a>
*
* @param[in] netlong A 32-bit integer number.
* @return The argument value converted from network to host byte
* order.
*/
#define ntohl(netlong) NTOHL(netlong)

/**
* @brief Convert values between host and network byte order.
*
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohs.html">
* The Open Group Base Specification Issue 7, ntohs
* </a>
*
* @param[in] netshort A 16-bit integer number.
* @return The argument value converted from network to host byte
* order.
*/
#define ntohs(netshort) NTOHS(netshort)

/**
* @brief Converts an IP address to its string representation
*
Expand Down
Loading

0 comments on commit fefce2b

Please sign in to comment.