/src/krb5/src/include/port-sockets.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
2 | | #ifndef _PORT_SOCKET_H |
3 | | #define _PORT_SOCKET_H |
4 | | #if defined(_WIN32) |
5 | | |
6 | | #include <winsock2.h> |
7 | | #include <ws2tcpip.h> |
8 | | #include <errno.h> |
9 | | |
10 | | /* Some of our own infrastructure where the Winsock stuff was too hairy |
11 | | * to dump into a clean Unix program */ |
12 | | |
13 | | typedef WSABUF sg_buf; |
14 | | |
15 | | #define SG_ADVANCE(SG, N) \ |
16 | | ((SG)->len < (N) \ |
17 | | ? (abort(), 0) \ |
18 | | : ((SG)->buf += (N), (SG)->len -= (N), 0)) |
19 | | |
20 | | #define SG_LEN(SG) ((SG)->len + 0) |
21 | | #define SG_BUF(SG) ((SG)->buf + 0) |
22 | | #define SG_SET(SG, B, N) ((SG)->buf = (char *)(B),(SG)->len = (N)) |
23 | | |
24 | | #define SOCKET_INITIALIZE() 0 |
25 | | #define SOCKET_CLEANUP() |
26 | | #define SOCKET_ERRNO (TranslatedWSAGetLastError()) |
27 | | #define SOCKET_SET_ERRNO(x) (TranslatedWSASetLastError(x)) |
28 | | #define SOCKET_NFDS(f) (0) /* select()'s first arg is ignored */ |
29 | | #define SOCKET_READ(fd, b, l) (recv(fd, b, l, 0)) |
30 | | #define SOCKET_WRITE(fd, b, l) (send(fd, b, l, 0)) |
31 | | #define SOCKET_CONNECT connect /* XXX */ |
32 | | #define SOCKET_GETSOCKNAME getsockname /* XXX */ |
33 | | #define SOCKET_CLOSE close /* XXX */ |
34 | | #define SOCKET_EINTR WSAEINTR |
35 | | |
36 | | /* |
37 | | * Return -1 for error or number of bytes written. TMP is a temporary |
38 | | * variable; must be declared by the caller, and must be used by this macro (to |
39 | | * avoid compiler warnings). |
40 | | */ |
41 | | /* WSASend returns 0 or SOCKET_ERROR. */ |
42 | | #define SOCKET_WRITEV_TEMP DWORD |
43 | | #define SOCKET_WRITEV(FD, SG, LEN, TMP) \ |
44 | | (WSASend((FD), (SG), (LEN), &(TMP), 0, 0, 0) ? \ |
45 | | (ssize_t)-1 : (ssize_t)(TMP)) |
46 | | |
47 | | #define SHUTDOWN_READ SD_RECEIVE |
48 | | #define SHUTDOWN_WRITE SD_SEND |
49 | | #define SHUTDOWN_BOTH SD_BOTH |
50 | | |
51 | | /* |
52 | | * Define any missing POSIX socket errors. This is for compatibility with |
53 | | * older versions of MSVC (pre-2010). |
54 | | */ |
55 | | #ifndef EINPROGRESS |
56 | | #define EINPROGRESS WSAEINPROGRESS |
57 | | #endif |
58 | | #ifndef EWOULDBLOCK |
59 | | #define EWOULDBLOCK WSAEWOULDBLOCK |
60 | | #endif |
61 | | #ifndef ECONNRESET |
62 | | #define ECONNRESET WSAECONNRESET |
63 | | #endif |
64 | | #ifndef ECONNABORTED |
65 | | #define ECONNABORTED WSAECONNABORTED |
66 | | #endif |
67 | | #ifndef ECONNREFUSED |
68 | | #define ECONNREFUSED WSAECONNREFUSED |
69 | | #endif |
70 | | #ifndef EHOSTUNREACH |
71 | | #define EHOSTUNREACH WSAEHOSTUNREACH |
72 | | #endif |
73 | | #ifndef ETIMEDOUT |
74 | | #define ETIMEDOUT WSAETIMEDOUT |
75 | | #endif |
76 | | |
77 | | /* Translate posix_error to its Winsock counterpart and set the last Winsock |
78 | | * error to the result. */ |
79 | | static __inline void TranslatedWSASetLastError(int posix_error) |
80 | | { |
81 | | int wsa_error; |
82 | | switch (posix_error) { |
83 | | case 0: |
84 | | wsa_error = 0; break; |
85 | | case EINPROGRESS: |
86 | | wsa_error = WSAEINPROGRESS; break; |
87 | | case EWOULDBLOCK: |
88 | | wsa_error = WSAEWOULDBLOCK; break; |
89 | | case ECONNRESET: |
90 | | wsa_error = WSAECONNRESET; break; |
91 | | case ECONNABORTED: |
92 | | wsa_error = WSAECONNABORTED; break; |
93 | | case ECONNREFUSED: |
94 | | wsa_error = WSAECONNREFUSED; break; |
95 | | case EHOSTUNREACH: |
96 | | wsa_error = WSAEHOSTUNREACH; break; |
97 | | case ETIMEDOUT: |
98 | | wsa_error = WSAETIMEDOUT; break; |
99 | | case EAFNOSUPPORT: |
100 | | wsa_error = WSAEAFNOSUPPORT; break; |
101 | | case EINVAL: |
102 | | wsa_error = WSAEINVAL; break; |
103 | | default: |
104 | | /* Ideally, we would log via k5-trace here, but we have no context. */ |
105 | | wsa_error = WSAEINVAL; break; |
106 | | } |
107 | | WSASetLastError(wsa_error); |
108 | | } |
109 | | |
110 | | /* |
111 | | * Translate Winsock errors to their POSIX counterparts. This is necessary for |
112 | | * MSVC 2010+, where both Winsock and POSIX errors are defined. |
113 | | */ |
114 | | static __inline int TranslatedWSAGetLastError(void) |
115 | | { |
116 | | int err = WSAGetLastError(); |
117 | | switch (err) { |
118 | | case 0: |
119 | | break; |
120 | | case WSAEINPROGRESS: |
121 | | err = EINPROGRESS; break; |
122 | | case WSAEWOULDBLOCK: |
123 | | err = EWOULDBLOCK; break; |
124 | | case WSAECONNRESET: |
125 | | err = ECONNRESET; break; |
126 | | case WSAECONNABORTED: |
127 | | err = ECONNABORTED; break; |
128 | | case WSAECONNREFUSED: |
129 | | err = ECONNREFUSED; break; |
130 | | case WSAEHOSTUNREACH: |
131 | | err = EHOSTUNREACH; break; |
132 | | case WSAETIMEDOUT: |
133 | | err = ETIMEDOUT; break; |
134 | | case WSAEAFNOSUPPORT: |
135 | | err = EAFNOSUPPORT; break; |
136 | | case WSAEINVAL: |
137 | | err = EINVAL; break; |
138 | | default: |
139 | | /* Ideally, we would log via k5-trace here, but we have no context. */ |
140 | | err = EINVAL; break; |
141 | | } |
142 | | return err; |
143 | | } |
144 | | |
145 | | #elif defined(__palmos__) |
146 | | |
147 | | /* If this source file requires it, define struct sockaddr_in (and possibly |
148 | | * other things related to network I/O). */ |
149 | | |
150 | | #include "autoconf.h" |
151 | | #include <netdb.h> |
152 | | typedef int socklen_t; |
153 | | |
154 | | #else /* UNIX variants */ |
155 | | |
156 | | #include "autoconf.h" |
157 | | |
158 | | #include <sys/types.h> |
159 | | #include <netinet/in.h> /* For struct sockaddr_in and in_addr */ |
160 | | #include <sys/un.h> /* For struct sockaddr_un */ |
161 | | #include <arpa/inet.h> /* For inet_ntoa */ |
162 | | #include <netdb.h> |
163 | | #include <string.h> /* For memset */ |
164 | | |
165 | | #ifndef HAVE_NETDB_H_H_ERRNO |
166 | | extern int h_errno; /* In case it's missing, e.g., HP-UX 10.20. */ |
167 | | #endif |
168 | | |
169 | | #include <sys/param.h> /* For MAXHOSTNAMELEN */ |
170 | | #include <sys/socket.h> /* For SOCK_*, AF_*, etc */ |
171 | | #include <sys/time.h> /* For struct timeval */ |
172 | | #include <net/if.h> /* For struct ifconf, for localaddr.c */ |
173 | | #ifdef HAVE_SYS_UIO_H |
174 | | #include <sys/uio.h> /* For struct iovec, for sg_buf */ |
175 | | #endif |
176 | | #ifdef HAVE_SYS_FILIO_H |
177 | | #include <sys/filio.h> /* For FIONBIO on Solaris. */ |
178 | | #endif |
179 | | |
180 | | /* |
181 | | * Either size_t or int or unsigned int is probably right. Under |
182 | | * SunOS 4, it looks like int is desired, according to the accept man |
183 | | * page. |
184 | | */ |
185 | | #ifndef HAVE_SOCKLEN_T |
186 | | typedef int socklen_t; |
187 | | #endif |
188 | | |
189 | | #ifndef HAVE_STRUCT_SOCKADDR_STORAGE |
190 | | struct krb5int_sockaddr_storage { |
191 | | struct sockaddr_in s; |
192 | | /* Plenty of slop just in case we get an ipv6 address anyways. */ |
193 | | long extra[16]; |
194 | | }; |
195 | | #define sockaddr_storage krb5int_sockaddr_storage |
196 | | #endif |
197 | | |
198 | | /* Unix equivalents of Winsock calls */ |
199 | 0 | #define SOCKET int |
200 | 0 | #define INVALID_SOCKET ((SOCKET)~0) |
201 | 0 | #define closesocket close |
202 | 0 | #define ioctlsocket ioctl |
203 | | #define SOCKET_ERROR (-1) |
204 | | |
205 | | typedef struct iovec sg_buf; |
206 | | |
207 | | #define SG_ADVANCE(SG, N) \ |
208 | 0 | ((SG)->iov_len < (N) \ |
209 | 0 | ? (abort(), 0) \ |
210 | 0 | : ((SG)->iov_base = (char *) (SG)->iov_base + (N), \ |
211 | 0 | (SG)->iov_len -= (N), 0)) |
212 | | |
213 | 0 | #define SG_LEN(SG) ((SG)->iov_len + 0) |
214 | 0 | #define SG_BUF(SG) ((char*)(SG)->iov_base + 0) |
215 | 0 | #define SG_SET(SG, B, L) ((SG)->iov_base = (char*)(B), (SG)->iov_len = (L)) |
216 | | |
217 | | #define SOCKET_INITIALIZE() (0) /* No error (or anything else) */ |
218 | | #define SOCKET_CLEANUP() /* nothing */ |
219 | 0 | #define SOCKET_ERRNO errno |
220 | | #define SOCKET_SET_ERRNO(x) (errno = (x)) |
221 | | #define SOCKET_NFDS(f) ((f)+1) /* select() arg for a single fd */ |
222 | 0 | #define SOCKET_READ read |
223 | | #define SOCKET_WRITE write |
224 | | static inline int |
225 | | socket_connect(int fd, const struct sockaddr *addr, socklen_t addrlen) |
226 | 0 | { |
227 | 0 | int st; |
228 | | #ifdef SO_NOSIGPIPE |
229 | | int set = 1; |
230 | | #endif |
231 | |
|
232 | 0 | st = connect(fd, addr, addrlen); |
233 | 0 | if (st == -1) |
234 | 0 | return st; |
235 | | |
236 | | #ifdef SO_NOSIGPIPE |
237 | | st = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof(set)); |
238 | | if (st != 0) |
239 | | st = -1; |
240 | | #endif |
241 | | |
242 | 0 | return st; |
243 | 0 | } Unexecuted instantiation: fuzz_pac.c:socket_connect Unexecuted instantiation: init_ctx.c:socket_connect Unexecuted instantiation: kerrs.c:socket_connect Unexecuted instantiation: kfree.c:socket_connect Unexecuted instantiation: pac.c:socket_connect Unexecuted instantiation: parse.c:socket_connect Unexecuted instantiation: plugin.c:socket_connect Unexecuted instantiation: serialize.c:socket_connect Unexecuted instantiation: unparse.c:socket_connect Unexecuted instantiation: expand_path.c:socket_connect Unexecuted instantiation: hostrealm.c:socket_connect Unexecuted instantiation: hostrealm_dns.c:socket_connect Unexecuted instantiation: hostrealm_domain.c:socket_connect Unexecuted instantiation: hostrealm_profile.c:socket_connect Unexecuted instantiation: hostrealm_registry.c:socket_connect Unexecuted instantiation: init_os_ctx.c:socket_connect Unexecuted instantiation: localauth.c:socket_connect Unexecuted instantiation: localauth_an2ln.c:socket_connect Unexecuted instantiation: localauth_k5login.c:socket_connect Unexecuted instantiation: localauth_names.c:socket_connect Unexecuted instantiation: localauth_rule.c:socket_connect Unexecuted instantiation: locate_kdc.c:socket_connect Unexecuted instantiation: trace.c:socket_connect Unexecuted instantiation: krb5_libinit.c:socket_connect Unexecuted instantiation: asn1_k_encode.c:socket_connect Unexecuted instantiation: ccbase.c:socket_connect Unexecuted instantiation: ccdefops.c:socket_connect Unexecuted instantiation: ccselect.c:socket_connect Unexecuted instantiation: ccselect_hostname.c:socket_connect Unexecuted instantiation: ccselect_k5identity.c:socket_connect Unexecuted instantiation: ccselect_realm.c:socket_connect Unexecuted instantiation: cc_dir.c:socket_connect Unexecuted instantiation: cc_file.c:socket_connect Unexecuted instantiation: cc_kcm.c:socket_connect Unexecuted instantiation: cc_memory.c:socket_connect Unexecuted instantiation: ccfns.c:socket_connect Unexecuted instantiation: ktbase.c:socket_connect Unexecuted instantiation: ktfns.c:socket_connect Unexecuted instantiation: kt_file.c:socket_connect Unexecuted instantiation: kt_memory.c:socket_connect Unexecuted instantiation: authdata.c:socket_connect Unexecuted instantiation: authdata_enc.c:socket_connect Unexecuted instantiation: authdata_dec.c:socket_connect Unexecuted instantiation: bld_princ.c:socket_connect Unexecuted instantiation: copy_auth.c:socket_connect Unexecuted instantiation: copy_creds.c:socket_connect Unexecuted instantiation: copy_data.c:socket_connect Unexecuted instantiation: copy_princ.c:socket_connect Unexecuted instantiation: cp_key_cnt.c:socket_connect Unexecuted instantiation: deltat.c:socket_connect Unexecuted instantiation: etype_list.c:socket_connect Unexecuted instantiation: libdef_parse.c:socket_connect Unexecuted instantiation: parse_host_string.c:socket_connect Unexecuted instantiation: preauth2.c:socket_connect Unexecuted instantiation: preauth_ec.c:socket_connect Unexecuted instantiation: preauth_encts.c:socket_connect Unexecuted instantiation: preauth_otp.c:socket_connect Unexecuted instantiation: preauth_sam2.c:socket_connect Unexecuted instantiation: princ_comp.c:socket_connect Unexecuted instantiation: random_str.c:socket_connect Unexecuted instantiation: response_items.c:socket_connect Unexecuted instantiation: set_realm.c:socket_connect Unexecuted instantiation: sname_match.c:socket_connect Unexecuted instantiation: ucstr.c:socket_connect Unexecuted instantiation: addr.c:socket_connect Unexecuted instantiation: c_ustime.c:socket_connect Unexecuted instantiation: ccdefname.c:socket_connect Unexecuted instantiation: dnsglue.c:socket_connect Unexecuted instantiation: dnssrv.c:socket_connect Unexecuted instantiation: krbfileio.c:socket_connect Unexecuted instantiation: lock_file.c:socket_connect Unexecuted instantiation: net_read.c:socket_connect Unexecuted instantiation: net_write.c:socket_connect Unexecuted instantiation: prompter.c:socket_connect Unexecuted instantiation: sn2princ.c:socket_connect Unexecuted instantiation: timeofday.c:socket_connect Unexecuted instantiation: unlck_file.c:socket_connect Unexecuted instantiation: asn1_encode.c:socket_connect Unexecuted instantiation: cccursor.c:socket_connect Unexecuted instantiation: ccmarshal.c:socket_connect Unexecuted instantiation: cc_retr.c:socket_connect Unexecuted instantiation: ktfr_entry.c:socket_connect Unexecuted instantiation: ai_authdata.c:socket_connect Unexecuted instantiation: cammac_util.c:socket_connect Unexecuted instantiation: copy_addrs.c:socket_connect Unexecuted instantiation: enc_helper.c:socket_connect Unexecuted instantiation: get_in_tkt.c:socket_connect Unexecuted instantiation: gic_opt.c:socket_connect Unexecuted instantiation: gic_pwd.c:socket_connect Unexecuted instantiation: kdc_rep_dc.c:socket_connect Unexecuted instantiation: padata.c:socket_connect Unexecuted instantiation: pr_to_salt.c:socket_connect Unexecuted instantiation: send_tgs.c:socket_connect Unexecuted instantiation: str_conv.c:socket_connect Unexecuted instantiation: ucdata.c:socket_connect Unexecuted instantiation: changepw.c:socket_connect Unexecuted instantiation: localaddr.c:socket_connect Unexecuted instantiation: sendto_kdc.c:socket_connect Unexecuted instantiation: toffset.c:socket_connect Unexecuted instantiation: ustime.c:socket_connect Unexecuted instantiation: auth_con.c:socket_connect Unexecuted instantiation: bld_pr_ext.c:socket_connect Unexecuted instantiation: chpw.c:socket_connect Unexecuted instantiation: fast.c:socket_connect Unexecuted instantiation: gen_subkey.c:socket_connect Unexecuted instantiation: get_creds.c:socket_connect Unexecuted instantiation: mk_priv.c:socket_connect Unexecuted instantiation: mk_req_ext.c:socket_connect Unexecuted instantiation: privsafe.c:socket_connect Unexecuted instantiation: rd_error.c:socket_connect Unexecuted instantiation: rd_priv.c:socket_connect Unexecuted instantiation: rd_rep.c:socket_connect Unexecuted instantiation: s4u_creds.c:socket_connect Unexecuted instantiation: tgtname.c:socket_connect Unexecuted instantiation: valid_times.c:socket_connect Unexecuted instantiation: walk_rtree.c:socket_connect Unexecuted instantiation: memrcache.c:socket_connect Unexecuted instantiation: rc_base.c:socket_connect Unexecuted instantiation: rc_dfl.c:socket_connect Unexecuted instantiation: rc_file2.c:socket_connect Unexecuted instantiation: rc_none.c:socket_connect Unexecuted instantiation: hostaddr.c:socket_connect Unexecuted instantiation: mk_faddr.c:socket_connect Unexecuted instantiation: addr_comp.c:socket_connect Unexecuted instantiation: addr_srch.c:socket_connect Unexecuted instantiation: authdata_exp.c:socket_connect Unexecuted instantiation: gc_via_tkt.c:socket_connect Unexecuted instantiation: gen_seqnum.c:socket_connect Unexecuted instantiation: gen_save_subkey.c:socket_connect Unexecuted instantiation: decode_kdc.c:socket_connect Unexecuted instantiation: cf2.c:socket_connect Unexecuted instantiation: checksum_length.c:socket_connect Unexecuted instantiation: cksumtypes.c:socket_connect Unexecuted instantiation: crypto_length.c:socket_connect Unexecuted instantiation: decrypt.c:socket_connect Unexecuted instantiation: encrypt.c:socket_connect Unexecuted instantiation: encrypt_length.c:socket_connect Unexecuted instantiation: enctype_util.c:socket_connect Unexecuted instantiation: etypes.c:socket_connect Unexecuted instantiation: key.c:socket_connect Unexecuted instantiation: keyblocks.c:socket_connect Unexecuted instantiation: keyed_cksum.c:socket_connect Unexecuted instantiation: make_checksum.c:socket_connect Unexecuted instantiation: make_random_key.c:socket_connect Unexecuted instantiation: mandatory_sumtype.c:socket_connect Unexecuted instantiation: prf.c:socket_connect Unexecuted instantiation: prf_aes2.c:socket_connect Unexecuted instantiation: prf_cmac.c:socket_connect Unexecuted instantiation: prf_dk.c:socket_connect Unexecuted instantiation: prf_rc4.c:socket_connect Unexecuted instantiation: prng.c:socket_connect Unexecuted instantiation: random_to_key.c:socket_connect Unexecuted instantiation: s2k_pbkdf2.c:socket_connect Unexecuted instantiation: s2k_rc4.c:socket_connect Unexecuted instantiation: state.c:socket_connect Unexecuted instantiation: string_to_key.c:socket_connect Unexecuted instantiation: verify_checksum.c:socket_connect Unexecuted instantiation: cmac.c:socket_connect Unexecuted instantiation: hmac.c:socket_connect Unexecuted instantiation: kdf.c:socket_connect Unexecuted instantiation: pbkdf2.c:socket_connect Unexecuted instantiation: des_keys.c:socket_connect Unexecuted instantiation: f_parity.c:socket_connect Unexecuted instantiation: des3.c:socket_connect Unexecuted instantiation: rc4.c:socket_connect Unexecuted instantiation: aes.c:socket_connect Unexecuted instantiation: camellia.c:socket_connect Unexecuted instantiation: hash_md4.c:socket_connect Unexecuted instantiation: hash_md5.c:socket_connect Unexecuted instantiation: hash_sha1.c:socket_connect Unexecuted instantiation: hash_sha2.c:socket_connect Unexecuted instantiation: aead.c:socket_connect Unexecuted instantiation: checksum_dk_cmac.c:socket_connect Unexecuted instantiation: checksum_dk_hmac.c:socket_connect Unexecuted instantiation: checksum_etm.c:socket_connect Unexecuted instantiation: checksum_hmac_md5.c:socket_connect Unexecuted instantiation: checksum_unkeyed.c:socket_connect Unexecuted instantiation: default_state.c:socket_connect Unexecuted instantiation: derive.c:socket_connect Unexecuted instantiation: enc_dk_cmac.c:socket_connect Unexecuted instantiation: enc_dk_hmac.c:socket_connect Unexecuted instantiation: enc_etm.c:socket_connect Unexecuted instantiation: enc_raw.c:socket_connect Unexecuted instantiation: enc_rc4.c:socket_connect Unexecuted instantiation: nfold.c:socket_connect Unexecuted instantiation: d3_aead.c:socket_connect Unexecuted instantiation: d3_kysched.c:socket_connect Unexecuted instantiation: f_aead.c:socket_connect Unexecuted instantiation: f_sched.c:socket_connect Unexecuted instantiation: f_tables.c:socket_connect Unexecuted instantiation: weak_key.c:socket_connect Unexecuted instantiation: aescrypt.c:socket_connect Unexecuted instantiation: aestab.c:socket_connect Unexecuted instantiation: aeskey.c:socket_connect Unexecuted instantiation: md4.c:socket_connect Unexecuted instantiation: md5.c:socket_connect Unexecuted instantiation: shs.c:socket_connect Unexecuted instantiation: sha256.c:socket_connect Unexecuted instantiation: sha512.c:socket_connect Unexecuted instantiation: threads.c:socket_connect Unexecuted instantiation: init-addrinfo.c:socket_connect Unexecuted instantiation: fake-addrinfo.c:socket_connect |
244 | 0 | #define SOCKET_CONNECT socket_connect |
245 | | #define SOCKET_GETSOCKNAME getsockname |
246 | | #define SOCKET_CLOSE close |
247 | 0 | #define SOCKET_EINTR EINTR |
248 | 0 | #define SOCKET_WRITEV_TEMP int |
249 | | static inline ssize_t |
250 | | socket_sendmsg(SOCKET fd, sg_buf *iov, int iovcnt) |
251 | 0 | { |
252 | 0 | struct msghdr msg; |
253 | 0 | int flags = 0; |
254 | |
|
255 | 0 | #ifdef MSG_NOSIGNAL |
256 | 0 | flags |= MSG_NOSIGNAL; |
257 | 0 | #endif |
258 | |
|
259 | 0 | memset(&msg, 0, sizeof(msg)); |
260 | 0 | msg.msg_iov = iov; |
261 | 0 | msg.msg_iovlen = iovcnt; |
262 | |
|
263 | 0 | return sendmsg(fd, &msg, flags); |
264 | 0 | } Unexecuted instantiation: fuzz_pac.c:socket_sendmsg Unexecuted instantiation: init_ctx.c:socket_sendmsg Unexecuted instantiation: kerrs.c:socket_sendmsg Unexecuted instantiation: kfree.c:socket_sendmsg Unexecuted instantiation: pac.c:socket_sendmsg Unexecuted instantiation: parse.c:socket_sendmsg Unexecuted instantiation: plugin.c:socket_sendmsg Unexecuted instantiation: serialize.c:socket_sendmsg Unexecuted instantiation: unparse.c:socket_sendmsg Unexecuted instantiation: expand_path.c:socket_sendmsg Unexecuted instantiation: hostrealm.c:socket_sendmsg Unexecuted instantiation: hostrealm_dns.c:socket_sendmsg Unexecuted instantiation: hostrealm_domain.c:socket_sendmsg Unexecuted instantiation: hostrealm_profile.c:socket_sendmsg Unexecuted instantiation: hostrealm_registry.c:socket_sendmsg Unexecuted instantiation: init_os_ctx.c:socket_sendmsg Unexecuted instantiation: localauth.c:socket_sendmsg Unexecuted instantiation: localauth_an2ln.c:socket_sendmsg Unexecuted instantiation: localauth_k5login.c:socket_sendmsg Unexecuted instantiation: localauth_names.c:socket_sendmsg Unexecuted instantiation: localauth_rule.c:socket_sendmsg Unexecuted instantiation: locate_kdc.c:socket_sendmsg Unexecuted instantiation: trace.c:socket_sendmsg Unexecuted instantiation: krb5_libinit.c:socket_sendmsg Unexecuted instantiation: asn1_k_encode.c:socket_sendmsg Unexecuted instantiation: ccbase.c:socket_sendmsg Unexecuted instantiation: ccdefops.c:socket_sendmsg Unexecuted instantiation: ccselect.c:socket_sendmsg Unexecuted instantiation: ccselect_hostname.c:socket_sendmsg Unexecuted instantiation: ccselect_k5identity.c:socket_sendmsg Unexecuted instantiation: ccselect_realm.c:socket_sendmsg Unexecuted instantiation: cc_dir.c:socket_sendmsg Unexecuted instantiation: cc_file.c:socket_sendmsg Unexecuted instantiation: cc_kcm.c:socket_sendmsg Unexecuted instantiation: cc_memory.c:socket_sendmsg Unexecuted instantiation: ccfns.c:socket_sendmsg Unexecuted instantiation: ktbase.c:socket_sendmsg Unexecuted instantiation: ktfns.c:socket_sendmsg Unexecuted instantiation: kt_file.c:socket_sendmsg Unexecuted instantiation: kt_memory.c:socket_sendmsg Unexecuted instantiation: authdata.c:socket_sendmsg Unexecuted instantiation: authdata_enc.c:socket_sendmsg Unexecuted instantiation: authdata_dec.c:socket_sendmsg Unexecuted instantiation: bld_princ.c:socket_sendmsg Unexecuted instantiation: copy_auth.c:socket_sendmsg Unexecuted instantiation: copy_creds.c:socket_sendmsg Unexecuted instantiation: copy_data.c:socket_sendmsg Unexecuted instantiation: copy_princ.c:socket_sendmsg Unexecuted instantiation: cp_key_cnt.c:socket_sendmsg Unexecuted instantiation: deltat.c:socket_sendmsg Unexecuted instantiation: etype_list.c:socket_sendmsg Unexecuted instantiation: libdef_parse.c:socket_sendmsg Unexecuted instantiation: parse_host_string.c:socket_sendmsg Unexecuted instantiation: preauth2.c:socket_sendmsg Unexecuted instantiation: preauth_ec.c:socket_sendmsg Unexecuted instantiation: preauth_encts.c:socket_sendmsg Unexecuted instantiation: preauth_otp.c:socket_sendmsg Unexecuted instantiation: preauth_sam2.c:socket_sendmsg Unexecuted instantiation: princ_comp.c:socket_sendmsg Unexecuted instantiation: random_str.c:socket_sendmsg Unexecuted instantiation: response_items.c:socket_sendmsg Unexecuted instantiation: set_realm.c:socket_sendmsg Unexecuted instantiation: sname_match.c:socket_sendmsg Unexecuted instantiation: ucstr.c:socket_sendmsg Unexecuted instantiation: addr.c:socket_sendmsg Unexecuted instantiation: c_ustime.c:socket_sendmsg Unexecuted instantiation: ccdefname.c:socket_sendmsg Unexecuted instantiation: dnsglue.c:socket_sendmsg Unexecuted instantiation: dnssrv.c:socket_sendmsg Unexecuted instantiation: krbfileio.c:socket_sendmsg Unexecuted instantiation: lock_file.c:socket_sendmsg Unexecuted instantiation: net_read.c:socket_sendmsg Unexecuted instantiation: net_write.c:socket_sendmsg Unexecuted instantiation: prompter.c:socket_sendmsg Unexecuted instantiation: sn2princ.c:socket_sendmsg Unexecuted instantiation: timeofday.c:socket_sendmsg Unexecuted instantiation: unlck_file.c:socket_sendmsg Unexecuted instantiation: asn1_encode.c:socket_sendmsg Unexecuted instantiation: cccursor.c:socket_sendmsg Unexecuted instantiation: ccmarshal.c:socket_sendmsg Unexecuted instantiation: cc_retr.c:socket_sendmsg Unexecuted instantiation: ktfr_entry.c:socket_sendmsg Unexecuted instantiation: ai_authdata.c:socket_sendmsg Unexecuted instantiation: cammac_util.c:socket_sendmsg Unexecuted instantiation: copy_addrs.c:socket_sendmsg Unexecuted instantiation: enc_helper.c:socket_sendmsg Unexecuted instantiation: get_in_tkt.c:socket_sendmsg Unexecuted instantiation: gic_opt.c:socket_sendmsg Unexecuted instantiation: gic_pwd.c:socket_sendmsg Unexecuted instantiation: kdc_rep_dc.c:socket_sendmsg Unexecuted instantiation: padata.c:socket_sendmsg Unexecuted instantiation: pr_to_salt.c:socket_sendmsg Unexecuted instantiation: send_tgs.c:socket_sendmsg Unexecuted instantiation: str_conv.c:socket_sendmsg Unexecuted instantiation: ucdata.c:socket_sendmsg Unexecuted instantiation: changepw.c:socket_sendmsg Unexecuted instantiation: localaddr.c:socket_sendmsg Unexecuted instantiation: sendto_kdc.c:socket_sendmsg Unexecuted instantiation: toffset.c:socket_sendmsg Unexecuted instantiation: ustime.c:socket_sendmsg Unexecuted instantiation: auth_con.c:socket_sendmsg Unexecuted instantiation: bld_pr_ext.c:socket_sendmsg Unexecuted instantiation: chpw.c:socket_sendmsg Unexecuted instantiation: fast.c:socket_sendmsg Unexecuted instantiation: gen_subkey.c:socket_sendmsg Unexecuted instantiation: get_creds.c:socket_sendmsg Unexecuted instantiation: mk_priv.c:socket_sendmsg Unexecuted instantiation: mk_req_ext.c:socket_sendmsg Unexecuted instantiation: privsafe.c:socket_sendmsg Unexecuted instantiation: rd_error.c:socket_sendmsg Unexecuted instantiation: rd_priv.c:socket_sendmsg Unexecuted instantiation: rd_rep.c:socket_sendmsg Unexecuted instantiation: s4u_creds.c:socket_sendmsg Unexecuted instantiation: tgtname.c:socket_sendmsg Unexecuted instantiation: valid_times.c:socket_sendmsg Unexecuted instantiation: walk_rtree.c:socket_sendmsg Unexecuted instantiation: memrcache.c:socket_sendmsg Unexecuted instantiation: rc_base.c:socket_sendmsg Unexecuted instantiation: rc_dfl.c:socket_sendmsg Unexecuted instantiation: rc_file2.c:socket_sendmsg Unexecuted instantiation: rc_none.c:socket_sendmsg Unexecuted instantiation: hostaddr.c:socket_sendmsg Unexecuted instantiation: mk_faddr.c:socket_sendmsg Unexecuted instantiation: addr_comp.c:socket_sendmsg Unexecuted instantiation: addr_srch.c:socket_sendmsg Unexecuted instantiation: authdata_exp.c:socket_sendmsg Unexecuted instantiation: gc_via_tkt.c:socket_sendmsg Unexecuted instantiation: gen_seqnum.c:socket_sendmsg Unexecuted instantiation: gen_save_subkey.c:socket_sendmsg Unexecuted instantiation: decode_kdc.c:socket_sendmsg Unexecuted instantiation: cf2.c:socket_sendmsg Unexecuted instantiation: checksum_length.c:socket_sendmsg Unexecuted instantiation: cksumtypes.c:socket_sendmsg Unexecuted instantiation: crypto_length.c:socket_sendmsg Unexecuted instantiation: decrypt.c:socket_sendmsg Unexecuted instantiation: encrypt.c:socket_sendmsg Unexecuted instantiation: encrypt_length.c:socket_sendmsg Unexecuted instantiation: enctype_util.c:socket_sendmsg Unexecuted instantiation: etypes.c:socket_sendmsg Unexecuted instantiation: key.c:socket_sendmsg Unexecuted instantiation: keyblocks.c:socket_sendmsg Unexecuted instantiation: keyed_cksum.c:socket_sendmsg Unexecuted instantiation: make_checksum.c:socket_sendmsg Unexecuted instantiation: make_random_key.c:socket_sendmsg Unexecuted instantiation: mandatory_sumtype.c:socket_sendmsg Unexecuted instantiation: prf.c:socket_sendmsg Unexecuted instantiation: prf_aes2.c:socket_sendmsg Unexecuted instantiation: prf_cmac.c:socket_sendmsg Unexecuted instantiation: prf_dk.c:socket_sendmsg Unexecuted instantiation: prf_rc4.c:socket_sendmsg Unexecuted instantiation: prng.c:socket_sendmsg Unexecuted instantiation: random_to_key.c:socket_sendmsg Unexecuted instantiation: s2k_pbkdf2.c:socket_sendmsg Unexecuted instantiation: s2k_rc4.c:socket_sendmsg Unexecuted instantiation: state.c:socket_sendmsg Unexecuted instantiation: string_to_key.c:socket_sendmsg Unexecuted instantiation: verify_checksum.c:socket_sendmsg Unexecuted instantiation: cmac.c:socket_sendmsg Unexecuted instantiation: hmac.c:socket_sendmsg Unexecuted instantiation: kdf.c:socket_sendmsg Unexecuted instantiation: pbkdf2.c:socket_sendmsg Unexecuted instantiation: des_keys.c:socket_sendmsg Unexecuted instantiation: f_parity.c:socket_sendmsg Unexecuted instantiation: des3.c:socket_sendmsg Unexecuted instantiation: rc4.c:socket_sendmsg Unexecuted instantiation: aes.c:socket_sendmsg Unexecuted instantiation: camellia.c:socket_sendmsg Unexecuted instantiation: hash_md4.c:socket_sendmsg Unexecuted instantiation: hash_md5.c:socket_sendmsg Unexecuted instantiation: hash_sha1.c:socket_sendmsg Unexecuted instantiation: hash_sha2.c:socket_sendmsg Unexecuted instantiation: aead.c:socket_sendmsg Unexecuted instantiation: checksum_dk_cmac.c:socket_sendmsg Unexecuted instantiation: checksum_dk_hmac.c:socket_sendmsg Unexecuted instantiation: checksum_etm.c:socket_sendmsg Unexecuted instantiation: checksum_hmac_md5.c:socket_sendmsg Unexecuted instantiation: checksum_unkeyed.c:socket_sendmsg Unexecuted instantiation: default_state.c:socket_sendmsg Unexecuted instantiation: derive.c:socket_sendmsg Unexecuted instantiation: enc_dk_cmac.c:socket_sendmsg Unexecuted instantiation: enc_dk_hmac.c:socket_sendmsg Unexecuted instantiation: enc_etm.c:socket_sendmsg Unexecuted instantiation: enc_raw.c:socket_sendmsg Unexecuted instantiation: enc_rc4.c:socket_sendmsg Unexecuted instantiation: nfold.c:socket_sendmsg Unexecuted instantiation: d3_aead.c:socket_sendmsg Unexecuted instantiation: d3_kysched.c:socket_sendmsg Unexecuted instantiation: f_aead.c:socket_sendmsg Unexecuted instantiation: f_sched.c:socket_sendmsg Unexecuted instantiation: f_tables.c:socket_sendmsg Unexecuted instantiation: weak_key.c:socket_sendmsg Unexecuted instantiation: aescrypt.c:socket_sendmsg Unexecuted instantiation: aestab.c:socket_sendmsg Unexecuted instantiation: aeskey.c:socket_sendmsg Unexecuted instantiation: md4.c:socket_sendmsg Unexecuted instantiation: md5.c:socket_sendmsg Unexecuted instantiation: shs.c:socket_sendmsg Unexecuted instantiation: sha256.c:socket_sendmsg Unexecuted instantiation: sha512.c:socket_sendmsg Unexecuted instantiation: threads.c:socket_sendmsg Unexecuted instantiation: init-addrinfo.c:socket_sendmsg Unexecuted instantiation: fake-addrinfo.c:socket_sendmsg |
265 | | /* Use TMP to avoid compiler warnings and keep things consistent with |
266 | | * Windows version. */ |
267 | | #define SOCKET_WRITEV(FD, SG, LEN, TMP) \ |
268 | 0 | ((TMP) = socket_sendmsg((FD), (SG), (LEN)), (TMP)) |
269 | | |
270 | | #define SHUTDOWN_READ 0 |
271 | | #define SHUTDOWN_WRITE 1 |
272 | | #define SHUTDOWN_BOTH 2 |
273 | | |
274 | | #ifndef HAVE_INET_NTOP |
275 | | #define inet_ntop(AF,SRC,DST,CNT) \ |
276 | | ((AF) == AF_INET \ |
277 | | ? ((CNT) < 16 \ |
278 | | ? (SOCKET_SET_ERRNO(ENOSPC), (const char *)NULL) \ |
279 | | : (sprintf((DST), "%d.%d.%d.%d", \ |
280 | | ((const unsigned char *)(const void *)(SRC))[0] & 0xff, \ |
281 | | ((const unsigned char *)(const void *)(SRC))[1] & 0xff, \ |
282 | | ((const unsigned char *)(const void *)(SRC))[2] & 0xff, \ |
283 | | ((const unsigned char *)(const void *)(SRC))[3] & 0xff), \ |
284 | | (DST))) \ |
285 | | : (SOCKET_SET_ERRNO(EAFNOSUPPORT), (const char *)NULL)) |
286 | | #define HAVE_INET_NTOP |
287 | | #endif |
288 | | |
289 | | #endif /* _WIN32 */ |
290 | | |
291 | | #if !defined(_WIN32) |
292 | | /* UNIX or ...? */ |
293 | | # ifdef S_SPLINT_S |
294 | | extern int socket (int, int, int) /*@*/; |
295 | | # endif |
296 | | #endif |
297 | | |
298 | | #endif /*_PORT_SOCKET_H*/ |