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 18, 2015
1 parent f81adda commit 902d305
Show file tree
Hide file tree
Showing 11 changed files with 994 additions and 483 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 @@ -13,7 +13,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
70 changes: 3 additions & 67 deletions sys/posix/include/arpa/inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* @addtogroup pnet
* @addtogroup posix_sockets
* @{
*/

Expand All @@ -24,80 +24,16 @@
#define ARPA_INET_H

#include <inttypes.h>
#include <netinet/in.h>

#include "net_help.h"
#include "inet_ntop.h"
#include "inet_pton.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

#define INET_ADDRSTRLEN 16 ///< Length of the string form for IPv4.
#define INET6_ADDRSTRLEN 46 ///< Length of the string form for IPv6.

/**
* 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)

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 902d305

Please sign in to comment.