Changeset c0e74b1 in mainline for uspace/lib/c/include/net/inet.h
- Timestamp:
- 2010-10-06T22:58:18Z (14 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/net/inet.h
r49d871ea rc0e74b1 27 27 */ 28 28 29 /** @addtogroup net29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 32 33 33 /** @file 34 * Host - network byte order manipulation functions.34 * Internet common definitions. 35 35 */ 36 36 37 #ifndef __NET_BYTEORDER_H__38 #define __NET_BYTEORDER_H__37 #ifndef LIBC_INET_H_ 38 #define LIBC_INET_H_ 39 39 40 #include <sys/types.h> 40 41 #include <byteorder.h> 41 #include <sys/types.h>42 42 43 /** Type definition of the socket address. 44 * @see sockaddr 45 */ 46 typedef struct sockaddr sockaddr_t; 43 47 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 47 50 */ 48 #define htons(number) host2uint16_t_be(number) 51 typedef struct addrinfo addrinfo_t; 49 52 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. */ 54 struct sockaddr { 55 /** Address family. @see socket.h */ 56 uint16_t sa_family; 57 /** 14 byte protocol address. */ 58 uint8_t sa_data[14]; 59 }; 55 60 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) 61 extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t); 62 extern int inet_pton(uint16_t, const char *, uint8_t *); 67 63 68 64 #endif
Note:
See TracChangeset
for help on using the changeset viewer.