My Project
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
inet.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <netinet/in.h>
4 #include <stdint.h>
5 
6 static inline uint32_t htonl(uint32_t hostlong)
7 {
8  return __builtin_bswap32(hostlong);
9 }
10 
11 static inline uint16_t htons(uint16_t hostshort)
12 {
13  return __builtin_bswap16(hostshort);
14 }
15 
16 static inline uint32_t ntohl(uint32_t netlong)
17 {
18  return __builtin_bswap32(netlong);
19 }
20 
21 static inline uint16_t ntohs(uint16_t netshort)
22 {
23  return __builtin_bswap16(netshort);
24 }
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30  in_addr_t inet_addr(const char *cp);
31  int inet_aton(const char *cp, struct in_addr *inp);
32  char* inet_ntoa(struct in_addr in);
33 
34 #ifdef __cplusplus
35 }
36 #endif
in_addr_t inet_addr(const char *cp)
Definition: soc_inet_addr.c:4
Definition: in.h:19
int inet_aton(const char *cp, struct in_addr *inp)
Definition: soc_inet_aton.c:6
uint32_t in_addr_t
Definition: in.h:17
char * inet_ntoa(struct in_addr in)
Definition: soc_inet_ntoa.c:7