MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipsec_address

Function ipsec_address

freebsd/netipsec/key_debug.c:939–964  ·  view source on GitHub ↗

Return a printable string for the address. */

Source from the content-addressed store, hash-verified

937
938/* Return a printable string for the address. */
939char *
940ipsec_address(const union sockaddr_union* sa, char *buf, socklen_t size)
941{
942
943 switch (sa->sa.sa_family) {
944#ifdef INET
945 case AF_INET:
946 return (inet_ntop(AF_INET, &sa->sin.sin_addr, buf, size));
947#endif /* INET */
948#ifdef INET6
949 case AF_INET6:
950 if (IN6_IS_SCOPE_LINKLOCAL(&sa->sin6.sin6_addr)) {
951 snprintf(buf, size, "%s%%%u", inet_ntop(AF_INET6,
952 &sa->sin6.sin6_addr, buf, size),
953 sa->sin6.sin6_scope_id);
954 return (buf);
955 } else
956 return (inet_ntop(AF_INET6, &sa->sin6.sin6_addr,
957 buf, size));
958#endif /* INET6 */
959 case 0:
960 return ("*");
961 default:
962 return ("(unknown address family)");
963 }
964}
965
966char *
967ipsec_sa2str(struct secasvar *sav, char *buf, size_t size)

Callers 15

ipsec_check_historyFunction · 0.85
ipsec_common_inputFunction · 0.85
ipsec4_common_input_cbFunction · 0.85
ipsec6_common_input_cbFunction · 0.85
key_allocsaFunction · 0.85
ipcomp_input_cbFunction · 0.85
ipcomp_outputFunction · 0.85
ipcomp_output_cbFunction · 0.85
kdebug_secpolicyindexFunction · 0.85
kdebug_secasindexFunction · 0.85
kdebug_secnattFunction · 0.85
ipsec_sa2strFunction · 0.85

Calls 2

inet_ntopFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected