client-c  0.8.1
cc32xx_sock.h
Go to the documentation of this file.
1 
17 #ifndef CC32XX_SOCK_H_
18 #define CC32XX_SOCK_H_
19 
20 /* Avoid redefined warning */
21 #undef __CONCAT
22 #undef FD_SETSIZE
23 #undef FD_SET
24 #undef FD_CLR
25 #undef FD_ISSET
26 #undef FD_ZERO
27 #undef fd_set
28 #undef EBADF
29 #undef EAGAIN
30 #undef EWOULDBLOCK
31 #undef ENOMEM
32 #undef EACCES
33 #undef EFAULT
34 #undef EINVAL
35 #undef EDESTADDRREQ
36 #undef EPROTOTYPE
37 #undef ENOPROTOOPT
38 #undef EPROTONOSUPPORT
39 #undef EOPNOTSUPP
40 #undef EAFNOSUPPORT
41 #undef EADDRINUSE
42 #undef EADDRNOTAVAIL
43 #undef ENETUNREACH
44 #undef ENOBUFS
45 #undef EISCONN
46 #undef ENOTCONN
47 #undef ETIMEDOUT
48 #undef ECONNREFUSED
49 
50 #include "simplelink.h"
51 #include "socket.h"
52 #include "../common/kaa_htonll.h"
53 
54 struct addrinfo
55 {
56  int ai_flags; /* Input flags. */
57  int ai_family; /* Protocol family for socket. */
58  int ai_socktype; /* Socket type. */
59  int ai_protocol; /* Protocol for socket. */
60  socklen_t ai_addrlen; /* Length of socket address. */
61  struct sockaddr *ai_addr; /* Socket address for socket. */
62  char *ai_canonname; /* Canonical name for service location. */
63  struct addrinfo *ai_next; /* Pointer to next in list. */
64 };
65 
66 #define _SS_PADSIZE (128 - (2 * sizeof (unsigned long)))
68 {
69  unsigned short ss_family; /* Address family, etc. */
70  unsigned long __ss_align; /* Force desired alignment. */
72 };
73 
74 typedef int kaa_fd_t;
75 
76 typedef struct sockaddr kaa_sockaddr_t;
78 typedef socklen_t kaa_socklen_t;
79 
80 #define KAA_HTONS(hostshort) htons((hostshort))
81 #define KAA_HTONL(hostlong) htonl((hostlong))
82 #define KAA_HTONLL(hostlonglong) htonll((hostlonglong))
83 
84 #define KAA_NTOHS(netshort) ntohs((netshort))
85 #define KAA_NTOHL(netlong) ntohl((netlong))
86 #define KAA_NTOHLL(netlonglong) ntohll((netlonglong))
87 
88 #endif /* CC32XX_SOCK_H_ */
socklen_t ai_addrlen
Definition: cc32xx_sock.h:60
socklen_t kaa_socklen_t
Definition: cc32xx_sock.h:78
unsigned long __ss_align
Definition: cc32xx_sock.h:70
char * ai_canonname
Definition: cc32xx_sock.h:62
unsigned short ss_family
Definition: cc32xx_sock.h:69
char __ss_padding[_SS_PADSIZE]
Definition: cc32xx_sock.h:71
int ai_protocol
Definition: cc32xx_sock.h:59
#define _SS_PADSIZE
Definition: cc32xx_sock.h:66
int ai_socktype
Definition: cc32xx_sock.h:58
struct addrinfo * ai_next
Definition: cc32xx_sock.h:63
int kaa_fd_t
Definition: cc32xx_sock.h:74
int ai_flags
Definition: cc32xx_sock.h:56
struct sockaddr * ai_addr
Definition: cc32xx_sock.h:61
struct sockaddr kaa_sockaddr_t
Definition: cc32xx_sock.h:76
int ai_family
Definition: cc32xx_sock.h:57