summaryrefslogtreecommitdiffstats
path: root/src/protocol_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol_null.c')
-rw-r--r--src/protocol_null.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/protocol_null.c b/src/protocol_null.c
index 4772739..71957e2 100644
--- a/src/protocol_null.c
+++ b/src/protocol_null.c
@@ -47,39 +47,6 @@ static size_t protocol_min_head_space(fastd_context *ctx) {
return 0;
}
-static char* protocol_peer_str(const fastd_context *ctx, const fastd_peer *peer) {
- char addr_buf[INET6_ADDRSTRLEN] = "";
- char *ret;
-
- const char *temp = fastd_peer_is_temporary(peer) ? " (temporary)" : "";
-
- switch (peer->address.sa.sa_family) {
- case AF_UNSPEC:
- if (asprintf(&ret, "<floating>%s", temp) > 0)
- return ret;
- break;
-
- case AF_INET:
- if (inet_ntop(AF_INET, &peer->address.in.sin_addr, addr_buf, sizeof(addr_buf))) {
- if (asprintf(&ret, "%s:%u%s", addr_buf, ntohs(peer->address.in.sin_port), temp) > 0)
- return ret;
- }
- break;
-
- case AF_INET6:
- if (inet_ntop(AF_INET6, &peer->address.in6.sin6_addr, addr_buf, sizeof(addr_buf))) {
- if (asprintf(&ret, "[%s]:%u%s", addr_buf, ntohs(peer->address.in6.sin6_port), temp) > 0)
- return ret;
- }
- break;
-
- default:
- exit_bug(ctx, "unsupported address family");
- }
-
- return NULL;
-}
-
static void protocol_init_peer(fastd_context *ctx, fastd_peer *peer) {
pr_info(ctx, "Connection with %P established.", peer);
@@ -131,8 +98,6 @@ const fastd_protocol fastd_protocol_null = {
.min_encrypt_head_space = protocol_min_head_space,
.min_decrypt_head_space = protocol_min_head_space,
- .peer_str = protocol_peer_str,
-
.init_peer = protocol_init_peer,
.handle_recv = protocol_handle_recv,
.send = protocol_send,