Lines Matching refs:peer_addr

108 	struct sockaddr peer_addr;  member
551 const struct sockaddr *peer_addr) in peer_addr_cmp() argument
553 if (addr->sa_family != peer_addr->sa_family) { in peer_addr_cmp()
557 if (IS_ENABLED(CONFIG_NET_IPV6) && peer_addr->sa_family == AF_INET6) { in peer_addr_cmp()
558 struct sockaddr_in6 *addr1 = net_sin6(peer_addr); in peer_addr_cmp()
563 } else if (IS_ENABLED(CONFIG_NET_IPV4) && peer_addr->sa_family == AF_INET) { in peer_addr_cmp()
564 struct sockaddr_in *addr1 = net_sin(peer_addr); in peer_addr_cmp()
574 static int tls_session_save(const struct sockaddr *peer_addr, in tls_session_save() argument
588 if (peer_addr_cmp(&client_cache[i].peer_addr, peer_addr)) { in tls_session_save()
629 memcpy(&entry->peer_addr, peer_addr, sizeof(*peer_addr)); in tls_session_save()
634 static int tls_session_get(const struct sockaddr *peer_addr, in tls_session_get() argument
642 peer_addr_cmp(&client_cache[i].peer_addr, peer_addr)) { in tls_session_get()
670 struct sockaddr peer_addr = { 0 }; in tls_session_store() local
677 memcpy(&peer_addr, addr, addrlen); in tls_session_store()
686 ret = tls_session_save(&peer_addr, &session); in tls_session_store()
700 struct sockaddr peer_addr = { 0 }; in tls_session_restore() local
707 memcpy(&peer_addr, addr, addrlen); in tls_session_restore()
710 ret = tls_session_get(&peer_addr, &session); in tls_session_restore()
823 const struct sockaddr *peer_addr, in dtls_is_peer_addr_valid() argument
830 return peer_addr_cmp(&context->dtls_peer_addr, peer_addr); in dtls_is_peer_addr_valid()
834 const struct sockaddr *peer_addr, in dtls_peer_address_set() argument
838 memcpy(&context->dtls_peer_addr, peer_addr, addrlen); in dtls_peer_address_set()
844 struct sockaddr *peer_addr, in dtls_peer_address_get() argument
849 memcpy(peer_addr, &context->dtls_peer_addr, len); in dtls_peer_address_get()