aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/priv.h
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2016-11-07 09:39:19 +0100
committerAndreas Schneider <asn@cryptomilk.org>2016-11-07 09:39:19 +0100
commit52efbc3a23fd62640177c96a14df76c42a1b462c (patch)
tree101f9fb804a0a4b0f0e6cf9b38d06308a3fc4701 /include/libssh/priv.h
parent639dc3b5fd298b952dd5a7880ae89d448547d353 (diff)
downloadlibssh-52efbc3a23fd62640177c96a14df76c42a1b462c.tar.gz
libssh-52efbc3a23fd62640177c96a14df76c42a1b462c.tar.xz
libssh-52efbc3a23fd62640177c96a14df76c42a1b462c.zip
misc: Use simpler macros for htonll and ntohll
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/priv.h')
-rw-r--r--include/libssh/priv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 2e41225f..5dd65bd4 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -361,6 +361,24 @@ int ssh_connector_remove_event(ssh_connector connector);
#define CLOSE_SOCKET(s) do { if ((s) != SSH_INVALID_SOCKET) { _XCLOSESOCKET(s); (s) = SSH_INVALID_SOCKET;} } while(0)
+#ifndef HAVE_HTONLL
+# ifdef WORDS_BIGENDIAN
+# define htonll(x) (x)
+# else
+# define htonll(x) \
+ (((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
+# endif
+#endif
+
+#ifndef HAVE_NTOHLL
+# ifdef WORDS_BIGENDIAN
+# define ntohll(x) (x)
+# else
+# define ntohll(x) \
+ (((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
+# endif
+#endif
+
void ssh_agent_state_free(void *data);
#endif /* _LIBSSH_PRIV_H */