summaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:52:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:52:50 +0000
commit9752fb8037bf6856aad9c51a1a7370ffc866f201 (patch)
tree054ae5378aa8919e67fa610a348b5f4e8ef9de3b /src/util.h
parentAdding upstream version 1.60.0. (diff)
downloadnghttp2-9752fb8037bf6856aad9c51a1a7370ffc866f201.tar.xz
nghttp2-9752fb8037bf6856aad9c51a1a7370ffc866f201.zip
Adding upstream version 1.61.0.upstream/1.61.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/util.h b/src/util.h
index d818bf2..e1c0d81 100644
--- a/src/util.h
+++ b/src/util.h
@@ -567,6 +567,12 @@ std::string to_numeric_addr(const struct sockaddr *sa, socklen_t salen);
// Sets |port| to |addr|.
void set_port(Address &addr, uint16_t port);
+// Get port from |su|.
+uint16_t get_port(const sockaddr_union *su);
+
+// Returns true if |port| is prohibited as a QUIC client port.
+bool quic_prohibited_port(uint16_t port);
+
// Returns ASCII dump of |data| of length |len|. Only ASCII printable
// characters are preserved. Other characters are replaced with ".".
std::string ascii_dump(const uint8_t *data, size_t len);
@@ -840,8 +846,10 @@ StringRef make_http_hostport(OutputIt first, const StringRef &host,
return StringRef{first, p};
}
-// Dumps |src| of length |len| in the format similar to `hexdump -C`.
-void hexdump(FILE *out, const uint8_t *src, size_t len);
+// hexdump dumps |data| of length |datalen| in the format similar to
+// hexdump(1) with -C option. This function returns 0 if it succeeds,
+// or -1.
+int hexdump(FILE *out, const void *data, size_t datalen);
// Copies 2 byte unsigned integer |n| in host byte order to |buf| in
// network byte order.