/* * Copyright (C) 2015 Martine Lenders * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @addtogroup posix_sockets */ /** * @{ * * @file * @brief System-internal byte operations. * * @author Martine Lenders */ #ifndef BYTES_H #define BYTES_H #include "byteorder.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Convert values between host and network byte order. * * @see * The Open Group Base Specification Issue 7, htonl * * * @param[in] hostlong A 32 bit number. * @return The argument value converted from host to network byte * order. */ #ifndef htonl #define htonl(hostlong) HTONL(hostlong) #endif /** * @brief Convert values between host and network byte order. * * @see * The Open Group Base Specification Issue 7, htons * * * @param[in] hostshort A 16 bit number. * @return The argument value converted from host to network byte * order. */ #ifndef htons #define htons(hostshort) HTONS(hostshort) #endif /** * @brief Convert values between host and network byte order. * * @see * The Open Group Base Specification Issue 7, ntohl * * * @param[in] netlong A 32-bit integer number. * @return The argument value converted from network to host byte * order. */ #ifndef ntohl #define ntohl(netlong) NTOHL(netlong) #endif /** * @brief Convert values between host and network byte order. * * @see * The Open Group Base Specification Issue 7, ntohs * * * @param[in] netshort A 16-bit integer number. * @return The argument value converted from network to host byte * order. */ #ifndef ntohs #define ntohs(netshort) NTOHS(netshort) #endif typedef size_t socklen_t; /**< socket address length */ #ifdef __cplusplus } #endif #endif /* BYTES_H */ /** @} */