Lines Matching refs:ss
30 jobject sockaddrToInetAddress(JNIEnv* env, const sockaddr_storage* ss, jint* port) {
35 const sockaddr_in6* sin6 = reinterpret_cast<const sockaddr_in6*>(ss);
36 if (ss->ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
38 memcpy(&tmp, ss, sizeof(tmp));
45 ss = &tmp;
52 if (ss->ss_family == AF_INET) {
53 const sockaddr_in* sin = reinterpret_cast<const sockaddr_in*>(ss);
57 } else if (ss->ss_family == AF_INET6) {
58 const sockaddr_in6* sin6 = reinterpret_cast<const sockaddr_in6*>(ss);
67 "sockaddrToInetAddress bad ss_family: %i", ss->ss_family);
90 static bool inetAddressToSockaddr(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss, bool map) {
91 memset(ss, 0, sizeof(*ss));
100 ss->ss_family = env->GetIntField(inetAddress, familyFid);
101 if (ss->ss_family == AF_UNSPEC) {
106 if (ss->ss_family != AF_INET && ss->ss_family != AF_INET6) {
108 "inetAddressToSockaddr bad family: %i", ss->ss_family);
121 sockaddr_in6* sin6 = reinterpret_cast<sockaddr_in6*>(ss);
123 if (ss->ss_family == AF_INET6) {
148 sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ss);
156 bool inetAddressToSockaddrVerbatim(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss) {
157 return inetAddressToSockaddr(env, inetAddress, port, ss, false);
160 bool inetAddressToSockaddr(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss) {
161 return inetAddressToSockaddr(env, inetAddress, port, ss, true);